/* ═══════════════════════════════════════════════════════════════════
   Saanjhi Books — home page
   Source: the design project's books-home.css ("Saanjhi - Homepage Cards").
   Component rules are that file's; removed are the pieces books-theme.css
   already owns (base reset, tokens, .sh, .bk, .ph, the whole header/genres
   chrome and the footer), plus responsive rules the fixed comp lacks.

   ⚠ ONE DELIBERATE DEVIATION: the source file declares its component classes
   UNPREFIXED and unscoped — `.card`, `.row`, `.news`, `.trend`. Bootstrap is
   still loaded during the migration and defines `.card` and `.row` itself, so
   those would collide destructively. Everything here is scoped under `.f`,
   which raises specificity above Bootstrap's bare class selectors and confines
   the rules to the storefront body. Do not un-scope them until Bootstrap is
   gone from the <head>.
   ═══════════════════════════════════════════════════════════════════ */

.f main{padding:26px 0 0}
.f .row{display:grid;gap:20px;margin-bottom:20px}
.f .row.solo{grid-template-columns:minmax(0,1fr)}
.f .r-2-1{grid-template-columns:minmax(0,1.72fr) minmax(0,1fr)}
.f .r-1-1{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.f .r-1-2{grid-template-columns:minmax(0,1fr) minmax(0,1.72fr)}
.f [hidden]{display:none!important}

/* ── card system ── */
.f .card{background:#fff;border:1px solid var(--line);border-radius:7px;overflow:hidden}
.f .card>header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 24px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.f .card>header .ttl{display:flex;align-items:center;gap:11px;flex-wrap:wrap}
.f .card>header h2{font-family:"Newsreader",serif;font-size:24px;font-weight:500;letter-spacing:-.02em}
.f .card>header .tag{font-size:10px;font-weight:800;letter-spacing:.11em;text-transform:uppercase;padding:5px 9px;border-radius:3px;background:var(--surf);color:var(--acc)}
.f .card>header .tag.hot{background:#fbecea;color:var(--sale)}
.f .card>header .tag.gold{background:#fbf1e0;color:#8a5a12}
.f .card>header .lnk{font-size:13px;font-weight:700;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:var(--acc)}
.f .card>header .sub{font-size:13px;color:var(--mut);font-weight:600}

/* ── search hero ── */
.f .searchcard{background:var(--ink);color:#fff;border-color:var(--ink);padding:34px 40px 30px;border-radius:7px;margin-bottom:20px}
.f .searchcard .eyb{font-family:"JetBrains Mono",monospace;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--acc-lt);margin-bottom:14px}
.f .searchcard h1{font-family:"Newsreader",serif;font-size:38px;font-weight:500;letter-spacing:-.026em;line-height:1.1;margin-bottom:22px;max-width:760px}
.f .searchcard h1 em{font-style:italic;color:var(--acc-lt)}
.f .stabs{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
.f .stabs a{font-size:13px;font-weight:700;padding:9px 16px;border-radius:100px;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.14);color:#fff}
.f .stabs a.on{background:#fff;color:var(--ink);border-color:#fff}
.f .sbox{display:flex;align-items:center;gap:12px;background:#fff;border-radius:100px;padding:7px 7px 7px 22px}
.f .sbox svg{width:19px;height:19px;color:var(--mut);flex:none}
.f .sbox input{flex:1;min-width:0;border:0;background:none;outline:none;font:inherit;font-size:15.5px;color:var(--ink)}
.f .sbox input::placeholder{color:#a29d95}
.f .sbox .go{background:var(--acc);color:#fff;border:0;border-radius:100px;padding:13px 28px;font:inherit;font-size:14.5px;font-weight:800;cursor:pointer}
.f .pops{display:flex;align-items:center;gap:10px;margin-top:16px;flex-wrap:wrap;font-size:12.5px}
.f .pops .lb{color:rgba(255,255,255,.5);font-weight:700}
.f .pops a{border:1px solid rgba(255,255,255,.2);border-radius:100px;padding:6px 13px;font-weight:600;color:rgba(255,255,255,.86)}
.f .srow{display:flex;gap:26px;margin-top:22px;padding-top:20px;border-top:1px solid rgba(255,255,255,.14);flex-wrap:wrap}
.f .srow div{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:rgba(255,255,255,.62)}
.f .srow svg{width:15px;height:15px;color:var(--acc-lt);flex:none}
.f .srow b{color:#fff;font-weight:700}

/* ── book of the day ── */
.f .botd .body{display:grid;grid-template-columns:196px minmax(0,1fr);gap:30px;padding:28px 26px}
.f .botd .why{font-family:"Newsreader",serif;font-size:17px;font-style:italic;line-height:1.55;color:#3a3f44;border-left:2px solid var(--acc);padding-left:16px;margin-bottom:18px}
.f .botd h3{font-family:"Newsreader",serif;font-size:31px;font-weight:500;letter-spacing:-.024em;line-height:1.1;margin-bottom:6px}
.f .botd .au{font-size:14px;color:var(--mut);margin-bottom:12px}
.f .botd .meta{display:flex;align-items:center;gap:13px;font-size:12.5px;color:var(--mut);font-weight:600;margin-bottom:16px;flex-wrap:wrap}
.f .botd .meta b{color:var(--ink)}
.f .botd .pill{background:var(--surf);border-radius:100px;padding:4px 10px;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--acc)}
.f .buyrow{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.f .buyrow .p{font-size:24px;font-weight:800;letter-spacing:-.02em}
.f .buyrow s{font-size:14px;color:var(--mut);font-weight:600}
.f .buyrow .add{background:var(--ink);color:#fff;border:0;padding:13px 24px;border-radius:100px;font:inherit;font-size:13.5px;font-weight:800;cursor:pointer}
.f .buyrow .alt{font-size:13px;font-weight:700;border-bottom:1.5px solid var(--ink);padding-bottom:2px}

/* ── deal ── */
.f .deal{display:flex;flex-direction:column}
.f .deal .body{padding:24px 26px 26px;display:flex;flex-direction:column;flex:1}
.f .deal .dg{display:grid;grid-template-columns:104px minmax(0,1fr);gap:18px;margin-bottom:18px}
.f .deal h3{font-family:"Newsreader",serif;font-size:22px;font-weight:500;line-height:1.16;letter-spacing:-.02em;margin-bottom:5px}
.f .deal .au{font-size:12.5px;color:var(--mut);margin-bottom:10px}
.f .deal .pw{display:flex;align-items:baseline;gap:8px;margin-bottom:4px}
.f .deal .pw b{font-size:26px;font-weight:800;letter-spacing:-.025em;color:var(--sale)}
.f .deal .pw s{font-size:14px;color:var(--mut);font-weight:600}
.f .deal .save{font-size:12.5px;font-weight:800;color:var(--sale);margin-bottom:12px}
.f .deal .bar{height:7px;background:var(--surf);border-radius:100px;overflow:hidden;margin-bottom:8px}
.f .deal .bar i{display:block;height:100%;background:var(--sale)}
.f .deal .left{font-size:12px;color:var(--mut);font-weight:700;margin-bottom:auto}
.f .deal .add{display:block;text-align:center;background:var(--sale);color:#fff;padding:14px;border-radius:100px;font-size:14.5px;font-weight:800;margin-top:18px}

/* ── trending ── */
.f .trend .body{display:grid;grid-template-columns:repeat(6,1fr);gap:22px;padding:26px}
.f .tc{position:relative}
.f .tc .bk{margin-bottom:12px}
.f .tc .rk{position:absolute;top:-8px;left:-8px;width:30px;height:30px;border-radius:100px;background:var(--ink);color:#fff;display:grid;place-items:center;font-family:"JetBrains Mono",monospace;font-size:13px;z-index:2;box-shadow:0 2px 6px rgba(0,0,0,.22)}
.f .tc .bt{font-size:13.5px;font-weight:700;line-height:1.32;margin-bottom:3px}
.f .tc .ba{font-size:12px;color:var(--mut);margin-bottom:7px}
.f .tc .bp{display:flex;align-items:baseline;gap:6px;margin-bottom:6px;flex-wrap:wrap}
.f .tc .bp b{font-size:14.5px;font-weight:800}
.f .tc .bp s{font-size:12px;color:var(--mut);font-weight:600}

/* ── categories ── */
.f .cats .body{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;padding:22px 24px 24px}
.f .catt{position:relative;border-radius:5px;overflow:hidden;display:block}
.f .catt .ph{height:150px}
.f .catt .lb{position:absolute;inset:auto 0 0 0;padding:16px 14px;background:linear-gradient(transparent,rgba(0,0,0,.8));color:#fff}
.f .catt .lb h4{font-family:"Newsreader",serif;font-size:18px;font-weight:500;line-height:1.16;margin-bottom:2px}
.f .catt .lb p{font-size:11.5px;font-weight:700;opacity:.78}

/* ── NYT lists ── */
.f .nyt{border-color:#d8d5cf}
.f .nyt>header{background:var(--surf)}
.f .nyt .body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 34px;padding:22px 26px 26px}
.f .nl{display:flex;gap:16px;padding:13px 0;border-bottom:1px solid var(--line);align-items:center}
.f .nl:last-child{border-bottom:none}
.f .nl .rk{font-family:"Newsreader",serif;font-size:27px;font-weight:500;color:var(--ink);width:35px;text-align:center;flex:none;letter-spacing:-.02em}
.f .nl .bk{width:44px;flex:none}
.f .nl .info{flex:1;min-width:0}
.f .nl .bt{font-size:13.5px;font-weight:700;line-height:1.3;margin-bottom:2px}
.f .nl .ba{font-size:12px;color:var(--mut);margin-bottom:4px}
.f .nl .wk{font-size:11px;color:#8d8880;font-weight:700;letter-spacing:.03em}
.f .nl .rt{text-align:right;flex:none}
.f .nl .p{font-size:14px;font-weight:800}
.f .nl .p s{display:block;font-size:11.5px;color:var(--mut);font-weight:600;margin-top:2px}
.f .nyt .foot{border-top:1px solid var(--line);padding:14px 26px;font-size:12px;color:var(--mut);display:flex;justify-content:space-between;align-items:center;background:var(--surf);gap:14px;flex-wrap:wrap}

/* ── trust + newsletter ── */
.f .trust{display:grid;grid-template-columns:repeat(4,1fr);background:#fff;border:1px solid var(--line);border-radius:7px;overflow:hidden;margin-bottom:20px}
.f .ti{padding:24px 26px;border-right:1px solid var(--line)}
.f .ti:last-child{border-right:none}
.f .ti svg{width:26px;height:26px;color:var(--acc);margin-bottom:12px}
.f .ti h4{font-size:14.5px;font-weight:800;margin-bottom:5px}
.f .ti p{font-size:13px;line-height:1.55;color:var(--mut)}
.f .nlcard{background:var(--ink);color:#fff;border-radius:7px;padding:40px;display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:56px;align-items:center;margin-bottom:20px}
.f .nlcard h3{font-family:"Newsreader",serif;font-size:31px;font-weight:500;margin-bottom:8px}
.f .nlcard p{font-size:14.5px;opacity:.6;line-height:1.55}
.f .nlf{display:flex;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.16);border-radius:100px;padding:5px 5px 5px 20px;align-items:center}
.f .nlf input{flex:1;min-width:0;border:0;background:none;outline:none;font:inherit;font-size:14px;color:#fff}
.f .nlf input::placeholder{color:rgba(255,255,255,.45)}
.f .nlf button{background:#fff;color:var(--ink);border:0;padding:12px 22px;border-radius:100px;font:inherit;font-size:13.5px;font-weight:800;cursor:pointer}

/* ── skeleton for the async rail ── */
.f .railskel{display:grid;grid-template-columns:repeat(6,1fr);gap:22px;padding:26px}

/* ── responsive ── */
@media(max-width:1080px){
  .f .r-2-1,.f .r-1-1,.f .r-1-2{grid-template-columns:minmax(0,1fr)}
  .f .trend .body,.f .railskel{grid-template-columns:repeat(4,1fr)}
  .f .cats .body{grid-template-columns:repeat(3,1fr)}
  .f .nyt .body{grid-template-columns:minmax(0,1fr)}
  .f .nlcard{grid-template-columns:minmax(0,1fr);gap:24px;padding:28px}
  .f .trust{grid-template-columns:repeat(2,1fr)}
  .f .ti:nth-child(2n){border-right:none}
}
@media(max-width:720px){
  .f .searchcard{padding:24px 18px}
  .f .searchcard h1{font-size:27px}
  .f .sbox{padding:6px 6px 6px 16px}
  .f .sbox .go{padding:11px 18px;font-size:13px}
  .f .botd .body{grid-template-columns:minmax(0,1fr);gap:20px}
  .f .trend .body,.f .railskel{grid-template-columns:repeat(2,1fr);padding:20px}
  .f .cats .body{grid-template-columns:repeat(2,1fr)}
  .f .trust{grid-template-columns:minmax(0,1fr)}
  .f .ti{border-right:none;border-bottom:1px solid var(--line)}
  .f .card>header{padding:16px 18px}
}

/* ── lazy-rail row (LazyHomeRail.ftl injects into this, so the eager rail on
      the home page uses the identical grid and card markup) ── */
.f .railrow{display:grid;grid-template-columns:repeat(6,1fr);gap:22px;padding:26px}
.f .railrow .tc .bk{margin-bottom:12px}
.f .flag{position:absolute;top:9px;left:9px;background:#fff;font-size:9px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;padding:4px 7px;border-radius:2px;z-index:2;box-shadow:0 1px 3px rgba(0,0,0,.16)}
@media(max-width:1080px){.f .railrow{grid-template-columns:repeat(4,1fr)}}
@media(max-width:720px){.f .railrow{grid-template-columns:repeat(2,1fr);padding:20px}}

/* ── page background ───────────────────────────────────────────────────
   The design's home page sits on a warm grey (#f2f0ec) and its whole card
   system depends on it: every .card is #fff, so on a white body the card
   edges and the 20px gaps between them vanish and the page reads as one
   flat sheet with broken spacing.

   books-theme.css sets body{background:#fff} because it was adapted from
   books-pdp.css, and the PDP genuinely is a white page. Scoped here instead
   of changing the global, because books-home.css is linked ONLY by
   homeBody.ftl — no other page loads it, so no other page is affected. */
body{background:#f2f0ec}

/* ── NYT list rows ─────────────────────────────────────────────────────
   The three New York Times rails render as .nl list rows per the design,
   not as .tc cover cards. The .nyt/.nl rules already existed in this sheet
   but nothing emitted the markup. Two columns on desktop, one on narrow. */
.f .nyt .body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 34px;padding:22px 26px 26px}
.f .nl .bk{width:44px;flex:none;aspect-ratio:2/3;border-radius:2px;overflow:hidden;background:#e7e3dc}
.f .nl .bk img{width:100%;height:100%;object-fit:cover;display:block}
.f .nl .add{display:inline-block;margin-top:6px;border:1.5px solid var(--line);border-radius:100px;padding:5px 12px;font-size:11.5px;font-weight:800;background:none;cursor:pointer;font-family:inherit}
.f .nl .add:hover{border-color:var(--ink)}
.f .nlskel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 34px;padding:22px 26px 26px}
@media(max-width:900px){.f .nyt .body,.f .nlskel{grid-template-columns:minmax(0,1fr)}}

/* ── Deal of the Day countdown ─────────────────────────────────────────
   Straight from the design (.deal .clock). Counts down to midnight, which is
   what "Deal of the Day" actually means here — there is no campaign end-time
   in the data model to read, so the day boundary is the honest bound. */
.f .deal .clock{display:flex;gap:8px;margin-bottom:20px}
.f .deal .clock div{flex:1;background:var(--ink);color:#fff;border-radius:5px;padding:11px 6px;text-align:center}
.f .deal .clock b{display:block;font-family:"JetBrains Mono",monospace;font-size:22px;font-weight:500;letter-spacing:-.02em;line-height:1}
.f .deal .clock span{display:block;font-size:9.5px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;opacity:.5;margin-top:5px}

/* ── news carousel ─────────────────────────────────────────────────────
   The design's .news chrome. Each slide is one row of covers; the design's
   334px editorial story panel is omitted because there is no story text in
   the feed and inventing it would be worse than leaving it out. */
.f .news .stage{position:relative;overflow:hidden}
.f .news .slides{display:flex;transition:transform .42s cubic-bezier(.4,.1,.2,1)}
@media (prefers-reduced-motion:reduce){.f .news .slides{transition:none}}
.f .news .slide{flex:0 0 100%;display:grid;grid-template-columns:repeat(6,1fr);gap:22px;padding:26px}
.f .news .ctrl{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 26px;border-top:1px solid var(--line);background:var(--surf)}
.f .news .dots{display:flex;gap:7px}
.f .news .dots button{appearance:none;border:0;padding:0;width:7px;height:7px;border-radius:100px;background:#cfcbc4;cursor:pointer;transition:width .2s,background .2s}
.f .news .dots button[aria-current="true"]{width:22px;background:var(--ink)}
.f .news .arrows{display:flex;gap:8px}
.f .news .arrows button{appearance:none;width:34px;height:34px;border-radius:100px;border:1.5px solid var(--line);background:#fff;display:grid;place-items:center;cursor:pointer;color:var(--ink)}
.f .news .arrows button:hover{border-color:var(--ink)}
.f .news .arrows svg{width:15px;height:15px}
.f .news .cnt{font-family:"JetBrains Mono",monospace;font-size:11px;letter-spacing:.08em;color:var(--mut)}
@media(max-width:1080px){.f .news .slide{grid-template-columns:repeat(4,1fr)}}
@media(max-width:720px){.f .news .slide{grid-template-columns:repeat(2,1fr);padding:20px}}


/* ── .row collides with Bootstrap's grid row ───────────────────────────
   core.min.css (transition scaffolding) defines
     .row{display:flex;margin-left:calc(var(--bs-gutter-x)*-.5);margin-right:same}
   with --bs-gutter-x:1.5rem, i.e. negative 12px gutters. The books design also
   uses .row, so the Book of the Day / Deal of the Day row rendered 24px wider
   than every other card (1192px against 1168px) and pushed past the page width.

   .f .row already wins `display` at 0,2,0. The margins need 0,2,1 to beat
   Bootstrap's own later `.row{margin-left:0}` too, hence body.f.
   margin-bottom is left alone — .f .row owns it.
   DELETE THIS when core.min.css goes. */
body.f .row{margin-left:0;margin-right:0;margin-top:0}

/* ── carousel rails ────────────────────────────────────────────────────
   The lazy rails use the same slider chrome as the news card, so .news's
   rules apply to any .carousel section. Kept as a shared selector list
   rather than duplicated blocks. */
.f .carousel .stage{position:relative;overflow:hidden}
.f .carousel .slides{display:flex;transition:transform .42s cubic-bezier(.4,.1,.2,1)}
@media (prefers-reduced-motion:reduce){.f .carousel .slides{transition:none}}
.f .carousel .slide{flex:0 0 100%;display:grid;grid-template-columns:repeat(6,1fr);gap:22px;padding:26px}
.f .carousel .ctrl{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 26px;border-top:1px solid var(--line);background:var(--surf)}
.f .carousel .dots{display:flex;gap:7px}
.f .carousel .dots button{appearance:none;border:0;padding:0;width:7px;height:7px;border-radius:100px;background:#cfcbc4;cursor:pointer;transition:width .2s,background .2s}
.f .carousel .dots button[aria-current="true"]{width:22px;background:var(--ink)}
.f .carousel .arrows{display:flex;gap:8px}
.f .carousel .arrows button{appearance:none;width:34px;height:34px;border-radius:100px;border:1.5px solid var(--line);background:#fff;display:grid;place-items:center;cursor:pointer;color:var(--ink)}
.f .carousel .arrows button:hover{border-color:var(--ink)}
.f .carousel .arrows svg{width:15px;height:15px}
.f .carousel .cnt{font-family:"JetBrains Mono",monospace;font-size:11px;letter-spacing:.08em;color:var(--mut)}
@media(max-width:1080px){.f .carousel .slide{grid-template-columns:repeat(4,1fr)}}
@media(max-width:720px){.f .carousel .slide{grid-template-columns:repeat(2,1fr);padding:20px}}
