/* ===========================================================
   BLOGSITE — editorial bilingual news portal
   Design tokens + base + components
   =========================================================== */

:root {
  /* fonts (overridable by Tweaks) */
  --font-head: "Tiro Bangla", "Noto Serif Bengali", Georgia, serif;
  --font-ui:   "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;

  /* accent (overridable by Tweaks — only --accent need change) */
  --accent: #0e8388;
  --accent-ink: color-mix(in oklch, var(--accent), black 20%);
  --accent-wash: color-mix(in oklch, var(--accent), var(--bg) 88%);

  /* neutrals — cool editorial */
  --bg:        oklch(0.992 0.002 230);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.975 0.003 230);
  --ink:       oklch(0.22 0.012 250);
  --ink-2:     oklch(0.43 0.012 250);
  --ink-3:     oklch(0.60 0.010 250);
  --line:      oklch(0.90 0.004 250);
  --line-2:    oklch(0.94 0.003 250);

  --red:   oklch(0.55 0.18 25);
  --amber: oklch(0.72 0.13 70);
  --green: oklch(0.60 0.11 150);

  /* density (overridable) */
  --gap: 28px;
  --pad: 22px;
  --radius: 4px;
  --maxw: 1240px;

  --shadow-1: 0 1px 2px oklch(0.2 0.02 250 / 0.06), 0 1px 1px oklch(0.2 0.02 250 / 0.04);
  --shadow-2: 0 8px 30px oklch(0.2 0.02 250 / 0.10), 0 2px 8px oklch(0.2 0.02 250 / 0.06);
}

[data-density="compact"] { --gap: 18px; --pad: 16px; }
[data-density="comfy"]   { --gap: 40px; --pad: 30px; }

[data-theme="dark"] {
  --bg:        oklch(0.20 0.012 250);
  --surface:   oklch(0.235 0.012 250);
  --surface-2: oklch(0.27 0.013 250);
  --ink:       oklch(0.95 0.004 250);
  --ink-2:     oklch(0.78 0.006 250);
  --ink-3:     oklch(0.62 0.008 250);
  --line:      oklch(0.34 0.012 250);
  --line-2:    oklch(0.30 0.012 250);
  --accent-ink:  color-mix(in oklch, var(--accent), white 30%);
  --accent-wash: color-mix(in oklch, var(--accent), var(--bg) 80%);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-2: 0 10px 34px oklch(0 0 0 / 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { min-height: 100vh; }

h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.12; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--font-head); }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }

/* kicker / labels */
.kicker {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--accent-ink);
}
.kicker.bn { letter-spacing: 0.02em; text-transform: none; font-weight: 700; }

.divider { height: 1px; background: var(--line); border: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 15px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.danger { color: var(--red); border-color: color-mix(in oklch, var(--red), transparent 70%); }
.btn.danger:hover { background: color-mix(in oklch, var(--red), transparent 92%); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2);
}
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  letter-spacing: .02em; white-space: nowrap; display: inline-block;
}
/* short UI headings should never wrap mid-phrase */
.nowrap { white-space: nowrap; }
.badge.teal { background: var(--accent-wash); color: var(--accent-ink); }
.badge.red  { background: color-mix(in oklch, var(--red), transparent 88%); color: var(--red); }
.badge.amber{ background: color-mix(in oklch, var(--amber), transparent 80%); color: oklch(0.45 0.12 70); }
.badge.green{ background: color-mix(in oklch, var(--green), transparent 85%); color: oklch(0.42 0.11 150); }
.badge.gray { background: var(--surface-2); color: var(--ink-3); border:1px solid var(--line); }

/* ---------- image placeholder ---------- */
.imgph {
  position: relative; overflow: hidden; background: var(--surface-2);
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 9px,
    color-mix(in oklch, var(--ink-3), transparent 88%) 9px,
    color-mix(in oklch, var(--ink-3), transparent 88%) 10px);
  display: flex; align-items: center; justify-content: center;
}
.imgph span {
  position: absolute; top: 8px; left: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; letter-spacing: .04em; color: var(--ink-3);
  background: color-mix(in oklch, var(--surface), transparent 12%); padding: 3px 7px; border-radius: 3px;
  border: 1px solid var(--line-2); text-transform: uppercase;
}

/* ---------- cards ---------- */
.card { background: var(--surface); }
.headline-link { transition: color .12s ease; }
.headline-link:hover { color: var(--accent-ink); }

.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
}
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity:.6; }

.views { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }

/* scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, textarea, select {
  font-family: var(--font-ui); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label.field { display: block; }
label.field > .lbl { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing:.03em; margin-bottom: 6px; display:block; }

.fade-in { animation: none; }

@media (max-width: 920px) {
  .wrap { padding: 0 16px; }
}

/* ---------- nav links ---------- */
.catlink {
  background: none; border: 0; cursor: pointer; white-space: nowrap;
  font-family: var(--font-head); font-size: 16px; font-weight: 600;
  color: var(--ink-2); padding: 0 14px; height: 46px; position: relative;
  transition: color .12s ease;
}
.catlink:hover { color: var(--ink); }
.catlink[data-active="true"] { color: var(--accent-ink); }
.catlink[data-active="true"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2.5px; background: var(--accent);
}
.catnav::-webkit-scrollbar { height: 0; }

/* ---------- slider arrows ---------- */
.slider-arr {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: oklch(1 0 0 / 0.92); color: var(--ink); display: grid; place-items: center;
  box-shadow: var(--shadow-2); transition: background .15s ease;
}
.slider-arr:hover { background: #fff; }

/* ---------- article body drop-cap ----------
   Scoped to .article-content so the muted loading/notice paragraphs never get
   a drop cap, and both the plain-text and raw-HTML branches share it.
   ::first-letter operates on the first grapheme; current engines keep Bengali
   clusters (e.g. প্র, কি) intact — if an engine ever splits one, gate this
   rule behind :lang(en). */
.article-body .article-content > p:first-of-type::first-letter {
  font-size: 3.1em; font-weight: 700; float: left; line-height: .85;
  margin: 6px 10px 0 0; color: var(--accent-ink);
}

/* ---------- "read at source" CTA (summary-only articles) ---------- */
.source-cta {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); padding: 20px; margin-top: 4px;
}

/* ---------- article body: raw-HTML branch (RSS bodies) ---------- */
.article-body-html p { margin-bottom: 22px; }
.article-body-html h2, .article-body-html h3 {
  font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 28px 0 12px;
}
.article-body-html ul, .article-body-html ol { margin: 0 0 22px 22px; }
.article-body-html li { margin-bottom: 8px; }
.article-body-html a { color: var(--accent-ink); text-decoration: underline; }
.article-body-html img {
  max-width: 100%; height: auto; border-radius: var(--radius); margin: 12px 0; display: block;
}
.article-body-html figure { margin: 0 0 22px; }
.article-body-html figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.article-body-html blockquote {
  border-left: 3px solid var(--accent); padding-left: 16px; margin: 16px 0; color: var(--ink-2);
}

/* ---------- responsive ---------- */
.hide-sm { display: inline; }

@media (max-width: 1040px) {
  .home-top, .cat-page, .art-grid { grid-template-columns: 1fr !important; }
  .home-lead { border-right: 0 !important; padding-right: 0 !important; }
  aside .stickyfix { position: static !important; }
  .editor-grid, .dash-grid, .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .bb-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .hamb { display: inline-flex !important; }
  .home-lead, .cat-row, .stat-grid, .dash-grid, .editor-grid, .login-art, .foot-grid { grid-template-columns: 1fr !important; }
  .login-art { display: none !important; }
  .home-lead .ac-text { grid-column: auto !important; }
  .cat-row > div[style*="span 2"] { grid-column: auto !important; }
  .ac-row, .ac-mini { grid-template-columns: 1fr !important; }
  .ac-row .imgph, .ac-mini .imgph { display: none; }
  .post-row, .people-row, .people-head, .post-head { grid-template-columns: 1fr auto !important; }
  .post-row span:nth-child(2), .post-row span:nth-child(3),
  .post-head span:nth-child(2), .post-head span:nth-child(3) { display: none; }
  .queue-card, .feed-card { grid-template-columns: 1fr !important; }
}
