/*
 * Apostolic Preaching — site styles
 * Based on samples/professional-redesign.html (approved design).
 * Sections 1–3 are extracted from the sample; section 4 adds components
 * for the full site using the same tokens.
 */

/* ---------- 1. Tokens & base ---------- */
:root {
  --bg: #0f1419;
  --surface: #1a2129;
  --surface-2: #242d38;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #4fc3f7;
  --accent-dim: #0288d1;
  --gold: #ffd54f;
  --border: #2d3742;
  --radius: 16px;
  --success: #81c784;
  --error: #ef9a9a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 2. Header, hero, sections (from sample) ---------- */
header {
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
a.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 1.75rem; }
nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
nav a:hover, nav a.active { color: var(--text); text-decoration: none; }

.hero {
  position: relative;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  background: radial-gradient(ellipse at top, #1a2733 0%, var(--bg) 70%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234fc3f7' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.search-bar {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.search-bar:focus-within { border-color: var(--accent-dim); }
.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 1rem 1.25rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input::-webkit-search-cancel-button { filter: invert(0.7); }
.search-bar select {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0 0.5rem;
  font-family: inherit;
  cursor: pointer;
}
.search-bar select option { background: var(--surface); color: var(--text); }
.search-bar button {
  background: var(--accent);
  color: #0f1419;
  border: none;
  padding: 0 1.5rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.search-bar button:hover { background: #81d4fa; }

.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

section { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
section[id] { scroll-margin-top: 5rem; }
.section-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.section-subtitle { color: var(--text-muted); margin: 0 0 2rem; }

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}
.about-text p { color: var(--text-muted); margin: 0 0 1rem; }
.about-text p:last-child { margin-bottom: 0; }
.highlight-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.highlight-box h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.highlight-box ul { margin: 0; padding-left: 1.2rem; color: var(--text-muted); }
.highlight-box li { margin-bottom: 0.4rem; }

/* ---------- 3. Cards, podcast, buttons, ad, footer (from sample) ---------- */
.sermon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.sermon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sermon-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}
.sermon-card.is-playing { border-color: var(--accent); }
.sermon-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.sermon-card h3 a { color: var(--text); }
.sermon-card h3 a:hover { color: var(--accent); text-decoration: none; }
.meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin-top: auto; padding-top: 0.25rem; flex-wrap: wrap; }
.tag {
  display: inline-block;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
a.tag:hover { text-decoration: none; background: #2c3846; }

.podcast-banner {
  background: linear-gradient(135deg, #1a2733, #0d2137);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.podcast-banner h3 { margin: 0 0 0.35rem; }
.podcast-banner p { margin: 0; color: var(--text-muted); }
.podcast-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #0f1419;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
}
.btn:hover { background: #81d4fa; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(79,195,247,0.1); }
.btn-small { padding: 0.35rem 0.9rem; font-size: 0.85rem; }

.ad-section { padding-top: 1rem; padding-bottom: 2rem; }
.ad-slot {
  max-width: 728px;
  margin: 2rem auto 0;
  min-height: 90px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
footer .logo { margin-bottom: 0.5rem; }
footer p { margin: 0.5rem 0; }
.footer-links { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- 4. Full-site components ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  background: var(--accent);
  color: #0f1419;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; text-decoration: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.center { text-align: center; }
.center .btn { margin: 0.25rem; }

/* Inner-page hero */
.hero-compact { padding: 3.5rem 1.5rem 2.5rem; }
.hero-compact h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); overflow-wrap: anywhere; }
.hero-compact p.lead { margin-bottom: 1.75rem; }
.hero-compact p.lead:last-child { margin-bottom: 0; }

.list-section { padding-top: 1.5rem; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.section-head .section-subtitle { margin-bottom: 0; }
.section-title-sm { font-size: 1.25rem; margin-bottom: 0.75rem; }

/* Card actions */
.card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.card-btn:hover { color: var(--text); border-color: var(--accent-dim); text-decoration: none; }
.card-btn-play { background: var(--accent); border-color: var(--accent); color: #0f1419; font-weight: 600; }
.card-btn-play:hover { background: #81d4fa; border-color: #81d4fa; color: #0f1419; }
.is-playing .card-btn-play { background: var(--gold); border-color: var(--gold); }

/* Toolbar + sort */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.result-count { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.result-count strong { color: var(--text); font-weight: 600; }
.sort-form { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.sort-form select,
.filter-box input,
.contact-form input,
.contact-form textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.sort-form select {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.sort-form select:focus, .filter-box input:focus,
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-dim); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.page-link {
  min-width: 2.4rem;
  padding: 0.45rem 0.8rem;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
a.page-link:hover { border-color: var(--accent-dim); color: var(--text); text-decoration: none; }
.page-link.current { background: var(--accent); border-color: var(--accent); color: #0f1419; font-weight: 600; }
.page-gap { color: var(--text-muted); padding: 0 0.25rem; }

/* Notices */
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--text-muted);
  text-align: center;
}
.notice strong { color: var(--text); font-weight: 600; }

/* Search: matching preachers */
.preacher-matches { margin-bottom: 2.5rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
}
.chip span { color: var(--text-muted); font-size: 0.8rem; }
.chip:hover { border-color: var(--accent-dim); text-decoration: none; }

/* Authors index */
.authors-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  position: sticky;
  top: 4.4rem;
  z-index: 10;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.75rem 0;
}
.letter-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.letter-nav a, .letter-nav span {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.letter-nav a { background: var(--surface); border: 1px solid var(--border); color: var(--accent); }
.letter-nav a:hover { border-color: var(--accent-dim); text-decoration: none; }
.letter-nav span.disabled { color: var(--border); }
.filter-box input {
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  width: 240px;
  max-width: 100%;
}
.filter-box input::placeholder { color: var(--text-muted); }
.author-group { margin-bottom: 2.5rem; scroll-margin-top: 9rem; }
.author-letter {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.author-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}
.author-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.author-list a:hover { border-color: var(--accent-dim); text-decoration: none; }
.author-list a:hover .author-name { color: var(--accent); }
.author-count {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 500; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.form-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  border: 1px solid;
}
.form-status-success { color: var(--success); border-color: rgba(129,199,132,0.4); background: rgba(129,199,132,0.08); }
.form-status-error { color: var(--error); border-color: rgba(239,154,154,0.4); background: rgba(239,154,154,0.08); }

/* Sticky audio player */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  background: rgba(26, 33, 41, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
}
.player-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.player-info { min-width: 0; flex: 0 1 280px; }
.player-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-preacher { font-size: 0.8rem; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player audio { flex: 1; min-width: 0; height: 40px; color-scheme: dark; }
.player-download, .player-close {
  flex-shrink: 0;
  width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.player-download:hover, .player-close:hover { color: var(--text); border-color: var(--accent-dim); }
body.has-player { padding-bottom: 5rem; }

/* ---------- 5. Responsive ---------- */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 0.75rem; }
  nav { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .podcast-banner { flex-direction: column; text-align: center; }
  .stats { gap: 1.5rem; }

  .hero { padding: 4rem 1.25rem 3rem; }
  .hero-compact { padding: 2.5rem 1.25rem 2rem; }
  section { padding: 3rem 1.25rem; }
  .list-section { padding-top: 1rem; }
  .sermon-grid { grid-template-columns: 1fr; }
  .search-bar input { padding: 0.9rem 1rem; }
  .search-bar button { padding: 0 1rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .authors-toolbar { position: static; }
  .filter-box, .filter-box input { width: 100%; }
  .author-group { scroll-margin-top: 8rem; }
  .player-inner { flex-wrap: wrap; padding: 0.6rem 1rem; gap: 0.5rem 0.75rem; }
  .player-info { flex: 1 1 0; }
  .player audio { order: 3; flex-basis: 100%; }
  body.has-player { padding-bottom: 7.5rem; }
}
@media (max-width: 420px) {
  .search-bar select { padding: 0 0.25rem; font-size: 0.85rem; }
  .stats { gap: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sermon-card { transition: none; }
  .sermon-card:hover { transform: none; }
}
