/* E-magazine — one small stylesheet, system fonts only (nothing extra to download). */
:root {
  --bg: #f6f3ee; --surface: #fff; --ink: #1d1a17; --muted: #6b645c; --line: #e3ddd4;
  --ph: #e8e3db; --stage: #e9e5df; --ctrl-bg: rgba(29, 26, 23, .86); --ctrl-ink: #fff;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --display: "Tiro Bangla", var(--serif);   /* Bengali + Latin literary serif for headings */
  --accent-ink: var(--accent);              /* accent colour for text */
  --err-bg: #fdecea; --err-ink: #b71c1c;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --bar: 52px; --ctrl: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210; --surface: #1d1a17; --ink: #efe9e1; --muted: #a59d93; --line: #2e2a26;
    --ph: #24211d; --stage: #0e0d0c; --ctrl-bg: rgba(239, 233, 225, .9); --ctrl-ink: #141210;
    --accent-ink: #f2948a; --err-bg: #3a1714; --err-ink: #ffb4ab;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: inherit; }
img { max-width: 100%; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.25; }
a, button, input, label, textarea { touch-action: manipulation; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; }
.skip:focus { top: 8px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Rolling message strip (top of page) */
.ticker { overflow: hidden; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.tk-track { display: flex; width: max-content; animation: tk var(--tk, 30s) linear infinite; }
.ticker:hover .tk-track, .ticker:focus-within .tk-track { animation-play-state: paused; }
.tk-list { display: flex; margin: 0; padding: 0; list-style: none; }
.tk-list li { display: flex; align-items: center; min-height: 36px; white-space: nowrap; }
.tk-list li::after { content: "✦"; margin: 0 22px; opacity: .6; font-size: 11px; }
.ticker a { display: inline-flex; align-items: center; min-height: 36px; color: inherit; text-decoration: none; }
.ticker a:hover { text-decoration: underline; }
@keyframes tk { to { transform: translateX(-50%); } }
/* reduce motion: one message at a time */
.ticker.rot .tk-track { animation: none; width: auto; justify-content: center; }
.ticker.rot .tk-list[aria-hidden], .ticker.rot li { display: none; }
.ticker.rot li.on { display: flex; min-height: 36px; }
.ticker.rot li::after { content: none; }

/* ── Home ─────────────────────────────────────────── */
.site-head { max-width: 1120px; margin: 0 auto; padding: 22px 16px 14px; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .logo { width: clamp(52px, 13vw, 72px); height: auto; flex: none; }
.brand .name { display: block; font: 400 clamp(24px, 6vw, 36px)/1.15 var(--display); }
.tagline { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; margin-left: -12px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--ink); background: var(--ph); }
.nav a[aria-current] { color: var(--accent-ink); }
@media (min-width: 640px) { .nav { margin-left: 0; } }
.home { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.empty { padding: 64px 0; text-align: center; color: var(--muted); font-size: 18px; }

.hero { display: grid; gap: 24px; padding: 28px 0 40px; border-bottom: 1px solid var(--line); }
.hero-cover { justify-self: center; width: min(70vw, 360px); }
.hero-cover img, .grid img { display: block; width: 100%; height: auto; background: var(--ph);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 30px -10px rgba(0,0,0,.35); border-radius: 2px; }
.kicker { margin: 0 0 6px; color: var(--accent-ink); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.hero h1 { margin: 0; font-size: clamp(30px, 7vw, 52px); }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.desc { margin: 14px 0 0; font-size: 17px; max-width: 52ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border-radius: 999px; background: var(--accent); color: #fff; font: 600 16px var(--sans); text-decoration: none;
  border: 2px solid var(--accent); cursor: pointer; transition: filter .15s, transform .1s, border-color .15s; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: progress; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 360px 1fr; align-items: center; gap: 48px; padding: 48px 0 56px; }
  .hero-cover { width: 100%; }
}

/* Gallery strip (home page, below the latest issue) */
.gallery { padding: 8px 0 32px; border-bottom: 1px solid var(--line); }
.gal-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 14px; }
.gal-head h2 { margin: 0; font-size: 26px; }
.gal-nav { display: flex; gap: 8px; }
.gal-nav button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s; }
.gal-nav button:hover { border-color: var(--muted); }
.track { position: relative; list-style: none; margin: 0; padding: 0 0 6px; display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: none; scroll-snap-align: center; border-radius: 10px; overflow: hidden; background: var(--ph); }
.slide img { display: block; height: clamp(200px, 42vw, 400px); width: auto; max-width: 88vw; object-fit: cover; }
.cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); }

.archive h2, .about h2 { font-size: 26px; margin: 36px 0 18px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 18px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.grid a { display: block; text-decoration: none; border-radius: 4px; }
.grid img { transition: transform .2s; }
.grid a:hover img { transform: translateY(-3px); }
.grid .t { display: block; margin-top: 10px; font: 400 17px/1.4 var(--display); }
.grid .d { display: block; color: var(--muted); font-size: 14px; }
.about p { max-width: 65ch; margin: 0 0 20px; font-size: 17px; }
.about p[lang="bn"] { font-size: 18px; line-height: 1.8; }
/* Forms (download + contact) */
.formpage { max-width: 520px; padding-top: 28px; }
.formpage h1 { margin: 0; text-align: center; font-size: clamp(28px, 7vw, 38px); }
.formpage .sub { margin: 4px 0 24px; text-align: center; color: var(--muted); font-size: 17px; }
.dlcover { display: block; width: 120px; margin: 0 auto 18px; }
.dlcover img { display: block; width: 100%; height: auto; box-shadow: 0 6px 20px -6px rgba(0,0,0,.35); }
.form { display: grid; gap: 6px; }
.form .intro { margin: 0 0 8px; }
.form label, .form legend { font-weight: 600; font-size: 15px; margin-top: 10px; }
.form .opt { font-weight: 400; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]), .form textarea { display: block; width: 100%; min-height: 48px; margin-top: 6px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: 17px/1.5 var(--sans); transition: border-color .15s; }
.form textarea { resize: vertical; min-height: 140px; }
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.form :user-invalid { border-color: var(--err-ink) !important; }
.help { color: var(--muted); font-size: 13px; }
.tel { display: flex; gap: 8px; margin-top: 6px; }
.tel input { margin-top: 0 !important; }
.tel [name=code] { flex: 0 0 76px; }
.kinds { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kinds legend { width: 100%; margin-bottom: 8px; padding: 0; }
.chip { margin: 0 !important; position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-weight: 500; transition: background-color .15s, border-color .15s; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 10px; font-weight: 400; font-size: 14px; color: var(--muted); }
.check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.form .btn { margin-top: 8px; }
.err { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--err-bg); color: var(--err-ink); font-weight: 600; }
.hp { position: absolute; left: -9999px; }
.done { text-align: center; }
.done h2 { margin: 8px 0 4px; font-size: 28px; }
.done .actions, .formpage .actions { justify-content: center; }
.alt { margin-top: 28px; text-align: center; color: var(--muted); font-size: 15px; }
.site-foot { border-top: 1px solid var(--line); padding: 20px 16px 32px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── Reader (phones: vertical scroll) ─────────────── */
body.read { background: var(--stage); }
.rbar { height: var(--bar); display: flex; align-items: center; gap: 8px; padding: 0 8px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.rbar a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; text-decoration: none; font-weight: 600; font-size: 15px; }
.back .logo { width: 32px; height: 32px; flex: none; }
.back span { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtitle { flex: 1; min-width: 0; margin: 0; font-size: 17px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl { color: var(--accent-ink); }

.reader { padding: 0 0 calc(var(--ctrl) + 24px + env(safe-area-inset-bottom)); }
.pg { position: relative; margin: 0 auto 6px; max-width: 1000px; background: var(--ph); }
.pg img { display: block; width: 100%; height: auto; }

.ctrl { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--ctrl-bg); color: var(--ctrl-ink); box-shadow: 0 6px 24px rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity .2s, transform .2s; z-index: 5; }
.ctrl button { min-width: 48px; height: 48px; border: 0; border-radius: 999px; background: none; color: inherit;
  font: 600 15px var(--sans); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
#pill { gap: .3em; padding: 0 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctrl button:hover { background: rgba(127,127,127,.2); }
.ui-off .ctrl { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }

/* Page picker */
#jump { width: min(720px, 100vw - 24px); max-height: min(80vh, 760px); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
#jump::backdrop { background: rgba(0,0,0,.55); }
.jhead { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 18px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.jhead form { margin: 0; }
.jhead button { width: 44px; height: 44px; border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; border-radius: 50%; }
.thumbs { list-style: none; margin: 0; padding: 14px; display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.thumbs a { display: block; text-align: center; text-decoration: none; font-size: 13px; color: var(--muted); border-radius: 4px; padding: 4px; }
.thumbs img { display: block; width: 100%; height: auto; background: var(--ph); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.thumbs a[aria-current] { background: var(--accent); color: #fff; }

/* Resume toast */
.toast { position: fixed; left: 50%; top: calc(var(--bar) + 12px); transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--ctrl-bg); color: var(--ctrl-ink); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 15px; white-space: nowrap; }
.toast[hidden], .zoom[hidden] { display: none; }
.toast button { height: 38px; border: 0; border-radius: 999px; cursor: pointer; font: 600 14px var(--sans); }
.toast .go { padding: 0 14px; background: var(--accent); color: #fff; }
.toast .x { width: 38px; background: none; color: inherit; }

/* ── Reader (desktop: two-page spreads) ────────────── */
.spread .reader { display: flex; justify-content: center; align-items: center;
  height: calc(100vh - var(--bar)); height: calc(100dvh - var(--bar));
  padding: 16px 24px calc(var(--ctrl) + 28px); }
.spread .pg { display: none; height: 100%; width: auto; max-width: 50%; min-width: 0; margin: 0; background: none; cursor: zoom-in; }
.spread .pg.on { display: block; }
.spread .pg.on:not(.l):not(.r) { max-width: 100%; }
.spread .pg img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.25)); }
.spread .pg.l img { object-position: right center; }
.spread .pg.r img { object-position: left center; }
.spread .ctrl { bottom: 18px; }

/* Zoom overlay (desktop) */
.zoom { position: fixed; inset: 0; z-index: 10; overflow: auto; background: rgba(10,9,8,.94); cursor: zoom-out; text-align: center; }
.zoom img { display: block; margin: 0 auto; width: auto; max-width: 100%; height: auto; cursor: zoom-in; }
.zoom.full img { max-width: none; width: 1600px; cursor: zoom-out; }
.zclose { position: fixed; top: 14px; right: 18px; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; }
.zoomed { overflow: hidden; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
