/*
Theme Name: Meridian News
Theme URI: https://news1.bpittech.com/
Description: A bilingual (English / Bangla) newspaper theme converted from The Meridian design: serif masthead, live headline ticker, front-page grid, opinion band, dark mode, reading progress and ad slots. Works with Polylang for the two editions.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meridian
Tags: news, blog, two-columns, three-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready, rtl-language-support, threaded-comments
*/

/* ============ Tokens ============ */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #141414;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --rule: #e3e0d9;
  --rule-strong: #141414;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --tag: #8a0a1f;
  --img-a: #d9d4c7;
  --img-b: #b8b1a0;
  --shadow: 0 10px 30px rgba(0,0,0,.08);

  --serif-display: "Fraunces", "Noto Serif Bengali", Georgia, serif;
  --serif-body: "Source Serif 4", "Noto Serif Bengali", Georgia, serif;
  --sans: "Inter", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1240px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111213; --surface: #191a1c; --ink: #eceae6; --ink-2: #c9c6c0; --muted: #94918b;
    --rule: #2c2d30; --rule-strong: #eceae6; --accent: #ff4d5e; --accent-ink: #111;
    --tag: #ff8a95; --img-a: #2a2b2e; --img-b: #3a3b3f; --shadow: 0 10px 30px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111213; --surface: #191a1c; --ink: #eceae6; --ink-2: #c9c6c0; --muted: #94918b;
  --rule: #2c2d30; --rule-strong: #eceae6; --accent: #ff4d5e; --accent-ink: #111;
  --tag: #ff8a95; --img-a: #2a2b2e; --img-b: #3a3b3f; --shadow: 0 10px 30px rgba(0,0,0,.4);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover .hl, a.hl:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
main { outline: none; min-height: 60vh; }

/* ============ Buttons ============ */
.btn {
  border: 1px solid var(--ink); background: transparent; padding: 10px 16px;
  border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(1.08); background: var(--accent); color: var(--accent-ink); }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--rule); color: var(--ink); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ============ Header ============ */
.topbar { border-bottom: 1px solid var(--rule); font-size: 13px; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 48px; gap: 12px; }
.topbar__date { color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }

.masthead { text-align: center; padding: 28px 0 18px; }
.logo {
  font-family: var(--serif-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(40px, 8vw, 84px); line-height: 1; display: inline-block;
  font-variation-settings: "opsz" 144;
}
.logo--sm { font-size: 28px; margin-bottom: 8px; }
.tagline { margin: 8px 0 0; font-family: var(--serif-body); font-style: italic; color: var(--muted); font-size: 15px; }

.sections { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--bg); z-index: 20; }
.sections__list {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; justify-content: center;
  overflow-x: auto; scrollbar-width: none;
}
.sections__list::-webkit-scrollbar { display: none; }
.sections__list a {
  display: block; padding: 12px 12px; font-size: 14px; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent; color: var(--ink-2);
}
.sections__list a:hover { color: var(--ink); }
.sections__list a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 900px) { .sections__list { justify-content: flex-start; } }

.search-panel { border-bottom: 1px solid var(--rule); background: var(--surface); padding: 14px 0; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1; min-width: 0; padding: 10px 16px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: inherit;
}

/* ============ Ticker ============ */
.ticker { border-bottom: 1px solid var(--rule); font-size: 14px; }
.ticker__inner { display: flex; align-items: center; gap: 14px; height: 42px; }
.ticker__label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-transform: uppercase;
  font-size: 12px; letter-spacing: .08em; color: var(--accent); flex-shrink: 0;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent)} 70%{box-shadow:0 0 0 8px transparent} 100%{box-shadow:0 0 0 0 transparent} }
.ticker__viewport { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker__track { display: inline-flex; gap: 40px; white-space: nowrap; animation: scroll 60s linear infinite; }
.ticker__track:hover { animation-play-state: paused; }
.ticker__track a { color: var(--ink-2); }
.ticker__track a:hover { color: var(--ink); text-decoration: underline; }
.ticker__track time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } .live-dot { animation: none; } }

/* ============ Shared story bits ============ */
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tag);
  display: inline-flex; gap: 8px; align-items: center;
}
.kicker--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hl { font-family: var(--serif-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 6px 0 8px; }
.dek { font-family: var(--serif-body); color: var(--ink-2); margin: 0 0 10px; line-height: 1.45; }
.meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.meta b { color: var(--ink-2); font-weight: 600; }

.media { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--img-a), var(--img-b)); aspect-ratio: 3 / 2; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
a:hover .media img { transform: scale(1.03); }
.media--wide { aspect-ratio: 16 / 9; }
.caption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 2px solid var(--rule-strong); padding-top: 10px; margin: 48px 0 20px;
}
.section-head h2 { font-family: var(--serif-display); font-size: 24px; margin: 0; font-weight: 800; }
.section-head a { font-size: 13px; font-weight: 600; color: var(--muted); }
.section-head a:hover { color: var(--ink); }

/* ============ Front page ============ */
.front { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 0; margin-top: 28px; }
.front > * { padding: 0 24px; }
.front > *:first-child { padding-left: 0; }
.front > *:last-child { padding-right: 0; }
.front > * + * { border-left: 1px solid var(--rule); }

.lead .hl { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; }
.lead .dek { font-size: 19px; }
.lead .media { margin-bottom: 16px; }

.stack > * + * { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 18px; }
.stack .hl { font-size: 20px; }
.stack .dek { font-size: 15px; }
.stack .media { margin-bottom: 12px; }

.rail h3 { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); }
.popular li:first-child { border-top: 0; padding-top: 0; }
.popular li::before { content: counter(pop); font-family: var(--serif-display); font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1; }
.popular .hl { font-size: 16px; margin: 0; }

.brief { background: var(--surface); border: 1px solid var(--rule); padding: 18px; margin-top: 28px; }
.brief h3 { margin-bottom: 6px; }
.brief p { font-family: var(--serif-body); margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }

@media (max-width: 1024px) {
  .front { grid-template-columns: 2fr 1fr; }
  .front .lead { order: -1; grid-column: 1 / -1; padding: 0 0 24px; border-left: 0; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
  .front > .stack { padding-left: 0; border-left: 0; }
}
@media (max-width: 680px) {
  .front { grid-template-columns: 1fr; }
  .front > * { padding: 0 !important; border-left: 0 !important; }
  .front .rail { margin-top: 32px; }
}

/* Card grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
.grid .hl { font-size: 19px; }
.grid .dek { font-size: 15px; }
.grid .media { margin-bottom: 12px; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

/* Horizontal list card */
.row-card { display: grid; grid-template-columns: 1fr 200px; gap: 20px; padding: 20px 0; border-top: 1px solid var(--rule); }
.row-card:first-child { border-top: 0; padding-top: 0; }
.row-card .hl { font-size: 22px; }
@media (max-width: 560px) { .row-card { grid-template-columns: 1fr 110px; gap: 14px; } .row-card .hl { font-size: 18px; } .row-card .dek { display: none; } }

/* Opinion band */
.opinion { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 48px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 36px; }
.opinion .section-head { border-top-color: var(--accent); }
.op-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.op-card { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif-display); font-weight: 800; font-size: 20px; color: #fff;
}
.op-card .author { font-size: 13px; font-weight: 700; }
.op-card .hl { font-size: 18px; font-style: italic; font-family: var(--serif-body); font-weight: 600; margin-top: 4px; }
@media (max-width: 1024px) { .op-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .op-grid { grid-template-columns: 1fr; } }

/* Two-column section blocks */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }

/* ============ Section page ============ */
.page-title { padding: 32px 0 8px; border-bottom: 2px solid var(--rule-strong); margin-bottom: 28px; }
.page-title h1 { font-family: var(--serif-display); font-size: clamp(36px, 6vw, 60px); margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.page-title p { margin: 6px 0 14px; color: var(--muted); font-family: var(--serif-body); font-size: 17px; }
.section-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.section-layout .lead .hl { font-size: clamp(28px, 3vw, 38px); }
@media (max-width: 900px) { .section-layout { grid-template-columns: 1fr; } }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-family: var(--serif-body); font-size: 18px; }

/* ============ Article ============ */
.article { max-width: 720px; margin: 0 auto; padding: 36px 0 0; }
.article .hl { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 14px; }
.article .dek { font-size: 21px; margin-bottom: 20px; }
.byline { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; margin-bottom: 24px; flex-wrap: wrap; }
.byline .avatar { width: 40px; height: 40px; font-size: 15px; }
.byline__who { flex: 1; min-width: 160px; font-size: 14px; }
.byline__who b { display: block; }
.share { display: flex; gap: 6px; }
.share button { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.share button:hover { border-color: var(--ink); }
.article > figure { margin: 0 0 28px; }
@media (min-width: 900px) { .article > figure { margin-left: -80px; margin-right: -80px; } }
.body { font-family: var(--serif-body); font-size: 19.5px; line-height: 1.7; color: var(--ink); }
.body p { margin: 0 0 1.2em; }
.body > p:first-child::first-letter {
  font-family: var(--serif-display); font-weight: 800; float: left; font-size: 4.2em; line-height: .85;
  padding: 6px 10px 0 0; color: var(--accent);
}
.body blockquote {
  margin: 1.6em 0; padding: 0 0 0 20px; border-left: 3px solid var(--accent);
  font-family: var(--serif-display); font-size: 26px; line-height: 1.3; font-weight: 600;
}
.body h2, .body h3 { font-family: var(--sans); font-size: 20px; margin: 1.6em 0 .6em; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 28px 0; }
.tags a { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); }
.tags a:hover { border-color: var(--ink); }
@media (max-width: 560px) { .body { font-size: 18px; } .article .dek { font-size: 18px; } }

/* ============ Subscribe ============ */
.sub { text-align: center; padding: 48px 0 16px; }
.sub h1 { font-family: var(--serif-display); font-size: clamp(34px, 5vw, 54px); margin: 0 0 10px; font-weight: 800; letter-spacing: -0.02em; }
.sub > p { font-family: var(--serif-body); font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 0 auto 36px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 980px; margin: 0 auto; text-align: left; }
.plan { background: var(--surface); border: 1px solid var(--rule); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.plan--featured { border: 2px solid var(--accent); box-shadow: var(--shadow); position: relative; }
.plan--featured::before { content: attr(data-badge); position: absolute; top: -12px; left: 24px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.plan h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.price { font-family: var(--serif-display); font-size: 42px; font-weight: 800; line-height: 1; }
.price small { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 500; }
.plan ul { padding: 0; margin: 6px 0 14px; list-style: none; font-size: 14.5px; flex: 1; }
.plan li { padding: 6px 0 6px 24px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; max-width: 440px; } }

/* ============ Footer ============ */
.footer { border-top: 2px solid var(--rule-strong); margin-top: 64px; padding: 36px 0 28px; background: var(--surface); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 32px; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.footer li { padding: 4px 0; }
.footer li a:hover { text-decoration: underline; }
.footer p { font-size: 14px; }
.newsletter { display: flex; gap: 8px; }
.newsletter input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; }
.newsletter__msg { min-height: 1.4em; color: var(--accent); font-weight: 600; }
.footer__legal { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 18px; font-size: 12.5px; }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ============ Reading progress ============ */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 50; transition: width .1s linear; }

/* Fade-in on route change */
main > * { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } }

/* ============ Language switch ============ */
.lang-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; margin-right: 6px; }
.lang-switch button { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); line-height: 1.3; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 520px) { .topbar__sub { display: none; } .topbar__date { font-size: 12px; } }

.translation-link { display: inline-flex; gap: 6px; font-size: 14px; font-weight: 600; color: var(--tag); margin: 0 0 16px; border: 1px solid var(--rule); padding: 6px 12px; border-radius: 999px; }
.translation-link:hover { border-color: var(--tag); }
.hl--opinion { font-family: var(--serif-body); font-style: italic; }

/* ============ Bangla typography ============ */
/* Bengali script needs more line height, no faux italics, no drop cap (it breaks conjuncts) and no uppercase tracking. */
:lang(bn) body { line-height: 1.65; }
:lang(bn) .hl { line-height: 1.4; letter-spacing: 0; }
:lang(bn) .dek { line-height: 1.6; }
:lang(bn) .body { line-height: 1.95; font-size: 19px; }
:lang(bn) .body > p:first-child::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; font-family: inherit; font-weight: inherit; line-height: inherit; }
:lang(bn) .body blockquote { line-height: 1.55; }
:lang(bn) .hl--opinion, :lang(bn) .op-card .hl, :lang(bn) .tagline { font-style: normal; }
:lang(bn) .kicker, :lang(bn) .rail h3, :lang(bn) .ticker__label, :lang(bn) .footer h4, :lang(bn) .ad__label { letter-spacing: 0; text-transform: none; }
:lang(bn) .logo { letter-spacing: 0; font-size: clamp(36px, 7vw, 72px); line-height: 1.25; }
:lang(bn) .sections__list a { font-size: 15px; }

/* ============ Advertising ============ */
.ad { margin: 28px auto; text-align: center; max-width: 100%; }
.ad__label { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad__img { display: inline-block; max-width: 100%; }
.ad__img img { max-width: 100%; height: auto; margin: 0 auto; }
.ad__frame { width: 100%; border: 0; display: block; background: transparent; }
.ad-holder--top .ad { margin: 18px auto 0; }
.ad-holder--top .ad__img img { max-height: 120px; width: auto; }
.ad--sidebar { margin: 28px 0 0; }
.ad--sidebar .ad__img img { width: 100%; }
.ad--infeed { margin: 48px auto 0; max-width: 970px; }
.ad--article { margin: 1.8em 0; font-family: var(--sans); }

.ad-text {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; text-align: left;
  background: var(--ad-bg); color: var(--ad-fg); padding: 18px 22px; border-radius: 6px; line-height: 1.4;
}
.ad-text:hover { filter: brightness(1.06); }
.ad-text__copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ad-text__copy b { font-family: var(--serif-display); font-size: 21px; font-weight: 800; }
.ad-text__copy span { font-size: 14.5px; opacity: .88; }
.ad-text__cta { flex-shrink: 0; border: 1.5px solid currentColor; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.ad--sidebar .ad-text { flex-direction: column; align-items: flex-start; padding: 22px; }
.ad--sidebar .ad-text__copy b { font-size: 22px; }
@media (max-width: 560px) { .ad-text { flex-direction: column; align-items: flex-start; } }

/* ============ Logo images ============ */
.logo.is-image { line-height: 0; display: inline-block; }
.logo-img { display: inline-block; }
.logo-img img { height: var(--logo-h); width: auto; max-width: min(100%, calc(100vw - 32px)); object-fit: contain; display: block; margin: 0 auto; }
@media (max-width: 560px) { .masthead .logo-img img { height: min(var(--logo-h), 16vw); } }
.footer .logo.is-image { margin-bottom: 10px; }
.footer .logo-img img { margin: 0; }
.logo-img .logo-dark { display: none; }
:root[data-theme="dark"] .logo-img.has-dark .logo-light { display: none; }
:root[data-theme="dark"] .logo-img.has-dark .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img.has-dark .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-img.has-dark .logo-dark { display: block; }
}

/* =====================================================================
   WordPress additions
   ===================================================================== */

/* Admin bar offsets for the sticky section nav */
.admin-bar .sections { top: 32px; }
@media (max-width: 782px) { .admin-bar .sections { top: 46px; } }
@media (max-width: 600px) { .admin-bar .sections { top: 0; } }
.admin-bar .progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .progress { top: 46px; } }

/* Menu current states (wp_nav_menu) */
.sections__list li { margin: 0; }
.sections__list .current-menu-item > a,
.sections__list .current-post-ancestor > a,
.sections__list .current-menu-ancestor > a,
.sections__list .current-category-ancestor > a { color: var(--ink); border-bottom-color: var(--accent); }

/* Language switch as links (Polylang) */
.lang-switch a { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* Accessibility helpers */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus { background: var(--surface); clip: auto !important; clip-path: none; display: block; height: auto; left: 8px; top: 8px; padding: 12px 16px; width: auto; z-index: 100000; }

/* Post content from the editor */
.body a { color: var(--tag); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.body img { height: auto; }
.body figure { margin: 1.6em 0; }
.body figcaption, .wp-caption-text, .wp-element-caption { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.body ul, .body ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.body li { margin-bottom: .4em; }
.body blockquote p { margin: 0; }
.body blockquote cite { display: block; font-family: var(--sans); font-size: 14px; font-style: normal; font-weight: 600; color: var(--muted); margin-top: 10px; }
.body .wp-block-quote { border-left: 3px solid var(--accent); }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.body pre, .body code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--surface); }
.body pre { padding: 14px 16px; overflow-x: auto; border: 1px solid var(--rule); }
.body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; margin: 0 0 1.2em; }
.body th, .body td { border-bottom: 1px solid var(--rule); padding: 8px 10px; text-align: left; }
.body iframe, .body embed, .body video { max-width: 100%; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .body .alignwide { margin-left: -80px; margin-right: -80px; max-width: none; } }
.body .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.wp-caption { max-width: 100%; }
.sticky, .bypostauthor, .gallery-caption { }
.body::after { content: ""; display: table; clear: both; }

/* Plain pages: no drop cap */
.body--page > p:first-child::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; font-family: inherit; font-weight: inherit; line-height: inherit; }

/* Pagination */
.pagination { margin: 40px 0 0; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pagination .dots { border: 0; }

/* Rail widgets */
.rail .widget { margin-top: 28px; font-size: 15px; }
.rail .widget ul { list-style: none; padding: 0; margin: 0; }
.rail .widget li { padding: 8px 0; border-top: 1px solid var(--rule); }
.rail .widget li:first-child { border-top: 0; }
.rail .widget a:hover { text-decoration: underline; }

/* Ad rotation: one unit per slot */
.ad__slot:not(.is-rotated) > .ad__unit ~ .ad__unit { display: none; }
.ad__slot.is-rotated > .ad__unit:not(.is-picked) { display: none; }
.ad__unit > :first-child { margin-top: 0; }
div.ad-text { cursor: default; }

/* Comments */
.comments { max-width: 720px; margin: 40px auto 0; font-family: var(--sans); }
.comments__title { font-family: var(--serif-display); font-size: 24px; font-weight: 800; border-top: 2px solid var(--rule-strong); padding-top: 10px; margin: 0 0 20px; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { padding-left: 28px; border-left: 1px solid var(--rule); }
.comment-body { padding: 16px 0; border-top: 1px solid var(--rule); font-size: 15px; }
.comment-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-author img { border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 8px; }
.comment-author .says { display: none; }
.comment-content p { margin: 0 0 .8em; font-family: var(--serif-body); font-size: 17px; }
.reply a { font-size: 13px; font-weight: 600; color: var(--tag); }
.comment-respond { margin-top: 28px; }
.comment-reply-title { font-family: var(--serif-display); font-size: 20px; margin: 0 0 12px; }
.comment-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.comment-form p { margin: 0 0 14px; }
.comment-form .submit { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* Newsletter honeypot */
.newsletter__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Subscribe template: page content in place of the stock intro */
.sub__intro { font-family: var(--serif-body); font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 0 auto 36px; }
.sub__intro p { margin: 0 0 .8em; }
a.btn { display: inline-block; text-align: center; }

/* ============ Share bar ============ */
.share-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -8px 0 24px; }
.share-bar--bottom { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); }
.share-bar__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
:lang(bn) .share-bar__label { letter-spacing: 0; text-transform: none; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 9px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.share-btn svg { flex-shrink: 0; }
.share-btn:hover, .share-btn:focus-visible { color: #fff; border-color: transparent; }
.share-btn--facebook:hover, .share-btn--facebook:focus-visible { background: #1877f2; }
.share-btn--x:hover, .share-btn--x:focus-visible { background: #000; }
.share-btn--whatsapp:hover, .share-btn--whatsapp:focus-visible { background: #25d366; }
.share-btn--telegram:hover, .share-btn--telegram:focus-visible { background: #229ed9; }
.share-btn--linkedin:hover, .share-btn--linkedin:focus-visible { background: #0a66c2; }
.share-btn--reddit:hover, .share-btn--reddit:focus-visible { background: #ff4500; }
.share-btn--email:hover, .share-btn--email:focus-visible,
.share-btn--copy:hover, .share-btn--copy:focus-visible,
.share-btn--native:hover, .share-btn--native:focus-visible { background: var(--ink); color: var(--bg); }
.share-btn--card { padding: 0 12px; border-color: var(--accent); color: var(--accent); }
.share-btn--card:hover, .share-btn--card:focus-visible { background: var(--accent); color: var(--accent-ink); }
.share-btn.is-done { background: var(--ink); color: var(--bg); }
.share-bar:not(.share-bar--labels) .share-btn:not(.share-btn--card) .share-btn__text:not(.screen-reader-text) { display: none; }
.share-bar--labels .share-btn { padding: 0 12px; }
.share button[data-newscard] { border-color: var(--accent); color: var(--accent); }

/* ============ Source credit (auto news) ============ */
.source-note { margin: 24px 0 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--accent); font-size: 14px; }
.source-note .btn { margin-bottom: 10px; }
.source-note p { margin: 0; }
.source-note p a { color: var(--tag); text-decoration: underline; }

/* ============ News card dialog ============ */
.ncard { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.ncard[hidden] { display: none; }
.ncard__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.6); }
.ncard__panel {
  position: relative; background: var(--bg); color: var(--ink); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px;
}
.ncard__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ncard__head h2 { margin: 0; font-family: var(--serif-display); font-size: 22px; font-weight: 800; }
.ncard__x { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 50%; }
.ncard__x:hover { background: var(--rule); color: var(--ink); }
.ncard__sizes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ncard__sizes button { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.ncard__sizes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ncard__stage { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; display: grid; place-items: center; padding: 10px; min-height: 200px; }
.ncard__stage canvas { max-width: 100%; max-height: 58vh; width: auto; height: auto; display: block; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ncard__status { position: absolute; margin: 0; font-size: 14px; font-weight: 600; background: var(--bg); padding: 6px 12px; border-radius: 999px; }
.ncard__status:empty { display: none; }
.ncard.is-busy canvas { opacity: .35; }
.ncard__actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ncard__actions .btn { flex: 1; }
html.ncard-open { overflow: hidden; }
