/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

/* ── Layout ──────────────────────────────────────────────── */
.content-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Top Nav ─────────────────────────────────────────────── */
.top-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
.top-nav .content-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.church-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.back-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.back-link:hover { text-decoration: underline; }

/* ── Banner (series index) ───────────────────────────────── */
.banner-wrap {
  padding: 2rem 0 0;
}
.banner-wrap img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

/* ── Tagline (series index) ──────────────────────────────── */
.tagline {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

/* ── Sermons Heading row (series index) ──────────────────── */
.sermons-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.sermons-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
}

/* ── Sermon Timeline (root index + series index) ─────────── */
.sermons-section { padding-bottom: 3rem; }

/* Month separator — a discreet label + hairline that breaks the
   timeline rail between months. No collapse, just visual grouping. */
.month-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.9rem 0 0.7rem;
  padding-left: 1.6rem;
}
.month-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.month-divider:first-child { margin-top: 0.4rem; }

.sermon-card {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.5rem 0 0.5rem 1.6rem;
  margin-bottom: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Continuous rail line — consecutive rows have no gap, so the
   line reads as one unbroken thread down the month. */
.sermon-card::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

/* Node dot, sitting on the rail */
.sermon-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  transition: background 0.15s, box-shadow 0.15s;
}
.sermon-card:hover::after { background: var(--accent); }
.sermon-card:hover .card-title { color: var(--accent); }

.card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}
/* Trailing chevron, pinned to the right edge so each row terminates
   at the right margin instead of trailing off into empty space. */
.card-nav-icon {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s, transform 0.15s;
}
.sermon-card:hover .card-nav-icon {
  color: var(--accent);
  transform: translateX(3px);
}

.sermon-card.highlighted::after {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sermon-card.highlighted .card-title { color: var(--accent); }

/* Fixed-width date column keeps every title left-aligned. Width
   fits the longest abbreviated month + day (e.g. "Sep 28"). */
.card-date {
  width: 3.9rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.card-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.15s;
}
.card-title-soon {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1.3;
}
.card-coming {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-top: 0.4rem;
}

/* ── Header Card (sermon detail) ────────────────────────── */
.header-card {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}
.series-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.85rem;
  background: rgba(139, 32, 32, 0.04);
  border: 1px solid rgba(139, 32, 32, 0.3);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.series-nav-link:hover {
  color: var(--accent);
  background: var(--bg);
  border-color: var(--gold);
}
.series-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}
.sermon-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.65rem;
}
.meta-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.meta-line span.separator { margin: 0 0.4rem; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.82; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

/* ── Pull Quote ──────────────────────────────────────────── */
.pull-quote {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--accent);
  margin: 0.25rem 0 2.5rem;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  padding: 2.5rem 0 3rem;
}

/* ── Section Label ───────────────────────────────────────── */
.section-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* ── Sermon Points ───────────────────────────────────────── */
.points-section { margin-bottom: 2.5rem; }
.point {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.point:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.point-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.55rem;
}
.scripture-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.scripture-tag {
    display: inline-block;
    background: #373983;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-family: var(--font-sans);
}
.point-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

/* ── Challenges ──────────────────────────────────────────── */
.challenges-section { margin-bottom: 2.5rem; }
.challenge-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.challenge-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
  line-height: 1.55;
}
.challenge-list li:last-child { border-bottom: none; }
.challenge-arrow {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ── Reflection Section ──────────────────────────────────── */
.reflection-section { margin-bottom: 1rem; }
.reflection-group { margin-bottom: 1.5rem; }
.reflection-group-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.pastoral-question {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border);
  margin-bottom: 0.6rem;
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}
.further-question {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.6;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--gold);
  margin-bottom: 0.6rem;
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: var(--surface);
}
.site-footer .content-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.footer-church {
  font-size: 0.875rem;
  color: var(--muted);
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}
.footer-link:hover { text-decoration: underline; }

/* ── Library page header ─────────────────────────────────── */
.lib-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.lib-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  text-align: center;
}
.lib-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
  margin: 0;
}

/* ── Library body (stacked: year selector above content) ── */
.lib-body {
  display: block;
}

/* ── Year selector (dropdown) ────────────────────────────── */
.year-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}
.year-select-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}
.year-select {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 2.4rem 0.5rem 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.year-select:hover { border-color: #c8bfb4; }
.year-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── Year content (flat timeline list) ───────────────────── */
.year-content {
  padding-bottom: 3rem;
}

/* ── Loading / empty states ──────────────────────────────── */
.lib-loading, .lib-empty {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 1.5rem 0;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .year-content {
    width: 100%;
  }
  .year-select {
    flex: 1;
    font-size: 1rem;
  }
}

@media (max-width: 500px) {
  .btn-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .site-footer .content-wrap { flex-direction: column; align-items: flex-start; }
  .meta-sep-loc { display: none; }
  .meta-location { display: block; }
}
