*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0e2154;
  --navy-dark:  #081438;
  --navy-light: #1a3268;
  --gold:       #c8a96e;
  --gold-light: #e2c98e;
  --rule-dark:  #1e3060;
  --bg:         #f4f3ef;
  --surface:    #ffffff;
  --text:       #1a1a1a;
  --text-sub:   #4a4a4a;
  --text-dim:   #888880;
  --rule:       #d8d5cc;
  --red:        #8b1a1a;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ═══════════════════════════════════════
   MASTHEAD
═══════════════════════════════════════ */
.masthead { background: var(--navy-dark); border-bottom: 3px solid var(--gold); }
.masthead-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 40px;
  display: flex; align-items: stretch; justify-content: space-between; min-height: 64px;
}
.masthead-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; padding: 14px 0; }
.brand-emblem { width: 38px; height: 38px; position: relative; flex-shrink: 0; }
.brand-emblem::before, .brand-emblem::after { content: ''; position: absolute; background: var(--gold); border-radius: 1px; }
.brand-emblem::before { width: 3px; height: 100%; left: 50%; transform: translateX(-50%); }
.brand-emblem::after  { width: 100%; height: 3px; top: 38%; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.15rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; line-height: 1.1; }
.brand-tagline { font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); opacity: 0.7; margin-top: 2px; }

.masthead-nav { display: flex; align-items: stretch; }
.masthead-nav a {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; color: rgba(255,255,255,0.55); padding: 0 18px; display: flex; align-items: center;
  border-left: 1px solid var(--rule-dark); transition: color 0.15s, background 0.15s;
}
.masthead-nav a:hover  { color: #fff; background: rgba(255,255,255,0.05); }
.masthead-nav a.active { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); }

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero { position: relative; height: 360px; overflow: hidden; display: flex; align-items: flex-end; background: var(--navy-dark); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; filter: brightness(0.45) saturate(0.8); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(8,20,56,0.3) 0%, rgba(8,20,56,0.6) 60%, rgba(8,20,56,0.88) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 1100px; width: 100%; margin: 0 auto; padding: 0 40px 36px; }
.hero-content h1 { font-size: 2.4rem; font-weight: normal; letter-spacing: 0.05em; color: #fff; line-height: 1.2; margin-bottom: 10px; }
.hero-content p { font-style: italic; font-size: 0.95rem; color: rgba(255,255,255,0.65); max-width: 520px; }
.hero-content cite { font-style: normal; font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); opacity: 0.8; display: block; margin-top: 6px; }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.page-body { max-width: 1100px; margin: 0 auto; padding: 0 40px; display: grid; grid-template-columns: 1fr 300px; gap: 0 48px; align-items: start; }
.main-col { padding: 32px 48px 72px 0; border-right: 1px solid var(--rule); min-width: 0; }

/* ── Toolbar: search + filters ── */
.toolbar { background: var(--surface); border: 1px solid var(--rule); padding: 14px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.search-box { display: block; }
.search-box input {
  width: 100%; font-family: var(--sans); font-size: 0.95rem; padding: 10px 14px 10px 38px; border: 1px solid var(--rule); background: #fbfaf7 no-repeat 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888880' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-size: 18px; border-radius: 2px; color: var(--text);
}
.search-box input:focus { border-color: var(--navy); background-color: #fff; outline: none; box-shadow: 0 0 0 3px rgba(14,33,84,0.12); }
.toolbar-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--navy); padding: 7px 14px; min-height: 34px; border-radius: 2px; transition: all 0.12s;
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.toolbar select {
  font-family: var(--sans); font-size: 0.8rem; padding: 7px 32px 7px 10px; min-height: 34px; border: 1px solid var(--rule); background: var(--surface) no-repeat right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e2154' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-size: 14px; color: var(--navy); border-radius: 2px; -webkit-appearance: none; appearance: none; max-width: 100%;
}

/* ── Section heading ── */
.section-heading {
  font-family: var(--sans); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--surface); background: var(--navy); padding: 8px 14px; display: flex; align-items: center; gap: 10px;
}
.section-heading::before { content: ''; display: block; width: 14px; height: 14px; background: var(--gold); flex-shrink: 0; clip-path: polygon(50% 0%, 50% 100%, 53% 100%, 53% 55%, 100% 55%, 100% 45%, 53% 45%, 53% 0%); }
.section-heading .count { margin-left: auto; background: rgba(255,255,255,0.14); padding: 2px 9px; border-radius: 10px; letter-spacing: 0.05em; font-size: 0.68rem; }

/* ── Sermon entries ── */
.sermons { border: 1px solid var(--rule); border-top: none; background: var(--surface); }
.sermon-entry { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: start; padding: 18px 16px; border-bottom: 1px solid var(--rule); transition: background 0.12s; }
.sermon-entry:last-child { border-bottom: none; }
.sermon-entry:hover { background: #faf9f6; }
.sermon-body { min-width: 0; }
.sermon-title { font-size: 1.02rem; font-weight: bold; color: var(--text); line-height: 1.35; margin-bottom: 3px; }
.new-tag { font-family: var(--sans); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin-left: 8px; vertical-align: middle; }
.sermon-verse { font-size: 0.8rem; font-style: italic; color: var(--text-sub); margin-bottom: 5px; }
.sermon-author { font-family: var(--sans); font-size: 0.76rem; color: var(--text-dim); }
.sermon-author em { font-style: normal; }
.formats { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex-shrink: 0; padding-top: 2px; }
.format-link {
  font-family: var(--sans); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  color: var(--surface); background: var(--navy); white-space: nowrap; padding: 6px 12px; min-width: 76px; text-align: center; border-radius: 2px; transition: background 0.12s;
}
.format-link:hover { background: var(--navy-light); }
.format-link::before { content: '▶'; font-size: 0.55em; margin-right: 6px; vertical-align: 1px; opacity: 0.8; }
.format-link.fmt-text::before { content: '≡'; font-size: 0.9em; }
.format-link.fmt-video { background: #3a2a5a; }
.format-link.fmt-video:hover { background: #4c3a72; }
.format-link.fmt-text { background: #5a4a2a; }
.format-link.fmt-text:hover { background: #73603a; }

.empty { font-family: var(--sans); font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 28px 16px; border: 1px dashed var(--rule); margin-top: 16px; }
.hint { font-family: var(--sans); font-size: 0.72rem; color: var(--text-dim); margin-top: 14px; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar { padding: 32px 0 72px; }
.sidebar-block { margin-bottom: 28px; }
.sidebar-heading { font-family: var(--sans); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--surface); background: var(--navy); padding: 7px 12px; }
.sidebar-img { width: 100%; height: 170px; object-fit: cover; display: block; filter: saturate(0.7) brightness(0.9); }
.sidebar-text { background: var(--surface); border: 1px solid var(--rule); border-top: none; padding: 16px; font-size: 0.82rem; font-style: italic; color: var(--text-sub); line-height: 1.6; }
.sidebar-text cite { display: block; margin-top: 8px; font-style: normal; font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy); opacity: 0.6; }
.sidebar-links { background: var(--surface); border: 1px solid var(--rule); border-top: none; }
.sidebar-links a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-family: var(--sans); font-size: 0.78rem; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--rule); transition: background 0.12s; }
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { background: #f0ede6; }
.sidebar-links a::before { content: '›'; color: var(--gold); font-size: 1.1rem; font-weight: bold; line-height: 1; }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer { background: var(--navy-dark); border-top: 3px solid var(--gold); color: rgba(255,255,255,0.4); font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.08em; text-align: center; padding: 20px 40px; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: rgba(255,255,255,0.6); text-decoration: none; }
footer a:hover { color: #fff; }

/* ═══════════════════════════════════════
   CONTENT PAGES
═══════════════════════════════════════ */
.mini-hero { height: 220px; position: relative; overflow: hidden; display: flex; align-items: flex-end; background: var(--navy-dark); }
.mini-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: brightness(0.4) saturate(0.7); }
.mini-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, rgba(8,20,56,0.85) 100%); }
.mini-hero-content { position: relative; z-index: 2; max-width: 1100px; width: 100%; margin: 0 auto; padding: 0 40px 26px; }
.mini-hero-content h1 { font-size: 1.5rem; font-weight: normal; color: #fff; letter-spacing: 0.03em; line-height: 1.3; }
.mini-hero-content .breadcrumb { font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); opacity: 0.8; margin-bottom: 6px; }
.mini-hero-content .breadcrumb a { color: inherit; text-decoration: none; }
.mini-hero-content .breadcrumb a:hover { opacity: 1; text-decoration: underline; }

.content-page { max-width: 1100px; margin: 0 auto; padding: 36px 40px 56px; display: grid; grid-template-columns: 1fr 260px; gap: 0 48px; align-items: start; }
.content-page article { background: var(--surface); padding: 32px 40px; border: 1px solid var(--rule); font-size: 1rem; line-height: 1.85; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.content-page article h1 { font-size: 1.45rem; font-weight: normal; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--navy); color: var(--navy); line-height: 1.3; }
.content-page article h2 { font-size: 1.15rem; font-weight: normal; margin: 1.8em 0 0.5em; color: var(--navy); }
.content-page article h3, .content-page article h4 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--navy); margin: 1.6em 0 0.5em; }
.content-page article h5, .content-page article h6 { font-family: var(--sans); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-dim); margin: 1.2em 0 0.3em; }
.content-page article p { margin-bottom: 1em; }
.content-page article blockquote { border-left: 3px solid var(--gold); margin: 1.5em 0; padding: 0.5em 0 0.5em 1.2em; color: var(--text-sub); font-style: italic; background: #faf9f4; }
.content-page article strong, .content-page article b { color: var(--navy); }
.content-page article a { color: var(--navy); }
.content-page article a:hover { color: var(--navy-light); }
.content-page article hr { border: none; border-top: 1px solid var(--rule); margin: 1.8em 0; }
.content-page article ul, .content-page article ol { margin: 0.8em 0 1em 1.4em; }
.content-page article li { margin-bottom: 0.3em; }
.content-page article img, .content-page article iframe { max-width: 100%; height: auto; }
.content-page article table { max-width: 100%; }
.content-page article .unavailable { color: var(--text-dim); }
.content-page article .note { font-family: var(--sans); font-size: 0.78rem; color: var(--text-dim); font-style: italic; margin-top: 1.5em; padding-top: 1em; border-top: 1px solid var(--rule); }

.content-sidebar { padding-top: 0; }

.back-link { margin-top: 20px; font-family: var(--sans); font-size: 0.78rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back-link a { color: var(--navy); text-decoration: none; font-weight: 600; }
.back-link a:hover { text-decoration: underline; }
.back-link .sep { color: var(--text-dim); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 800px) {
  .page-body, .content-page { grid-template-columns: 1fr; padding-left: 20px; padding-right: 20px; }
  .main-col { border-right: none; padding-right: 0; padding-bottom: 32px; }
  .sidebar { padding-top: 0; padding-bottom: 48px; border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 28px; }
  .content-sidebar { padding-top: 28px; }
  .hero { height: 260px; }
  .hero-content h1 { font-size: 1.7rem; }
  .masthead-inner, .hero-content, .mini-hero-content, footer { padding-left: 20px; padding-right: 20px; }
  .mini-hero { height: auto; min-height: 160px; }
  .mini-hero-content h1 { font-size: 1.2rem; }
  .content-page article { padding: 22px 18px; }
  .footer-inner { justify-content: center; }
}
@media (max-width: 600px) {
  .masthead-inner { flex-wrap: wrap; padding-left: 0; padding-right: 0; }
  .masthead-brand { padding: 12px 20px; }
  .brand-name { font-size: 1rem; }
  .masthead-nav { width: 100%; border-top: 1px solid var(--rule-dark); }
  .masthead-nav a { flex: 1; justify-content: center; padding: 11px 6px; border-left: none; }
  .masthead-nav a + a { border-left: 1px solid var(--rule-dark); }
  .toolbar-row { flex-direction: column; align-items: stretch; }
  .toolbar select { width: 100%; }
  .sermon-entry { grid-template-columns: 1fr; gap: 8px; }
  .formats { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .format-link { padding: 8px 14px; }
}
