/* The house style: General Sans, International Klein Blue (--blue, #002fa7), pill labels and
   buttons, rounded cards, a deep-blue header and hero. The blues were made from the old greens by
   swapping the hue in OKLCH, so lightness and contrast follow the old design: white text reads on
   --btn (15:1) and --blue (10.7:1). plan.css and the door pages build on these variables. */
@font-face { font-family: "General Sans"; src: url("/static/fonts/GeneralSans-Variable.woff2") format("woff2");
             font-weight: 200 700; font-style: normal; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("/static/fonts/GeneralSans-VariableItalic.woff2") format("woff2");
             font-weight: 200 700; font-style: italic; font-display: swap; }
:root {
  --blue: #002fa7; --dark: #011d6c; --deep: #051742;
  --bg: #f6f8fc; --surface: #ffffff; --ink: #272727; --muted: #525b6d; --line: #dae2f2; --rule: #c5d3ef;
  --tint: #e9f0fe; --head: #01288f; --link: #011d6c; --btn: #011d6c; --btn-ink: #ffffff;
  --mark: #cfdfff; --shadow: 0 1px 2px rgba(5,23,66,.06), 0 4px 14px rgba(5,23,66,.06);
  --accent: var(--btn); --accent-ink: var(--btn-ink); --chip: var(--tint);
  --sans: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--sans);
  --hero: radial-gradient(ellipse 55% 75% at 88% 70%, rgba(51,113,255,.42), transparent 62%),
          radial-gradient(ellipse 45% 60% at 0% 105%, rgba(0,47,167,.32), transparent 60%),
          linear-gradient(180deg, #051742 0%, #051437 100%);   /* the top edge is the header's colour: no seam */
}
@media (prefers-color-scheme: dark) {
  /* IKB is far darker than the old green was, so on the dark ground --blue and --btn lighten to keep
     the old green's contrast: --blue 4.9:1 on --bg (hovers, verse numbers, focus rings); --btn 3.5:1
     on --bg with white labels at 5.5:1 */
  :root { --blue: #3c78ff; --bg: #060f21; --surface: #0b172e; --ink: #e5ecf8; --muted: #98a6c1; --line: #142445; --rule: #1b2e57;
          --tint: #0b1b3e; --head: #6a9bff; --link: #7aa6ff; --btn: #2a5fe0; --btn-ink: #ffffff;
          --mark: #04226b; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; overflow-x: clip; margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans);
       -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--blue); }
main { flex: 1 0 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 0; }
h1 { font: 700 2.5rem/1.1 var(--sans); letter-spacing: -.02em; color: var(--head); margin: 1.2rem 0 .7rem; }
h2 { font: 700 1.35rem/1.25 var(--sans); letter-spacing: -.01em; color: var(--head); margin: 2rem 0 .8rem; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ring, var(--blue)); outline-offset: 2px; }
/* IKB is too dark to show a focus ring on the deep-blue bands: white there, blue again on the white cards inside them */
.top, .hero, .pagehead, .foot, .player { --ring: #fff; }
.pagehead .warn { --ring: var(--blue); }

/* --- header --- */
.top { background: #051742; color: #fff; position: relative; z-index: 2; }
.top-inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 18px; align-items: center; padding: 12px 16px; }
.brand { display: inline-flex; align-items: baseline; text-decoration: none; flex: none; white-space: nowrap;
         font: 700 1.42rem/1 var(--sans); letter-spacing: -.015em; color: #fff; }   /* the wordmark, TheArchive@Truth.FM */
.brand:hover { color: #fff; }
.brand .name { font-weight: 700; }
.brand .at, .hero .eyebrow .at { color: #6a9bff; font-weight: 600; margin: 0 .04em; }   /* 6.4:1 on the header blue */
.brand .dom { font-weight: 500; color: rgba(255,255,255,.86); }
.nav { display: flex; gap: 18px; }
.navlink { color: rgba(255,255,255,.88); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.navlink:hover { color: #fff; }
.topsearch { flex: 1; min-width: 180px; }
.top input[type=search] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.top input[type=search]::placeholder { color: rgba(255,255,255,.62); }
.top input[type=search]:focus { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); outline: none; }
.live { flex: none; color: #fff; text-decoration: none; font-weight: 600; font-size: .92rem; border: 1.5px solid #fff;
        border-radius: 999px; padding: 6px 16px; white-space: nowrap; }
.live:hover { background: #fff; color: var(--dark); }
.who { display: inline-flex; gap: 10px; align-items: center; font-size: .9rem; color: rgba(255,255,255,.8); white-space: nowrap; min-width: 0; }
.who[hidden] { display: none; }
.who span { overflow: hidden; text-overflow: ellipsis; max-width: 14em; }
.who .linkish { background: none; border: 0; color: #fff; padding: 0; text-decoration: underline; font: inherit; cursor: pointer; }
input[type=search] { width: 100%; padding: 9px 16px; font: inherit; color: var(--ink); background: var(--surface);
                     border: 1px solid var(--rule); border-radius: 999px; }
input[type=search]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,47,167,.18); }

/* --- the home hero --- */
.hero { background: var(--hero); color: #fff; padding: 56px 16px 64px; margin-top: -1px; }
.hero-inner { max-width: 1048px; margin: 0 auto; }
.eyebrow { display: inline-block; font: 600 .82rem/1 var(--sans); color: var(--dark); border: 1.5px solid var(--blue);
           border-radius: 999px; padding: 6px 13px 5px; margin: 0 0 .9rem; background: var(--surface); }
.hero .eyebrow { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
.hero h1 { color: #fff; font-size: 3.6rem; line-height: 1.02; margin: 0 0 1rem; letter-spacing: -.03em; }
.hero p { color: rgba(255,255,255,.86); max-width: 36em; font-size: 1.1rem; margin: 0; }
.hero .bigsearch { max-width: 680px; margin: 1.6rem 0 .8rem; }
.hero .bigsearch input { padding: 14px 22px; font-size: 1.05rem; }
.hero .bigsearch input, .pagehead .bigsearch input { background: #fff; color: #272727; border: 0; }
.hero .bigsearch input::placeholder, .pagehead .bigsearch input::placeholder { color: #60697b; }
.hero .bigsearch button { background: #fff; color: var(--dark); padding: 12px 28px; font-size: 1.05rem; }
.hero .bigsearch button:hover { background: #e9f0fe; }   /* fixed light tint: --tint is dark in dark mode */
.tries { font-size: .92rem; color: rgba(255,255,255,.75); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.tries a { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 12px; }
.tries a:hover { background: rgba(255,255,255,.12); color: #fff; }
.stats { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); max-width: 760px; }
.stats li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 14px 18px;
            backdrop-filter: blur(4px); }
.stats b { display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.stats span { display: block; line-height: 1.3; margin-top: 3px; color: rgba(255,255,255,.78); font-size: .92rem; }

/* --- the blue title band on every inner page (full bleed from inside main) --- */
.pagehead { background: var(--hero); color: #fff; margin: -16px calc(50% - 50vw) 28px; padding: 26px calc(50vw - 50%) 34px; }
.pagehead h1 { color: #fff; font-size: 2.9rem; margin: .5rem 0 .6rem; letter-spacing: -.025em; }
.pagehead .crumbs, .pagehead .meta, .pagehead .hint { color: rgba(255,255,255,.8); }
.pagehead .crumbs { margin-top: 0; }
.pagehead .crumbs a, .pagehead .hint a { color: #fff; }
.pagehead .crumbs a:hover, .pagehead .hint a:hover { color: #fff; text-decoration: underline; }
.pagehead .eyebrow { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; margin-bottom: .3rem; }
.pagehead .bigsearch { max-width: 720px; }
.pagehead .bigsearch button, .pagehead .play { background: #fff; color: var(--dark); }
.pagehead .bigsearch button:hover, .pagehead .play:hover { background: #e9f0fe; filter: none; }
.pagehead .chnav a { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.pagehead .chnav a:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.pagehead .lede { color: #fff; }
.pagehead .warn { margin: 8px 0; }

/* --- forms and buttons --- */
.bigsearch { display: flex; gap: 8px; margin: 1rem 0; }
.bigsearch button, .play { background: var(--btn); color: var(--btn-ink); border: 0; border-radius: 999px; padding: 9px 20px; font-weight: 600; }
.bigsearch button:hover, .play:hover { filter: brightness(1.12); }
.recording .pagehead > .play { padding: 12px 28px; font-size: 1.05rem; margin: 6px 0 4px; }
.play.small { padding: 2px 10px; font-size: .78rem; font-weight: 600; margin-left: 6px; vertical-align: 2px; }
.more { margin: 10px 0; background: var(--surface); border: 1.5px solid var(--blue); color: var(--link); border-radius: 999px;
        padding: 6px 18px; font-weight: 600; }
.more:hover { background: var(--tint); }

/* --- Bible grids --- */
.testament h2 { display: flex; align-items: baseline; gap: 10px; }
.testament h2 small { font: 500 .9rem var(--sans); color: var(--muted); letter-spacing: 0; }
.bookgrid, .chaptergrid { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.chaptergrid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.bookgrid a, .chaptergrid a { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 6px;
  padding: 11px 12px 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none;
  color: var(--ink); font-weight: 500; transition: border-color .15s, transform .15s, box-shadow .15s; }
.chaptergrid a { flex-direction: column; align-items: center; padding: 10px 6px; }
.bookgrid a:hover, .chaptergrid a:hover { border-color: var(--blue); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.n { font: 600 .74rem/1 var(--sans); color: var(--dark); background: var(--tint); border-radius: 999px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { .n { color: var(--head); } }
.empty { opacity: .45; }
.ch { font-weight: 700; font-size: 1.05rem; }
.note, .hint, .meta, .crumbs { color: var(--muted); font-size: .92rem; }
.crumbs { margin-top: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }

/* --- chapter pages --- */
.chnav { display: flex; justify-content: space-between; gap: 8px; margin: .4rem 0 0; }
.chnav a { text-decoration: none; font-weight: 600; font-size: .92rem; border: 1px solid var(--line); background: var(--surface);
           border-radius: 999px; padding: 5px 14px; }
.chnav a:hover { border-color: var(--blue); }
.verse { padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.vtext { font-size: 1.1rem; line-height: 1.65; margin: 0 0 8px; }
.vn { font: 700 .78rem var(--sans); color: var(--blue); text-decoration: none; vertical-align: super; margin-right: 3px; }
.verse:target { background: var(--tint); border-radius: 12px; padding-left: 12px; padding-right: 12px; }
.refs { background: var(--tint); color: var(--dark); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 14px;
        font-size: .85rem; font-weight: 600; }
.refs:hover { border-color: var(--blue); }
.refs[aria-expanded=true] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
@media (prefers-color-scheme: dark) { .refs { color: var(--head); } .refs[aria-expanded=true] { color: #fff; } }

/* --- result cards --- */
.hits { list-style: none; padding: 0; margin: 10px 0 0; }
.hit { padding: 14px 16px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.hit .t { font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.hit .t a { color: var(--ink); text-decoration: none; }
.hit .t a:hover { color: var(--blue); }
.hit .sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.hit .sum { margin: 6px 0 0; font-size: .94rem; line-height: 1.5; }
.hit .ctx { font-size: .95rem; margin: 6px 0 0; line-height: 1.55; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.pager { display: flex; gap: 12px; align-items: center; margin: 1rem 0; }
.scope { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); border: 1px solid var(--rule); border-radius: 999px;
         padding: 3px 6px 3px 14px; font-size: .9rem; margin: 4px 0 8px; }
.scope a { color: var(--muted); text-decoration: none; font-size: 1.1rem; line-height: 1; padding: 0 6px; }
.scope a:hover { color: var(--blue); }

/* --- recording page --- */
.recording h1 { margin-bottom: .5rem; }
.recording .lede { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.55; max-width: 44em; }
.cited ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cited li { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
            padding: 4px 6px 4px 14px; font-size: .92rem; font-weight: 500; }
.cited li a { text-decoration: none; }
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 6px 24px 10px; margin-top: 2rem; }
.vtext, .recording .lede, .transcript .segs { max-width: 50em; }
.transcript h2 { margin-top: 1.1rem; }
.transcript .segs { font-size: 1.05rem; line-height: 1.75; margin: 0 0 1em; }
.seg { cursor: pointer; border-radius: 4px; transition: background .1s; }
.seg:hover { background: var(--tint); }
.seg.now { background: var(--mark); }
.auto { font: 600 .72rem var(--sans); color: var(--muted); background: var(--tint); border-radius: 999px; padding: 3px 9px; vertical-align: middle; margin-left: 4px; }
.warn { background: #fff1ef; color: #7a1c10; border: 1px solid #ffc9c1; padding: 10px 14px; border-radius: 12px; }
@media (prefers-color-scheme: dark) { .warn { background: #3a1410; color: #ffd2cb; border-color: #6b2a21; } }

/* --- programs --- */
.proglist { list-style: none; padding: 0; margin: 0; columns: 2 18rem; column-gap: 28px; }
.proglist li { break-inside: avoid; padding: 8px 2px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proglist a { color: var(--ink); text-decoration: none; font-weight: 500; }
.proglist a:hover { color: var(--blue); }

/* --- footer --- */
body:has(#player:not([hidden])) .foot { padding-bottom: 76px; }   /* room for the player bar */
.foot { margin-top: 4.5rem; background: linear-gradient(to top right, #01288f 55%, #051742); color: #fff; }
.foot-inner { max-width: 1080px; margin: 0 auto; padding: 36px 16px 22px; }
.foot-top { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.foot .brand { font-size: 1.5rem; text-decoration: none; }
.foot .brand .at { color: #d8e6ff; }   /* 9.8:1 on the footer's lighter blue */
.foot .brand:hover { text-decoration: none; }
.foot-tag { display: block; color: #fff; font-size: .85rem; margin-top: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: #fff; text-decoration: none; font-weight: 500; }
.foot a:hover { text-decoration: underline; color: #fff; }
.foot .disclaimer { color: rgba(255,255,255,.94); font-size: .88rem; max-width: 48em; margin: 22px 0 0; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; border-top: 1px solid rgba(255,255,255,.3);
               margin-top: 22px; padding-top: 14px; font-size: .85rem; color: rgba(255,255,255,.94); }

/* --- the player --- */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 12px; align-items: center; padding: 10px 16px;
          background: #051742; color: #fff; box-shadow: 0 -4px 18px rgba(0,0,0,.18); }
.player[hidden] { display: none; }
.player-info { flex: 0 1 30%; min-width: 0; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player audio { flex: 1; min-width: 0; height: 40px; }
#player-close { background: none; border: 0; color: rgba(255,255,255,.8); font-size: 1.6rem; line-height: 1; }
#player-close:hover { color: #fff; }

/* --- the door pages (/auth) and /admin --- */
.door { display: grid; place-items: start center; min-height: 100vh; padding: 10vh 16px 16px; }
.door-main { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 28px 20px; box-shadow: var(--shadow); }
.door-main h1 { margin-top: 0; font-size: 2rem; }
.invite { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; margin: 1rem 0; }
.invite label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.invite input, .invite select { padding: 8px 12px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.invite button { background: var(--btn); color: var(--btn-ink); border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 600; }
.invite-link { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; margin: 1rem 0; }
.invite-link code { word-break: break-all; }
.people { width: 100%; border-collapse: collapse; font-size: .92rem; }
.people th, .people td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.people .actions button { padding: 4px 10px; font-size: .85rem; }
.status-row-disabled td { color: var(--muted); }

@media (max-width: 1040px) {            /* two rows: brand, name and Listen live; then nav and search */
  .top-inner { flex-wrap: wrap; gap: 10px 14px; }
  .who { order: 2; margin-left: auto; }
  .live { order: 3; }
  .who[hidden] + .live { margin-left: auto; }
  .top-inner::after { content: ""; order: 4; flex-basis: 100%; height: 0; margin-top: -10px; }   /* the row break */
  .nav { order: 5; gap: 14px; }
  .topsearch { order: 6; min-width: 0; }
}
@media (max-width: 760px) {
  .top .brand { font-size: 1.1rem; }
  .live { padding: 5px 13px; font-size: .85rem; }
  .who { order: 7; flex-basis: 100%; justify-content: flex-end; }
  .live { margin-left: auto; }
  .pagehead h1 { font-size: 2.2rem; }
  .hero { padding: 36px 16px 44px; }
  .hero h1 { font-size: 2.5rem; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stats li { padding: 10px 12px; }
  .stats b { font-size: 1.2rem; }
  .stats span { font-size: .8rem; }
}
@media (max-width: 560px) {
  .topsearch { flex-basis: 100%; }
  h1 { font-size: 1.9rem; }
  .hero h1 { font-size: 2.2rem; }
  .bigsearch button { padding: 9px 16px; }
  .hero .bigsearch input { padding: 12px 16px; font-size: 1rem; }
  .hero .bigsearch button { padding: 10px 18px; font-size: 1rem; }
  .transcript { padding: 4px 16px 8px; border-radius: 16px; }
  .player { flex-wrap: wrap; }
  .player-info { flex-basis: calc(100% - 40px); }
  .player audio { flex-basis: 100%; }
}

/* Topics (/topics/ and /topics/<slug>/) */
.topicfind { margin-top: 14px; }
.topicfind input { width: 100%; box-sizing: border-box; }
section.theme { margin: 0 0 30px; }
section.theme h2 .n, .topiclist .n { color: var(--muted); font-weight: 400; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tdesc { color: var(--muted); margin: -4px 0 10px; max-width: 65ch; }
.pagehead .meta a { color: #fff; }
.topicclips .ctx { font-style: italic; }
.topicnote { margin-top: 28px; max-width: 65ch; }
