/* =========================================
   COMPACT HOME (home-preview.php)
   Scoped to body.home-compact; hc-* classes. Built on the light-shell
   tokens (--ls-*), so it matches About, Books and Open Stories.
   ========================================= */

body.home-compact {
  --hc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hc-btn: #965220;
}

/* Tall enough to show most of the banner (fence, grass, the rider), but
   never so tall that "Read ..., free" drops below the first screen on a
   laptop (40% of the window height). The page's paper starts fading in
   100px above the header's bottom edge, over the banner's own blend (see
   the fixed banner in light-shell.css). */
body.home-compact {
  --banner-h: clamp(270px, 40vh, 440px);
  --banner-pos: center 62%;
  --sheet-edge: -100px;
}

.hc {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 24px;
  box-sizing: border-box;
  color: var(--ls-ink);
}

.hc a {
  color: inherit;
}

.hc h1,
.hc h2 {
  color: var(--ls-ink);
}

/* ---------- Shared bits ---------- */

.hc-kicker,
.hc-section-label,
.hc-tag {
  font-family: var(--hc-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
  margin: 0;
}

.hc-meta {
  font-family: var(--hc-sans);
  font-size: 0.78rem;
  color: var(--ls-muted);
}

.hc-btn {
  display: inline-block;
  font-family: var(--hc-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff8ef !important;
  background: var(--hc-btn);
  border: 1px solid var(--hc-btn);
  border-radius: 4px;
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.hc-btn:hover,
.hc-btn:focus-visible {
  background: var(--ls-accent-deep);
}

.hc-link {
  font-family: var(--hc-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ls-link) !important;
  text-decoration: none;
  white-space: nowrap;
}

.hc-link:hover,
.hc-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- First screen ---------- */

.hc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 8px 0 56px;
}

.hc-hero h1 {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 10px 0 18px;
}

.hc-promise {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-style: italic;
  line-height: 1.4;
  margin: 0 0 16px;
  color: var(--ls-ink);
}

.hc-lede {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ls-ink-soft);
  margin: 0 0 28px;
  max-width: 34rem;
}

.hc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin: 0;
}

/* Featured story: the cover is what makes the first screen land. */
.hc-feature {
  display: flex;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  background: var(--ls-paper-card);
  border: 1px solid var(--ls-hairline);
  border-radius: 6px;
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hc-feature:hover,
.hc-feature:focus-visible {
  border-color: var(--ls-accent);
  transform: translateY(-2px);
}

.hc-feature img {
  flex: 0 0 auto;
  width: 150px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 14px 28px rgba(43, 33, 24, 0.28);
}

.hc-feature-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hc-feature-body strong {
  font-size: 1.5rem;
  line-height: 1.2;
}

.hc-feature-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ls-ink-soft);
  margin-top: 4px;
}

/* ---------- Where to begin ---------- */

.hc-begin {
  border-top: 1px solid var(--ls-hairline);
  padding: 28px 0 8px;
}

.hc-begin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-top: 18px;
}

.hc-door {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}

.hc-door strong {
  font-size: 1.12rem;
}

.hc-door span {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ls-ink-soft);
}

.hc-door em {
  font-family: var(--hc-sans);
  font-style: normal;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ls-link);
  margin-top: 4px;
}

.hc-door:hover em,
.hc-door:focus-visible em {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Cover rows ---------- */

.hc-row {
  border-top: 1px solid var(--ls-hairline);
  margin-top: 44px;
  padding-top: 28px;
}

.hc-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.hc-row-head h2 {
  font-size: 1.6rem;
  margin: 0 0 6px;
}

.hc-row-head p {
  margin: 0;
  color: var(--ls-muted);
  font-size: 0.95rem;
}

.hc-covers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.hc-covers--books,
.hc-covers--stories {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.hc-covers a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}

.hc-covers img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 8px 18px rgba(43, 33, 24, 0.22);
  margin-bottom: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hc-covers a:hover img,
.hc-covers a:focus-visible img {
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(43, 33, 24, 0.3);
}

.hc-covers strong {
  font-size: 0.95rem;
  line-height: 1.3;
}

.hc-badge {
  font-family: var(--hc-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
}

/* ---------- Follow box ---------- */

.hc .follow-box {
  margin-top: 56px;
  margin-bottom: 40px;
}

/* ---------- Tablet ---------- */

@media (max-width: 900px) {
  .hc-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hc-covers--books,
  .hc-covers--stories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Phone ---------- */

@media (max-width: 640px) {
  /* Narrow screens crop the sides; keep the rider (right) in frame. */
  body.home-compact {
    --banner-h: clamp(180px, 30vh, 240px);
    --banner-pos: 74% 60%;
    --sheet-edge: -70px;
  }

  body.home-compact .header-inner {
    padding-bottom: 36px;
  }

  .hc {
    padding: 0 16px 16px;
  }

  .hc-hero {
    padding-bottom: 36px;
  }

  .hc-hero h1 {
    margin: 6px 0 12px;
  }

  .hc-lede {
    margin-bottom: 22px;
  }

  .hc-feature {
    padding: 16px;
    gap: 16px;
  }

  .hc-feature img {
    width: 96px;
  }

  .hc-feature-body strong {
    font-size: 1.2rem;
  }

  .hc-feature-desc {
    font-size: 0.9rem;
  }

  .hc-begin-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hc-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Cover rows scroll sideways instead of stacking into a tall grid. */
  .hc-covers--books,
  .hc-covers--stories {
    display: flex;
    gap: 14px;
    max-width: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 0 16px 8px;
    scrollbar-width: none;
  }

  .hc-covers::-webkit-scrollbar {
    display: none;
  }

  .hc-covers li {
    flex: 0 0 38%;
    scroll-snap-align: start;
  }
}
