/* ==========================================================
   Apologia: Power to the Young People
   Colors are sampled from the Apologia series graphic.
   ========================================================== */
:root {
  --black: #151516;        /* graphic background */
  --panel: #1d1e20;
  --line: #2f3033;
  --text: #ecece6;
  --muted: #a9aaa4;
  --green: #cdda18;        /* graphic lettering */
  --green-dark: #b3be12;
  --tan: #d9cbad;          /* wave banner */
  --tan-deep: #c9b993;
  --radius: 14px;
  --wide: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --greek: 'Gentium Book Plus', Georgia, serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--wide);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: #e3ee4a; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
button, input, textarea { font: inherit; color: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--green); color: var(--black); padding: 10px 16px; z-index: 50; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Nav buttons ---------- */
.site-nav { display: flex; gap: 10px; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 22px;
  background: var(--black); color: var(--text);
  border: 1px solid var(--green); border-radius: 999px;
  font-size: 14px; font-weight: 600; font-stretch: 118%; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav-btn:hover, .nav-btn.is-current { background: var(--green); color: var(--black); }

/* ---------- Inner page header ---------- */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: rgba(21,21,22,.92); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.wordmark { font-family: var(--greek); font-size: 32px; line-height: 1; color: var(--green); text-decoration: none; }
.wordmark.small { font-size: 26px; }

/* ---------- Home hero: top third of the screen ---------- */
.hero {
  position: relative;
  /* One third of the screen; on short, wide laptop screens it grows
     just enough that the Greek title and tagline aren't cropped. */
  height: max(33.333vh, 25vw);
  height: max(33.333svh, 25vw);
  min-height: 220px;
  background: var(--black);
  overflow: hidden;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero-nav { position: absolute; top: 18px; right: 20px; z-index: 2; }
@media (max-aspect-ratio: 4/3) {
  /* Tall or narrow screens: show the whole graphic */
  .hero-img { object-fit: contain; }
}

/* ---------- Moving wave banner ---------- */
.wave-banner { position: relative; color: var(--black); overflow: hidden; margin-top: -1px; }
.wave-edge { display: block; width: 200%; height: 26px; fill: var(--tan); animation: wave-slide 9s linear infinite; }
.wave-bottom { animation-direction: reverse; animation-duration: 12s; }
.wave-body { background: var(--tan); padding: 6px 0; overflow: hidden; }
.wave-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.wave-item {
  display: inline-flex; align-items: center; gap: 0;
  padding: 0 1.4em;
  font-size: clamp(22px, 3.2vw, 38px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; white-space: nowrap;
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.55s);
}
.wave-item::after { content: ''; display: inline-block; width: .32em; height: .32em; margin-left: 1.4em; background: var(--black); border-radius: 50%; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes wave-slide { to { transform: translateX(-50%); } }
@keyframes bob { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) {
  .wave-edge, .wave-track, .wave-item { animation: none; }
}

/* ---------- Home: latest article ---------- */
.home-latest { padding: 56px 24px 8px; }
.section-title { font-size: 14px; font-weight: 600; font-stretch: 118%; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.latest-link { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.latest-title { font-size: clamp(24px, 3vw, 34px); font-weight: 700; line-height: 1.2; }
.latest-link:hover .latest-title { color: var(--green); }
.latest-meta { color: var(--muted); font-size: 15px; }

/* ---------- Home: Have a question? ---------- */
.ask { padding: 64px 0 80px; }
.ask-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: stretch; }
.ask-graphic {
  background: var(--green); color: var(--black);
  border-radius: var(--radius); padding: clamp(32px, 5vw, 56px);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; min-height: 360px;
  position: relative; overflow: hidden;
}
.ask-graphic::before {
  content: '?'; position: absolute; right: -0.08em; top: -0.22em;
  font-family: var(--greek); font-size: clamp(220px, 28vw, 360px); line-height: 1; color: rgba(21,21,22,.12);
}
.ask-graphic h2 { position: relative; margin: 0; font-size: clamp(44px, 6vw, 76px); line-height: .95; font-weight: 800; font-stretch: 116%; letter-spacing: -0.03em; }
.ask-graphic p { position: relative; margin: 0; font-size: 18px; max-width: 30ch; font-weight: 500; }

.ask-form { background: #0d0d0e; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; font-stretch: 112%; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; font-size: 17px; color: var(--text);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); }
.field [aria-invalid="true"] { border-color: #ff8a6b; }
.field-error { color: #ff9f86; font-size: 14px; }
.hp { position: absolute; left: -9999px; }
.btn-submit {
  align-self: flex-start; min-height: 50px; padding: 12px 30px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--green); color: var(--black); font-weight: 700; font-stretch: 112%; letter-spacing: .08em; text-transform: uppercase; font-size: 15px;
}
.btn-submit:hover { background: #dbe73a; }
.btn-submit[disabled] { opacity: .6; cursor: wait; }
.form-status { margin: 0; min-height: 1.5em; font-size: 16px; }
.form-status.ok { color: var(--green); }
.form-status.err { color: #ff9f86; }

/* ---------- Inner pages ---------- */
.page { padding-top: 48px; padding-bottom: 80px; }
.page-head { margin-bottom: 36px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(44px, 7vw, 80px); font-weight: 800; font-stretch: 120%; letter-spacing: -0.03em; line-height: 1; }
.page-head p { margin: 0; color: var(--muted); font-size: 19px; }
.empty { color: var(--muted); }
.card-kicker { display: block; color: var(--green); font-size: 13px; font-weight: 600; font-stretch: 118%; letter-spacing: .14em; text-transform: uppercase; }
.card-meta { display: block; color: var(--muted); font-size: 15px; }
.card-desc { display: block; color: var(--text); opacity: .85; }

/* Articles: newest = big banner */
.feature-card {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--text); margin-bottom: 56px; transition: border-color .15s;
}
.feature-card:hover { border-color: var(--green); }
.feature-img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/9; }
.feature-text { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.feature-title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
.feature-card:hover .feature-title { color: var(--green); }

/* Articles: previous = smaller banners */
.article-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.article-card {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--text); transition: border-color .15s;
}
.article-card:hover { border-color: var(--green); }
.card-img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/9; }
.card-text { padding: 18px 24px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; line-height: 1.2; }
.article-card:hover .card-title { color: var(--green); }

/* Single article */
.back-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); text-decoration: none; font-size: 16px; }
.back-link:hover { color: var(--text); }
.article-head h1 { margin: 10px 0 12px; font-size: clamp(34px, 5.4vw, 54px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; }
.article-img { border-radius: var(--radius); margin: 28px 0; border: 1px solid var(--line); }
.scripture { margin: 0 0 32px; padding: 20px 24px; border-left: 3px solid var(--green); background: var(--panel); border-radius: 0 10px 10px 0; font-family: var(--greek); font-size: 21px; font-style: italic; }
.prose { font-size: 19px; line-height: 1.75; }
.prose h2 { font-size: 28px; line-height: 1.2; margin: 44px 0 12px; font-weight: 800; }
.prose h3 { font-size: 22px; margin: 32px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--green); }
.prose blockquote { margin: 0 0 22px; padding-left: 20px; border-left: 3px solid var(--line); color: var(--muted); }
.prose strong { color: #fff; }
.article-cta { margin-top: 48px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.article-cta p { margin: 0; font-weight: 600; }
.btn-outline { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 22px; border: 1px solid var(--green); border-radius: 999px; color: var(--green); text-decoration: none; font-weight: 600; }
.btn-outline:hover { background: var(--green); color: var(--black); }
.next-article { margin-top: 32px; display: flex; flex-direction: column; gap: 6px; }
.next-article a { font-size: 24px; font-weight: 700; color: var(--text); text-decoration: none; }
.next-article a:hover { color: var(--green); }

/* Videos */
.video-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.video-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); height: 100%; transition: border-color .15s; }
a.video-card:hover { border-color: var(--green); }
a.video-card:hover .card-title { color: var(--green); }
.video-thumb { position: relative; aspect-ratio: 16/9; background: #0d0d0e; display: block; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--green); color: var(--black); display: flex; align-items: center; justify-content: center; padding-left: 4px; transition: transform .15s; }
a.video-card:hover .play { transform: scale(1.08); }
.duration { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.8); color: #fff; font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.soon-thumb { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); }
.soon-thumb span { font-size: 13px; font-weight: 600; font-stretch: 118%; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line); padding: 8px 14px; border-radius: 999px; }
.is-soon .card-title { color: var(--muted); }
.channel-link { margin-top: 40px; }

.video-page-title { margin: 8px 0 20px; font-size: clamp(30px, 4.8vw, 46px); line-height: 1.1; font-weight: 800; }
.video-embed, .modal-frame { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe, .modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-page-title + .video-embed { margin-bottom: 18px; }
.video-desc { font-size: 19px; }

/* Pop-out player */
.video-modal { width: min(1100px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
.video-modal::backdrop { background: rgba(5,5,6,.86); backdrop-filter: blur(4px); }
.video-modal[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal-inner { position: relative; }
.modal-close { position: absolute; top: -54px; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { border-color: var(--green); color: var(--green); }
.modal-title { margin: 14px 0 0; font-weight: 700; font-size: 20px; }
@media (prefers-reduced-motion: reduce) { .video-modal[open] { animation: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 32px; align-items: center; }
.footer-verse { margin: 0; color: var(--muted); font-size: 15px; font-style: italic; max-width: 60ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.footer-nav a { color: var(--text); text-decoration: none; padding: 8px 0; }
.footer-nav a:hover { color: var(--green); }
.footer-copy { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ask-inner { grid-template-columns: minmax(0, 1fr); }
  .ask-graphic { min-height: 260px; }
  .feature-card { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  /* Phones: nav sits above the graphic instead of on top of it */
  .hero { height: auto; min-height: 0; padding-top: 62px; }
  .hero-img { height: auto; object-fit: contain; }
  .hero-nav { top: 10px; right: 12px; }
  .nav-btn { padding: 8px 16px; font-size: 12px; }
  .article-card { grid-template-columns: 120px minmax(0, 1fr); }
  .card-text { padding: 14px 16px; }
  .header-inner { min-height: 64px; }
  .site-header .nav-btn { min-height: 44px; }
  .modal-close { top: -52px; }
}
