/*
Theme Name: Phitron
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.3
Text Domain: phitron
*/

/* ==========================================================================
   1. Fonts
   Self-hosted so the reading surface never waits on a third party.
   ========================================================================== */

@font-face {
    font-family: 'Anek Bangla';
    font-style: normal;
    font-weight: 100 800;
    font-stretch: 100%;
    font-display: swap;
    src: url('assets/fonts/anek-bengali.woff2') format('woff2');
    unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+20B9, U+25CC;
}

@font-face {
    font-family: 'Anek Bangla';
    font-style: normal;
    font-weight: 100 800;
    font-stretch: 100%;
    font-display: swap;
    src: url('assets/fonts/anek-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('assets/fonts/geist-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('assets/fonts/geistmono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   2. Tokens
   One accent (amber) for action, one brand surface (blue) for identity.
   ========================================================================== */

:root {
    --blue-900: #0b2447;
    --blue-800: #123b74;
    --blue-700: #1d4ed8;
    --blue-100: #dbeafe;

    --amber-500: #f59e0b;
    --amber-400: #fbbf24;
    --amber-300: #fcd34d;
    --amber-ink: #2a1a02;

    --canvas: #f7f9fc;
    --surface: #ffffff;
    --surface-sunken: #eef2f8;
    --line: #dfe6ef;
    --line-strong: #c6d2e2;

    --ink: #0d1729;
    --ink-soft: #33415a;
    --ink-muted: #4a576e;
    --ink-faint: #5d6b82;

    /* `--brand` paints surfaces, `--brand-text` paints words. They are separate
       tokens because a blue dark enough to hold white type is too dark to read
       as text on a dark canvas. */
    --brand: var(--blue-700);
    --brand-text: #1d4ed8;
    --brand-deep: var(--blue-800);
    --brand-line: rgba(255, 255, 255, 0.18);
    --on-brand: #ffffff;
    --on-brand-soft: #c7d8f5;

    --accent: var(--amber-500);
    --accent-hover: #dc8a05;
    --on-accent: var(--amber-ink);

    /* Amber is too pale to read as an outline on white, so the ring uses a
       darker amber. It still clears 3:1 against both the canvas and a card. */
    --focus-ring: #b45309;

    --font-sans: 'Geist', 'Anek Bangla', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-bangla: 'Anek Bangla', 'Geist', system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;

    --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
    --step--1: clamp(0.84rem, 0.81rem + 0.14vw, 0.91rem);
    --step-0: clamp(1rem, 0.96rem + 0.20vw, 1.09rem);
    --step-1: clamp(1.13rem, 1.06rem + 0.34vw, 1.31rem);
    --step-2: clamp(1.31rem, 1.19rem + 0.58vw, 1.63rem);
    --step-3: clamp(1.55rem, 1.35rem + 0.94vw, 2.06rem);
    --step-4: clamp(1.84rem, 1.52rem + 1.50vw, 2.63rem);

    --space-lg: 1.5rem;

    --measure: 68ch;
    --width-site: 1220px;
    --width-article: 740px;

    /* Core's constrained layout reads these custom properties. Defining them
       here keeps core's own alignment rules working without a theme.json. */
    --wp--style--global--content-size: 740px;
    --wp--style--global--wide-size: 740px;

    /* Documented shape system: cards 12px, controls pill, inputs 10px. */
    --radius-card: 12px;
    --radius-card-lg: 16px;
    --radius-pill: 999px;
    --radius-input: 10px;

    --shadow-lift: 0 2px 4px rgba(13, 23, 41, 0.06), 0 18px 36px -16px rgba(13, 23, 41, 0.28);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --fast: 150ms var(--ease);
    --base: 240ms var(--ease);
}

/* Dark theme keeps the brand blue recognisable rather than desaturating it. */
:root[data-theme='dark'] {
    color-scheme: dark;

    --canvas: #080d17;
    --surface: #0e1626;
    --surface-sunken: #131f33;
    --line: #1e2c44;
    --line-strong: #2b3d5a;

    --ink: #f4f7fc;
    --ink-soft: #cbd7e8;
    --ink-muted: #93a4bd;
    --ink-faint: #7f92a8;

    --brand: #1e3a8a;
    --brand-text: #93b4f8;
    --brand-deep: #14295f;
    --on-brand: #ffffff;
    --on-brand-soft: #bfd4f7;

    --accent: var(--amber-400);
    --accent-hover: var(--amber-300);
    --on-accent: #1a1204;
    --focus-ring: var(--amber-400);

    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 36px -16px rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;

        --canvas: #080d17;
        --surface: #0e1626;
        --surface-sunken: #131f33;
        --line: #1e2c44;
        --line-strong: #2b3d5a;

        --ink: #f4f7fc;
        --ink-soft: #cbd7e8;
        --ink-muted: #93a4bd;
        --ink-faint: #7f92a8;

        --brand: #1e3a8a;
        --brand-text: #93b4f8;
        --brand-deep: #14295f;
        --on-brand: #ffffff;
        --on-brand-soft: #bfd4f7;

        --accent: var(--amber-400);
        --accent-hover: var(--amber-300);
        --on-accent: #1a1204;
        --focus-ring: var(--amber-400);

        --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 36px -16px rgba(0, 0, 0, 0.8);
    }
}

/* ==========================================================================
   3. Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-underline-offset: 0.18em;
}

/* Offset for the sticky header. The admin bar is added on top for signed-in
   editors, so it is measured rather than guessed; without this the header
   slides under the toolbar and the first heading hides behind both. */
:root {
    --header-height: 68px;
    --admin-bar-height: 0px;
}

/* The admin bar is only present for signed-in editors, and WordPress puts its
   class on `body`, so the offset has to be re-declared where the toolbar
   actually exists. `--sticky-offset` cannot be computed once on `:root`,
   because `calc()` substitutes its variables at the element that declares it. */
html:has(body.admin-bar) {
    --admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
    html:has(body.admin-bar) {
        --admin-bar-height: 46px;
    }
}

:root {
    --sticky-offset: calc(var(--header-height) + var(--admin-bar-height) + 1.25rem);
}

html {
    scroll-padding-top: var(--sticky-offset);
}

/* Smooth scrolling is motion, so it is opt-in and opt-out together. */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink-soft);
    font-family: var(--font-bangla);
    font-size: var(--step-0);
    line-height: 1.85;
    font-synthesis-weight: auto;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

/* Bangla must never be tracked or transformed: both break its conjuncts. */
:lang(bn) {
    letter-spacing: normal;
    text-transform: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.24;
    text-wrap: balance;
}

/* Latin headlines can tighten. Bangla cannot, so the class gates it. */
.is-latin {
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.08;
}

.is-bengali {
    font-family: var(--font-bangla);
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.3;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--fast);
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

img {
    display: block;
    height: auto;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
    cursor: pointer;
}

time {
    font-variant-numeric: tabular-nums;
}

:focus-visible {
    outline: 2.5px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 3px;
}

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 200;
    translate: -50% -120%;
    padding: 0.7rem 1.25rem;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    border-radius: 0 0 var(--radius-input) var(--radius-input);
    transition: translate var(--fast);
}

.skip-link:focus {
    translate: -50% 0;
}

.container {
    width: 100%;
    max-width: var(--width-site);
    margin-inline: auto;
    padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

.meta-sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
    vertical-align: middle;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.reading-progress {
    position: fixed;
    inset-inline: 0;
    top: var(--admin-bar-height);
    z-index: 120;
    height: 2.5px;
    background: transparent;
    pointer-events: none;
}

.reading-progress-bar {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}

.site-header {
    position: sticky;
    /* The admin bar sits above the header for signed-in editors, so the header
       sticks below it instead of sliding underneath. */
    top: var(--admin-bar-height);
    z-index: 110;
    background: color-mix(in srgb, var(--brand) 94%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--brand-line);
    color: var(--on-brand);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    height: 68px;
}

.brand-identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    color: var(--on-brand);
}

.brand-monogram {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--on-brand);
    flex-shrink: 0;
}

.brand-monogram svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-family: var(--font-sans);
    font-size: 1.06rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.02em;
    color: var(--on-brand);
}

.brand-tagline {
    margin-top: 1px;
    font-family: var(--font-bangla);
    font-size: 0.69rem;
    font-weight: 500;
    color: var(--on-brand-soft);
    letter-spacing: normal;
}

.header-nav {
    flex: 1;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-link {
    display: block;
    padding: 0.42rem 0.72rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
    transition: background var(--fast), color var(--fast);
}

.nav-link:hover {
    color: var(--on-brand);
    background: rgba(255, 255, 255, 0.14);
}

.nav-link.active {
    color: var(--on-brand);
    background: rgba(255, 255, 255, 0.17);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-label {
    position: absolute;
    left: 0.7rem;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.header-search-icon {
    width: 15px;
    height: 15px;
}

.header-search input[type='search'] {
    width: 168px;
    height: 36px;
    padding: 0 0.75rem 0 2rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.13);
    color: var(--on-brand);
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    transition: width var(--base), background var(--fast), border-color var(--fast);
}

.header-search input[type='search']::placeholder {
    color: rgba(255, 255, 255, 0.85);
}

/* The field sits on the brand band, where the global amber ring is legible, so
   focus is expressed with the ring plus a stronger field fill rather than by
   removing the outline. */
.header-search input[type='search']:focus {
    width: 232px;
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.6);
    outline: 2.5px solid var(--focus-ring);
    outline-offset: 2px;
}

/* The submit button is redundant next to the visible icon, so it is a
   transparent overlay. Inside a standalone search surface (the drawer, the 404,
   the empty state) there is no icon to click, so it becomes a real button. */
.header-search-submit {
    position: absolute;
    top: 0;
    left: 0;
    /* Cover the icon gutter, never the whole field. An overlay as wide as the
       form swallows the click that should place the caret, so the reader gets
       an empty search instead of a cursor and cannot type at all. */
    width: 2rem;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    opacity: 0;
    cursor: pointer;
}

/* The button is transparent, so its own focus ring is invisible. Show the ring
   on the icon it sits over instead. */
.header-search:has(.header-search-submit:focus-visible) .header-search-icon {
    outline: 2.5px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 3px;
}

.mobile-menu-search .header-search-submit,
.error-search .header-search-submit,
.empty-state-search .header-search-submit {
    position: static;
    width: auto;
    height: 36px;
    overflow: visible;
    padding-inline: 0.85rem;
    margin-left: 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    opacity: 1;
}

.mobile-menu-search .header-search-submit {
    background: #ffffff;
    color: var(--blue-800);
}

.icon-button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    color: var(--on-brand);
    transition: background var(--fast), transform var(--fast);
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.icon-button:active {
    transform: scale(0.94);
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.icon-sun,
.icon-close {
    display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
    display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .theme-toggle .icon-moon {
        display: none;
    }

    :root:not([data-theme='light']) .theme-toggle .icon-sun {
        display: block;
    }
}

.menu-toggle {
    display: none;
}

.menu-toggle[aria-expanded='true'] .icon-menu {
    display: none;
}

.menu-toggle[aria-expanded='true'] .icon-close {
    display: block;
}

.mobile-menu {
    border-top: 1px solid var(--brand-line);
    background: color-mix(in srgb, var(--brand) 97%, transparent);
}

.mobile-menu[hidden] {
    display: none;
}

.mobile-menu-list {
    display: flex;
    flex-direction: column;
    padding: 0.6rem clamp(1.15rem, 4vw, 2.5rem) 1.1rem;
}

/* Search moves into the drawer on phones, so the header stays on one line. */
.mobile-menu-search {
    padding: 0.9rem clamp(1.15rem, 4vw, 2.5rem) 0.2rem;
}

.mobile-menu-search .header-search input[type='search'] {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.16);
}

.mobile-menu-search .header-search input[type='search']:focus {
    width: 100%;
    background: rgba(255, 255, 255, 0.24);
}

.mobile-menu-list a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-bangla);
    font-weight: 600;
    color: var(--on-brand);
}

.mobile-menu-list li:last-child a {
    border-bottom: 0;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(2rem, 4vw, 3.25rem);
    background: linear-gradient(168deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: var(--on-brand);
}

/* A single hairline grid, used once, to give the brand surface structure. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(120% 90% at 15% 0%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(120% 90% at 15% 0%, #000 0%, transparent 72%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.05rem;
    min-width: 0;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.24rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    letter-spacing: normal;
}

.hero-kicker-mark {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.hero-headline {
    margin: 0;
    font-size: var(--step-4);
    color: var(--on-brand);
    max-width: 20ch;
    text-wrap: balance;
}

.hero-headline.is-latin {
    max-width: 18ch;
}

.hero-subtext {
    max-width: 46ch;
    color: var(--on-brand-soft);
    font-size: var(--step-0);
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem 1.25rem;
    margin-top: 0.35rem;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--on-brand-soft);
}

.button-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.68rem 1.35rem;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 700;
    white-space: nowrap;
    transition: background var(--fast), transform var(--fast), box-shadow var(--fast);
}

.button-primary svg {
    width: 16px;
    height: 16px;
    transition: transform var(--base);
}

.button-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.button-primary:hover svg {
    transform: translateX(3px);
}

.button-primary:active {
    transform: translateY(0) scale(0.99);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 600;
    white-space: nowrap;
    transition: border-color var(--fast), background var(--fast), transform var(--fast);
}

.button-secondary:hover {
    border-color: var(--brand-text);
    color: var(--brand-text);
    transform: translateY(-1px);
}

.hero-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-card-lg);
    overflow: hidden;
    border: 1px solid var(--brand-line);
    box-shadow: 0 24px 48px -24px rgba(3, 10, 26, 0.7);
    background: #0a1526;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 600ms var(--ease);
}

.hero-media:hover img {
    transform: scale(1.03);
}

/* ==========================================================================
   6. Category strip
   ========================================================================== */

.category-strip {
    background: var(--brand-deep);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-block: 0.55rem;
    color: var(--on-brand);
}

.category-track {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 0.2rem;
    -webkit-overflow-scrolling: touch;
}

.category-track::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.category-pill.active {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--blue-800);
}

.category-count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.05rem 0.34rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
}

.category-pill.active .category-count {
    background: var(--blue-100);
    color: var(--blue-800);
}

/* ==========================================================================
   7. Listing
   ========================================================================== */

.editorial {
    padding-block: clamp(2.25rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--line);
}

.section-title {
    font-size: var(--step-2);
    font-weight: 700;
}

.section-note {
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--ink-faint);
    white-space: nowrap;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(1.1rem, 2vw, 1.6rem);
}

.post-card {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    transition: border-color var(--base), box-shadow var(--base), transform var(--base);
}

.post-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
}

/* Imported banners are designed artwork with Bangla type baked in, so they are
   contained inside a fixed frame rather than cropped. The frame background is
   the deep ink the banners themselves use, so the letterboxing on the few
   square or ultra-wide covers reads as part of the artwork. */
.card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0a1526;
}

.card-media-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 500ms var(--ease);
}

.post-card:hover .card-media-img {
    transform: scale(1.03);
}

.card-media-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 140px;
    color: var(--ink-faint);
    background:
        repeating-linear-gradient(
            -45deg,
            var(--surface-sunken) 0 10px,
            transparent 10px 20px
        );
}

.card-media-placeholder svg {
    width: 26px;
    height: 26px;
    opacity: 0.5;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.1rem 1.15rem 1.15rem;
    flex: 1;
}

.category-tag {
    align-self: flex-start;
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    color: var(--brand-text);
    letter-spacing: normal;
}

.category-tag:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.card-heading {
    font-family: var(--font-bangla);
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.42;
    letter-spacing: normal;
    text-wrap: pretty;
}

.card-heading a {
    color: var(--ink);
}

.card-heading a:hover {
    color: var(--brand-text);
}

.card-excerpt {
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.75;
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    color: var(--ink-faint);
}

.card-byline {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-date {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Related posts sit in the same ordered grid, slightly denser. */
.posts-grid--related .card-body {
    padding: 1rem 1.1rem 1.1rem;
}

.posts-grid--related .card-heading {
    font-size: var(--step-0);
}

/* ==========================================================================
   8. Archive header
   ========================================================================== */

.archive-header {
    padding-block: clamp(1.75rem, 3vw, 2.75rem) 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.breadcrumbs {
    margin-bottom: 0.9rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    color: var(--ink-faint);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    color: var(--line-strong);
}

.breadcrumb-item a:hover {
    color: var(--brand-text);
}

.archive-title {
    font-family: var(--font-bangla);
    font-size: var(--step-3);
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.34;
}

.archive-description {
    max-width: var(--measure);
    margin-top: 0.6rem;
    font-family: var(--font-bangla);
    color: var(--ink-muted);
    font-size: var(--step-0);
}

.archive-count {
    margin-top: 0.7rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--ink-faint);
}

/* ==========================================================================
   9. Pagination
   ========================================================================== */

.pagination-wrap {
    margin-top: clamp(2rem, 4vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 38px;
    height: 38px;
    padding-inline: 0.7rem;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink-soft);
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 600;
    transition: border-color var(--fast), background var(--fast), color var(--fast);
}

.page-btn:hover {
    border-color: var(--brand-text);
    color: var(--brand-text);
}

.page-btn.active {
    background: var(--brand);
    border-color: var(--brand-text);
    color: var(--on-brand);
}

.page-btn .pagination-label {
    font-size: var(--step--2);
}

/* ==========================================================================
   10. Empty state
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    max-width: 560px;
    margin-inline: auto;
    padding: clamp(2.25rem, 5vw, 3.5rem) 1.5rem;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-card-lg);
    background: var(--surface);
}

.empty-state-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--brand-text);
}

.empty-state-mark svg {
    width: 21px;
    height: 21px;
}

.empty-state-title {
    font-family: var(--font-bangla);
    font-size: var(--step-1);
    letter-spacing: normal;
}

.empty-state-text {
    max-width: 42ch;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--ink-muted);
}

.empty-state-search {
    width: min(340px, 100%);
}

.empty-state-search .header-search input[type='search'] {
    width: 100%;
    background: var(--surface-sunken);
    border-color: var(--line);
    color: var(--ink);
}

.empty-state-search .header-search input[type='search']::placeholder,
.empty-state-search .header-search-label {
    color: var(--ink-faint);
}

.empty-state-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-block: 0.25rem;
}

.empty-state .category-pill {
    background: var(--surface-sunken);
    border-color: var(--line);
    color: var(--ink-soft);
}

.empty-state .category-pill:hover {
    border-color: var(--brand-text);
    color: var(--brand-text);
}

.empty-state .category-count {
    background: var(--line);
    color: var(--ink-muted);
}

/* ==========================================================================
   11. Article header and shell
   ========================================================================== */

.article-band {
    padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.25rem);
    background: linear-gradient(172deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: var(--on-brand);
}

/* Header band, cover and body share this grid, so the title, the artwork and
   the first paragraph all start on the same vertical line. Without it the
   title sits about 200px to the right of the text it introduces. */
.article-shell {
    display: grid;
    grid-template-columns: 216px minmax(0, var(--width-article));
    gap: clamp(1.75rem, 4vw, 3.5rem);
    justify-content: center;
}

.article-shell > .article-head {
    grid-column: 2;
}

.article-band .breadcrumb-list {
    color: rgba(255, 255, 255, 0.72);
}

.article-band .breadcrumb-item a:hover {
    color: var(--on-brand);
}

.article-band .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.4);
}

.article-title {
    max-width: 24ch;
    font-size: var(--step-4);
    color: var(--on-brand);
    text-wrap: pretty;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.1rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--on-brand-soft);
}

.article-band .category-tag {
    padding: 0.16rem 0.6rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.18);
    color: var(--on-brand);
    font-weight: 600;
}

.article-band .category-tag:hover {
    background: rgba(255, 255, 255, 0.28);
    text-decoration: none;
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-cover {
    margin: clamp(1.5rem, 3vw, 2.25rem) auto 0;
}

.article-cover-img {
    width: 100%;
    max-height: min(70vh, 620px);
    object-fit: contain;
    border-radius: var(--radius-card-lg);
    border: 1px solid var(--line);
    background: #0a1526;
}

.article-cover figcaption {
    margin-top: 0.6rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--ink-faint);
    text-align: center;
}

/* ==========================================================================
   12. Article body and cover
   ========================================================================== */

.article-shell--body {
    align-items: start;
    padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
}

.article-main {
    min-width: 0;
}

.article-cover {
    margin: 0 0 clamp(1.5rem, 3vw, 2rem);
}

/* The cover is framed to the reading column, not the viewport. A square or
   ultra-wide banner is contained inside a landscape frame so it cannot push the
   first paragraph off the screen, and the dark mat matches the artwork. */
.article-cover-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: var(--radius-card-lg);
    border: 1px solid var(--line);
    background: #0a1526;
}

.article-cover figcaption {
    margin-top: 0.6rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    color: var(--ink-faint);
    text-align: center;
}

.article-aside {
    position: relative;
    height: 100%;
}

.aside-sticky {
    position: sticky;
    top: var(--sticky-offset);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    /* A long contents list scrolls inside the sticky column instead of running
       off the bottom of the viewport. */
    max-height: calc(100vh - var(--sticky-offset) - 1.25rem);
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.aside-sticky::-webkit-scrollbar {
    width: 4px;
}

.aside-sticky::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--line-strong);
}

.author-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
}

.author-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: var(--on-brand);
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.95rem;
}

.author-avatar--large {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
}

.author-monogram {
    line-height: 1;
}

.author-block-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.author-name {
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}

.author-role {
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    color: var(--ink-faint);
    line-height: 1.5;
}

.toc[hidden] {
    display: none;
}

.toc-title,
.share-title {
    margin-bottom: 0.55rem;
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    color: var(--ink-faint);
    letter-spacing: normal;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border-inline-start: 1px solid var(--line);
}

.toc-link {
    display: block;
    padding: 0.3rem 0 0.3rem 0.8rem;
    margin-left: -1px;
    border-inline-start: 2px solid transparent;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.5;
    color: var(--ink-muted);
    transition: color var(--fast), border-color var(--fast);
}

.toc-link:hover {
    color: var(--ink);
}

.toc-link.is-active {
    color: var(--brand-text);
    border-inline-start-color: var(--brand-text);
    font-weight: 600;
}

.share {
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 600;
    color: var(--ink-soft);
    transition: border-color var(--fast), color var(--fast);
}

.share-button svg {
    width: 14px;
    height: 14px;
}

.share-button:hover {
    border-color: var(--brand-text);
    color: var(--brand-text);
}

/* ==========================================================================
   13. Article body
   This is the reading surface. It styles native block output, so authors
   never have to add a class.
   ========================================================================== */

.article-entry {
    max-width: var(--width-article);
    font-family: var(--font-bangla);
    font-size: var(--step-0);
    line-height: 1.9;
    color: var(--ink-soft);
    min-width: 0;
}

.article-entry > * + * {
    margin-top: 1.15rem;
}

.article-entry p {
    margin: 0;
    text-wrap: pretty;
}

.article-entry > p:first-of-type {
    font-size: var(--step-1);
    line-height: 1.8;
    color: var(--ink);
}

.article-entry h2 {
    margin-top: 2.4rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-bangla);
    font-size: var(--step-2);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: normal;
    scroll-margin-top: var(--sticky-offset);
}

.article-entry h3 {
    margin-top: 1.9rem;
    margin-bottom: 0.6rem;
    font-family: var(--font-bangla);
    font-size: var(--step-1);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: normal;
    scroll-margin-top: var(--sticky-offset);
}

.article-entry h4 {
    margin-top: 1.5rem;
    font-family: var(--font-bangla);
    font-size: var(--step-0);
    font-weight: 700;
    letter-spacing: normal;
}

.article-entry strong,
.article-entry b {
    font-weight: 700;
    color: var(--ink);
}

.article-entry a {
    color: var(--brand-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--brand-text) 40%, transparent);
}

.article-entry a:hover {
    text-decoration-thickness: 2px;
    text-decoration-color: var(--brand-text);
}

.article-entry ul,
.article-entry ol {
    padding-inline-start: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.article-entry ul {
    list-style: disc;
}

.article-entry ol {
    list-style: decimal;
}

.article-entry li::marker {
    color: var(--ink-faint);
}

.article-entry li > ul,
.article-entry li > ol {
    margin-top: 0.45rem;
}

.article-entry blockquote {
    margin: 1.75rem 0;
    padding: 1.15rem 1.4rem;
    border-inline-start: 3px solid var(--accent);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    background: var(--surface-sunken);
    color: var(--ink);
    font-size: var(--step-0);
    line-height: 1.8;
}

.article-entry blockquote p + p {
    margin-top: 0.8rem;
}

.article-entry blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-size: var(--step--1);
    font-style: normal;
    color: var(--ink-faint);
}

.article-entry figure {
    margin: 1.9rem 0;
}

.article-entry figure img {
    width: 100%;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
}

.article-entry figcaption,
.wp-element-caption {
    margin-top: 0.6rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.65;
    color: var(--ink-faint);
    text-align: center;
}

.article-entry code {
    padding: 0.12em 0.36em;
    border-radius: 4px;
    background: var(--surface-sunken);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.86em;
}

.article-entry pre {
    margin: 1.75rem 0;
    padding: 1.05rem 1.15rem;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    background: var(--blue-900);
    color: #dbe6f5;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    tab-size: 2;
}

.article-entry pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

:root[data-theme='dark'] .article-entry pre {
    border-color: var(--line-strong);
}

/* Tables scroll inside their own wrapper rather than overflowing the column.
   The `<table>` keeps its table display mode so header cells and row grouping
   still mean something to assistive technology. */
.article-entry .wp-block-table,
.article-entry .wp-block-table figure {
    margin: 1.75rem 0;
    max-width: 100%;
    overflow-x: auto;
}

.article-entry table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.6;
}

.article-entry th,
.article-entry td {
    padding: 0.62rem 0.8rem;
    border: 1px solid var(--line);
    text-align: start;
    vertical-align: top;
}

.article-entry th {
    background: var(--surface-sunken);
    color: var(--ink);
    font-weight: 700;
}

.article-entry hr,
.wp-block-separator {
    margin: 2.25rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

/* Embeds. Scoped to the embed wrapper so a plain pasted iframe (a map, a form)
   keeps its own aspect ratio instead of being forced to 16:9. */
.article-entry .wp-block-embed__wrapper {
    position: relative;
}

.article-entry .wp-block-embed__wrapper iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius-card);
}

.article-entry iframe {
    max-width: 100%;
}

/* Native block alignment. Imported content uses these, so they must work
   without the author touching anything. The article column is already narrow
   and sits beside a TOC, so there is no side gutter to bleed into: wide
   blocks stay inside the column and full blocks use the full column width.
   Bleeding out of a grid cell is what caused horizontal page scroll. */
.article-entry .alignwide,
.article-entry .alignfull {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}

.article-entry .aligncenter {
    margin-inline: auto;
    display: block;
}

.article-entry .alignleft {
    float: left;
    margin: 0.4rem 1.5rem 0.8rem 0;
    max-width: 50%;
}

.article-entry .alignright {
    float: right;
    margin: 0.4rem 0 0.8rem 1.5rem;
    max-width: 50%;
}

.article-entry .alignfull img,
.article-entry .alignwide img {
    width: 100%;
}

/* Imported content hardcodes light background colours from the source theme.
   On the dark palette those blocks would render invisible text, so the theme
   owns the background of any coloured block instead. */
.article-entry .has-background,
.article-entry .has-ast-global-color-5-background-color {
    background-color: var(--surface-sunken) !important;
}

.article-entry .has-background,
.article-entry .has-background * {
    color: var(--ink-soft);
}

.article-entry .has-background a {
    color: var(--brand-text);
}

.wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.75rem 0;
}

.wp-block-column {
    flex: 1 1 0;
    min-width: 0;
}

.wp-block-quote.is-style-large,
.wp-block-pullquote {
    padding: 1.5rem 1.6rem;
    border-inline-start: 0;
    border-top: 2px solid var(--brand-text);
    border-bottom: 2px solid var(--brand-text);
    background: none;
    font-size: var(--step-1);
    line-height: 1.6;
    text-align: start;
}

.wp-block-pullquote cite {
    margin-top: 0.75rem;
}

/* FAQ conventions in the imported content: a bold question followed by an
   answer paragraph. `details` is used where the source has it. */
.article-entry details {
    margin: 0.9rem 0;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.article-entry summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.6;
}

.article-entry details[open] summary {
    margin-bottom: 0.6rem;
}

.page-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
}

.page-links-title {
    color: var(--ink-faint);
}

.page-links a,
.page-links > span:not(.page-links-title) {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding-inline: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

/* ==========================================================================
   14. Article footer
   ========================================================================== */

.article-footer {
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: var(--width-article);
    margin-inline: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.tag-list-label {
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    color: var(--ink-faint);
}

.tag-pill {
    padding: 0.24rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    color: var(--ink-muted);
    transition: border-color var(--fast), color var(--fast);
}

.tag-pill:hover {
    border-color: var(--brand-text);
    color: var(--brand-text);
}

.author-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: var(--width-article);
    margin: 2rem auto 0;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-card-lg);
    background: var(--surface);
}

.author-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.author-card-name {
    font-family: var(--font-bangla);
    font-size: var(--step-0);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
}

.author-card-bio {
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.7;
    color: var(--ink-muted);
}

.author-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 600;
    color: var(--brand-text);
}

.author-card-link svg {
    width: 14px;
    height: 14px;
    transition: transform var(--base);
}

.author-card-link:hover svg {
    transform: translateX(3px);
}

.post-navigation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: var(--width-article);
    margin: 2rem auto 0;
}

.nav-post-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    transition: border-color var(--fast), transform var(--fast);
}

.nav-post-card:hover {
    border-color: var(--brand-text);
    transform: translateY(-2px);
}

.nav-post-next {
    text-align: end;
}

.nav-post-direction {
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 600;
    color: var(--ink-faint);
}

.nav-post-title {
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    font-weight: 700;
    line-height: 1.5;
    color: var(--ink);
}

.related {
    margin-top: clamp(2.25rem, 4vw, 3rem);
}

.related-title {
    margin-bottom: 1.1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-bangla);
    font-size: var(--step-1);
    letter-spacing: normal;
}

/* ==========================================================================
   15. Page + 404
   ========================================================================== */

.page-entry {
    margin-inline: auto;
    padding-block: clamp(1.75rem, 3.5vw, 2.5rem) clamp(2.5rem, 5vw, 4rem);
}

.error-page {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(1.75rem, 4vw, 2.75rem);
    padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 6vw, 5rem);
}

/* The message reads best at a narrow measure, but the recent-post grid needs
   the full container width or its byline truncates. */
.error-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    max-width: 640px;
}

.error-code {
    font-family: var(--font-mono);
    font-size: clamp(3rem, 9vw, 5rem);
    font-weight: 700;
    line-height: 1;
    color: var(--brand-text);
    letter-spacing: -0.04em;
}

.error-title {
    font-family: var(--font-bangla);
    font-size: var(--step-3);
    letter-spacing: normal;
}

.error-text {
    max-width: 48ch;
    font-family: var(--font-bangla);
    color: var(--ink-muted);
}

.error-search {
    width: min(400px, 100%);
    margin-block: 0.5rem;
}

.error-search .header-search input[type='search'] {
    width: 100%;
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

.error-search .header-search input[type='search']:focus {
    width: 100%;
    background: var(--surface);
}

.error-search .header-search-label {
    color: var(--ink-faint);
}

.error-search .header-search input[type='search']::placeholder {
    color: var(--ink-faint);
}

.error-recent {
    width: 100%;
    margin-top: 1.5rem;
}

.error-recent-title {
    margin-bottom: 1rem;
    font-family: var(--font-bangla);
    font-size: var(--step-1);
    letter-spacing: normal;
}

/* ==========================================================================
   16. Footer
   ========================================================================== */

.site-footer {
    margin-top: auto;
    padding-block: clamp(2.25rem, 4vw, 3.25rem) 1.5rem;
    background: var(--blue-900);
    color: var(--on-brand-soft);
}

:root[data-theme='dark'] .site-footer {
    background: #050a13;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: 2rem;
}

.brand-identity--footer {
    margin-bottom: 0.85rem;
}

.footer-about {
    max-width: 34ch;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
    line-height: 1.75;
    color: var(--on-brand-soft);
    opacity: 0.85;
}

.footer-column-title {
    margin-bottom: 0.7rem;
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: normal;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-family: var(--font-bangla);
    font-size: var(--step--1);
}

.footer-links a {
    color: var(--on-brand-soft);
    opacity: 0.85;
}

.footer-links a:hover {
    color: #ffffff;
    opacity: 1;
}

.footer-address {
    color: var(--on-brand-soft);
    opacity: 0.7;
    line-height: 1.6;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-bangla);
    font-size: var(--step--2);
    color: var(--on-brand-soft);
    opacity: 0.7;
}

/* ==========================================================================
   17. Motion
   Scroll-driven where supported. Everything degrades to static.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    /* Reveal cards by moving them into place. Opacity is deliberately not
       animated: a scroll-driven opacity would leave off-screen content
       invisible in print, in screenshots and on engines that never advance
       the timeline. Transform alone can always be read. */
    @supports (animation-timeline: view()) {
        .posts-grid > .post-card {
            animation: card-rise linear both;
            animation-timeline: view();
            animation-range: entry 4% cover 22%;
        }

        @keyframes card-rise {
            from {
                transform: translateY(16px);
            }
            to {
                transform: none;
            }
        }
    }

    .hero-headline {
        animation: hero-in 700ms var(--ease) both;
    }

    .hero-subtext {
        animation: hero-in 700ms var(--ease) 80ms both;
    }

    .hero-actions {
        animation: hero-in 700ms var(--ease) 150ms both;
    }

    @keyframes hero-in {
        from {
            opacity: 0;
            transform: translateY(14px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }
}

/* Cross-document view transitions, inherited by every page. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 220ms;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .post-card:hover,
    .button-primary:hover,
    .nav-post-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   18. Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .article-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-media {
        aspect-ratio: 16 / 9;
        order: -1;
    }

    .hero-headline {
        max-width: 30ch;
    }

    .posts-grid,
    .posts-grid--related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-card {
        grid-column: span 1;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-shell > .article-head {
        grid-column: 1;
    }

    .article-aside {
        order: 2;
    }

    /* The article footer already carries the author card and the tag list, so
       the sidebar's author line and TOC would repeat them on narrow screens.
       Only the share control stays. */
    .aside-sticky {
        position: static;
        padding-top: 0;
        border-top: 0;
        max-height: none;
        overflow: visible;
    }

    .article-aside .author-block,
    .article-aside .toc {
        display: none;
    }

    .article-aside .share {
        padding-top: 1.5rem;
    }

    .article-entry,
    .tag-list,
    .author-card,
    .post-navigation-grid {
        max-width: none;
    }
}

@media (max-width: 899px) {
    .header-nav {
        display: none;
    }

    .menu-toggle {
        display: grid;
    }

    .header-search input[type='search'] {
        width: 132px;
    }

    .header-search input[type='search']:focus {
        width: 172px;
    }
}

@media (max-width: 720px) {
    .brand-tagline {
        display: none;
    }

    /* The header search collapses into the menu drawer on phones. */
    .header-actions .header-search {
        display: none;
    }

    .mobile-menu-search .header-search {
        display: flex;
    }

    .article-title {
        font-size: var(--step-3);
        max-width: none;
    }

    .hero-headline {
        font-size: var(--step-3);
        max-width: none;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .posts-grid,
    .posts-grid--related {
        grid-template-columns: 1fr;
    }

    .post-card {
        grid-column: span 1;
    }

    .post-navigation-grid {
        grid-template-columns: 1fr;
    }

    .nav-post-next {
        text-align: start;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .error-page {
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .header-inner {
        gap: 0.6rem;
        height: 62px;
    }

    .brand-monogram {
        width: 30px;
        height: 30px;
    }

    .card-body {
        padding: 1rem;
    }

    .author-card {
        padding: 1.1rem;
    }

    .article-entry {
        font-size: 1rem;
        line-height: 1.85;
    }

    .article-entry pre {
        padding: 0.85rem;
        font-size: 0.78rem;
    }
}
