/* styles.css */

/* ==========================================================================
   1. Design tokens
   Палітра: слонова кістка + лісовий зелений, з теракотовим допоміжним акцентом
   ========================================================================== */
:root {
    /* Поверхні */
    --bg: #f6f3ea;
    --bg-soft: #f1ede1;
    --surface: #fffdf8;
    --surface-alt: #efebdf;
    --surface-inset: #ebe6d7;

    /* Бордери */
    --border: #dcd6c6;
    --border-light: #e8e3d5;
    --border-strong: #c9c2ae;

    /* Текст */
    --text-main: #1d2219;
    --text-body: #2a2f27;
    --text-muted: #5a6154;
    --text-faint: #6f7668;

    /* Акценти */
    --primary: #2f5d3f;
    --primary-hover: #1f4029;
    --primary-light: #e3ebdc;
    --primary-ink: #ffffff;
    --secondary: #9a4a2c;
    --secondary-light: #f4e4da;

    /* Попередження */
    --accent-warning: #7a4a12;
    --accent-warning-bg: #f5e7c9;

    /* Тіні (м'які, легкі) */
    --shadow-sm: 0 1px 2px rgba(29, 34, 25, 0.05);
    --shadow-md: 0 6px 18px -10px rgba(29, 34, 25, 0.14);
    --shadow-lg: 0 14px 30px -18px rgba(29, 34, 25, 0.22);

    /* Радіуси */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    /* Шкала відступів */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Типографіка */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: 'Lora', Charter, Georgia, "Times New Roman", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --fs-xs: 0.72rem;
    --fs-sm: 0.85rem;
    --fs-base: 1rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.125rem;

    --lh-body: 1.7;
    --lh-tight: 1.3;

    /* Розміри сітки */
    --container: 1160px;
    --article-max: 70ch;
    --sidebar-w: 300px;
    --gutter: 16px;
    --tap-min: 44px;

    /* Фокус */
    --focus-ring: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ==========================================================================
   2. Reset / normalize
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: var(--lh-body);
    overflow-wrap: break-word;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

iframe {
    width: 100%;
    border: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

ul,
ol {
    list-style-position: outside;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
    hyphens: auto;
}

p,
li,
blockquote,
dd,
dt,
figcaption,
td,
th {
    overflow-wrap: anywhere;
}

::selection {
    background: var(--primary-light);
    color: var(--text-main);
}

/* ==========================================================================
   3. Base elements
   ========================================================================== */
a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: rgba(47, 93, 63, 0.35);
    transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

a:hover {
    color: var(--primary-hover);
    text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
    box-shadow: none;
}

strong,
b {
    font-weight: 700;
    color: var(--text-main);
}

em,
i {
    font-style: italic;
}

small {
    font-size: var(--fs-sm);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-10) 0;
}

code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.88em;
}

:not(pre) > code {
    background: var(--surface-inset);
    color: var(--text-main);
    padding: 0.1em 0.38em;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-light);
    overflow-wrap: anywhere;
}

pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--surface-alt);
    color: var(--text-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin: var(--space-6) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    tab-size: 4;
}

pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    white-space: inherit;
}

/* Таблиці — прокрутка на мобільному всередині обгортки */
table {
    width: 100%;
    font-size: var(--fs-sm);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-6) 0;
}

thead,
tbody,
tfoot {
    display: table;
    width: 100%;
    table-layout: auto;
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-light);
    min-width: 8ch;
}

th {
    font-weight: 700;
    color: var(--text-main);
    background: var(--surface-alt);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tbody tr:nth-child(even) td {
    background: rgba(239, 235, 223, 0.45);
}

tbody tr {
    transition: background-color 0.2s var(--ease);
}

tbody tr:hover td {
    background: var(--primary-light);
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* ==========================================================================
   4. Header & navigation
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 253, 248, 0.88);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border-light);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-3) var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 60px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-decoration: none;
    min-height: var(--tap-min);
}

.logo:hover {
    color: var(--primary);
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--primary);
    box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1px var(--primary);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.main-nav {
    display: none;
    gap: var(--space-6);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    padding: var(--space-2) 0;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    transform: scaleX(1);
}

.lang-switcher {
    display: inline-flex;
    gap: 2px;
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    padding: 2px;
    border-radius: var(--radius-pill);
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-switcher a:hover {
    color: var(--text-main);
}

.lang-switcher a.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border);
}

/* ==========================================================================
   5. Layout shell
   ========================================================================== */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-8) var(--gutter) var(--space-16);
    min-width: 0;
}

/* ==========================================================================
   6. Hero / article head
   ========================================================================== */
.hero {
    max-width: var(--article-max);
    margin: 0 auto var(--space-10);
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(47, 93, 63, 0.14);
}

.reading-time {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.article-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: var(--space-4);
    text-wrap: balance;
}

.lead {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: var(--space-6);
    text-wrap: pretty;
}

.meta-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-5);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-8);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.meta-item .label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.meta-item .value {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.hero-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-inset);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   7. Content layout & article typography
   ========================================================================== */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-10);
    align-items: start;
}

.content-body {
    max-width: var(--article-max);
    min-width: 0;
    width: 100%;
    margin: 0 auto;
}

.content-body > * + * {
    margin-top: 0;
}

.content-body p {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-body);
    margin-bottom: var(--space-5);
    text-wrap: pretty;
}

.content-body h2 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -0.015em;
    color: var(--text-main);
    margin: var(--space-12) 0 var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    scroll-margin-top: 88px;
}

.content-body h2:first-child,
.content-body > h2:first-of-type {
    margin-top: var(--space-6);
}

.content-body h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: var(--lh-tight);
    color: var(--text-main);
    margin: var(--space-8) 0 var(--space-3);
    scroll-margin-top: 88px;
}

.content-body h4 {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-main);
    margin: var(--space-6) 0 var(--space-2);
}

.content-body strong {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text-main);
}

.content-body a {
    font-weight: 500;
}

.content-body ul,
.content-body ol {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--text-body);
    padding-left: var(--space-6);
    margin-bottom: var(--space-5);
}

.content-body ul {
    list-style: none;
    padding-left: 0;
}

.content-body ul > li {
    position: relative;
    padding-left: var(--space-6);
}

.content-body ul > li + li,
.content-body ol > li + li {
    margin-top: var(--space-2);
}

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--primary);
}

.content-body ol {
    list-style: decimal;
}

.content-body ol > li::marker {
    color: var(--primary);
    font-weight: 700;
    font-family: var(--font-sans);
}

.content-body li > ul,
.content-body li > ol {
    margin: var(--space-2) 0 0;
}

.content-body img {
    margin: var(--space-6) 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.content-body figure {
    margin: var(--space-6) 0;
}

.content-body figcaption {
    margin-top: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.content-body blockquote {
    position: relative;
    margin: var(--space-8) 0;
    padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
    background: var(--surface-alt);
    border-left: 3px solid var(--secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-main);
}

.content-body blockquote p:last-child {
    margin-bottom: 0;
}

.content-body blockquote cite {
    display: block;
    margin-top: var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-style: normal;
    font-weight: 700;
    color: var(--secondary);
}

/* ==========================================================================
   8. Info box
   ========================================================================== */
.info-box {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin: var(--space-8) 0;
    box-shadow: var(--shadow-sm);
}

.info-box-title {
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--text-main);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.info-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.info-box li {
    position: relative;
    padding-left: var(--space-5);
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--text-body);
}

.info-box li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.5em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--surface);
}

/* ==========================================================================
   9. Sidebar
   ========================================================================== */
.sidebar {
    min-width: 0;
    order: 2;
}

.sidebar-sticky {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.author-card,
.toc-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.author-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    min-width: 0;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--border);
    flex-shrink: 0;
}

.author-badge {
    display: block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--secondary);
}

.author-name {
    display: block;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.author-bio {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

.author-socials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.author-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.author-socials a:hover {
    background: var(--primary-light);
    border-color: rgba(47, 93, 63, 0.25);
    color: var(--primary);
}

.toc-title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-list li a {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-height: var(--tap-min);
    padding: var(--space-2) var(--space-3);
    margin: 0 calc(var(--space-3) * -1);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.toc-list li a span {
    flex-shrink: 0;
    font-size: var(--fs-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    padding-top: 2px;
    min-width: 1.6em;
}

.toc-list li a:hover {
    background: var(--surface-alt);
    color: var(--text-main);
}

/* ==========================================================================
   10. Related section & cards
   ========================================================================== */
.related-section {
    margin-top: var(--space-16);
    padding-top: var(--space-10);
    border-top: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--text-main);
    white-space: normal;
}

.section-line {
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(47, 93, 63, 0.35);
    box-shadow: var(--shadow-md);
}

.card:focus-within {
    border-color: var(--primary);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 9px;
    border-radius: var(--radius-xs);
}

.tag.warning {
    color: var(--accent-warning);
    background: var(--accent-warning-bg);
}

.card-meta .date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-main);
    margin-bottom: var(--space-2);
}

.card h3 a {
    color: inherit;
    text-decoration: none;
}

.card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.card p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap-min);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.read-more::after {
    content: "→";
    transition: transform 0.25s var(--ease);
}

.read-more:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.card:hover .read-more::after {
    transform: translateX(3px);
}

/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer {
    margin-top: var(--space-16);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-10) var(--gutter) var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.brand-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.brand-desc {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    max-width: 52ch;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-6);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    color: var(--text-muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-light);
}

.footer-copy p {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   12. Breakpoints (mobile-first)
   ========================================================================== */

/* ≥ 480px */
@media (min-width: 480px) {
    :root {
        --gutter: 20px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .meta-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

/* ≥ 768px */
@media (min-width: 768px) {
    :root {
        --fs-md: 1.0625rem;
    }

    .main-nav {
        display: flex;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .content-body p,
    .content-body ul,
    .content-body ol {
        font-size: 1.06rem;
    }

    .content-body h2 {
        font-size: 1.35rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-6);
    }

    .card {
        padding: var(--space-6);
    }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .footer-copy {
        width: 100%;
    }
}

/* ≥ 1024px */
@media (min-width: 1024px) {
    :root {
        --gutter: 24px;
    }

    body {
        font-size: 1.0625rem;
    }

    main {
        padding-top: var(--space-12);
    }

    .article-title {
        font-size: 2rem;
    }

    .hero {
        max-width: 860px;
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
        gap: var(--space-12);
    }

    .sidebar {
        order: 0;
    }

    .sidebar-sticky {
        position: sticky;
        top: 84px;
    }

    .content-body {
        margin: 0;
    }
}

/* ≥ 1280px */
@media (min-width: 1280px) {
    :root {
        --sidebar-w: 320px;
    }

    .article-title {
        font-size: 2.125rem;
    }

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

/* ==========================================================================
   13. Reduced motion
   ========================================================================== */
@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;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }

    .card:hover {
        transform: none;
    }
}