/* The Reverse Times — homepage sections, header pills, mobile bottom navigation,
   and image-height limits. Uses the site's tokens. */

/* ── Homepage sections (admin "Homepage blocks") ───────────────────── */
.hb { position: relative; z-index: 1; padding: 4.5rem 0; border-top: 1px solid var(--gold10); }
.hb-wrap { max-width: 1320px; margin: 0 auto; padding: 0 2.5rem; }
.hb-paper { background: linear-gradient(rgba(245,237,216,.86), rgba(245,237,216,.86)), url('../img/magazine/paper-bg.jpg') center/cover; color: #1a1410; }
.hb-paper .hb-sub, .hb-paper .hb-desc { color: rgba(26,20,16,.72); }
.hb-paper .hb-card { background: rgba(255,255,255,.55); border-color: rgba(26,20,16,.12); }
.hb-paper .hb-name a, .hb-paper .hb-name { color: #1a1410; }
.hb-dark { background: #0c0906; color: #f5edd8; --text: #f5edd8; --text-muted: rgba(245,237,216,.78); --text-faint: rgba(245,237,216,.66); --text-faintest: rgba(245,237,216,.56); }
.hb-dark .hb-card { background: #17110c; }
.hb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hb-eyebrow { font-family: var(--ff-label); letter-spacing: 3px; text-transform: uppercase; font-size: .78rem; color:var(--gold-ink); margin-bottom: .35rem; }
.hb-title { font-family: var(--ff-display); font-weight: 900; font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.15; }
.hb-sub { color: var(--text-muted); margin-top: .5rem; max-width: 640px; font-size: 1.05rem; }
.hb-all { font-family: var(--ff-label); letter-spacing: 2px; text-transform: uppercase; font-size: .85rem; color:var(--gold-ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; white-space: nowrap; }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.6rem; }
.hb-mags { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2rem; }
.hb-card { display: flex; flex-direction: column; border: 1px solid var(--gold10); background: var(--dark2); text-decoration: none; color: inherit; transition: transform .25s, border-color .25s; min-width: 0; }
.hb-card:hover { transform: translateY(-4px); border-color: var(--gold30); }
.hb-imglink { display: block; }
.hb-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--dark3); }
.hb-img.cover { aspect-ratio: 595 / 842; }
.hb-img.wide { aspect-ratio: 16 / 9; }
.hb-mags .hb-card { background: none; border: 0; }
.hb-mags .hb-img.cover { box-shadow: 12px 18px 36px rgba(0,0,0,.35); border-radius: 2px 5px 5px 2px; }
.hb-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.hb-mags .hb-body { padding: 1rem 0 0; }
.hb-kicker { font-family: var(--ff-label); letter-spacing: 2px; text-transform: uppercase; font-size: .72rem; color:var(--gold-ink); }
.hb-name { font-family: var(--ff-display); font-size: 1.15rem; line-height: 1.35; font-weight: 700; }
.hb-name a { color: inherit; text-decoration: none; }
.hb-desc { color: var(--text-muted); font-size: .92rem; line-height: 1.6; }
.hb-price { font-family: var(--ff-label); letter-spacing: 1px; font-size: 1.1rem; color:var(--gold-ink); }
.hb-price s { color: var(--text-faint); font-size: .85rem; margin-left: .3rem; }
.hb-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.hb-badge { font-family: var(--ff-label); letter-spacing: 1.5px; font-size: .66rem; text-transform: uppercase; padding: .25rem .55rem; border: 1px solid var(--gold30); color:var(--gold-ink); }
.hb-badge.free { background: #2f7d3a; border-color: #2f7d3a; color: #fff; }
.hb-badge.dark { background: #1d1712; border-color: #1d1712; color: #f5edd8; }
.hb-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.hb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .5rem .95rem; background: var(--gold); color: #fff !important; border: 1px solid var(--gold); font-family: var(--ff-label); letter-spacing: 1.5px; text-transform: uppercase; font-size: .78rem; text-decoration: none; cursor: pointer; }
.hb-btn.ghost { background: transparent; color:var(--gold-ink) !important; }
.hb-text { display: grid; gap: 2rem; align-items: center; }
.hb-text.has-img { grid-template-columns: 1fr 1fr; }
.hb-text img { width: 100%; max-height: 420px; object-fit: cover; }
.hb-text-body { font-size: 1.08rem; line-height: 1.85; }
@media (max-width: 900px) { .hb-text.has-img { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .hb { padding: 3rem 0; }
  .hb-wrap { padding: 0 1rem; }
  /* phones: swipeable row instead of a tall stack */
  .hb-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: .9rem; padding-bottom: .6rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: thin; }
  .hb-grid > * { flex: 0 0 68%; scroll-snap-align: start; }
  .hb-mags > * { flex-basis: 58%; }
}

/* ── Header: Magazine / Shop pills and language on the left ────────── */
.nav-left { gap: 1.2rem; }
.nav-left .lang-toggle { display: flex; }
@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr auto; }
  .nav-left .lang-toggle { display: flex !important; height: 30px; padding: 0 8px; }
}

/* ── Mobile bottom navigation ───────────────────────────────────────── */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500;
    background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--gold30);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; color: var(--text-muted); text-decoration: none; font-family: var(--ff-label); letter-spacing: 1.2px; font-size: .68rem; text-transform: uppercase; position: relative; }
  .bottom-nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a[aria-current="page"] { color:var(--gold-ink); }
  .bottom-nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--gold); }
  .bottom-nav .bn-badge { position: absolute; top: 7px; left: calc(50% + 6px); background: var(--gold); color: #fff; font: 700 .58rem/16px sans-serif; min-width: 16px; height: 16px; border-radius: 8px; text-align: center; padding: 0 3px; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .floating-actions { bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }
  .toast-container { bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ── Image heights (less scrolling past big images) ─────────────────── */
@media (min-width: 901px) {
  .hero-overlay { height: min(calc(100vh - 40px), 760px) !important; min-height: 520px !important; }
}
article figure img, .article-figure img { max-height: 520px; object-fit: cover; }
@media (max-width: 700px) {
  article figure img, .article-figure img { max-height: 300px; }
}

/* Bangla text inside label-style elements: proper Bangla font, no letter-spacing */
.bn-text { letter-spacing: 0 !important; font-family: var(--ff-bangla-ui, 'Noto Sans Bengali'), sans-serif !important; text-transform: none !important; font-weight: 500; }

/* Single magazine issue on the homepage: feature layout */
.hb-feature { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 3rem; align-items: center; }
.hb-feature-cover img { width: 100%; aspect-ratio: 595 / 842; object-fit: cover; display: block; border-radius: 2px 5px 5px 2px; box-shadow: 14px 22px 44px rgba(0,0,0,.35); transform: rotate(-2deg); transition: transform .4s; }
.hb-feature-cover:hover img { transform: rotate(0) translateY(-4px); }
.hb-feature-title { font-family: var(--ff-display); font-weight: 900; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin: .4rem 0 .5rem; }
.hb-feature-title a { color: inherit; text-decoration: none; }
.hb-feature-sub { font-style: italic; font-size: 1.15rem; margin-bottom: .8rem; opacity: .85; }
.hb-feature .hb-desc { font-size: 1.02rem; margin-bottom: 1rem; display: block; }
.hb-feature-toc { list-style: none; margin: 0 0 1.2rem; padding: 0; border-top: 1px dashed currentColor; opacity: .9; }
.hb-feature-toc li { padding: .45rem 0; border-bottom: 1px dashed rgba(127,127,127,.35); font-size: .98rem; }
.hb-feature .hb-badges { margin-bottom: .4rem; }
@media (max-width: 760px) { .hb-feature { grid-template-columns: 1fr; gap: 1.6rem; } .hb-feature-cover { max-width: 220px; margin: 0 auto; } }

/* Flat magazine covers: no tilt, no shadow, no hover movement */
.hb-feature-cover img, .hb-feature-cover:hover img,
.hb-mags .hb-img.cover { transform: none !important; box-shadow: none !important; transition: none !important; border-radius: 0 !important; }
.hb-mags .hb-card:hover { transform: none; }

/* Cards match the blog card ("Recent Discoveries"): framed, lift + red border + shadow on hover */
.hb-card, .hb-mags .hb-card, .hb-feature, .mz-issue, .mz-story {
  background: var(--dark2); border: 1px solid var(--gold30);
  transition: transform .4s ease, border-color .4s ease, background .4s ease, box-shadow .4s ease;
}
.hb-card:hover, .hb-card:focus-within, .hb-feature:hover, .hb-feature:focus-within,
.mz-issue:hover, .mz-issue:focus-visible, .mz-story:hover, .mz-story:focus-visible {
  transform: translateY(-5px); border-color: var(--gold); background: var(--dark3);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.hb-mags .hb-card { padding: 1rem; }
.hb-mags .hb-body { padding: 1rem 0 0; }
.hb-feature { padding: 2rem; }
.mz-issue { padding: 1rem 1rem 1.3rem; }
.mz-issue .mz-cover { margin-bottom: 1rem; }

/* On the light "paper" homepage band, use light cards so they sit well on the texture */
.hb-paper .hb-card, .hb-paper .hb-feature { background: rgba(255,255,255,.5); border-color: rgba(227,64,31,.3); }
.hb-paper .hb-card:hover, .hb-paper .hb-card:focus-within, .hb-paper .hb-feature:hover, .hb-paper .hb-feature:focus-within {
  background: rgba(255,255,255,.78); border-color: var(--gold); box-shadow: 0 10px 30px rgba(60,40,20,.18);
}
@media (prefers-reduced-motion: reduce) {
  .hb-card:hover, .hb-feature:hover, .mz-issue:hover, .mz-story:hover { transform: none; }
}
@media (max-width: 760px) { .hb-feature { padding: 1.2rem; } }
.nav-btn.is-signed-in{background:var(--gold);color:var(--bg);border-color:var(--gold)}

/* Empty homepage section ("coming soon") */
.hb-empty { border: 1px dashed var(--gold30); padding: 2.4rem 1.5rem; text-align: center; background: var(--dark2); }
.hb-dark .hb-empty { background: #17110c; }
.hb-empty-title { font-family: var(--ff-display); font-size: 1.4rem; font-weight: 700; margin-bottom: .4rem; }
.hb-empty p { opacity: .85; }
.hb-empty-staff { margin-top: .8rem; font-size: .9rem; }
.hb-empty-staff a { color:var(--gold-ink); }

/* Reader activity: like / save / rating / comments */
.eg { --eg-line: var(--gold30); max-width: 760px; margin: 3rem auto 0; padding: 1.6rem 0 0; border-top: 1px solid var(--eg-line); }
.eg-title { font-family: var(--ff-display); font-size: 1.35rem; margin: 0 0 1rem; }
.eg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.eg-actions form { margin: 0; }
.eg-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: 0 .95rem; border: 1px solid var(--eg-line); background: transparent; color: var(--text); font: inherit; font-family: var(--ff-bangla-ui); font-size: .95rem; cursor: pointer; text-decoration: none; border-radius: 999px; transition: border-color .2s, color .2s, background .2s; }
.eg-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.eg-btn:hover, .eg-btn:focus-visible { border-color: var(--gold); color:var(--gold-ink); }
.eg-btn.is-on { border-color: var(--gold); color:var(--gold-ink); }
.eg-btn.is-on svg { fill: currentColor; }
.eg-btn b { font-weight: 600; }
.eg-stars { display: inline-flex; align-items: center; gap: 0; text-decoration: none; }
.eg-star { width: 34px; height: 42px; border: 0; background: none; font-size: 1.45rem; line-height: 1; color: var(--text-faint); cursor: pointer; padding: 0; }
.eg-stars:hover .eg-star, .eg-star.is-on { color:var(--gold-ink); }
.eg-stars .eg-star:hover ~ .eg-star { color: var(--text-faint); }
.eg-avg { font-family: var(--ff-bangla-ui); font-size: .9rem; color: var(--text-muted); }
.eg-login { margin: 1.2rem 0 0; padding: 1rem 1.1rem; border: 1px dashed var(--gold); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.eg-login p { flex: 1 1 280px; margin: 0; font-family: var(--ff-bangla-ui); font-size: .95rem; }
.eg-cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; background: var(--gold); color: #fff; border: 1px solid var(--gold); font: inherit; font-family: var(--ff-bangla-ui); font-weight: 600; cursor: pointer; text-decoration: none; }
.eg-cta-ghost { background: transparent; color:var(--gold-ink); }
.eg-comments { margin-top: 1.8rem; }
.eg-comments h3 { font-family: var(--ff-bangla-heading, var(--ff-display)); font-size: 1.1rem; margin: 0 0 .8rem; }
.eg-form textarea { width: 100%; padding: .75rem .85rem; border: 1px solid var(--eg-line); background: transparent; color: var(--text); font: inherit; font-size: 1rem; resize: vertical; }
.eg-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.eg-form-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: .5rem; }
.eg-msg { margin: 0; font-size: .88rem; color: var(--text-muted); }
.eg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.eg-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.eg-item { padding: .9rem 0; border-top: 1px solid var(--eg-line); }
.eg-meta { margin: 0 0 .3rem; font-size: .88rem; color: var(--text-muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.eg-meta strong { color: var(--text); }
.eg-body { margin: 0; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.eg-del { margin-left: auto; }
.eg-del button { background: none; border: 0; color: var(--text-muted); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }
.eg-empty { color: var(--text-muted); font-size: .95rem; padding: .6rem 0; }

/* Homepage: history games */
.hb-games { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hb-game { text-decoration: none; color: inherit; }
.hb-game-art { display: grid; place-items: center; aspect-ratio: 16 / 9; color:var(--gold-ink); background: var(--gold10); border-bottom: 1px solid var(--gold30); }
.hb-game-art svg { width: 42%; max-width: 150px; height: auto; }
.hb-game .hb-name { font-family: var(--ff-bangla-heading); font-size: 1.45rem; }
.hb-play { display: inline-block; margin-top: .6rem; color:var(--gold-ink); font-weight: 600; font-family: var(--ff-bangla-ui); }
.hb-games-note { margin-top: 1rem; text-align: center; font-family: var(--ff-bangla-ui); color: var(--text-muted); }

/* Magazine cover: hover overlay "পড়ে দেখুন" */
.has-peek { position: relative; display: block; overflow: hidden; }
.cv-peek { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
  background: rgba(18, 13, 8, .62); color: #fff; font-family: var(--ff-bangla-ui); font-weight: 600; font-size: 1.05rem;
  opacity: 0; transition: opacity .25s ease; pointer-events: none; z-index: 2; }
.cv-peek svg { width: 34px; height: 34px; transform: translateY(6px); transition: transform .25s ease; }
.has-peek:hover .cv-peek, .has-peek:focus-visible .cv-peek, .mz-issue:hover .cv-peek, .mz-issue:focus-visible .cv-peek { opacity: 1; }
.has-peek:hover .cv-peek svg, .has-peek:focus-visible .cv-peek svg, .mz-issue:hover .cv-peek svg { transform: none; }
.has-peek:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (hover: none) {
  /* Touch screens: a small label instead of a hover overlay */
  .cv-peek { inset: auto .6rem .6rem auto; flex-direction: row; gap: .3rem; padding: .3rem .6rem; font-size: .8rem; opacity: 1; border-radius: 999px; background: rgba(18, 13, 8, .78); }
  .cv-peek svg { width: 16px; height: 16px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cv-peek, .cv-peek svg { transition: none; } }

/* Magazine: two clear buttons with the price inside */
.mzc-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.mzc { display: inline-flex; align-items: center; justify-content: space-between; gap: .9rem; min-height: 52px; padding: .55rem 1.1rem;
  font: inherit; font-family: var(--ff-bangla-ui); font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 2px solid var(--gold); transition: background .2s, color .2s, transform .2s; }
.mzc b { font-family: var(--ff-bangla-ui); font-weight: 700; font-size: 1.05rem; padding-left: .9rem; border-left: 1px solid currentColor; }
.mzc-primary { background: var(--gold); color: #fff !important; }
.mzc-primary:hover { background: #c93519; border-color: #c93519; transform: translateY(-2px); }
.mzc-print { background: #1d1712; border-color: #1d1712; color: #f5edd8 !important; }
.mzc-print:hover { background: transparent; color: var(--text) !important; transform: translateY(-2px); }
.mzc-owned { background: #2f7d4f; border-color: #2f7d4f; }
.mzc-owned:hover { background: #256640; border-color: #256640; }
.mzc-wait { background: transparent; border-color: var(--gold); color:var(--gold-ink) !important; }
.mzc-wait:hover { background: var(--gold10); border-color: var(--gold); }
.mzc.is-off { opacity: .55; cursor: default; background: transparent; color: var(--text) !important; border-color: var(--gold30); }
.mzc:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hb-mags .mzc-row { flex-direction: column; }
.hb-mags .mzc { width: 100%; min-height: 46px; font-size: .92rem; padding: .45rem .8rem; }
.hb-peeklink { display: inline-block; margin-top: .7rem; color:var(--gold-ink); font-family: var(--ff-bangla-ui); font-size: .95rem; text-decoration: none; }
.hb-peeklink:hover { text-decoration: underline; }
@media (max-width: 560px) { .mzc-row { flex-direction: column; } .mzc { width: 100%; } }

/* After the free pages in the reader */
.mz-endcta { margin: 1.6rem auto 0; max-width: 760px; text-align: center; padding: 1.4rem 1.2rem; border: 1px dashed var(--gold); background: var(--gold10); }
.mz-endcta-title { font-family: var(--ff-bangla-heading); font-size: 1.3rem; font-weight: 700; margin: 0 0 .35rem; }
.mz-endcta-sub { margin: 0; color: var(--text-muted); font-family: var(--ff-bangla-ui); }
.mz-endcta .mzc-row { justify-content: center; }
.mz-lock .mz-btn-ghost { color: #f5edd8 !important; border-color: rgba(245,237,216,.4); }
.mz-reader .mz-endcta { color: #f5edd8; background: rgba(227,64,31,.08); }
.mz-reader .mz-endcta-sub { color: rgba(245,237,216,.75); }
.mz-reader .mzc-print { background: #f5edd8; border-color: #f5edd8; color: #1d1712 !important; }
.mz-reader .mzc-print:hover { background: transparent; color: #f5edd8 !important; }

/* Magazine page shelf cards with CTAs */
.mz-shelf .mz-issue h3 a { color: inherit; text-decoration: none; }
.mz-shelf .mz-issue h3 a:hover { color:var(--gold-ink); }
.mz-shelf .mz-issue .mz-prices { margin: 0; }
.mz-shelf .mz-issue .mzc-row { flex-direction: column; margin-top: auto; padding-top: .9rem; }
.mz-shelf .mz-issue .mzc { width: 100%; min-height: 48px; font-size: .95rem; }
.mz-latest .mzc-row { margin-top: 1.1rem; }
.mz-shelf { grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr)); }
.hb-mags { grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); }
.mz-shelf .mzc, .hb-mags .mzc { white-space: nowrap; gap: .6rem; }
.mz-shelf .mzc b, .hb-mags .mzc b { padding-left: .7rem; }
