/* ============================================================
 *  styles.css  —  Editorial design system for the news portal.
 *  Light mode. OKLCH palette, warm paper, signal-red masthead.
 *  Fonts: Fraunces (display), Libre Franklin (UI/body),
 *         Noto Sans Bengali (Bangla content).
 * ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Libre+Franklin:wght@400;500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap');

:root {
  /* palette (OKLCH) */
  --paper:      oklch(97.5% 0.008 75);
  --surface:    oklch(99.2% 0.004 75);
  --surface-2:  oklch(95.5% 0.009 75);
  --ink:        oklch(24% 0.012 55);
  --ink-soft:   oklch(43% 0.012 55);
  --ink-faint:  oklch(60% 0.010 55);
  --line:       oklch(89% 0.010 70);
  --line-soft:  oklch(93% 0.008 72);
  --accent:     oklch(54% 0.196 25);   /* signal red */
  --accent-ink: oklch(46% 0.20 25);
  --accent-wash:oklch(95% 0.03 30);
  --gold:       oklch(72% 0.13 75);
  --money:      oklch(48% 0.13 150);   /* earnings green */
  --money-wash: oklch(95% 0.04 150);
  --ok:         oklch(52% 0.14 150);
  --warn:       oklch(72% 0.15 75);
  --err:        oklch(55% 0.19 25);

  /* type */
  --serif: 'Fraunces', 'Noto Serif Bengali', Georgia, serif;
  --sans:  'Libre Franklin', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* space (4pt) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* misc */
  --radius: 10px;
  --shadow-sm: 0 1px 2px oklch(24% 0.02 55 / 0.06);
  --shadow-md: 0 6px 24px oklch(24% 0.02 55 / 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
:lang(bn), .bn { font-family: var(--sans); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; text-wrap: balance; margin: 0; color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-wash); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s5); }

/* ---------------- masthead / header ---------------- */
#site-header { border-bottom: 2px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.masthead {
  max-width: var(--maxw); margin: 0 auto; padding: var(--s4) var(--s5);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s4);
}
.brand { display: flex; flex-direction: column; align-items: center; }
.brand__name {
  font-family: var(--serif); font-weight: 900; font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: -0.02em; line-height: 1;
}
.brand__rule { display: none; }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); padding: var(--s2); }
.chrome-user { display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; }

.mainnav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s5) var(--s3);
  display: flex; gap: var(--s5); flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: var(--s3);
}
.nav-link {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); padding-bottom: 2px; border-bottom: 2px solid transparent; transition: color .2s var(--ease);
}
.nav-link:hover { color: var(--accent); }
.nav-link.is-active { color: var(--accent); border-color: var(--accent); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2); justify-content: center;
  font-weight: 600; font-size: 0.92rem; border-radius: var(--radius);
  padding: 10px 18px; border: 1px solid transparent; transition: all .18s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 7px 13px; font-size: 0.82rem; }
.btn--solid { background: var(--accent); color: oklch(99% 0.01 75); }
.btn--solid:hover { background: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: oklch(32% 0.012 55); }
.btn--money { background: var(--money); color: oklch(99% 0.01 150); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn i { width: 16px; height: 16px; }

/* ---------------- homepage grid ---------------- */
.lead-strap {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding: var(--s6) 0 var(--s3); margin-bottom: var(--s5);
}
.lead-strap h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.lead-strap .date { color: var(--ink-faint); font-size: 0.85rem; }

.news-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s6); align-items: start; }
.stack { display: flex; flex-direction: column; }

/* hero article */
.hero-card { display: block; padding-bottom: var(--s6); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.hero-card img { border-radius: var(--radius); aspect-ratio: 1200/675; object-fit: cover; margin-bottom: var(--s4); }
.hero-card .kicker { color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-card h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; margin: var(--s2) 0; letter-spacing: -0.015em; }
.hero-card p { color: var(--ink-soft); font-size: 1.05rem; margin: var(--s2) 0 0; max-width: 62ch; }
.hero-card:hover h2 { color: var(--accent); }

/* secondary list (left column, below hero) */
.row-card { display: grid; grid-template-columns: 1fr 200px; gap: var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--line-soft); }
.row-card img { border-radius: 8px; aspect-ratio: 1200/675; object-fit: cover; }
.row-card .kicker { color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.row-card h3 { font-size: 1.3rem; margin: 6px 0; font-weight: 600; }
.row-card:hover h3 { color: var(--accent); }
.row-card .meta { color: var(--ink-faint); font-size: 0.82rem; margin-top: 6px; display: flex; gap: var(--s3); flex-wrap: wrap; }
.row-card .earn { color: var(--money); font-weight: 600; }

/* sidebar (most read) */
.aside-box { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); background: var(--surface); position: sticky; top: 120px; }
.aside-box h4 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding-bottom: var(--s3); border-bottom: 2px solid var(--ink); margin-bottom: var(--s3); }
.mini { display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-soft); }
.mini:last-child { border-bottom: 0; }
.mini .n { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--line); line-height: 1; }
.mini h5 { font-size: 0.96rem; font-weight: 600; margin: 0; }
.mini:hover h5 { color: var(--accent); }

/* ---------------- article page ---------------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: var(--s7) var(--s5) var(--s8); }
.article-kicker { color: var(--accent); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.article-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; margin: var(--s3) 0 var(--s4); line-height: 1.06; }
.byline { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-soft); }
.byline .author { font-weight: 600; color: var(--ink); }
.byline .earn-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--money-wash); color: var(--money); font-weight: 700;
  padding: 6px 12px; border-radius: 999px; font-size: 0.86rem; font-variant-numeric: tabular-nums;
}
.article-hero { margin: var(--s6) 0; }
.article-hero img { border-radius: var(--radius); aspect-ratio: 1200/675; object-fit: cover; }
.article-hero figcaption { color: var(--ink-faint); font-size: 0.82rem; margin-top: var(--s2); text-align: center; }

.article-body { font-size: 1.16rem; line-height: 1.75; color: oklch(30% 0.012 55); }
.article-body p { margin: 0 0 1.4em; text-wrap: pretty; max-width: 68ch; }
.article-body h2 { font-size: 1.7rem; margin: 1.6em 0 .5em; }
.article-body h3 { font-size: 1.35rem; margin: 1.4em 0 .5em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { border-radius: 8px; margin: 1.5em 0; }
.article-body blockquote { border-left: 3px solid var(--accent); margin: 1.5em 0; padding: .2em 0 .2em 1.2em; font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--ink); }

/* injected inline ad */
.inline-ad { margin: 2em 0; padding: var(--s3); text-align: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; }
.inline-ad::before { content: 'Advertisement'; display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--s2); }

/* injected read-more widget */
.readmore-widget {
  margin: 2em 0; padding: var(--s4) var(--s5); background: var(--accent-wash);
  border: 1px solid oklch(88% 0.05 30); border-radius: var(--radius);
}
.readmore-kicker { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.readmore-widget a { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink) !important; text-decoration: none !important; }
.readmore-widget a:hover { color: var(--accent) !important; }

/* social share */
.share-row { display: flex; align-items: center; gap: var(--s3); margin: var(--s7) 0; padding: var(--s5) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-row .lbl { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); transition: all .18s var(--ease); }
.share-btn:hover { transform: translateY(-2px); }
.share-btn.fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-btn.tw:hover { background: #000; color: #fff; border-color: #000; }
.share-btn.wa:hover { background: #25d366; color: #fff; border-color: #25d366; }
.share-btn.cp:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* author bio */
.author-box { display: grid; grid-template-columns: 64px 1fr; gap: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin: var(--s6) 0; }
.author-box .avatar { width: 64px; height: 64px; border-radius: 999px; background: var(--accent-wash); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.6rem; color: var(--accent); }
.author-box .avatar img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }
.author-box h4 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-family: var(--sans); }
.author-box .name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 2px 0 6px; }
.author-box p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; max-width: 60ch; }

/* related */
.related-strap { font-family: var(--sans); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border-bottom: 2px solid var(--ink); padding-bottom: var(--s3); margin: var(--s7) 0 var(--s5); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s5); }
.related-grid a img { border-radius: 8px; aspect-ratio: 1200/675; object-fit: cover; margin-bottom: var(--s3); }
.related-grid a h3 { font-size: 1.1rem; font-weight: 600; }
.related-grid a:hover h3 { color: var(--accent); }

/* ---------------- forms ---------------- */
.field { margin-bottom: var(--s4); }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], textarea, select {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: 0.96rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

/* ---------------- tables ---------------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th { text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.badge--pending  { background: oklch(94% 0.06 75);  color: oklch(48% 0.12 75); }
.badge--published,.badge--paid,.badge--approved { background: var(--money-wash); color: var(--money); }
.badge--rejected,.badge--cancelled { background: var(--accent-wash); color: var(--accent); }

/* ---------------- dashboard shell ---------------- */
.dash { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.dash-side { background: var(--ink); color: oklch(88% 0.01 75); padding: var(--s5) var(--s4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-side .logo { font-family: var(--serif); font-weight: 900; font-size: 1.4rem; color: var(--paper); margin-bottom: var(--s6); display: block; }
.dash-nav a { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 500; color: oklch(80% 0.01 75); margin-bottom: 2px; transition: background .15s var(--ease); }
.dash-nav a:hover { background: oklch(32% 0.012 55); color: var(--paper); }
.dash-nav a.is-active { background: var(--accent); color: #fff; }
.dash-nav a i { width: 18px; height: 18px; }
.dash-main { padding: var(--s6) var(--s7); max-width: 1000px; }
.dash-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
.dash-h h1 { font-size: 1.9rem; font-weight: 700; }

/* stat tiles (varied, not the hero-metric cliche) */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.stat { padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat .k { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.stat .v { font-family: var(--serif); font-size: 2rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat.money .v { color: var(--money); }
.stat.accent .v { color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s5); }
.panel h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: var(--s4); font-family: var(--sans); }
.tabs { display: flex; gap: var(--s2); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); flex-wrap: wrap; }
.tab { padding: 10px 16px; font-weight: 600; font-size: 0.9rem; color: var(--ink-faint); border-bottom: 2px solid transparent; }
.tab.is-active { color: var(--accent); border-color: var(--accent); }
.hidden { display: none !important; }

/* ---------------- pager ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin: var(--s6) 0; }
.pager__btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.pager__btn:hover:not(:disabled) { border-color: var(--ink); }
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }
.pager__label { font-size: 0.86rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.pager__btn i { width: 15px; height: 15px; }

/* ---------------- footer ---------------- */
#site-footer { border-top: 2px solid var(--ink); margin-top: var(--s9); background: var(--surface); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: var(--s7) var(--s5); text-align: center; }
.foot-brand { font-family: var(--serif); font-weight: 900; font-size: 1.6rem; margin-bottom: var(--s4); }
.foot-links { display: flex; gap: var(--s5); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.foot-link { font-size: 0.88rem; color: var(--ink-soft); }
.foot-link:hover { color: var(--accent); }
.foot-copy { font-size: 0.82rem; color: var(--ink-faint); }

/* ---------------- toast ---------------- */
.toast-box { position: fixed; bottom: var(--s5); right: var(--s5); z-index: 100; display: flex; flex-direction: column; gap: var(--s2); }
.toast { background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); transition: all .3s var(--ease); max-width: 340px; }
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--money); }
.toast--error { background: var(--accent); }
.toast--warn { background: var(--warn); color: var(--ink); }

/* ---------------- empty / loading ---------------- */
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--ink-faint); }
.empty i { width: 40px; height: 40px; margin-bottom: var(--s3); opacity: .5; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-soft) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------- auth page ---------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--s7); box-shadow: var(--shadow-md); }
.auth-card .logo { font-family: var(--serif); font-weight: 900; font-size: 2rem; text-align: center; margin-bottom: var(--s2); }
.auth-card .sub { text-align: center; color: var(--ink-faint); margin-bottom: var(--s6); font-size: 0.92rem; }
.auth-toggle { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: var(--s5); }
.auth-toggle button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font-weight: 600; font-size: 0.88rem; color: var(--ink-faint); }
.auth-toggle button.is-active { background: var(--ink); color: var(--paper); }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .news-grid { grid-template-columns: 1fr; }
  .aside-box { position: static; }
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
  .dash-side .logo { margin: 0 var(--s4) 0 0; }
  .dash-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .dash-nav a { margin: 0; }
  .dash-main { padding: var(--s5) var(--s4); }
}
@media (max-width: 680px) {
  .masthead { grid-template-columns: auto 1fr auto; }
  .nav-toggle { display: inline-flex; }
  .mainnav { display: none; }
  .mainnav.is-open { display: flex; flex-direction: column; gap: var(--s3); }
  .row-card { grid-template-columns: 1fr; }
  .row-card img { order: -1; }
  .byline .earn-badge { margin-left: 0; }
  .dash-main { padding: var(--s5) var(--s4); }
}
