/* styles.css */

/* =============================================
   TOKENS — паперовий фон + чорнильно-синій + теракота
   ============================================= */
:root {
    /* Colors */
    --bg: #f5f1e8;
    --surface: #fffdf8;
    --card: #faf6ee;
    --text: #1c2230;
    --text-soft: #3a4152;
    --muted: #5a6070;
    --accent: #1e3a5f;
    --accent-strong: #142a46;
    --accent2: #9a4a26;
    --accent2-soft: rgba(154, 74, 38, 0.1);
    --accent-soft: rgba(30, 58, 95, 0.08);
    --line: rgba(28, 34, 48, 0.1);
    --line-soft: rgba(28, 34, 48, 0.06);
    --code-bg: #ede7d9;
    --quote-bg: #f1eadb;
    --focus: #1e3a5f;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(28, 34, 48, 0.04), 0 2px 8px rgba(28, 34, 48, 0.04);
    --shadow-md: 0 8px 28px -10px rgba(28, 34, 48, 0.14);

    /* Radius */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    /* Typography */
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --fs-body: 1rem;
    --lh-body: 1.7;
    --lh-heading: 1.3;

    /* Spacing scale */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.25rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --space-sm: 0.625rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --gutter: 1rem;

    /* Layout */
    --container: 1180px;
    --measure: 70ch;
    --sidebar: 300px;
    --touch: 2.75rem;

    --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);
    background-image: radial-gradient(circle at 1px 1px, rgba(28, 34, 48, 0.035) 1px, transparent 0);
    background-size: 22px 22px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--fs-body);
    font-weight: 400;
    line-height: var(--lh-body);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

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

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

ul, ol { list-style: none; }

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

img { height: auto; }

iframe, embed, object {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

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

h1 {
    font-size: 1.375rem;
    font-weight: 700;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 241, 232, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

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

.logo-name {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.005em;
    color: var(--text);
    text-decoration: none;
}

.main-nav {
    display: none;
    gap: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

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

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--accent);
}

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

.lang-switcher {
    display: flex;
    gap: var(--s-1);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: var(--s-1) var(--s-3);
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-switcher a.active,
.lang-switcher a:hover {
    color: var(--accent);
    border-color: rgba(30, 58, 95, 0.3);
    background: var(--accent-soft);
    text-decoration: none;
}

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

/* =============================================
   HERO
   ============================================= */
.hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.hero-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--accent);
    box-shadow: var(--shadow-md);
}

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

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

.hero-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 2rem;
    padding: var(--s-1) var(--s-3);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent2);
    background: var(--accent2-soft);
    border: 1px solid rgba(154, 74, 38, 0.25);
    border-radius: 999px;
}

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

.lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--muted);
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--space-md);
    padding-top: var(--space-md);
    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.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-item .value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    overflow-wrap: anywhere;
}

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

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

.author-sidebar {
    order: -1;
}

/* =============================================
   ARTICLE CONTENT
   ============================================= */
.content-body {
    min-width: 0;
    max-width: var(--measure);
    font-size: 1rem;
    color: var(--text-soft);
    overflow-wrap: anywhere;
    animation: none;
}

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

.content-body p {
    margin-bottom: 1.25em;
    font-size: 1em;
    line-height: 1.75;
    color: var(--text-soft);
}

.content-body h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
    padding-top: 0.25rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--accent);
    scroll-margin-top: 96px;
}

.content-body h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--text);
    scroll-margin-top: 96px;
}

.content-body ul,
.content-body ol {
    margin-bottom: 1.25em;
    padding-left: 1.25rem;
    color: var(--text-soft);
}

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

.content-body li {
    margin-bottom: 0.4em;
    padding-left: 0.2rem;
    line-height: 1.7;
}

.content-body li::marker {
    color: var(--accent2);
}

.content-body a {
    overflow-wrap: anywhere;
}

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

.content-body blockquote {
    position: relative;
    margin: 2rem
0 2.5rem;
    padding: var(--s-4) var(--s-5);
    font-family: var(--font-serif);
    font-size: 1.1875rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text);
    background: var(--accent2-soft);
    border-left: 3px solid var(--accent2);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

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

.content-body blockquote cite {
    display: block;
    margin-top: var(--s-3);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-style: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.content-body figure {
    margin: 2.25rem 0;
}

.content-body figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.content-body figcaption {
    margin-top: var(--s-2);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.content-body hr {
    width: 100%;
    margin: 2.5rem 0;
    border: 0;
    height: 1px;
    background: var(--line);
}

.content-body code {
    padding: 0.1em 0.35em;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 4px;
}

.content-body pre {
    margin-bottom: 1.5em;
    padding: var(--s-4);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    background: #f9f7f2;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.content-body pre code {
    padding: 0;
    color: inherit;
    background: none;
}

.content-body table {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.content-body th,
.content-body td {
    padding: var(--s-2) var(--s-3);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.content-body th {
    font-weight: 600;
    color: var(--text);
    background: var(--accent-soft);
}

/* =============================================
   AUTHOR BLOCK
   ============================================= */
.author-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.author-photo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent2-soft);
}

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

.author-role {
    font-size: 0.875rem;
    color: var(--muted);
}

.author-bio {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-soft);
}

/* =============================================
   BUTTONS & LINKS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: var(--touch);
    padding: var(--s-2) var(--s-4);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    background: #2a4d7a;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

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

.btn-ghost:hover,
.btn-ghost:focus-visible {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
}

.text-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent2);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--accent2);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg) var(--gutter);
    background: var(--accent);
    color: rgba(245, 241, 232, 0.85);
    font-size: 0.875rem;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
}

.footer-nav a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    border-bottom-color: var(--accent2-soft);
}

.footer-copy {
    font-size: 0.8125rem;
    color: rgba(245, 241, 232, 0.6);
}

/* =============================================
   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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--s-3);
    z-index: 200;
    padding: var(--s-2) var(--s-3);
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius-md);
    text-decoration: none;
}

.skip-link:focus {
    top: var(--s-3);
}

/* =============================================
   RESPONSIVE: TABLET
   ============================================= */
@media (min-width: 720px) {
    main {
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }

    .hero {
        flex-direction: row;
        align-items: center;
        gap: var(--space-xl);
    }

    .hero-visual {
        flex: 1 1 50%;
    }

    .hero-content {
        flex: 1 1 50%;
    }

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

    .meta-divider {
        display: block;
    }

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

    .author-card {
        flex-direction: row;
        align-items: center;
    }
}

/* =============================================
   RESPONSIVE: DESKTOP
   ============================================= */
@media (min-width: 960px) {
    .main-nav {
        display: flex;
    }

    .content-wrapper {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: var(--space-xl);
    }

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

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

    .lead {
        font-size: 1.1875rem;
    }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
    .site-header,
    .site-footer,
    .author-sidebar,
    .lang-switcher,
    .btn {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .content-body a {
        color: inherit;
        text-decoration: underline;
    }

    .content-body a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }
}

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