/* Hub pages. Built by build.py from content/hubs/*.json.

   One system for every hub (Oct 13, 2026). Five pieces, used the same way everywhere:
     1. Title band      - Cloud background (the band itself is .hero in style.css), left-aligned (centered still under consideration)
     2. Section heading - same size in every section, thin line under it, "see all" on the right
     3. Row             - small square photo, small blue label, title.
                          Journal prompts use it (title only), episodes use it (+ 2-line description)
     4. Button          - one style: solid navy, small corners. Nothing else looks like a button.
     5. Book covers     - the one place images are bigger, because the cover is the content
   Every section starts at the same left edge. Corners are 6px, buttons 4px.
   Phone: one column everywhere (books and guest cards still swipe sideways).
   Computer: journal prompts two across, books four across. */
.hub { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 90px; }

/* ---- 1. title band ---- */
.hero.hub-head { max-width: none; margin: 0; text-align: left; padding: 6vh 0 5vh; }   /* left for now; centered is a 4-line change (see design doc) */
.hero.hub-head h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 700; letter-spacing: -.02em;
                    line-height: 1.15; text-align: left; }
.hero.hub-head p { margin: 10px 0 0; font-size: 17px; line-height: 1.6; max-width: none; text-align: left; }
.jumps { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; }
.jumps a { font-size: 14px; font-weight: 500; color: var(--blue); }
.jumps a::after { content: " \2193"; }
.jumps a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- 2. section heading ---- */
.shelf { margin-top: 48px; scroll-margin-top: 90px; }   /* room for the sticky nav when jumped to */
.hub-head + .shelf { margin-top: 40px; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline;
              padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.shelf-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.shelf-head .all { background: none; border: 0; padding: 0; font-size: 13px; font-weight: 500;
                   color: var(--blue); cursor: pointer; white-space: nowrap; }

/* ---- 4. the one button ---- */
.hub .btn { display: inline-block; padding: 9px 16px; border-radius: 4px; background: var(--navy); color: #fff;
            font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s; }
.hub a:hover .btn { background: var(--blue); }

/* ---- phone: other card rows (books, guest features, links) swipe sideways ---- */
.shelf-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
             margin: 12px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter) 10px;
             scroll-padding-left: var(--gutter); scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-row > * { flex: 0 0 72%; scroll-snap-align: start; }
.shelf.open .shelf-row { flex-wrap: wrap; overflow: visible; }
.shelf.open .shelf-row > * { flex: 0 0 100%; }

/* ---- 3. rows: journal prompts ("Write it out") ---- */
.row-cards { display: flex; flex-direction: column; gap: 0; overflow: visible; scroll-snap-type: none;
             margin: 0; padding: 0; }
.row-cards > * { flex: none; }
.is-cards .shelf-head button.all { display: none; }   /* every item is already listed; links to other pages stay */
/* more than 4 prompts: show the first 4, "see all" opens the rest (phone and computer) */
.shelf:not(.open) .row-cards > .card:nth-child(n+5) { display: none; }
.hub .shelf.is-cards > .more { display: none; }
.hub .shelf.is-cards:has(.row-cards > .card:nth-child(5)) > .more { display: inline-block; }
.hub .shelf.is-books > .more { display: none; }   /* every book is already listed */
.row-cards .card { display: flex; flex-direction: row; align-items: center; gap: 14px;
                   padding: 12px 0; border: 0; border-bottom: 1px solid var(--rule-soft);
                   border-radius: 0; background: none; overflow: visible; }
.row-cards .card-img { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 6px; overflow: hidden;
                       background: var(--cloud); }
.row-cards .card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-cards .card-body { padding: 0; min-width: 0; }
.row-cards .kicker { display: block; font-size: 12px; font-weight: 500; color: var(--blue); margin-bottom: 2px; }
.row-cards .card h3 { font-size: 16px; font-weight: 500; line-height: 1.35; }
.row-cards .card:hover h3 { color: var(--blue); }

/* the workbook: a Cloud strip at the end of the list, price above the title, button on the right */
.hub .promo { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto;
                    grid-template-areas: "price btn" "title btn"; align-items: center; column-gap: 16px;
                    margin-top: 16px; padding: 18px 20px; border-radius: 6px; background: var(--navy); }
.hub .promo .price { grid-area: price; font-size: 12px; font-weight: 500; color: var(--light); margin-bottom: 2px; }
.hub .promo h3 { grid-area: title; font-size: 16px; font-weight: 500; line-height: 1.35; color: #fff; }
.hub .promo .btn { grid-area: btn; background: #fff; color: var(--navy); }
.hub .promo:hover .btn { background: var(--cloud); }   /* it's an ad: navy so it stands apart from the content rows */

/* ---- 3. rows: episodes ("Listen"). Same row as the prompts, plus the description ---- */
.shelf-list .item { grid-template-columns: 72px 1fr; gap: 14px; padding: 14px 0; align-items: start;
                    border-bottom: 1px solid var(--rule-soft); }
.shelf-list .item .thumb { width: 72px; border-radius: 6px; }
.shelf-list .item .head { margin-bottom: 2px; }
.shelf-list .item .date { font-size: 12px; font-weight: 500; }
.shelf-list .item .kind, .shelf-list .item .by { display: none; }   /* every row is a podcast by Amanda */
.shelf-list .item h3 { font-size: 16px; font-weight: 500; letter-spacing: 0; line-height: 1.35; }
.shelf-list .item p { font-size: 14px; line-height: 1.5; margin-top: 4px; max-width: none; -webkit-line-clamp: 2; }
.shelf:not(.open) .shelf-list > .item:nth-child(n+6) { display: none; }   /* phone: first 5 (LIST_SHOW in build.py) */
/* "see all" that opens the rest in place: always under the list, bottom left.
   (A link that goes to another page sits in the heading, top right.) */
.hub .shelf .more { display: inline-block; margin: 14px 0 0; padding: 0; border: 0; border-radius: 0;
                    background: none; color: var(--blue); font-size: 14px; font-weight: 500; }
.hub .shelf .more:hover { background: none; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 5. books: small cover left, title and author right (the same row as everything else) ----
   Works for any number of books: 1-4 share one row edge to edge, 5-6 go three across,
   7+ go four across. Removing or adding a book never leaves an empty slot. */
.row-books { display: flex; flex-direction: column; gap: 0; overflow: visible; scroll-snap-type: none;
             margin: 0; padding: 0; }
.row-books > * { flex: none; }
.is-books .shelf-head button.all { display: none; }   /* every book is already listed */
.book { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto;
        column-gap: 14px; align-content: center; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.book img { grid-row: 1 / 3; width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px;
            border: 1px solid var(--rule-soft); align-self: center; }
.book .t { align-self: end; font-weight: 500; font-size: 16px; line-height: 1.35; margin: 0; }
.book .a { align-self: start; font-size: 13px; color: var(--muted); margin-top: 2px; }
.book:hover .t { color: var(--blue); }
.scroller .nav { display: none; }   /* no arrows: every book is shown */
.hub-note { margin-top: 20px; max-width: none; font-size: 12px; line-height: 1.5; color: var(--muted); }
.hub-note a { color: var(--blue); font-weight: 500; }

/* ---- other hubs' pieces, brought into the same system ---- */
/* guest features: cards with square cover art */
.card { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden;
        background: #fff; border: 1px solid var(--rule-soft); }
.card-img { aspect-ratio: 4 / 3; background: var(--cloud); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 14px 16px; }
.kicker { display: block; font-size: 12px; font-weight: 500; color: var(--blue); margin-bottom: 2px; }
.card h3 { font-size: 16px; font-weight: 500; line-height: 1.35; }
.card:hover h3 { color: var(--blue); }
.card.feature .card-img { aspect-ratio: 1; }
.card.feature .kicker { line-height: 1.35; }

/* photo tiles (playlists, other pages) */
.tile { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border-radius: 6px;
        background: var(--cloud); }
.tile .card-img { flex: 0 0 72px; width: 72px; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #fff; }
.tile-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tile h3 { font-size: 16px; font-weight: 500; line-height: 1.35; }
.tile .blurb { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* poem cards: opening lines, no photo */
.vcard { display: block; padding: 16px 18px; border-radius: 6px; background: #fff;
         border: 1px solid var(--rule-soft); color: var(--navy); }
.vcard h3 { font-size: 16px; font-weight: 500; line-height: 1.35; margin-bottom: 6px; }
.vcard .lines { font-size: 14px; line-height: 1.6; color: var(--muted); }
.vcard:hover h3 { color: var(--blue); }

/* helpline block and closing note: same left edge and reading width as the episodes */
.support { margin: 56px 0 0; max-width: none; padding: 18px 20px; border-radius: 6px;
           background: var(--cloud); font-size: 15px; line-height: 1.6; }
.support a { color: var(--blue); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.closing { margin: 56px auto 0; max-width: 720px; text-align: center; font-size: 18px; line-height: 1.55; font-style: italic; }

/* ---- computer ---- */
@media (min-width: 861px) {
  .shelf { margin-top: 64px; }
  .hub-head + .shelf { margin-top: 48px; }
  .shelf:not(.is-list) .shelf-head button.all { display: none; }   /* links stay, the phone-only button goes */
  .shelf-row { display: grid; overflow: visible; margin: 12px 0 0; padding: 0; gap: 22px; }
  .row-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 0; margin-top: 0; }
  .row-cards .card-img { flex-basis: 80px; width: 80px; height: 80px; }
  /* odd number of items in a two-column list: the last one takes the full row, so there's never a gap */
  .row-cards .card:last-child:nth-child(odd),
  .shelf.open .shelf-list > .item:last-child:nth-child(odd),
  .shelf-list > .item:last-child:nth-child(odd):nth-child(-n+5),
  .row-links > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* episodes: two columns like the prompts, so the section fills the page */
  .shelf-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .shelf:not(.open) .shelf-list > .item:nth-child(6) { display: grid; }   /* 6 shown = 3 full rows */
  .row-books { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
               column-gap: 32px; margin-top: 0; overflow: visible; }
  .row-books:has(> :nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-books:has(> :nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row-verse { grid-template-columns: repeat(2, 1fr); }
  .row-features { grid-template-columns: repeat(4, 1fr); }
  .cols-4 { grid-template-columns: repeat(4, 1fr); }
  .row-links { grid-template-columns: repeat(2, 1fr); }
  .hub .shelf:is(.is-verse, .is-features, .is-links) > .more { display: none; }   /* grids show everything on a computer */
}
