/* styles.css */

/* =============================================
   DESIGN TOKENS
   Палітра: пісочний папір + теракота + оливковий
   ============================================= */
:root {
    /* Colors */
    --bg: #f6f1e8;
    --bg-alt: #efe6d6;
    --surface: #fffdf9;
    --surface-2: #faf6ee;
    --text: #2a2622;
    --text-soft: #4a443d;
    --muted: #5c554c;
    --accent: #8f3f25;
    --accent-hover: #6e2e19;
    --accent2: #5d6b32;
    --accent-tint: rgba(143, 63, 37, 0.08);
    --accent2-tint: rgba(93, 107, 50, 0.1);
    --line: rgba(42, 38, 34, 0.12);
    --line-soft: rgba(42, 38, 34, 0.07);
    --code-bg: #efe6d6;
    --focus: #8f3f25;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(74, 50, 24, 0.05);
    --shadow-md: 0 8px 24px -12px rgba(74, 50, 24, 0.14);

    /* Shape */
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 999px;

    /* Typography */
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-sans: var(--font-main);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --fs-base: 1rem;
    --fs-body: 1.0625rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;
    --lh-body: 1.7;
    --lh-heading: 1.3;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    --space-sm: var(--space-3);
    --space-md: clamp(1rem, 3vw, 1.5rem);
    --space-lg: clamp(2rem, 5vw, 3rem);

    --gutter: 1.25rem;
    --container: 1200px;
    --tap: 44px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* =============================================
   RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: var(--lh-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

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

img {
    font-style: italic;
}

iframe {
    border: 0;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 0.2s var(--ease), text-decoration-thickness 0.2s var(--ease);
}

a:hover {
    color: var(--accent-hover);
    text-decoration-thickness: 2px;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    line-height: var(--lh-heading);
    letter-spacing: -0.01em;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
    hyphens: auto;
}

p {
    overflow-wrap: anywhere;
}

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

button {
    cursor: pointer;
}

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

::selection {
    background: rgba(143, 63, 37, 0.2);
    color: var(--text);
}

/* =============================================
   HEADER
   ============================================= */
/* Solid background instead of backdrop-filter: blurring on every scroll frame caused jank. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo svg {
    flex-shrink: 0;
    color: var(--accent2);
}

.logo-sub {
    color: var(--accent2);
    font-style: italic;
}

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

.logo-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.005em;
    text-decoration: none;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
}

.main-nav {
    order: 3;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    gap: var(--space-1) var(--space-6);
    flex-wrap: wrap;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: var(--space-1);
    border-top: 1px solid var(--line-soft);
}

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

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

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    color: var(--accent);
}

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

.lang-switcher {
    display: flex;
    gap: var(--space-2);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap);
    min-height: var(--tap);
    padding: 0 var(--space-2);
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.lang-switcher a.active,
.lang-switcher a:hover {
    color: var(--surface);
    background: var(--accent);
    border-color: var(--accent);
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-7) var(--gutter);
    min-width: 0;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
    align-items: center;
    margin-bottom: var(--space-7);
}

/* The photo is 610×385. Capped well below that so it is never upscaled (no blur),
   framed at its own aspect ratio so it is never stretched or cropped. */
.hero-visual {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    min-width: 0;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 610 / 385;
    background: var(--bg-alt);
    box-shadow: var(--shadow-md);
}

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

/* Article pages: 16:9 illustration next to the title */
.article-cover {
    min-width: 0;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    box-shadow: var(--shadow-md);
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.breadcrumbs {
    margin-bottom: var(--space-5);
    font-size: var(--fs-small);
    color: var(--muted);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.breadcrumbs li + li::before {
    content: "›";
    margin-right: var(--space-2);
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--text-soft);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.hero-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 32px;
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-tint);
    border: 1px solid rgba(143, 63, 37, 0.22);
    border-radius: var(--radius-pill);
}

.article-title {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    text-wrap: balance;
}

.lead {
    font-size: var(--fs-body);
    color: var(--text-soft);
    line-height: 1.7;
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

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

.meta-item .label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-item .value {
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text);
}

.meta-divider {
    display: none;
    width: 1px;
    height: 28px;
    background: var(--line);
}

/* =============================================
   CONTENT WRAPPER
   ============================================= */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-7);
    margin-bottom: var(--space-8);
    align-items: start;
}

/* =============================================
   ARTICLE CONTENT
   ============================================= */
.content-body {
    min-width: 0;
    max-width: 68ch;
    font-size: var(--fs-body);
    color: var(--text-soft);
}

.content-body > * + * {
    margin-top: var(--space-4);
}

.content-body p {
    font-size: var(--fs-body);
    line-height: 1.75;
    color: var(--text-soft);
}

.content-body h2 {
    margin-top: var(--space-7);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--line-soft);
}

.content-body h3 {
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.content-body strong {
    color: var(--text);
    font-weight: 600;
}

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

.content-body ul,
.content-body ol {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-left: 0;
}

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

.content-body ul > li::before {
    content: "";
    position: absolute;
    left: 0.25rem;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent2);
}

.content-body ol {
    counter-reset: list-counter;
}

.content-body ol > li {
    position: relative;
    padding-left: var(--space-6);
    counter-increment: list-counter;
}

.content-body ol > li::before {
    content: counter(list-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.2em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent2);
    font-variant-numeric: tabular-nums;
}

.content-body blockquote {
    position: relative;
    margin: var(--space-6) 0;
    padding: var(--space-5) var(--space-5) var(--space-5) calc(var(--space-5) + var(--space-4));
    background: var(--bg-alt);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
}

.content-body blockquote::before {
    content: "\201C";
    position: absolute;
    left: var(--space-4);
    top: 0;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1;
    color: var(--accent2);
}

.content-body blockquote cite {
    display: block;
    margin-top: var(--space-3);
    font-family: var(--font-main);
    font-style: normal;
    font-size: var(--fs-small);
    color: var(--muted);
    letter-spacing: 0.02em;
}

.content-body code,
.content-body kbd,
.content-body samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.1em 0.4em;
    background: var(--code-bg);
    color: var(--text);
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    overflow-wrap: anywhere;
}

.content-body pre {
    padding: var(--space-4);
    background: var(--code-bg);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre;
}

.content-body pre code {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: inherit;
    overflow-wrap: normal;
}

.content-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    font-size: var(--fs-small);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

.content-body th,
.content-body td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line-soft);
    min-width: 120px;
}

.content-body th {
    font-weight: 600;
    color: var(--text);
    background: var(--bg-alt);
    white-space: nowrap;
}

.content-body tbody tr:nth-child(even) {
    background: rgba(239, 230, 214, 0.35);
}

.content-body tbody tr:hover {
    background: var(--accent-tint);
}

.content-body hr {
    border: 0;
    height: 1px;
    background: var(--line);
    margin: var(--space-7) 0;
}

.content-body img {
    border-radius: var(--radius-sm);
}

.content-body h2[id],
.content-body h3[id],
.footer-about,
.related-section {
    scroll-margin-top: 140px;
}

/* In-article figures: fixed 16:9 frame, centered, never distorted */
.article-figure {
    margin: var(--space-6) 0;
}

.article-figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.article-figure figcaption {
    margin-top: var(--space-2);
    font-size: var(--fs-small);
    line-height: 1.55;
    color: var(--muted);
    text-align: center;
}

/* Info Box */
.info-box {
    margin: var(--space-5) 0 var(--space-6);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.info-box ul li {
    position: relative;
    padding-left: var(--space-5);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-soft);
}

.info-box ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent2);
    font-weight: 600;
}

.info-box ul li strong {
    color: var(--text);
    font-weight: 600;
}

/* =============================================
   AUTHOR SIDEBAR
   ============================================= */
.author-sidebar {
    order: -1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: static;
}

.author-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-alt);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.author-info {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.author-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.author-name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.author-bio {
    font-size: var(--fs-small);
    line-height: 1.65;
    color: var(--muted);
}

/* Four equal buttons in one row under the bio */
.author-socials {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line-soft);
}

.author-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--tap);
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    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(--accent);
    border-color: var(--accent);
    color: var(--surface);
}

/* TOC Card */
.toc-card {
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.toc-title {
    margin-bottom: var(--space-3);
    font-family: var(--font-main);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.toc-list {
    counter-reset: toc-counter;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.toc-list li {
    counter-increment: toc-counter;
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    font-size: var(--fs-small);
    color: var(--muted);
}

.toc-list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    min-width: 22px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent2);
    font-variant-numeric: tabular-nums;
}

.toc-list li a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--text-soft);
    line-height: 1.4;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.toc-list li a:hover {
    color: var(--accent);
    border-color: currentColor;
}

/* =============================================
   RELATED SECTION
   ============================================= */
.related-section {
    margin-top: var(--space-7);
    padding-top: var(--space-7);
    border-top: 1px solid var(--line);
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

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

.section-header h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    white-space: normal;
}

.decoder-line {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

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

/* Cards */
.card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(143, 63, 37, 0.25);
    box-shadow: var(--shadow-md);
}

.card:focus-within {
    border-color: rgba(143, 63, 37, 0.35);
}

.card-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line-soft);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
}

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

.card:hover h4 a {
    color: var(--accent);
}

.card .card-excerpt {
    color: var(--text-soft);
}

.status-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent2);
}

.card-more {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.card-more::after {
    content: " →";
}

.card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--accent2-tint);
    color: #46521f;
    border-radius: var(--radius-pill);
    font-family: var(--font-main);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge.warning {
    background: var(--accent-tint);
    color: var(--accent);
}

.card h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.card p {
    flex-grow: 1;
    font-size: var(--fs-small);
    line-height: 1.65;
    color: var(--muted);
}

.card-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid
var(--line-soft);
    font-size: 0.8125rem;
    color: var(--muted);
}

.card-status-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent2);
}

.card-status-dot.is-warning {
    background: var(--accent);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

/* Stretched link: the whole card becomes clickable */
.card-link::before {
    content: "";
    position: absolute;
    inset: 0;
}

.card-link::after {
    content: "→";
    transition: transform 0.2s var(--ease);
}

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

/* Title link inside a card: stretched over the whole card, arrow shown by .card-more */
.card h4 .card-link {
    display: inline;
    min-height: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.card h4 .card-link::after {
    content: none;
}

.card-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-main);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--surface);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
    background: var(--accent-hover, #7a331e);
    border-color: var(--accent-hover, #7a331e);
}

.btn:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
}

.btn--ghost {
    color: var(--accent);
    background: transparent;
}

.btn--ghost:hover {
    color: var(--surface);
    background: var(--accent);
}

/* Utilities */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Footer */
.site-footer {
    padding: var(--space-7) var(--gutter) var(--space-6);
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    font-size: var(--fs-small);
    color: var(--muted);
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
}

.site-footer > * {
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    text-align: center;
}

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

.footer-left .brand {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-2) var(--space-5);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-nav a,
.footer-contacts {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--text-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-nav a:hover {
    color: var(--accent);
}

/* "Contacts" is a button that does not navigate anywhere */
.footer-contacts {
    padding: 0 var(--space-4);
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    cursor: default;
}

.footer-about {
    margin-top: var(--space-6);
    padding: var(--space-5);
    max-width: 760px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.footer-about h2 {
    margin-bottom: var(--space-2);
    font-size: 1.125rem;
    color: var(--text);
}

.footer-about p {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-soft);
}

.footer-bottom {
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    line-height: 1.6;
    text-align: center;
}

.not-found {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    max-width: 640px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-divider {
        display: block;
    }
}

@media (min-width: 768px) {
    .hero {
        grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
        gap: var(--space-7);
    }

    .hero-visual {
        max-width: 340px;
    }

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

    .hero--article .article-cover {
        order: 2;
    }

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

@media (min-width: 960px) {
    .cards-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .author-sidebar {
        order: 0;
        position: sticky;
        top: 140px;
    }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .card:hover {
        transform: none;
    }
}