/*
 * Base theme. Every colour, font, size and width comes from a Customizer variable (printed inline per site
 * in <style id="customizer-css">), so the live preview can change them in place. Spacing uses one scale:
 * 4 8 12 16 24 32 48 64 96. Light only (ad creatives are made for light backgrounds).
 */

:root {
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
    --gutter: 16px;
    /* Fallbacks; the inline Customizer block overrides every one of these. */
    --c-accent: #1d4ed8; --c-on-accent: #fff; --c-text: #1f2328; --c-muted: #57606a; --c-heading: #111418;
    --c-link: #1d4ed8; --c-link-hover: #1e3a8a; --c-bg: #fff; --c-surface: #f6f8fa; --c-border: #d8dee4;
    --c-header-bg: #fff; --c-header-text: #1f2328; --c-topbar-bg: #111418; --c-topbar-text: #fff;
    --c-footer-bg: #111418; --c-footer-text: #e6e8eb;
    --f-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --f-heading: var(--f-body);
    --fs-body: 19px; --fs-body-m: 18px; --lh-body: 1.6; --fw-heading: 700;
    --fs-h1: 42px; --fs-h1-m: 32px; --fs-h2: 31px; --fs-h2-m: 26px; --fs-h3: 24px; --fs-h3-m: 21px;
    --fs-meta: 14px; --fs-nav: 16px; --nav-transform: none; --kicker-transform: uppercase;
    --w-container: 1200px; --w-content: 720px; --w-sidebar: 300px; --radius: 6px; --h-header: 64px;
    --logo-w: 180px; --ratio-card: 16/9;
    --c-input-border: color-mix(in srgb, var(--c-text) 50%, var(--c-bg));
}

/* ---- base ------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--h-header) + var(--s4)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    margin: 0; background: var(--c-bg); color: var(--c-text);
    font-family: var(--f-body); font-size: var(--fs-body-m); line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (min-width: 768px) { body { font-size: var(--fs-body); } }
/* Bangla (html lang bn-BD, or a part marked lang="bn"; :lang() is inherited, lang="en" inside opts out): tracking
   pulls conjuncts and vowel signs apart, so no element sets any, whatever a theme rule says (CssBuilder::BANGLA_CSS
   repeats this inline). Uppercase/small caps do nothing to Bengali. Vowel signs above and below the letters need
   more room than Latin: headings never go under 1.35. */
:lang(bn), :lang(bn)::before, :lang(bn)::after { letter-spacing: 0 !important; }
:lang(bn) :is(h1, h2, h3, h4, h5, h6) { line-height: 1.35; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--f-heading); font-weight: var(--fw-heading); color: var(--c-heading);
    line-height: 1.2; margin: 0 0 var(--s3); text-wrap: balance;
}
h1 { font-size: var(--fs-h1-m); }
h2 { font-size: var(--fs-h2-m); }
h3 { font-size: var(--fs-h3-m); }
h4 { font-size: var(--fs-body-m); }
@media (min-width: 768px) {
    h1 { font-size: var(--fs-h1); }
    h2 { font-size: var(--fs-h2); }
    h3 { font-size: var(--fs-h3); }
    h4 { font-size: var(--fs-body); }
}
p { margin: 0 0 var(--s5); }
a { color: var(--c-link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--c-link-hover); }
img, video { max-width: 100%; height: auto; }
img { display: block; }
picture { display: contents; } /* WebP/AVIF wrapper: the <img> inside lays out as if it stood alone */
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; }

.sr-only, .screen-reader-text {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: var(--s2); top: -100px; z-index: 100; padding: var(--s2) var(--s4);
    background: var(--c-accent); color: var(--c-on-accent); border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: var(--s2); color: var(--c-on-accent); }

/* ---- layout ---------------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--w-container); margin-inline: auto; padding-inline: var(--gutter); }
.container-mid { max-width: 1080px; }
.container-narrow { max-width: calc(var(--w-content) + 2 * var(--gutter)); }
.main { min-width: 0; }
.entry { max-width: var(--w-content); }
.layout.sidebar-none .entry { margin-inline: auto; }
.layout.sidebar-none .related { max-width: var(--w-content); margin-inline: auto; }
@media (min-width: 1024px) {
    .layout.sidebar-right { display: grid; grid-template-columns: minmax(0, 1fr) var(--w-sidebar); gap: var(--s7); }
    .layout.sidebar-left { display: grid; grid-template-columns: var(--w-sidebar) minmax(0, 1fr); gap: var(--s7); }
    .layout.sidebar-left .sidebar { order: -1; }
}
.section { margin-block: 0 var(--s8); }
.section > h2 { margin-bottom: var(--s5); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s5); }
.section-head h2 { margin: 0; }
.section-link, .more-link a { font-weight: 700; }
.more-link { margin: var(--s5) 0 0; }
.empty { color: var(--c-muted); }
.plain-list { margin: 0; padding-left: 1.2em; }
.plain-list li { margin-bottom: var(--s2); }

/* ---- top bar and header ---------------------------------------------------------------------- */
.topbar { background: var(--c-topbar-bg); color: var(--c-topbar-text); font-size: var(--fs-meta); }
.topbar a { color: var(--c-topbar-text); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); min-height: 36px; }
.topbar-text { margin: 0; }
.menu-top { display: flex; flex-wrap: wrap; gap: var(--s4); list-style: none; margin: 0; padding: 0; }
.menu-top .menu-item > a { padding: var(--s1) 0; color: var(--c-topbar-text); font-size: var(--fs-meta); font-weight: 400; text-transform: none; }

.site-header { background: var(--c-header-bg); color: var(--c-header-text); border-bottom: 1px solid var(--c-border); z-index: 50; }
.sticky-all { position: sticky; top: 0; }
@media (min-width: 1024px) { .sticky-desktop { position: sticky; top: 0; } }
.header-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); min-height: 56px; }
@media (min-width: 768px) { .header-inner { min-height: var(--h-header); } }
.brand { display: inline-flex; align-items: center; gap: var(--s3); margin-right: auto; padding: var(--s2) 0; color: var(--c-header-text); text-decoration: none; }
.brand:hover { color: var(--c-header-text); }
.brand-logo { width: var(--logo-w); max-width: 60vw; height: auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--f-heading); font-weight: 700; font-size: var(--fs-h3-m); line-height: 1.15; }
.brand-tagline { font-size: var(--fs-meta); }
.header-tools { display: flex; align-items: center; gap: var(--s1); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    color: var(--c-header-text); border-radius: var(--radius); background: none; border: 0; cursor: pointer;
}
.icon-btn:hover { color: var(--c-header-text); background: color-mix(in srgb, var(--c-header-text) 8%, transparent); }

.nav-primary { display: none; order: 10; width: 100%; padding-bottom: var(--s3); }
.nav-primary:target, .nav-primary.is-open { display: block; }
.menu, .sub-menu { list-style: none; margin: 0; padding: 0; }
.menu > li { border-top: 1px solid var(--c-border); }
.menu-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; }
.menu-item > a {
    flex: 1; display: block; padding: var(--s3) 0; color: var(--c-header-text); text-decoration: none;
    font-size: var(--fs-nav); font-weight: 600; text-transform: var(--nav-transform);
}
.menu-item > a:hover, .menu-item > a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.submenu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 0; color: var(--c-header-text); cursor: pointer; }
.submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sub-menu { display: none; width: 100%; padding: 0 0 var(--s2) var(--s4); }
.menu-item.is-open > .sub-menu { display: block; }
.sub-menu .menu-item > a { font-weight: 400; padding: var(--s2) 0; }

.header-search { display: none; border-top: 1px solid var(--c-border); padding: var(--s4) 0; background: var(--c-header-bg); }
.header-search:target, .header-search.is-open { display: block; }

@media (min-width: 1024px) {
    .nav-toggle { display: none; }
    .nav-primary { display: block; width: auto; padding: 0; }
    .menu { display: flex; flex-wrap: wrap; gap: 0 var(--s5); }
    .menu > li { border-top: 0; }
    .menu-item { flex-wrap: nowrap; }
    .submenu-toggle { width: 28px; margin-left: -4px; }
    .sub-menu {
        position: absolute; top: 100%; left: 0; z-index: 60; min-width: 240px; padding: var(--s2) 0;
        background: var(--c-header-bg); border: 1px solid var(--c-border); border-radius: var(--radius);
        box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
    }
    .sub-menu .menu-item > a { padding: var(--s2) var(--s4); }
    .menu-item.has-children:hover > .sub-menu, .menu-item.has-children:focus-within > .sub-menu { display: block; }
    .header-inline .nav-primary { order: 2; margin-left: auto; }
    .header-inline .header-tools { order: 3; }
    .header-inline .brand { margin-right: 0; }
    .header-stacked .nav-primary, .header-centered .nav-primary { order: 10; width: 100%; border-top: 1px solid var(--c-border); }
    .header-centered .header-inner { justify-content: center; }
    .header-centered .brand { margin: 0 auto; }
    .header-centered .header-tools { position: absolute; right: var(--gutter); top: calc(var(--h-header) / 2 - 22px); }
    .header-centered .menu { justify-content: center; }
}

/* ---- breadcrumbs ----------------------------------------------------------------------------- */
.breadcrumbs ol {
    list-style: none; display: flex; gap: var(--s2); margin: var(--s5) 0 var(--s4); padding: 0;
    font-size: var(--fs-meta); color: var(--c-muted); white-space: nowrap; overflow-x: auto;
}
.breadcrumbs .crumb-sep { margin-right: var(--s2); color: var(--c-muted); }
.breadcrumbs .crumb-prefix { color: var(--c-muted); }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-link-hover); }
@media (min-width: 768px) { .breadcrumbs ol { flex-wrap: wrap; white-space: normal; overflow: visible; } }

/* ---- article --------------------------------------------------------------------------------- */
.entry-header { margin: var(--s5) 0; }
.entry-title { margin-bottom: var(--s3); }
.dek { font-size: var(--fs-h3-m); line-height: 1.4; margin: 0 0 var(--s4); }
@media (min-width: 768px) { .dek { font-size: var(--fs-h3); } }
.byline { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-meta); color: var(--c-muted); }
.byline p { margin: 0; }
.byline-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.byline-people a { color: var(--c-text); font-weight: 700; }
.byline-people > span + span::before, .byline-meta > span + span::before { content: "·"; margin: 0 var(--s2); }
.featured-image { margin: 0 0 var(--s5); }
.featured-image img { width: 100%; border-radius: var(--radius); }
.featured-image figcaption, .entry-content figcaption { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--c-muted); }
.credit::before { content: " · "; }

.entry-content { overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: var(--s5); }
.entry-content h2 { margin-top: var(--s7); margin-bottom: var(--s3); }
.entry-content h3 { margin-top: var(--s6); margin-bottom: var(--s2); }
.entry-content h4 { margin-top: var(--s5); margin-bottom: var(--s2); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: var(--s2); }
.entry-content li > ul, .entry-content li > ol { margin-top: var(--s2); }
.entry-content img { border-radius: var(--radius); }
.entry-content figure { margin-inline: 0; }
.entry-content blockquote { margin-inline: 0; padding: var(--s4) var(--s5); background: var(--c-surface); border-radius: var(--radius); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite { display: block; font-size: var(--fs-meta); color: var(--c-muted); font-style: normal; }
.entry-content hr, .wp-block-separator { border: 0; border-top: 1px solid var(--c-border); margin: var(--s7) 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: var(--fs-meta); }
.entry-content th, .entry-content td { padding: var(--s2) var(--s3); border: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.entry-content th { background: var(--c-surface); font-weight: 700; }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--c-surface); padding: 0.1em 0.3em; border-radius: 4px; }
.entry-content pre { overflow-x: auto; padding: var(--s4); background: var(--c-surface); border-radius: var(--radius); }
.entry-content pre code { padding: 0; background: none; }
.entry-content iframe { max-width: 100%; }
.aligncenter { margin-inline: auto; text-align: center; }
.aligncenter img { margin-inline: auto; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
/* Design rule (SOP): headings stay left-aligned even when the block was centred in the editor. */
.entry-content :is(h2, h3, h4, h5, h6):is(.has-text-align-center, .has-text-align-right) { text-align: left; }
@media (min-width: 640px) {
    .alignleft { float: left; max-width: 50%; margin: 0 var(--s5) var(--s4) 0; }
    .alignright { float: right; max-width: 50%; margin: 0 0 var(--s4) var(--s5); }
}
.entry-content::after { content: ""; display: table; clear: both; }
.wp-block-embed__wrapper { position: relative; }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.wp-block-embed.is-type-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--s3); }
.wp-block-button__link, .btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s5);
    background: var(--c-accent); color: var(--c-on-accent); border: 0; border-radius: var(--radius);
    font-weight: 700; text-decoration: none; cursor: pointer;
}
.wp-block-button__link:hover, .btn:hover { color: var(--c-on-accent); filter: brightness(0.92); }
.wp-block-columns { display: flex; flex-wrap: wrap; gap: var(--s5); }
.wp-block-column { flex: 1 1 240px; min-width: 0; }
.wp-block-image figcaption { text-align: left; }

/* table of contents */
.toc { margin: 0 0 var(--s6); padding: var(--s4) var(--s5); background: var(--c-surface); border-radius: var(--radius); }
.toc-title { cursor: pointer; font-family: var(--f-heading); font-weight: var(--fw-heading); color: var(--c-heading); }
.toc ol { margin: var(--s3) 0 0; padding-left: 1.3em; }
.toc ol ol { margin-top: var(--s2); }
.toc li { margin-bottom: var(--s2); }
.toc a { color: var(--c-text); }
.toc a:hover { color: var(--c-link-hover); }

/* author box */
.author-box { display: flex; align-items: flex-start; gap: var(--s5); margin: var(--s7) 0; padding: var(--s5); background: var(--c-surface); border-radius: var(--radius); }
.author-box-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; }
.author-box-title { font-size: var(--fs-h3-m); margin-bottom: var(--s1); }
@media (min-width: 768px) { .author-box-title { font-size: var(--fs-h3); } }
.author-box-title a { color: var(--c-heading); text-decoration: none; }
.author-box-title a:hover { text-decoration: underline; }
.author-box-role { margin: 0 0 var(--s3); font-size: var(--fs-meta); color: var(--c-muted); }
.author-box-bio { margin-bottom: var(--s3); }
.author-box-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0; font-size: var(--fs-meta); font-weight: 700; }
@media (max-width: 479px) { .author-box { flex-direction: column; } }
.related { margin: var(--s7) 0 0; }

/* ---- cards and lists ------------------------------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-media img { width: 100%; aspect-ratio: var(--ratio-card); object-fit: cover; border-radius: var(--radius); }
.card-body { padding-top: var(--s3); }
.kicker {
    position: relative; z-index: 1; display: inline-block; margin-bottom: var(--s2);
    font-size: var(--fs-meta); font-weight: 700; letter-spacing: 0.04em; text-transform: var(--kicker-transform);
    color: var(--c-accent); text-decoration: none;
}
.kicker:hover { color: var(--c-link-hover); text-decoration: underline; }
.card-title { margin: 0 0 var(--s2); font-size: var(--fs-h3-m); line-height: 1.25; }
.card-title a { color: var(--c-heading); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card-title a { text-decoration: underline; text-decoration-thickness: 1px; }
.card-excerpt { margin: 0 0 var(--s2); }
.card-meta { display: flex; flex-wrap: wrap; gap: 0 var(--s2); margin: 0; font-size: var(--fs-meta); color: var(--c-muted); }
.card-meta > * + *::before { content: "·"; margin-right: var(--s2); }
.cards-border .card { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.cards-tint .card { background: var(--c-surface); border-radius: var(--radius); overflow: hidden; }
.cards-border .card-media img, .cards-tint .card-media img { border-radius: 0; }
.cards-border .card-body, .cards-tint .card-body { padding: var(--s4); }

/* Phones: a compact list (96 px thumbnail, title, meta), as in the SOP wireframes. */
@media (max-width: 639px) {
    .post-grid { gap: var(--s4); }
    .post-grid .card { flex-direction: row; gap: var(--s3); align-items: flex-start; }
    .post-grid .card-media { flex: 0 0 96px; }
    .post-grid .card-media img { aspect-ratio: 1 / 1; }
    .post-grid .card-body { padding: 0; }
    .cards-border .post-grid .card, .cards-tint .post-grid .card { padding: var(--s3); }
    .post-grid .card-title { font-size: var(--fs-body-m); }
    .post-grid .card-excerpt { display: none; }
    .post-grid .kicker { margin-bottom: var(--s1); }
}
@media (min-width: 640px) {
    .post-grid { gap: var(--s6) var(--s5); }
    .post-grid.cols-2, .post-grid.cols-3, .post-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .post-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .post-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .layout.sidebar-right .post-grid.cols-4, .layout.sidebar-left .post-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .post-grid.cols-4 .card-title { font-size: var(--fs-body); }
}

/* "Start here": one large pick and a column of compact ones */
.feature-grid { display: grid; gap: var(--s5); }
.card-compact { flex-direction: row; gap: var(--s3); align-items: flex-start; }
.card-compact .card-media { flex: 0 0 96px; }
.card-compact .card-media img { aspect-ratio: 1 / 1; }
.card-compact .card-body { padding: 0; }
.cards-border .card-compact, .cards-tint .card-compact { padding: var(--s3); }
.card-compact .card-title { font-size: var(--fs-body-m); }
.card-feature .card-title { font-size: var(--fs-h2-m); }
@media (min-width: 768px) {
    .feature-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-auto-rows: min-content; }
    .feature-grid .card-feature { grid-row: span 4; }
    .card-feature .card-title { font-size: var(--fs-h2); }
}

/* ---- archives -------------------------------------------------------------------------------- */
.archive-header { margin: var(--s5) 0 var(--s6); }
.archive-title { margin-bottom: var(--s3); }
.archive-intro { max-width: var(--w-content); }
.archive-intro > :last-child { margin-bottom: 0; }
.archive-page, .archive-lead { margin: 0 0 var(--s4); color: var(--c-muted); }
.archive-lead { color: var(--c-text); max-width: var(--w-content); }
.chips ul, .chips-list { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0 0 var(--s7); padding: 0; }
.chip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
    border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-bg); color: var(--c-text);
    font-size: var(--fs-meta); font-weight: 700; text-decoration: none;
}
a.chip:hover { border-color: var(--c-accent); color: var(--c-accent); }
@media (max-width: 639px) {
    .chips ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--s2); }
    .chips .chip { flex: none; white-space: nowrap; }
}
.faq-item { border-top: 1px solid var(--c-border); }
.faq-item:last-of-type { border-bottom: 1px solid var(--c-border); }
.faq-item summary { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; cursor: pointer; list-style: none; font-weight: 700; color: var(--c-heading); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer > :last-child { margin-bottom: var(--s4); }

/* pagination: numbers on wider screens, "Previous · Page 2 of 20 · Next" on phones */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2) var(--s4); margin: var(--s7) 0 0; }
.page-numbers { display: flex; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.page-numbers a, .page-current, .page-gap {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px;
    padding: 0 var(--s2); border-radius: var(--radius); text-decoration: none;
}
.page-numbers a { color: var(--c-text); border: 1px solid var(--c-border); }
.page-numbers a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.page-current { background: var(--c-accent); color: var(--c-on-accent); font-weight: 700; }
.page-prev, .page-next { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; font-weight: 700; }
.page-status { display: none; margin: 0; color: var(--c-muted); }
@media (max-width: 639px) {
    .page-numbers { display: none; }
    .page-status { display: block; }
}

/* ---- home ------------------------------------------------------------------------------------ */
.hero { margin-bottom: var(--s7); padding: var(--s7) 0 var(--s6); background: var(--c-surface); }
.hero-title { max-width: 24ch; margin-bottom: var(--s3); }
.hero-sub { max-width: 60ch; margin-bottom: var(--s5); font-size: var(--fs-h3-m); line-height: 1.45; }
@media (min-width: 768px) {
    .hero { padding: var(--s8) 0; }
    .hero-sub { font-size: var(--fs-h3); }
}
.topic-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .topic-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.topic-tile {
    display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: var(--s3) var(--s4);
    border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); color: var(--c-text); text-decoration: none;
}
.topic-tile:hover { border-color: var(--c-accent); color: var(--c-text); }
.topic-name { font-weight: 700; color: var(--c-heading); }
.topic-count { font-size: var(--fs-meta); color: var(--c-muted); }
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .team { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.team-member img { width: 72px; height: 72px; margin-bottom: var(--s3); border-radius: 50%; object-fit: cover; }
.team-name { margin: 0; font-weight: 700; }
.team-name a { color: var(--c-heading); }
.team-role { margin: 0; font-size: var(--fs-meta); color: var(--c-muted); }

/* ---- author profile -------------------------------------------------------------------------- */
.profile { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s5); align-items: start; margin: var(--s5) 0 var(--s7); }
.profile:not(:has(.profile-photo)) { grid-template-columns: minmax(0, 1fr); }
.profile-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.profile-name { margin-bottom: var(--s2); }
.profile-role { margin: 0 0 var(--s3); font-weight: 700; }
.profile-bio { max-width: 60ch; margin-bottom: var(--s4); }
.profile-links { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0 0 var(--s3); padding: 0; }
.profile-links a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--c-border);
    border-radius: 999px; color: var(--c-text); font-size: var(--fs-meta); font-weight: 700; text-decoration: none;
}
.profile-links a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.profile-meta { margin: 0; font-size: var(--fs-meta); color: var(--c-muted); }
@media (min-width: 768px) {
    .profile { grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s7); }
    .profile-photo { order: 2; width: 200px; height: 200px; border-radius: var(--radius); }
}
.profile-section { max-width: var(--w-content); }
.profile-jump { margin: 0 0 var(--s7); padding: var(--s3) 0; border-block: 1px solid var(--c-border); }
.profile-jump ul { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); list-style: none; margin: 0; padding: 0; }
.profile-jump a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-meta); font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: 0 0 var(--s5) var(--s5); border-left: 2px solid var(--c-border); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ""; position: absolute; left: -7px; top: 0.45em; width: 12px; height: 12px;
    border-radius: 50%; background: var(--c-bg); border: 2px solid var(--c-accent);
}
.timeline-title { margin: 0 0 var(--s1); font-size: var(--fs-body-m); }
@media (min-width: 768px) { .timeline-title { font-size: var(--fs-body); } }
.timeline-sub { margin: 0; font-style: italic; }
.timeline-meta { margin: 0; font-size: var(--fs-meta); color: var(--c-muted); }
.timeline-notes { margin: var(--s2) 0 0; padding-left: 1.2em; }
.timeline-notes li { margin-bottom: var(--s1); }

/* ---- sidebar --------------------------------------------------------------------------------- */
.sidebar { margin-top: var(--s7); }
@media (min-width: 1024px) { .sidebar { margin-top: var(--s5); } }
.widget { margin-bottom: var(--s6); }
.widget-title { margin-bottom: var(--s3); font-size: var(--fs-body-m); }
.widget-links { list-style: none; margin: 0; padding: 0; }
.widget-links li { padding: var(--s2) 0; border-bottom: 1px solid var(--c-border); }
.widget-links a { color: var(--c-text); text-decoration: none; }
.widget-links a:hover { color: var(--c-link-hover); text-decoration: underline; }
.sidebar-sticky { position: sticky; top: calc(var(--h-header) + var(--s4)); }

/* ---- ad slots (App\Ads\AdSlots) ------------------------------------------------------------------
 * The wrapper reserves the slot's height (inline min-height, label included) and never collapses, so a late or
 * empty ad never moves the text. Units get an exact size for the width they have (container queries: a 728x90
 * row beside a sidebar becomes 468x60, a 336x280 box on a narrow phone 300x250); a unit hidden here is never
 * requested. */
.ad-slot { clear: both; margin: var(--s6) auto; text-align: center; container-type: inline-size; }
.ad-label { display: block; margin: 0 0 var(--s2); color: var(--c-muted); font-size: 12px; line-height: 16px; letter-spacing: 0.02em; }
.ad-slot ins.adsbygoogle { display: inline-block; vertical-align: top; }
.ad-unit-rect { width: 336px; height: 280px; }
.ad-unit-mrec { width: 300px; height: 250px; }
.ad-unit-half { width: 300px; height: 600px; }
.ad-unit-leader { width: 728px; height: 90px; }
@container (max-width: 335px) { .ad-unit-rect { width: 300px; height: 250px; } }
@container (max-width: 727px) { .ad-unit-leader { width: 468px; height: 60px; } }
.ad-sidebar { margin: 0 0 var(--s6); }
.ad-feed { grid-column: 1 / -1; margin: 0; }
.ad-sidebar, .ad-sidebar ins.adsbygoogle, .ad-feed-desktop, .ad-feed-desktop ins.adsbygoogle { display: none; }
@media (min-width: 1024px) {
    .ad-sidebar, .ad-feed-desktop { display: block; }
    .ad-sidebar ins.adsbygoogle, .ad-feed-desktop ins.adsbygoogle { display: inline-block; }
    .ad-feed-phone, .ad-feed-phone ins.adsbygoogle { display: none; }
}

/* ---- search ---------------------------------------------------------------------------------- */
.search-form { display: flex; gap: var(--s2); max-width: 560px; }
.search-input {
    flex: 1; min-width: 0; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--c-input-border);
    border-radius: var(--radius); background: var(--c-bg); color: var(--c-text); font: inherit;
}
.search-input:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.search-form-lg .search-input, .search-form-lg .btn { min-height: 52px; }

/* results: one column, picture beside the text, the searched words marked */
.results { display: grid; gap: var(--s5); }
.result { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); align-items: start; padding-bottom: var(--s5); border-bottom: 1px solid var(--c-border); }
.result:not(:has(.result-media)) { grid-template-columns: minmax(0, 1fr); }
.result-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.result .kicker { margin-bottom: var(--s1); }
.result-title { margin: 0 0 var(--s2); font-size: var(--fs-body-m); line-height: 1.3; }
.result-title a { color: var(--c-heading); text-decoration: none; }
.result-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.result-excerpt { margin: 0 0 var(--s2); }
.result mark { padding: 0 0.1em; border-radius: 2px; background: color-mix(in srgb, var(--c-accent) 16%, var(--c-bg)); color: inherit; }
@media (max-width: 639px) {
    .result-excerpt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
}
@media (min-width: 640px) {
    .result { grid-template-columns: 160px minmax(0, 1fr); gap: var(--s5); }
    .result-media img { aspect-ratio: var(--ratio-card); }
    .result-title { font-size: var(--fs-h3-m); }
}

/* ---- forms (the contact form) ---------------------------------------------------------------- */
.contact-form { --c-ok: #146c2e; --c-error: #b42318; max-width: var(--w-content); margin: var(--s7) 0 0; }
.form-row { display: grid; gap: 0 var(--s4); }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-field { margin: 0 0 var(--s4); }
.form-field label { display: block; margin-bottom: var(--s1); font-weight: 700; color: var(--c-heading); }
.form-optional { font-weight: 400; color: var(--c-muted); }
.form-input {
    display: block; width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--c-input-border);
    border-radius: var(--radius); background: var(--c-bg); color: var(--c-text); font: inherit;
}
textarea.form-input { min-height: 168px; line-height: 1.5; resize: vertical; }
.form-input:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.form-input:user-invalid { border-color: var(--c-error); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin: var(--s5) 0 0; }
.form-note { font-size: var(--fs-meta); color: var(--c-muted); }
.form-notice { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border: 1px solid; border-radius: var(--radius); color: var(--c-text); font-weight: 600; }
.form-notice-ok { border-color: color-mix(in srgb, var(--c-ok) 45%, var(--c-bg)); background: color-mix(in srgb, var(--c-ok) 8%, var(--c-bg)); }
.form-notice-error { border-color: color-mix(in srgb, var(--c-error) 45%, var(--c-bg)); background: color-mix(in srgb, var(--c-error) 7%, var(--c-bg)); }
.form-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-help { display: block; margin-top: var(--s1); font-size: var(--fs-meta); color: var(--c-muted); }

/* ---- comments (theme::partials.comments) ----------------------------------------------------- */
.comments { --c-ok: #146c2e; --c-error: #b42318; max-width: var(--w-content); margin: var(--s7) 0 0; padding-top: var(--s6); border-top: 1px solid var(--c-border); }
.comments-title { margin: 0 0 var(--s5); }
.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comment-list > .comment { padding: var(--s4) 0; border-bottom: 1px solid var(--c-border); }
.comment-replies { margin: var(--s3) 0 0 var(--s4); padding-left: var(--s4); border-left: 3px solid var(--c-border); }
.comment-replies > .comment { padding: var(--s3) 0 0; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s1); }
.comment-author { font-weight: 700; color: var(--c-heading); overflow-wrap: anywhere; }
.comment-date { font-size: var(--fs-meta); color: var(--c-muted); }
.comment-text { overflow-wrap: anywhere; }
.comment-text p { margin: 0 0 var(--s2); }
.comment-text p:last-child { margin-bottom: 0; }
.comment-staff > .comment-meta .comment-author { padding: 0 var(--s2); border-radius: var(--radius); background: var(--c-accent); color: var(--c-on-accent); }
.comment-reply, .comment-cancel {
    min-height: 44px; margin-top: var(--s1); padding: var(--s2) 0; border: 0; background: none; color: var(--c-link);
    font: inherit; font-size: var(--fs-meta); font-weight: 700; cursor: pointer;
}
.comment-reply:hover, .comment-cancel:hover { text-decoration: underline; }
.comment-reply:focus-visible, .comment-cancel:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.comments-none, .comments-closed, .comments-more { color: var(--c-muted); }
.comment-form { margin-top: var(--s6); }
.comment-form-title { margin: 0 0 var(--s4); }
.comment-replying { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 var(--s3); font-weight: 600; }
.comment-replying[hidden] { display: none; }
.comment-form textarea.form-input { min-height: 132px; }
.comment-turnstile { margin-top: var(--s4); min-height: 65px; }
.comment-form button[disabled] { opacity: .7; cursor: progress; }

/* ---- footer ---------------------------------------------------------------------------------- */
.site-footer { margin-top: var(--s8); padding: var(--s7) 0 var(--s5); background: var(--c-footer-bg); color: var(--c-footer-text); }
.site-footer a { color: var(--c-footer-text); }
.site-footer a:hover { color: var(--c-footer-text); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
@media (min-width: 768px) {
    .footer-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols-3 { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
    .footer-cols-4 { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
}
.footer-col p { max-width: 48ch; }
.footer-brand { margin: 0 0 var(--s3); font-family: var(--f-heading); font-size: var(--fs-h3-m); font-weight: 700; }
.footer-heading { margin: 0 0 var(--s3); font-weight: 700; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu .menu-item > a, .footer-menu li > a { display: inline-block; padding: var(--s1) 0; color: var(--c-footer-text); font-weight: 400; text-decoration: none; text-transform: none; }
.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); padding-top: var(--s5);
    border-top: 1px solid color-mix(in srgb, var(--c-footer-text) 25%, transparent); font-size: var(--fs-meta);
}
.copyright { margin: 0; }
.back-to-top { text-decoration: none; }

/* ---- print ----------------------------------------------------------------------------------- */
@media print {
    .topbar, .site-header, .site-footer, .sidebar, .related, .toc, .pagination, .skip-link, .ad-slot { display: none !important; }
    body { font-size: 12pt; }
    a { color: inherit; }
}
