/* Layout: a calm reading site, light look only (same as the approved post design).
   Full-width bands (header, hero, footer) with a 780px column.
   A post is one bordered card: dark title block on top, tables and worked solutions below. */
:root {
  color-scheme: light;
  --font: 'SolaimanLipi', 'Solaiman Lipi', 'Hind Siliguri', sans-serif;
  --bg: #EBF1ED;
  --surface: #FFFFFF;
  --ink: #1F2A28;
  --muted: #55665F;
  --line: #DCE6E0;
  --line-soft: #E3ECE7;
  --band: #0E3B34;
  --band-ink: #FFFFFF;
  --band-muted: #A9CFC3;
  --band-chip: #1C5247;
  --band-chip-ink: #E3F1EC;
  --gold: #F4B942;
  --gold-ink: #1F2A28;
  --accent: #0B6B4F;
  --link: #0B5A47;
  --zebra: #F4F9F6;
  --tint: #F4F9F6;
  --chip: #D9EFE6;
  --chip-ink: #0B5A47;
  --pill-bd: #CFDDD5;
  --wrong: #9A3B34;
  --focus: #0B6B4F;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.mark { width: 28px; height: 28px; border-radius: 50%; background: var(--band); display: inline-flex; align-items: center; justify-content: center; }
.mark i { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); }
.menu { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.menu a { text-decoration: none; color: var(--ink); }
.menu a:hover { color: var(--link); text-decoration: underline; }

/* home */
.hero { background: radial-gradient(900px 340px at 88% -10%, #1E6B5C 0%, rgba(30,107,92,0) 60%), linear-gradient(160deg, #0E3B34 0%, #0A2D28 100%); color: var(--band-ink); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%; border: 36px solid rgba(244,185,66,.12); pointer-events: none; }
.hero .wrap { padding-block: 40px 44px; position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #E3F1EC; font-size: 14px; line-height: 1.4; padding: 4px 14px; border-radius: 999px; margin-bottom: 14px; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.hstats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hstats span { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 6px 14px; font-size: 14px; line-height: 1.5; color: var(--band-muted); }
.hstats b { color: var(--gold); font-size: 18px; margin-right: 4px; }
.hero h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.45; font-weight: 700; text-wrap: balance; }
.hero p { margin: 0; color: var(--band-muted); font-size: 16px; line-height: 1.8; max-width: 56ch; }
.search { margin-top: 22px; display: flex; gap: 8px; max-width: 560px; }
.search input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; line-height: 1.5;
  padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18);
  background: var(--surface); color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 28px 0 12px; }
.list-head h2 { margin: 0; font-size: 19px; line-height: 1.6; }
.list-head span { font-size: 14px; color: var(--muted); }
.plist { display: grid; gap: 12px; }
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--ink); text-decoration: none; }
.pcard:hover { border-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 13px; line-height: 1.6; background: var(--chip); color: var(--chip-ink); padding: 0 10px; border-radius: 999px; }
.pt { font-weight: 700; font-size: 18px; line-height: 1.6; text-wrap: balance; }
.pm { font-size: 14px; color: var(--muted); margin-top: 4px; }
.go { display: inline-block; margin-top: 8px; font-size: 15px; font-weight: 600; color: var(--link); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }

/* post: title block */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 24px; }
.ph { background: var(--band); padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 10px; color: var(--band-ink); }
.crumb { font-size: 14px; line-height: 1.6; color: var(--band-muted); }
.crumb a { color: var(--band-muted); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.cat { align-self: flex-start; background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 14px; line-height: 1.4; padding: 3px 14px; border-radius: 999px; }
.ph h1 { margin: 0; font-weight: 700; font-size: 28px; line-height: 1.5; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.meta span { background: var(--band-chip); color: var(--band-chip-ink); font-size: 14px; line-height: 1.4; padding: 4px 14px; border-radius: 8px; }
.pub { font-size: 14px; color: var(--band-muted); }

/* post: content section */
.pb { padding: 24px 28px 36px; }
.intro { margin: 0 0 16px; font-size: 16px; line-height: 1.9; }
.toc { background: var(--tint); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.toc-t { font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--band); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { text-decoration: none; background: var(--surface); border: 1px solid var(--pill-bd); font-size: 14px; line-height: 1.4; padding: 3px 12px; border-radius: 999px; color: var(--link); }
.chip:hover { border-color: var(--accent); }
.grp { display: flex; align-items: center; gap: 12px; margin: 34px 0 0; }
.toc + .grp { margin-top: 30px; }
.grp span { background: var(--band); color: var(--band-ink); font-weight: 700; font-size: 14px; line-height: 1.4; padding: 3px 16px; border-radius: 999px; }
.grp::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }
.sec { margin-top: 26px; scroll-margin-top: 16px; }
.grp + .sec { margin-top: 18px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.num { flex: 0 0 auto; background: var(--band); color: var(--gold); font-weight: 700; font-size: 15px; line-height: 1; padding: 8px 10px; border-radius: 8px; }
.sec h2 { margin: 0; font-size: 19px; line-height: 1.6; color: var(--band); }

.tbl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tr { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.tbody > .tr:nth-child(even) { background: var(--zebra); }
.th { background: var(--band); color: var(--band-ink); font-weight: 600; font-size: 14px; line-height: 1.5; padding: 8px 16px; border-top: 0; }
.td { min-width: 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.td.b { font-weight: 700; font-size: 16px; color: var(--band); }
.td.ans { font-weight: 700; font-size: 16px; color: var(--ink); }
.td.acc { color: var(--ink); font-weight: 600; }
.td.acc2 { color: var(--ink); font-weight: 600; font-size: 16px; }
.td.wrong { color: var(--wrong); text-decoration: line-through; }
.td.muted { font-size: 14px; color: var(--muted); }
.acc { color: var(--ink); font-weight: 600; }
.wrong { color: var(--wrong); }
u.key { font-weight: 700; text-underline-offset: 4px; }
.pill { display: inline-block; background: var(--chip); color: var(--chip-ink); font-weight: 700; padding: 0 10px; border-radius: 6px; }

.trbox { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trbox p { margin: 0; padding: 14px 18px; font-size: 15px; line-height: 1.9; }
.trbox .src { background: var(--tint); }
.trbox .sol { border-top: 1px solid var(--line); color: var(--ink); }
.trbox .src { color: var(--band); font-weight: 700; }

.mq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.sec-head + .mq { margin-top: 6px; }
.mq-q { background: var(--tint); padding: 10px 16px; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line); }
.badge { flex: 0 0 auto; background: var(--band); color: var(--gold); font-weight: 700; font-size: 14px; line-height: 1.4; padding: 1px 9px; border-radius: 6px; }
.mq-t { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; font-size: 16px; line-height: 1.7; color: var(--band); }
.mq-s { padding: 10px 16px; font-size: 15px; line-height: 1.7; overflow-x: auto; }
.st { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 3px 0; }
.mq-a { background: var(--band); color: var(--band-ink); font-weight: 700; font-size: 15px; line-height: 1.6; padding: 7px 16px; }

.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 3px; line-height: 1.35; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 5px; }
.fr > span:last-child { padding: 0 5px; }
.pw { display: inline-flex; align-items: center; margin: 0 2px; }
.pw > b { font-size: 30px; font-weight: 300; line-height: 1; }
.pw > sup { font-size: 12px; align-self: flex-start; margin-top: 2px; }

.li { display: flex; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.tbody > .li:first-child { border-top: 0; }
.tbody > .li:nth-child(even) { background: var(--zebra); }
.li-l { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--chip); color: var(--chip-ink); font-weight: 700; font-size: 14px; line-height: 26px; text-align: center; }
.li-b { flex: 1 1 0; min-width: 0; }
.li-q { font-size: 15px; line-height: 1.7; color: var(--band); font-weight: 700; }
.li-a { font-weight: 600; font-size: 15px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.copy { font: inherit; font-size: 14px; background: var(--surface); color: var(--link); border: 1px solid var(--pill-bd); border-radius: 8px; padding: 6px 16px; min-height: 44px; cursor: pointer; }
.copy:hover { border-color: var(--accent); }
.share small { color: var(--muted); font-size: 14px; }
.pn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.pn a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.pn a:hover { border-color: var(--accent); }
.pn small { display: block; color: var(--muted); font-size: 13px; }
.pn b { font-size: 15px; line-height: 1.6; }

.foot { background: var(--band); color: var(--band-muted); margin-top: 40px; }
.foot .wrap { padding-block: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 14px; }
.foot b { color: var(--band-ink); }

.nf { padding-block: 64px; text-align: center; }
.nf h1 { font-size: 28px; margin: 0 0 8px; }

/* phones: same layout, tighter spacing (tables keep their header row and columns) */
@media (max-width: 600px) {
  .ph { padding: 20px 16px; }
  .ph h1 { font-size: 24px; }
  .pb { padding: 18px 14px 28px; }
  .tr, .th { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .td { font-size: 14px; }
  .td.b, .td.ans, .td.acc2 { font-size: 15px; }
  .mq-q, .mq-s, .mq-a { padding-left: 12px; padding-right: 12px; }
  .li { padding-left: 10px; padding-right: 10px; gap: 10px; }
  .hero h1 { font-size: 26px; }
}

/* ---- additions: brand, home grids, pages, footer, ads, forms, admin ---- */
.bt { display: flex; flex-direction: column; line-height: 1.35; }
.bt small { font-weight: 400; font-size: 13px; color: var(--muted); }
.logo { display: block; height: 44px; width: auto; max-width: 240px; object-fit: contain; }
.brand:has(.logo) { gap: 10px; }

.blk { margin-top: 8px; }
.hero-sm .wrap { padding-block: 24px 26px; }
.hero-sm h1 { font-size: 26px; }
.gh { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 26px 0 12px; }
.gh h2 { margin: 0; font-size: 19px; line-height: 1.6; }
.gh span { font-size: 14px; color: var(--muted); }
.ygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ycard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.ycard:hover { border-color: var(--accent); }
.ycard b { font-size: 18px; line-height: 1.5; }
.ycard span { font-size: 14px; color: var(--muted); }
.chip.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 700; }
.chips.on-band { margin-top: 16px; }
.chips.on-band .chip { background: var(--band-chip); border-color: var(--band-chip); color: var(--band-chip-ink); }
.chips.on-band .chip.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cats .cat { text-decoration: none; }
.cat.alt { background: var(--band-chip); color: var(--band-chip-ink); }

.post.prose-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 20px; }
.ph.slim { padding: 22px 28px; }
.prose { font-size: 16px; line-height: 1.95; }
.prose h2 { font-size: 20px; margin: 1.4em 0 .4em; line-height: 1.6; }
.prose h3 { font-size: 17px; margin: 1.2em 0 .3em; }
.prose p, .prose ul, .prose ol { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.4em; }

.flinks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.flinks a { color: var(--band-chip-ink); text-decoration: none; }
.flinks a:hover { text-decoration: underline; }
.fcopy { color: var(--band-muted); display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--band-chip); width: 100%; line-height: 1.6; }
.fcopy span { display: block; }

.ad { margin: 20px 0; text-align: center; min-height: 20px; }
.ad::before { content: "বিজ্ঞাপন"; display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.fld { margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; }
.fld label { font-weight: 700; font-size: 15px; }
.fld small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.fld input[type=text], .fld input[type=email], .fld input[type=url], .fld input[type=password], .fld textarea, .fld select {
  font: inherit; font-size: 16px; width: 100%; padding: 9px 12px; border: 1px solid var(--pill-bd); border-radius: 10px; background: #fff; color: var(--ink);
}
.fld input[type=file] { font: inherit; font-size: 15px; }
.fld textarea { line-height: 1.6; resize: vertical; }
.fld textarea.code, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
code { background: var(--tint); padding: 1px 6px; border-radius: 6px; }
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 16px; background: var(--band); color: #fff; border: 1px solid var(--band); border-radius: 10px; padding: 8px 20px; min-height: 44px; cursor: pointer; text-decoration: none; line-height: 1.6; }
.btn:hover { background: var(--accent); }
.btn.ghost { background: var(--surface); color: var(--link); border-color: var(--pill-bd); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 14px 0; font-size: 15px; border: 1px solid; }
.flash.ok { background: #E4F4EA; border-color: #A9D8BC; color: #0B5A47; }
.flash.err { background: #FBE9E7; border-color: #E8B4AE; color: #8A2F28; }
.flash.warn { background: #FFF6DC; border-color: #EBCF84; color: #5E4700; }
.cform { margin-top: 20px; }

/* admin */
.adm { padding-block: 20px 40px; }
.adm .card, .login .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0 0 18px; }
.adm .card h2, .login .card h2 { margin: 0 0 12px; font-size: 19px; line-height: 1.6; }
.card.narrow { max-width: 460px; }
.login { padding-block: 40px; max-width: 420px; }
.lg-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.subnav a { background: var(--surface); border: 1px solid var(--pill-bd); border-radius: 999px; padding: 3px 14px; text-decoration: none; font-size: 14px; }
.menu a.on { font-weight: 700; color: var(--accent); }
.inl { display: inline; margin: 0; }
.linkbtn { font: inherit; background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-weight: 400 !important; margin-top: 6px; }
.chk input { margin-top: 6px; }
.pv { background: var(--tint); border: 1px dashed var(--pill-bd); border-radius: 10px; padding: 10px; margin-bottom: 6px; display: inline-block; }
.pv-logo { max-height: 60px; max-width: 100%; display: block; }
.pv-fav { width: 32px; height: 32px; display: block; }
.badge-s { font-size: 12px; background: var(--gold); color: var(--gold-ink); padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.adm .top .wrap, .top.adm-top .wrap { max-width: 780px; }

/* search button + pager */
.search .sbtn { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); padding-inline: 18px; }
.search .sbtn:hover { background: #E8AA2C; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 22px 0 6px; }
.pg { min-width: 40px; min-height: 40px; padding: 4px 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--pill-bd); border-radius: 10px; color: var(--link); text-decoration: none; font-size: 15px; }
a.pg:hover { border-color: var(--accent); }
.pg.on { background: var(--band); border-color: var(--band); color: #fff; font-weight: 700; }
.pg.off { color: #9AA9A2; background: transparent; }
.gap { color: var(--muted); padding: 0 2px; }

.sec-note { margin: 0 0 12px; font-size: 15px; line-height: 1.85; }

/* newsletter */
.nl { margin-top: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.nl-h { background: var(--band); color: var(--band-ink); padding: 18px 22px; }
.nl-h h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.5; }
.nl-h p { margin: 0; color: var(--band-muted); font-size: 15px; line-height: 1.7; }
.nl form { display: flex; gap: 8px; padding: 18px 22px 8px; }
.nl input[type=email] { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--pill-bd); border-radius: 10px; background: #fff; color: var(--ink); }
.nl .btn { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); white-space: nowrap; }
.nl .btn:hover { background: #E8AA2C; }
.nl small { display: block; padding: 0 22px 16px; color: var(--muted); font-size: 13px; }
.nl .flash { margin: 14px 22px 0; }
@media (max-width: 520px) { .nl form { flex-direction: column; } .nl .btn { width: 100%; } .search { max-width: none; } }
.subs { width: 100%; border-collapse: collapse; font-size: 15px; }
.subs th, .subs td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
