/* =====================================================================
   FarryTalk – public theme  (Bootstrap 5 grid/utilities + custom design)
   ===================================================================== */

/* ---------- design tokens ---------- */
:root {
    --brand: #5b3cc4;
    --brand-2: #ff6b4a;
    --brand-ink: #432a9c;
    --bg: #ffffff;
    --bg-soft: #f7f6fb;
    --bg-elev: #ffffff;
    --ink: #16141d;
    --ink-2: #3d3a48;
    --muted: #6d6a7a;
    --line: #ebe8f2;
    --line-strong: #dcd7e8;
    --shadow-sm: 0 1px 2px rgba(22, 20, 29, .06);
    --shadow: 0 12px 32px -14px rgba(40, 24, 110, .28);
    --shadow-lg: 0 28px 60px -24px rgba(40, 24, 110, .38);
    --radius: 18px;
    --radius-sm: 12px;
    --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: Fraunces, Georgia, "Times New Roman", serif;
    --header-h: 68px;
    --cat: var(--brand);
    color-scheme: light;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-link-color-rgb: 91, 60, 196;
    --bs-border-color: var(--line);
}
[data-theme="dark"] {
    --brand: #9b85ff;
    --brand-ink: #c3b6ff;
    --bg: #0f0e14;
    --bg-soft: #17151f;
    --bg-elev: #1b1924;
    --ink: #f1eff7;
    --ink-2: #d2cfdc;
    --muted: #a19db0;
    --line: #2a2735;
    --line-strong: #3a3647;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
    --bs-link-color-rgb: 155, 133, 255;
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .25s ease, color .25s ease;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.container { max-width: 1240px; }
.container-narrow { max-width: 760px; margin-inline: auto; padding-inline: 20px; }
.container-wide { max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.site-main { min-height: 60vh; }
.section { padding-block: 56px 8px; }
.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 2000; background: var(--bg-elev); padding: .5rem 1rem; border-radius: 8px; }
.admin-bar { background: #16141d; color: #cfcbe0; font-size: .8rem; text-align: center; padding: .35rem 1rem; }
.admin-bar a { color: #fff; font-weight: 600; }

/* ---------- buttons, chips, badges ---------- */
.btn-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.35rem; border-radius: 999px; border: 1px solid transparent;
    background: var(--ink); color: var(--bg); font-weight: 600; font-size: .95rem;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn-pill:hover { color: var(--bg); transform: translateY(-1px); box-shadow: var(--shadow); background: var(--brand); }
.btn-pill svg { width: 18px; height: 18px; }
.btn-pill--sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-pill--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-pill--ghost:hover { background: var(--bg-soft); color: var(--ink); box-shadow: none; }
.btn-pill--light { background: #fff; color: #16141d; }
.btn-pill--light:hover { background: #fff; color: var(--brand); }

.badge-cat {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--cat);
}
.badge-cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.badge-cat:hover { color: var(--cat); filter: brightness(.85); }
.kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cat); margin-bottom: .6rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chip {
    display: inline-block; padding: .4rem .85rem; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2);
    font-size: .85rem; font-weight: 500; transition: all .15s ease;
}
.chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.icon-btn {
    display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--line-strong); }

/* ---------- top bar ---------- */
.topbar { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.topbar__inner { display: flex; align-items: center; gap: 1.25rem; min-height: 36px; }
.topbar__date { white-space: nowrap; font-weight: 500; }
.topbar__trending { display: flex; align-items: center; gap: .75rem; min-width: 0; overflow: hidden; }
.topbar__label { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.topbar__tags { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.topbar__tags::-webkit-scrollbar { display: none; }
.topbar__tags a { color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.topbar__tags a:hover { color: var(--brand); }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(0,0,0,.45); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; }
.brand:hover { color: var(--ink); }
.brand-mark {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none;
    color: #fff; font: 700 1.2rem/1 var(--font-display);
    background: linear-gradient(135deg, var(--brand) 0%, #8a5cf6 45%, var(--brand-2) 100%);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}
.brand-mark--lg { width: 52px; height: 52px; border-radius: 16px; font-size: 1.7rem; }
.brand--light, .brand--light:hover { color: #fff; }

.nav-panel { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-links .nav-link {
    position: relative; display: block; padding: .5rem .8rem; border-radius: 10px;
    color: var(--ink-2); font-weight: 500; font-size: .95rem; transition: color .15s ease, background .15s ease;
}
.nav-links .nav-link::after {
    content: ""; position: absolute; left: .8rem; right: .8rem; bottom: 2px; height: 2px; border-radius: 2px;
    background: var(--cat, var(--brand)); transform: scaleX(0); transition: transform .2s ease;
}
.nav-links .nav-link:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links .nav-link.active { color: var(--ink); font-weight: 600; }
.nav-links .nav-link.active::after, .nav-links .nav-link:hover::after { transform: scaleX(1); }

.nav-search { position: relative; margin-left: auto; }
.nav-search input {
    width: 220px; height: 42px; padding: 0 1rem 0 2.5rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); font-size: .92rem;
    transition: width .25s ease, border-color .15s ease, background .15s ease;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { outline: none; width: 280px; border-color: var(--brand); background: var(--bg-elev); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.nav-search__icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.nav-search__icon svg { width: 18px; height: 18px; }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.icon-sun, .icon-close { display: none; }
[data-theme="dark"] .icon-sun { display: inline-flex; }
[data-theme="dark"] .icon-moon { display: none; }
.nav-toggle { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: inline-flex; }

@media (max-width: 991.98px) {
    .site-nav { gap: .75rem; }
    .nav-actions { margin-left: auto; }
    .nav-toggle { display: inline-grid; }
    .nav-panel {
        position: fixed; inset: calc(var(--header-h) + 1px) 0 0 0; z-index: 999;
        flex-direction: column; align-items: stretch; gap: 1.25rem; padding: 1.25rem 20px 2rem;
        background: var(--bg); overflow-y: auto;
        opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .nav-open .nav-panel { opacity: 1; visibility: visible; transform: none; }
    .nav-open { overflow: hidden; }
    .nav-search { order: -1; margin: 0; }
    .nav-search input, .nav-search input:focus { width: 100%; height: 50px; font-size: 1rem; }
    .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-links .nav-link { font-size: 1.25rem; font-weight: 600; padding: .9rem .25rem; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--ink); }
    .nav-links .nav-link::after { left: auto; right: .25rem; top: 50%; bottom: auto; width: 10px; height: 10px; border-radius: 50%; transform: translateY(-50%) scale(1); }
    .nav-links .nav-link:hover { background: transparent; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { max-width: 42ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- section headings ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); position: relative; }
.section-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 3px; border-radius: 3px; background: var(--cat, var(--brand)); }
.section-head__title { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font: 700 1.6rem/1.2 var(--font-display); letter-spacing: -.01em; }
.section-head__title svg { color: var(--brand-2); width: 22px; height: 22px; }
.section-head__more { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.section-head__more svg { width: 16px; height: 16px; transition: transform .15s ease; }
.section-head__more:hover { color: var(--cat, var(--brand)); }
.section-head__more:hover svg { transform: translateX(3px); }
.side-heading { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem; }
.center-row { display: flex; justify-content: center; margin-top: 2.5rem; }

/* ---------- post cards ---------- */
.post-grid { display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .post-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .post-grid--2, .post-grid--3 { grid-template-columns: 1fr; } }

.pc { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pc__media { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-soft); aspect-ratio: 16 / 10; isolation: isolate; }
.pc__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pc:hover .pc__media img { transform: scale(1.05); }
.pc__placeholder {
    position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
    background:
        radial-gradient(circle at 20% 15%, rgba(255,255,255,.28) 0 2px, transparent 3px) 0 0 / 22px 22px,
        linear-gradient(135deg, var(--cat) 0%, color-mix(in srgb, var(--cat) 55%, #ff9a76) 100%);
}
.pc__placeholder span { font: 800 clamp(3rem, 8vw, 5.5rem)/1 var(--font-display); color: rgba(255,255,255,.92); text-shadow: 0 8px 30px rgba(0,0,0,.18); transition: transform .5s ease; }
.pc:hover .pc__placeholder span { transform: scale(1.08) rotate(-3deg); }
.pc__body { display: flex; flex-direction: column; gap: .45rem; padding-top: 1rem; flex: 1; }
.pc__title { margin: 0; font: 700 1.28rem/1.28 var(--font-display); letter-spacing: -.01em; }
.pc__title a { color: var(--ink); background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .3s ease; }
.pc:hover .pc__title a { background-size: 100% 2px; }
.pc__excerpt { color: var(--muted); font-size: .95rem; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: auto 0 0; padding-top: .25rem; color: var(--muted); font-size: .82rem; }
.pc__cat { color: var(--cat); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }

/* feature: big image with the headline on top of it */
.pc--feature .pc__media { aspect-ratio: auto; height: 100%; min-height: 480px; border-radius: calc(var(--radius) + 6px); }
.pc--feature .pc__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,8,20,0) 30%, rgba(10,8,20,.55) 60%, rgba(10,8,20,.9) 100%); }
.pc--feature .pc__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.25rem; gap: .7rem; pointer-events: none; }
.pc--feature .pc__body a { pointer-events: auto; }
.pc--feature .badge-cat { align-self: flex-start; color: #fff; background: var(--cat); padding: .35rem .75rem; border-radius: 999px; }
.pc--feature .badge-cat::before { background: #fff; }
.pc--feature .pc__title { font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.12; max-width: 24ch; }
.pc--feature .pc__title a { color: #fff; }
.pc--feature .pc__excerpt { color: rgba(255,255,255,.85); font-size: 1.05rem; max-width: 60ch; -webkit-line-clamp: 2; }
.pc--feature .pc__meta { color: rgba(255,255,255,.75); }
.pc--feature { height: 100%; }

/* compact: thumbnail + headline */
.pc--compact { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; align-items: center; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.pc--compact:last-child { border-bottom: 0; }
.pc--compact .pc__media { aspect-ratio: 1 / 1; border-radius: var(--radius-sm); }
.pc--compact .pc__placeholder span { font-size: 2.4rem; }
.pc--compact .pc__body { padding: 0; gap: .35rem; }
.pc--compact .pc__title { font-size: 1.05rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* row: horizontal with excerpt */
.pc--row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.5rem; align-items: center; }
.pc--row .pc__body { padding: 0; }

/* ---------- home: welcome + top stories ---------- */
.welcome { padding: 5rem 0 4rem; background: radial-gradient(900px 300px at 15% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%), radial-gradient(700px 300px at 100% 10%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%); }
.welcome__title { font: 800 clamp(2.2rem, 6vw, 4rem)/1.05 var(--font-display); letter-spacing: -.03em; max-width: 18ch; margin: 0; }
.welcome__title em { color: var(--brand); }
.welcome__lead { font-size: 1.2rem; color: var(--muted); max-width: 56ch; margin-top: 1.25rem; }

.top-stories { padding-top: 32px; }
.top-stories__grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 2.5rem; }
.top-stories__grid.is-single { grid-template-columns: minmax(0, 1fr); }
.top-stories__grid.is-single .pc--feature .pc__media { min-height: 540px; }
.top-stories__main .pc--card .pc__media { aspect-ratio: 16 / 9; }
.top-stories__main .pc--card .pc__title { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; }
.top-stories__side { display: flex; flex-direction: column; }
@media (max-width: 991.98px) {
    .top-stories__grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .pc--feature .pc__media { min-height: 420px; }
}
@media (max-width: 575.98px) {
    .top-stories { padding-top: 16px; }
    .pc--feature .pc__media { min-height: 400px; border-radius: var(--radius); }
    .pc--feature .pc__body { padding: 1.4rem; }
    .pc--feature .pc__excerpt { display: none; }
    .pc--compact { grid-template-columns: 92px minmax(0, 1fr); }
}

/* ---------- home: most read ---------- */
.most-read { margin-top: 56px; padding: 48px 0; background: var(--bg-soft); border-block: 1px solid var(--line); }
.most-read .section-head { border-color: var(--line-strong); }
.most-read__list { list-style: none; counter-reset: mr; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.75rem; margin: 0; padding: 0; }
.most-read__item { counter-increment: mr; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: start; }
.most-read__item::before {
    content: counter(mr); font: 800 3.2rem/0.9 var(--font-display);
    background: linear-gradient(180deg, var(--cat), color-mix(in srgb, var(--cat) 40%, transparent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.most-read__cat { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cat); margin-bottom: .3rem; }
.most-read__title { font: 700 1.05rem/1.3 var(--font-display); margin: 0 0 .35rem; }
.most-read__title a { color: var(--ink); }
.most-read__title a:hover { color: var(--brand); }
.most-read__meta { font-size: .8rem; color: var(--muted); }
@media (max-width: 1199.98px) { .most-read__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .most-read__list { grid-template-columns: 1fr; gap: 1.1rem; } .most-read__item::before { font-size: 2.6rem; min-width: 1.6ch; } }

/* ---------- layout with sidebar ---------- */
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 1.25rem; }
.widget { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.widget__title { font: 700 1.15rem/1.2 var(--font-display); margin: 0 0 1rem; }
.widget__text, .widget p { color: var(--muted); font-size: .92rem; }
.widget--brand { position: relative; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 12%, var(--bg-elev)), var(--bg-elev) 70%); }
.widget--brand .brand-mark { margin-bottom: 1rem; }
@media (max-width: 1099.98px) { .layout-sidebar { grid-template-columns: 1fr; } .sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

/* ---------- category / list page header ---------- */
.page-hero {
    position: relative; overflow: hidden; padding: 3.25rem 0 2.75rem; border-bottom: 1px solid var(--line);
    background:
        radial-gradient(800px 260px at 0% 0%, color-mix(in srgb, var(--cat) 16%, transparent), transparent 70%),
        radial-gradient(600px 260px at 100% 100%, color-mix(in srgb, var(--brand-2) 10%, transparent), transparent 70%),
        var(--bg);
}
.page-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cat); }
.page-hero__title { font: 800 clamp(2rem, 5vw, 3.3rem)/1.08 var(--font-display); letter-spacing: -.02em; margin: 0; max-width: 22ch; }
.page-hero__lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 1rem 0 0; }
.page-hero__count { margin: 1.25rem 0 0; display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.page-body { padding-block: 2.5rem 4rem; }

.search-big { position: relative; display: flex; gap: .6rem; max-width: 620px; margin-top: 1.75rem; }
.search-big input {
    flex: 1; min-width: 0; height: 56px; padding: 0 1.2rem 0 3rem; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink); font-size: 1.05rem;
}
.search-big input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.search-big__icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search-big .btn-pill { height: 56px; padding-inline: 1.6rem; }

.empty { text-align: center; padding: 4rem 1rem 3rem; color: var(--muted); }
.empty__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--bg-soft); color: var(--brand); margin-bottom: 1rem; }
.empty__icon svg { width: 30px; height: 30px; }
.empty h2 { font: 700 1.6rem var(--font-display); color: var(--ink); }
.empty .btn-pill { margin-top: 1rem; }

.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 3.5rem; }
.pager__btn { padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: .9rem; }
.pager__btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pager__pages { display: flex; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.pager__pages a, .pager__pages span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 12px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.pager__pages a:hover { background: var(--bg-soft); }
.pager__pages .is-current { background: var(--brand); color: #fff; }
.pager__gap { display: grid; place-items: center; color: var(--muted); }

/* ---------- article ---------- */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1100; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cat, var(--brand)), var(--brand-2)); transition: width .1s linear; }
.preview-banner { background: #fff3cd; color: #5c4400; border-bottom: 1px solid #ffe08a; padding: .6rem 0; font-size: .9rem; }

.article-head { padding: 2.75rem 0 1.5rem; }
/* header column lines up with the article text column (which moves right when there is a contents list) */
.head-grid { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; column-gap: 3.5rem; }
.head-grid.has-toc { grid-template-columns: 260px minmax(0, 720px); }
.head-grid.has-toc .head-grid__col { grid-column: 2; }
@media (max-width: 991.98px) {
    .head-grid, .head-grid.has-toc { grid-template-columns: minmax(0, 1fr); }
    .head-grid.has-toc .head-grid__col { grid-column: 1; }
}
.article-head .badge-cat { margin-bottom: .9rem; }
.article-head__title { font: 800 clamp(2.1rem, 5vw, 3.3rem)/1.1 var(--font-display); letter-spacing: -.025em; margin: 0 0 1.1rem; }
.article-head__lead { font-size: 1.28rem; line-height: 1.55; color: var(--muted); margin: 0 0 1.75rem; }
.byline { display: flex; align-items: center; gap: .85rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.byline__text { display: flex; flex-direction: column; gap: .1rem; }
.byline__name { font-weight: 700; }
.byline__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); }
.byline__meta svg { vertical-align: -2px; }
.avatar {
    display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
    color: #fff; font-weight: 700; font-size: .95rem;
    background: linear-gradient(135deg, var(--cat, var(--brand)), var(--brand-2));
}
.avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }

.article-cover { margin: 1rem auto 0; }
.article-cover img { width: 100%; height: auto; max-height: 640px; object-fit: cover; border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-lg); }
.article-cover figcaption { margin-top: .75rem; text-align: center; font-size: .85rem; color: var(--muted); }

.article-layout { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; gap: 3.5rem; padding-top: 2.75rem; }
.article-layout.has-toc { grid-template-columns: 260px minmax(0, 720px); }
.article-main { min-width: 0; }
.toc { position: relative; }
.toc__box { position: sticky; top: calc(var(--header-h) + 28px); }
.toc__title { display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.toc__title::-webkit-details-marker { display: none; }
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc__item a { display: block; padding: .4rem 0 .4rem 1rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: .9rem; line-height: 1.4; transition: color .15s ease, border-color .15s ease; }
.toc__item--h3 a { padding-left: 1.9rem; font-size: .84rem; }
.toc__item a:hover { color: var(--ink); }
.toc__item a.is-active { color: var(--cat, var(--brand)); border-left-color: var(--cat, var(--brand)); font-weight: 600; }
@media (max-width: 991.98px) {
    .article-layout, .article-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 2rem; }
    .toc__box { position: static; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
    .toc__title { margin: 0; }
    .toc__box[open] .toc__title { margin-bottom: .75rem; }
}

/* article typography */
.prose { font-size: 1.15rem; line-height: 1.8; color: var(--ink-2); }
.prose > :first-child { margin-top: 0; }
.prose > p:first-of-type::first-letter {
    float: left; font: 800 4.1rem/.82 var(--font-display); margin: .4rem .6rem 0 0; color: var(--cat, var(--brand));
}
.prose h2 { font: 700 1.9rem/1.25 var(--font-display); color: var(--ink); margin: 2.75rem 0 1rem; letter-spacing: -.015em; }
.prose h3 { font-size: 1.3rem; font-weight: 700; color: var(--ink); margin: 2rem 0 .7rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.4rem; }
.prose strong { color: var(--ink); }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); word-break: break-word; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.6rem; margin-bottom: .6rem; }
.prose ul > li::before { content: ""; position: absolute; left: .3rem; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--brand)); }
.prose ol { padding-left: 1.4rem; }
.prose ol > li { margin-bottom: .6rem; padding-left: .3rem; }
.prose ol > li::marker { color: var(--cat, var(--brand)); font-weight: 700; }
.prose blockquote {
    position: relative; margin: 2.25rem 0; padding: 1.5rem 1.75rem 1.5rem 2.25rem; border-radius: var(--radius-sm);
    background: var(--bg-soft); border-left: 4px solid var(--cat, var(--brand));
    font: 600 1.3rem/1.5 var(--font-display); color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { display: block; height: auto; margin: 2rem auto; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.prose figure { margin: 2rem 0; }
.prose figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .6rem; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3rem 0; opacity: 1; }
.prose table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .65rem .85rem; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--ink); }
/* "Key takeaways" list right after its heading gets a highlighted box */
.prose h2[id^="key-takeaways"] + ul, .prose h3[id^="key-takeaways"] + ul {
    padding: 1.4rem 1.6rem; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--cat, var(--brand)) 30%, var(--line));
    background: linear-gradient(160deg, color-mix(in srgb, var(--cat, var(--brand)) 9%, var(--bg-elev)), var(--bg-elev));
}
.prose h2[id^="key-takeaways"] + ul > li:last-child { margin-bottom: 0; }
/* FAQ: questions (h3 after the FAQ heading) look like cards */
.prose h2[id^="faq"] ~ h3, .prose h2[id^="frequently-asked"] ~ h3 { padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 1.15rem; }

.article-foot { margin-top: 3rem; display: flex; flex-direction: column; gap: 2rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; border-block: 1px solid var(--line); }
.share__label { font-weight: 700; }
.share__buttons { display: flex; gap: .5rem; }
.share__btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); cursor: pointer;
    transition: all .15s ease;
}
.share__btn:hover { background: var(--brand, #000); background: var(--brand); color: #fff; border-color: transparent; transform: translateY(-2px); }
.share__btn[style*="--brand"]:hover { background: var(--brand); }
.share__btn .copied-icon { display: none; }
.share__btn.is-copied { background: #12a150; color: #fff; border-color: transparent; }
.share__btn.is-copied .copied-icon { display: inline-flex; }
.share__btn.is-copied .copy-icon { display: none; }
.author-box { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.75rem; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.author-box__label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.author-box__name { display: block; font: 700 1.25rem var(--font-display); margin: .1rem 0 .4rem; }
.author-box__text { margin: 0; color: var(--muted); font-size: .95rem; }

.related { margin-top: 4.5rem; padding: 3.5rem 0 1rem; background: var(--bg-soft); border-top: 1px solid var(--line); }

/* ---------- misc pages ---------- */
.contact-card { display: flex; gap: 1.5rem; align-items: center; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow); }
.contact-card h2 { font: 700 1.4rem var(--font-display); margin: 0 0 .25rem; }
.contact-card a { font-size: 1.15rem; font-weight: 600; }
.error-page { padding: 5rem 0 6rem; }
.error-page__code { font: 800 clamp(5rem, 16vw, 9rem)/1 var(--font-display); margin: 0 0 .5rem; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .search-big { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { margin-top: 5rem; background: #110f18; color: #a9a5b8; padding: 0 0 1.75rem; font-size: .95rem; }
.related + .site-footer, .site-main:has(.related:last-child) + .site-footer { margin-top: 0; }
.footer-cta {
    position: relative; top: -48px; margin-bottom: -16px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 2rem 2.25rem; border-radius: calc(var(--radius) + 4px); color: #fff;
    background: linear-gradient(120deg, #5b3cc4 0%, #8a5cf6 45%, #ff6b4a 100%);
    box-shadow: 0 24px 48px -24px rgba(91, 60, 196, .7);
}
.footer-cta__title { font: 700 1.6rem/1.2 var(--font-display); margin: 0 0 .3rem; color: #fff; }
.footer-cta__text { margin: 0; color: rgba(255,255,255,.88); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; padding: 1rem 0 2.5rem; }
.footer-about p { margin-top: 1rem; max-width: 40ch; line-height: 1.65; }
.footer-title { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: 1rem; font-weight: 700; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { color: #cfcbe0; display: inline-flex; align-items: center; gap: .5rem; }
.footer-links a:hover { color: #fff; }
.footer-links .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; border-top: 1px solid #25222f; padding-top: 1.5rem; font-size: .85rem; }
@media (max-width: 767.98px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
    .footer-cta { padding: 1.6rem; }
}

/* ---------- newsletter ---------- */
.nl-form { width: 100%; max-width: 480px; }
.nl-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.nl-form__row { position: relative; display: flex; gap: .5rem; }
.nl-form__icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.nl-form__input {
    flex: 1; min-width: 0; height: 50px; padding: 0 1rem 0 2.75rem; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink); font-size: 1rem;
}
.nl-form__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.nl-form .btn-pill { height: 50px; flex-shrink: 0; }
.nl-form .btn-pill:disabled { opacity: .7; cursor: wait; }
.nl-form__note { margin: .55rem 0 0 1rem; font-size: .82rem; color: var(--muted); min-height: 1.2em; }
.nl-form.is-done .nl-form__note { color: #0f9d58; font-weight: 600; }
.nl-form.is-error .nl-form__note { color: #d93025; font-weight: 600; }
.nl-form.is-error .nl-form__input { border-color: #d93025; }
/* on the gradient footer banner */
.nl-form--light .nl-form__input { border-color: transparent; background: #fff; color: #16141d; }
.nl-form--light .nl-form__icon { color: #8a879a; }
.nl-form--light .nl-form__input:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.35); }
.nl-form--light .nl-form__note, .nl-form--light.is-done .nl-form__note, .nl-form--light.is-error .nl-form__note { color: rgba(255,255,255,.92); }
.footer-cta__copy { flex: 1 1 280px; }
.footer-cta .nl-form { flex: 1 1 360px; }
/* sidebar widget: stack */
.widget--newsletter .widget__title { display: flex; align-items: center; gap: .5rem; }
.widget--newsletter .widget__title svg { color: var(--brand); }
.widget--newsletter .nl-form__row { flex-direction: column; }
.widget--newsletter .nl-form__input { flex: none; width: 100%; }
.widget--newsletter .nl-form__icon { top: 25px; }
.widget--newsletter .nl-form .btn-pill { justify-content: center; }
.widget--newsletter .nl-form__note { margin-left: 0; text-align: center; }
.widget__rss { display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem; font-size: .85rem; color: var(--muted); }
.widget__rss svg { width: 15px; height: 15px; }
/* end of article */
.nl-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 2rem 0; padding: 1.5rem 1.6rem;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--bg-elev)), var(--bg-elev) 70%);
}
.nl-box__copy { flex: 1 1 220px; }
.nl-box__title { font: 700 1.3rem/1.2 var(--font-display); margin: 0 0 .25rem; }
.nl-box__copy p { margin: 0; color: var(--muted); }
.nl-box .nl-form { flex: 1 1 340px; }
/* subscribe / confirm pages */
.nl-hero { padding-block: 4.5rem 4rem; }
.nl-hero__icon {
    display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; margin-bottom: 1.25rem;
    color: #fff; background: linear-gradient(135deg, #5b3cc4, #8a5cf6 55%, #ff6b4a); box-shadow: var(--shadow);
}
.nl-hero__icon svg { width: 36px; height: 36px; }
.nl-hero .kicker { display: block; }
.site-footer.no-cta { padding-top: 3rem; }
.nl-hero__icon--warn { background: linear-gradient(135deg, #8a879a, #5b586b); }
.nl-hero__form { display: flex; justify-content: center; margin-top: 2rem; }
.nl-hero__form .nl-form { text-align: left; }
.nl-perks { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; color: var(--muted); font-size: .92rem; }
.nl-perks li { display: inline-flex; align-items: center; gap: .4rem; }
.nl-perks svg { width: 16px; height: 16px; color: #0f9d58; }
@media (max-width: 575.98px) {
    .nl-form__row { flex-direction: column; }
    .nl-form__input { flex: none; width: 100%; }
    .nl-form__icon { top: 25px; }
    .nl-form .btn-pill { justify-content: center; }
    .nl-form__note { margin-left: 0; text-align: center; }
}

.to-top {
    position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; border: 0; color: #fff; background: var(--brand); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s ease; cursor: pointer;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand-ink); }

/* ---------- small screens ---------- */
@media (max-width: 575.98px) {
    .container, .container-narrow, .container-wide { padding-inline: 16px; }
    .topbar__date { display: none; }
    .section { padding-top: 40px; }
    .section-head__title { font-size: 1.35rem; }
    .prose { font-size: 1.07rem; }
    .prose h2 { font-size: 1.55rem; }
    .article-head { padding-top: 1.75rem; }
    .article-head__lead { font-size: 1.12rem; }
    .search-big { flex-direction: column; }
    .search-big .btn-pill { justify-content: center; }
    .search-big__icon { top: 28px; }
    .author-box { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
    .topbar, .site-header, .site-footer, .share, .related, .to-top, .toc, .read-progress { display: none !important; }
}
