/* Section layout. Mobile first at 390px, two columns from 820px.
   Components live in components.css. Values come from tokens. */

/* ---------- Hero ---------- */
.hero {
  background: var(--paper);
  border-bottom: 2.5px solid var(--ink);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 32px 0 40px;
}
.hero__copy > * + * {
  margin-top: 16px;
}
.hero__copy .t-hero {
  margin-top: 10px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.hero__notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 15px;
  color: var(--ink-3);
}
.hero__art {
  position: relative;
  padding-top: 30px;
}
.hero__block {
  position: absolute;
  inset: 0 0 18% 22%;
  background: var(--halftone-yellow), var(--yellow);
  border: 3px solid var(--ink);
}
.hero__tablet {
  --tablet-max: 400px;
  position: relative;
  transform: rotate(-2deg);
}
.hero__tablet img {
  display: block;
  width: 100%;
  height: auto;
}
.hero__bubble {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: 220px;
  transform: rotate(2deg);
}
.hero__split {
  padding-bottom: 36px;
}

/* ---------- Hand-off line ---------- */
.handoff {
  color: var(--white);
  background: var(--navy);
  border-bottom: 2.5px solid var(--ink);
}
.handoff__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 18px;
  font-weight: var(--fw-bold);
  --icon-size: 22px;
}
.handoff__inner .icon {
  color: var(--yellow);
}

@media (min-width: 820px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    padding: 56px 0 64px;
  }
}

/* ---------- Reader launcher (inline) ---------- */
.reader {
  padding: 28px 0 40px;
  background: var(--halftone-ink), var(--paper-2);
  border-bottom: 2.5px solid var(--ink);
}
.reader__wrap {
  max-width: calc(640px + 2 * var(--gutter));
}
.reader__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.reader__title {
  margin: 0;
  font-size: 24px;
  font-weight: var(--fw-black);
}
.reader__meta {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
}
.reader__preview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-print-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.reader__preview > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}
/* The one permitted gradient (DESIGN.md): text protection over the art. */
.reader__fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  padding: 64px 16px 20px;
  background: linear-gradient(to top, rgba(10, 18, 56, 0.92), rgba(10, 18, 56, 0));
}
.reader__thumbs {
  display: grid;
  grid-template-columns: repeat(var(--thumb-count, 7), minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.reader__thumb {
  padding: 0;
  overflow: hidden;
  background: var(--ink);
  border: 2px solid var(--ink);
  cursor: pointer;
}
.reader__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}

/* ---------- Reader overlay (full screen) ---------- */
.rd {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--white);
  background: var(--ink);
}
.rd[hidden] {
  display: none;
}
.rd__bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  padding-top: env(safe-area-inset-top);
  background: var(--navy);
  border-bottom: 2.5px solid var(--ink);
  transition:
    transform var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}
.rd__bar--hidden {
  transform: translateY(-100%);
}
.rd__row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 12px;
}
.rd__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-print-sm);
  cursor: pointer;
  --icon-size: 22px;
  --icon-sw: 3;
}
.rd__close:active {
  transform: var(--press-shift);
  box-shadow: none;
}
.rd__title {
  flex: 1;
  min-width: 0;
}
.rd__ep {
  font-size: 17px;
  font-weight: var(--fw-black);
  line-height: 1.1;
}
.rd__page {
  font-size: 14px;
  font-weight: 600;
  color: var(--yellow);
}
.rd__switch {
  color: var(--white);
}
.rd__progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
}
.rd__fill {
  width: 0;
  height: 100%;
  background: var(--orange);
}
.rd__note {
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: var(--fw-bold);
  text-align: center;
  color: var(--ink);
  background: var(--yellow);
}
.rd__note[hidden] {
  display: none;
}
.rd__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
/* No width cap: the comic spans the whole screen, so no dark side bars on wide screens. */
.rd__pages {
  width: 100%;
  background: var(--paper-2);
}
.rd__pages img {
  display: block;
  width: 100%;
  height: auto;
  /* Placeholder height until a lazy page loads, so jumping to a page lands close. */
  aspect-ratio: auto 1200 / 3045;
}
.rd__end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 20px calc(56px + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--halftone-night), var(--night);
}
.tbc--reader {
  --tbc-size: 52px;
}
.rd__end-line {
  max-width: 420px;
  margin: 0;
  font-size: 22px;
  font-weight: var(--fw-black);
}

/* Keep the launcher pill on one line on narrow phones. */
.reader__fade .btn {
  white-space: nowrap;
  --btn-px: 22px;
}
@media (max-width: 420px) {
  .reader__fade .btn {
    --btn-fs: 19px;
    --btn-gap: 10px;
    --btn-px: 18px;
  }
}

/* ---------- Cliffhanger and unlock ---------- */
.cliff {
  padding: 44px 0 56px;
  color: var(--white);
  background: var(--halftone-night), var(--night);
  border-bottom: 2.5px solid var(--ink);
}
.cliff__wrap {
  max-width: calc(640px + 2 * var(--gutter));
}
.cliff__zhijie {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 28px 0 18px;
}
.cliff__avatar {
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  object-fit: cover;
  object-position: 25% 40%;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.cliff__bubble {
  margin-bottom: 40px;
}
.locked__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.unlock-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 18px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
}
.unlock-panel__title {
  margin: 0;
  font-size: 26px;
  font-weight: var(--fw-black);
}
.unlock-panel__title--lg {
  font-size: 28px;
  line-height: 1.1;
}
.unlock-panel__title:focus {
  outline: none;
}
.unlock-panel__lead {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-2);
}
.unlock-panel__question {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: var(--fw-bold);
}
.unlock-panel__more {
  padding-top: 16px;
  border-top: 2px solid var(--line);
}
.unlock-panel__more-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: var(--fw-black);
}
.unlock-panel__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Honeypot: off screen, not display:none, so simple bots still fill it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- For parents ---------- */
.parents {
  padding: 48px 0 56px;
  background: var(--paper);
}
.parents__title {
  max-width: 18em;
  margin-top: 8px;
  text-wrap: balance;
}
.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.parents__top {
  margin-top: 16px;
}
.parents__text > * + * {
  margin-top: 14px;
}
.parents__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.parents__sheet {
  transform: rotate(-1.5deg);
}
.parents__words {
  grid-column: 1 / -1;
}
.parents__bottom {
  margin-top: 40px;
}
.parents__side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.photo--3x4 {
  --photo-ratio: 3 / 4;
}
.photo--16x9 {
  --photo-ratio: 16 / 9;
}
.panel--3x4 {
  --panel-ratio: 3 / 4;
  --panel-pos: top;
}
.how {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border-top: 2.5px solid var(--ink);
}
.how li {
  padding: 14px 0;
  font-size: 19px;
  font-weight: 600;
  border-bottom: 1.5px solid var(--line);
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px 0 96px; /* the extra bottom space clears the WhatsApp button */
  color: var(--white);
  background: var(--navy);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.footer__mark {
  font-size: 28px;
  font-weight: var(--fw-black);
  letter-spacing: -0.02em;
}
.footer__tag {
  font-size: 16px;
  opacity: 0.85;
}
.footer__nav {
  display: flex;
  gap: 20px;
  font-size: 16px;
  font-weight: var(--fw-bold);
}
.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px; /* tap target */
  color: var(--white);
}
.footer__nav a:hover {
  color: var(--yellow);
}
.footer__nav a[hidden],
.fab[hidden] {
  display: none;
}

@media (min-width: 820px) {
  .two {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

/* ---------- Day 2 (return visit) ---------- */
/* body[data-day="2"] is set by main.js. Without it the page stays on Day 1. */
body:not([data-day='2']) .day2-only {
  display: none;
}
body[data-day='2'] .day1-only {
  display: none;
}
.welcome {
  background: var(--paper);
  border-bottom: 2.5px solid var(--ink);
}
.welcome .wrap {
  padding-top: 22px;
  padding-bottom: 22px;
}
.welcome__title {
  margin: 0;
  font-size: 26px;
  font-weight: var(--fw-black);
}
.day2 {
  padding: 28px 0 40px;
  background: var(--halftone-ink), var(--paper-2);
  border-bottom: 2.5px solid var(--ink);
}
.day2__wrap {
  max-width: calc(var(--reader-max) + 2 * var(--gutter));
}
.episodebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px 8px;
  font-size: 18px;
  font-weight: var(--fw-bold);
  color: var(--white);
  background: var(--navy);
  border: 3px solid var(--ink);
  border-bottom: 0;
  --rt-color: var(--yellow);
}
.day2__soon {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-print-lg);
}
.day2__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.8);
}
.day2__soon-text {
  margin: 0;
  padding: 16px 20px;
  font-size: 22px;
  font-weight: var(--fw-black);
  color: var(--white);
  background: var(--night);
}
.cliff--day2 {
  padding: 40px 0 52px;
  border-bottom: 0;
}
.cliff--day2 .cliff__wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.day2__details {
  background: var(--paper);
  border-bottom: 2.5px solid var(--ink);
}
.day2__details > summary {
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 18px var(--gutter);
  font-size: 20px;
  font-weight: var(--fw-black);
  cursor: pointer;
}

/* ---------- Reader fill mode (double-tap or double-click the comic) ---------- */
/* manipulation keeps pinch-zoom but stops the browser using a double-tap to zoom. */
.rd__scroll {
  touch-action: manipulation;
}
.rd__pages img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
