/*
 * Kairos Intelligence — the public site.
 *
 * Palette from church_outreach/generators/helpers.js, which is the source of
 * record for it. The documents a congregation receives and the page that
 * describes them should not be two different brands.
 */

:root {
  --navy: #1F3864;
  --blue: #2E5FA3;
  --pale: #D6E4F7;
  --gold: #C9A94E;
  --pale-gold: #FDF3DC;
  --amber: #B5711A;
  /* Amber as small text. The palette's amber is 3.93:1 on white, short of the
     4.5:1 that type this size needs, so labels take the same hue darkened
     just far enough (4.61:1). --amber itself stays the palette of record. */
  --amber-text: #A56718;
  --ink: #1A1A1A;
  --grey: #666666;
  --line: #E2E2E2;
  --page: #FAFAFA;
  --card: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #A8C4EC;
    --blue: #8FB3E0;
    --pale: #1B2A44;
    --pale-gold: #2A2415;
    --amber: #D9A14A;
    --amber-text: #D9A14A;
    --ink: #ECECEC;
    --grey: #A6A6A6;
    --line: #2C3140;
    --page: #14161C;
    --card: #1B1E26;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.wrap-wide { max-width: 58rem; margin: 0 auto; padding: 0 1.25rem; }

/* ── Masthead ─────────────────────────────────────────────────────────── */

header.masthead {
  background: var(--navy);
  color: #fff;
  padding: 2.5rem 0 2rem;
}
@media (prefers-color-scheme: dark) {
  header.masthead { background: #10182A; color: var(--ink); }
}

header.masthead a { color: inherit; text-decoration: none; }

.wordmark { margin: 0; font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; }
.tagline { margin: 0.4rem 0 0; font-size: 1rem; color: var(--gold); }

nav.site {
  border-bottom: 1px solid var(--line);
  background: var(--card);
  font-size: 0.95rem;
}
nav.site ul {
  list-style: none;
  margin: 0 auto;
  max-width: 58rem;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
nav.site a { color: var(--blue); text-decoration: none; }
nav.site a:hover { text-decoration: underline; }
nav.site a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ── Type ─────────────────────────────────────────────────────────────── */

main { padding: 2.5rem 0 1rem; }
section + section { margin-top: 3rem; }

h1.page { font-size: 1.85rem; line-height: 1.25; color: var(--navy); margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; line-height: 1.35; color: var(--navy); margin: 0 0 0.75rem; }

/* /survey/ opens with its heading inside a card, deliberately quiet — a member
   checking whether an email is real should meet an answer, not a banner. It is
   an <h1> because it is that page's one real heading, not because it should
   look like one, so it keeps the size it had as an <h2>. */
h1:not(.page) { font-size: 1.3rem; line-height: 1.35; color: var(--navy); margin: 0 0 0.75rem; }
h3 { font-size: 1.02rem; margin: 1.75rem 0 0.4rem; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }
a { color: var(--blue); }

.lede { font-size: 1.12rem; }
.quiet { color: var(--grey); font-size: 0.95rem; }
.scripture {
  border-left: 3px solid var(--gold);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  font-style: italic;
  color: var(--grey);
}
.scripture cite { display: block; font-style: normal; font-size: 0.9rem; margin-top: 0.35rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 0.75rem;
}

/* ── The two services, side by side ───────────────────────────────────── */

.services { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .services { grid-template-columns: 1fr 1fr; } }

.service {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.service.assessment { border-top-color: var(--gold); }
.service h2 { margin-bottom: 0.25rem; }
.service .cadence {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin: 0 0 0.9rem;
}
.service ul { margin-bottom: 1.25rem; }
.service .spacer { flex: 1; }

/* ── Deliverables ─────────────────────────────────────────────────────── */

.deliverables { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 46rem) { .deliverables { grid-template-columns: repeat(2, 1fr); } }

.deliverable {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  background: var(--card);
}
.deliverable h3 { margin: 0 0 0.15rem; color: var(--navy); font-size: 1rem; }
.deliverable .when {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--amber-text); margin: 0 0 0.6rem;
}
.deliverable ul { margin: 0; font-size: 0.94rem; }

/* ── Video ────────────────────────────────────────────────────────────── */

.video { margin: 1.25rem 0; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--navy);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* The facade: nothing is requested from YouTube until this is clicked, so the
   page keeps its promise to contact nobody until the visitor asks it to. */
.video-facade {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.9rem;
  background: linear-gradient(160deg, #1F3864 0%, #2E5FA3 100%);
  color: #fff; border: 0; cursor: pointer; padding: 1.5rem; text-align: center;
  font: inherit;
}
.video-facade:hover .play { transform: scale(1.06); }
.video-facade .play {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--gold); color: #1F3864;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; transition: transform 0.15s ease;
}
.video-facade .label { font-weight: 600; font-size: 1.05rem; }
.video-facade .note { font-size: 0.85rem; opacity: 0.85; max-width: 26rem; }

/* ── Downloads ────────────────────────────────────────────────────────── */

.downloads { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.downloads li {
  margin: 0; padding: 0.85rem 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline;
}
.downloads .name { font-weight: 600; }
.downloads .meta { color: var(--grey); font-size: 0.88rem; }
.downloads a { margin-left: auto; white-space: nowrap; }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.cta, .cta-quiet {
  display: inline-block; text-decoration: none; font-weight: 500;
  padding: 0.7rem 1.25rem; border-radius: 6px;
}
.cta { background: var(--navy); color: #fff; }
.cta-quiet { border: 1px solid var(--line); color: var(--blue); }
@media (prefers-color-scheme: dark) {
  .cta { background: var(--blue); color: #10182A; }
}

/* ── Tables ───────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Footer ───────────────────────────────────────────────────────────── */

footer.site {
  margin-top: 3.5rem; border-top: 1px solid var(--line);
  padding: 1.5rem 0 3rem; color: var(--grey); font-size: 0.9rem;
}
footer.site p { margin: 0 0 0.4rem; }

/* ── Lexical entries (Understanding the times) ────────────────────────── */

.lex {
  background: var(--pale-gold);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem 0.25rem;
  margin: 1.5rem 0;
}
.lex h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: var(--navy);
}
.lex h3 .gk {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}
.lex h3 span:not(.gk) {
  font-style: italic;
  font-weight: 400;
  color: var(--grey);
  font-size: 0.95rem;
}
.lex p:last-child { margin-bottom: 0.75rem; }

/* ── Hero — apex page only ────────────────────────────────────────────── */

/*
 * The four interior pages keep `header.masthead` above. The apex page carries
 * this instead, built to `docs/kairos_hero_spec.md`.
 *
 * One token departs from that spec, deliberately: the tagline is gold, not
 * the pale blue the spec asks for. C9A94E is the colour a congregation's own
 * name is printed in on the cover of every document it receives — see
 * `church_outreach/generators/helpers.js`, which is the palette of record. The
 * spec's "no second accent colour" rule was written for a Facebook cover that
 * never sits beside those documents. Do not "correct" this back to blue.
 *
 * Gold also reads better here than it does on the flat navy the interior
 * pages use: 5.13:1 against #1F3864, 6.62:1 against the gradient's midpoint,
 * 7.88:1 at its dark end. It clears AA at any size, so the spec's warning
 * about small tagline text does not apply to this colour.
 *
 * The wordmark is a <p>, not an <h1>. Each page gets one real heading, and on
 * this page that is `h1.page` in <main>.
 */

header.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(320px, 38vw, 560px);
  overflow: hidden;
  background: #0B1828;  /* behind the SVG, and before it paints */
}

/* Decorative. The SVG carries preserveAspectRatio="xMidYMid slice", so it
   crops from the centre instead of distorting. */
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__lockup { position: relative; width: 100%; }

header.hero .wordmark {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  color: #fff;
  text-transform: uppercase;  /* not typed as capitals — a screen reader
                                 spells out all-caps text letter by letter */
}
header.hero .wordmark a { color: inherit; text-decoration: none; }
.wordmark__a,
.wordmark__b { display: block; }
.wordmark__a { font-size: clamp(2.1rem, 6vw, 3.6rem);   letter-spacing: 0.15em; }

/* The spec wants a rule the width of the INTELLIGENCE line. Rather than guess
   at that width, the line carries it as its own underline: `fit-content` makes
   the box exactly as wide as the letters, so the rule tracks the type through
   every clamp step and any later change to the wordmark. */
.wordmark__b {
  width: fit-content;
  font-size: clamp(1.05rem, 3vw, 1.8rem);
  letter-spacing: 0.25em;
  margin-top: 0.4em;
  padding-bottom: 0.55em;
  border-bottom: 3px solid #4A8ACC;
}

header.hero .tagline {
  margin: 0.95rem 0 0;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--gold);
}

/* Below this width the rings crop badly behind a left-aligned lockup, so the
   background's focal point moves right and lets them sit clear of the type. */
@media (max-width: 768px) {
  .hero__bg { object-position: 70% center; }
}

@media (prefers-reduced-motion: reduce) {
  header.hero, .hero__bg { transition: none; animation: none; }
}

/* ── Focus ────────────────────────────────────────────────────────────── */

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* ── Audience profiles ────────────────────────────────────────────────── */

/* The section's own pages mark the nav item as current without claiming to
   be the hub page itself. */
nav.site a[aria-current="true"] { color: var(--ink); font-weight: 600; }

.back { font-size: 0.95rem; margin: 0 0 1.75rem; }

/* Three kinds of quotation, kept visibly apart: Scripture (.scripture above),
   a person's own words (.voice), and the pamphlet's opening (.excerpt). */
.voice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem 0.1rem;
  background: var(--pale);
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
}

.excerpt { margin: 1.75rem 0; }
.excerpt blockquote.pamphlet {
  margin: 0;
  padding: 1.5rem 1.5rem 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}
.excerpt .excerpt-end { color: var(--grey); font-size: 0.9rem; font-family: inherit; }
.excerpt figcaption { color: var(--grey); font-size: 0.92rem; margin-top: 0.6rem; }

.notice { color: var(--grey); font-size: 0.85rem; margin-top: 2rem; }
.colophon { font-size: 0.88rem; }

.profile-list {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .profile-list { grid-template-columns: 1fr 1fr; } }
.profile-list li {
  margin: 0; padding: 1rem 1.2rem 0.4rem;
  background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--blue); border-radius: 6px;
}
.profile-list .num {
  margin: 0 0 0.2rem; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--grey);
}
.profile-list h3 { margin: 0 0 0.35rem; font-size: 1.02rem; }
.profile-list .who { font-size: 0.94rem; margin-bottom: 0.5rem; }
.profile-list .pamphlet { font-size: 0.9rem; color: var(--grey); }
.profile-list cite { font-style: italic; color: var(--ink); }

.table-wrap { margin: 0 0 1.5rem; }

/* Narrow screens: each row becomes a small stacked block with its column
   names as labels, rather than a table that scrolls sideways. */
@media (max-width: 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
  table.stack td { border: 0; padding: 0.2rem 0; }
  table.stack td::before {
    content: attr(data-label); display: block;
    color: var(--navy); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  }
}

.pager {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.pager a { display: block; max-width: 48%; text-decoration: none; font-weight: 600; }
.pager a:hover { text-decoration: underline; }
.pager a span {
  display: block; font-weight: 400; font-size: 0.8rem; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pager .next { margin-left: auto; text-align: right; }
@media (max-width: 30rem) { .pager a { max-width: 100%; } }
