/* Valiant Lessons - design system
   Palette is fixed to six brand colors; everything else is derived from them. */

:root {
  --ink: #090222;
  --mint: #70d7bb;
  --lavender: #e1d8fd;
  --blue-deep: #3c5aaf;
  --blue: #607bc8;
  --white: #ffffff;

  --ink-80: rgba(9, 2, 34, 0.8);
  --ink-60: rgba(9, 2, 34, 0.6);
  --ink-40: rgba(9, 2, 34, 0.4);
  --ink-12: rgba(9, 2, 34, 0.12);
  --ink-06: rgba(9, 2, 34, 0.06);
  --lavender-soft: #f2eefe;
  --mint-soft: #e6f8f2;

  --font-display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(9, 2, 34, 0.06), 0 4px 12px rgba(9, 2, 34, 0.05);
  --shadow-md: 0 2px 6px rgba(9, 2, 34, 0.08), 0 18px 40px rgba(9, 2, 34, 0.1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }

a { color: var(--blue-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 780px); margin-inline: auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--mint), var(--blue));
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
}

.site-nav { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }

.site-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
}

.site-nav a:hover { color: var(--mint); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(9, 2, 34, 0.94) 0%, rgba(9, 2, 34, 0.78) 45%, rgba(9, 2, 34, 0.45) 100%);
}

.hero-inner { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem); max-width: 44rem; }

.hero h1 { color: var(--white); margin-bottom: 0.6rem; }
.hero p { color: rgba(255, 255, 255, 0.82); font-size: 1.1rem; max-width: 34rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--mint);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { background: #86e2c8; color: var(--ink); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

/* ---------- lesson grid ---------- */

.section { padding: clamp(3rem, 6vw, 4.5rem) 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head p { color: var(--ink-60); margin: 0; max-width: 40rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.4rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--ink-12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue); color: inherit; }

.card-thumb {
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, var(--ink) 0%, var(--blue-deep) 60%, var(--blue) 100%);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* keeps the generated art reading as one family with the dark chrome */
.card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 2, 34, 0) 45%, rgba(9, 2, 34, 0.4) 100%);
}

.card-thumb-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.02em;
  padding: 0 1rem;
  text-align: center;
}

.card-body { padding: 1.15rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }

.card-dates { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-deep); }
.card-title { font-family: var(--font-display); font-size: 1.16rem; font-weight: 600; line-height: 1.28; margin: 0; }
.card-ref { font-size: 0.88rem; color: var(--ink-60); margin: 0; }
.card-foot { margin-top: auto; padding-top: 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--blue-deep); }

.badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--mint);
  color: var(--ink);
}

.badge-done { background: var(--lavender); color: var(--ink-80); }

/* completed weeks stay clickable, just visually receded */
.card.is-done { opacity: 0.55; filter: saturate(0.55); }
.card.is-done:hover { opacity: 1; filter: none; }

.card.is-current { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft), var(--shadow-md); }

/* ---------- lesson page ---------- */

.lesson-hero { background: var(--ink); color: var(--white); position: relative; isolation: isolate; overflow: hidden; }

.lesson-hero .hero-slot {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 130% at 12% 0%, rgba(96, 123, 200, 0.5) 0%, transparent 55%),
    radial-gradient(90% 120% at 92% 20%, rgba(112, 215, 187, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, #0d0430 0%, var(--ink) 70%);
}

.lesson-hero .hero-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lesson-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(9, 2, 34, 0.35) 0%, rgba(9, 2, 34, 0.85) 100%);
}

.lesson-hero-inner { padding: clamp(2.6rem, 6vw, 4.6rem) 0; max-width: 46rem; }
.lesson-hero h1 { color: var(--white); }
.lesson-hero .meta { color: rgba(255, 255, 255, 0.75); font-size: 0.98rem; }
.lesson-hero .meta strong { color: var(--mint); font-weight: 600; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  align-items: start;
  padding: clamp(2rem, 4vw, 3.2rem) 0 4rem;
}

@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; gap: 2rem; }
}

.rail { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 940px) { .rail { position: static; } }

.rail-card { border: 1px solid var(--ink-12); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--lavender-soft); }
.rail-card h3 { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 0.7rem; }
.rail-card ul { margin: 0; padding-left: 1.1rem; }
.rail-card li { margin-bottom: 0.35rem; font-size: 0.93rem; }
.rail-card p { font-size: 0.93rem; margin: 0; }

.timing { list-style: none; padding: 0; margin: 0; }
.timing li { display: flex; gap: 0.7rem; font-size: 0.92rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--ink-12); }
.timing li:last-child { border-bottom: 0; }
.timing .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--blue-deep); flex: none; min-width: 3.2rem; }
.timing .opt { color: var(--ink-40); font-size: 0.8rem; }

/* ---------- lesson sections ---------- */

.step { margin-bottom: 2.6rem; scroll-margin-top: 96px; }

.step-head { display: flex; align-items: baseline; gap: 0.85rem; margin-bottom: 0.9rem; }

.step-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--mint);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-body);
  transform: translateY(4px);
}

.step-head h2 { margin: 0; font-size: 1.42rem; }
.step-head .mins { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--ink-40); white-space: nowrap; }

.note {
  border-left: 3px solid var(--blue);
  background: var(--ink-06);
  padding: 0.85rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.96rem;
}

.note strong { color: var(--blue-deep); }

.say {
  border-left: 3px solid var(--mint);
  background: var(--mint-soft);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.98rem;
}

.say::before {
  content: "Say";
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2f8f75;
  margin-bottom: 0.3rem;
}

.scripture {
  border: 1px solid var(--ink-12);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.scripture .ref { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 0.5rem; }
.scripture blockquote { margin: 0; font-family: var(--font-display); font-size: 1.08rem; line-height: 1.55; color: var(--ink); }

/* question lists with teacher answers */

.questions { background: var(--lavender-soft); border-radius: var(--radius); padding: 1.05rem 1.25rem 1.05rem 1.4rem; margin: 1rem 0; }
.questions > .qh { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 0.6rem; }
.questions ol { margin: 0; padding-left: 1.15rem; }
.questions li { margin-bottom: 0.6rem; }
.questions li:last-child { margin-bottom: 0; }
.answer { display: block; font-size: 0.9rem; color: var(--ink-60); font-style: italic; margin-top: 0.15rem; }

/* ---------- video card ---------- */

.video {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
  border: 1px solid var(--ink-12);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  margin: 1rem 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.video:hover { border-color: var(--blue); box-shadow: var(--shadow-md); color: inherit; }

@media (max-width: 560px) { .video { grid-template-columns: 1fr; } }

.video-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--ink); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(9, 2, 34, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='18' viewBox='0 0 16 18'%3E%3Cpath fill='%2370d7bb' d='M0 0l16 9-16 9z'/%3E%3C/svg%3E") no-repeat center / 15px 17px;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.video-meta { min-width: 0; }
.video-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #2f8f75; margin-bottom: 0.25rem; }
.video-title { font-family: var(--font-display); font-size: 1.03rem; font-weight: 600; line-height: 1.3; margin: 0 0 0.3rem; }
.video-sub { font-size: 0.86rem; color: var(--ink-60); margin: 0; }

/* ---------- prev / next ---------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 2rem 0 4rem; }
@media (max-width: 620px) { .pager { grid-template-columns: 1fr; } }

.pager a {
  border: 1px solid var(--ink-12);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  transition: border-color 0.15s ease;
}

.pager a:hover { border-color: var(--blue); color: inherit; }
.pager .dir { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-40); }
.pager .t { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.pager .next { text-align: right; }

/* ---------- footer ---------- */

.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.7); padding: 3rem 0 2.5rem; font-size: 0.9rem; }
.site-footer a { color: var(--mint); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.11em; text-transform: uppercase; margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.disclaimer { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.82rem; color: rgba(255, 255, 255, 0.5); }

/* ---------- print ---------- */

@media print {
  :root { --wrap: 100%; }

  .site-header,
  .site-nav,
  .pager,
  .site-footer,
  .hero-actions,
  .no-print { display: none !important; }

  body { font-size: 11.5pt; line-height: 1.45; }

  .lesson-hero,
  .lesson-hero::after,
  .lesson-hero .hero-slot { background: none !important; color: var(--ink) !important; }

  .lesson-hero { border-bottom: 2px solid var(--ink); }
  .lesson-hero h1 { color: var(--ink) !important; font-size: 22pt; }
  .lesson-hero .meta { color: #333 !important; }
  .lesson-hero .meta strong { color: var(--ink) !important; }
  .lesson-hero-inner { padding: 0 0 0.6rem; }
  .lesson-hero .hero-slot { display: none; }

  .layout { display: block; padding: 0.6rem 0 0; }
  .rail { display: block; margin-bottom: 1rem; }
  .rail-card { background: none; border: 1px solid #999; break-inside: avoid; }

  .step { break-inside: avoid; margin-bottom: 1.1rem; }
  .step-num { background: none; border: 1.5px solid var(--ink); }
  .questions, .say, .note { background: none; border: 1px solid #bbb; break-inside: avoid; }
  .scripture { box-shadow: none; border: 1px solid #999; break-inside: avoid; }

  .video { grid-template-columns: 1fr; box-shadow: none; break-inside: avoid; }
  .video-thumb { display: none; }

  /* printed pages are useless without the actual URL */
  .video::after {
    content: "Watch: " attr(href);
    display: block;
    grid-column: 1 / -1;
    font-size: 9pt;
    color: #444;
    word-break: break-all;
  }

  .grid { display: block; }
  .card { break-inside: avoid; box-shadow: none; margin-bottom: 0.5rem; }
  .card-thumb { display: none; }
  .card.is-done { opacity: 1; filter: none; }

  a { color: var(--ink); }
}
