/* =========================================================
   passengers.com.ua — styles.css
   Editorial / Tech · Light theme
   Palette: ivory paper + forest pine + brass ochre
   ========================================================= */

:root {
    /* Palette */
    --bg: #f5f1e6;
    --bg-soft: #efeadb;
    --surface: #fffdf8;
    --card: #fffefa;
    --text: #23261f;
    --text-soft: #3a3e35;
    --muted: #5c6056;
    --accent: #2c5a43;
    --accent-hover: #1f4332;
    --accent-tint: rgba(44, 90, 67, 0.09);
    --accent-tint-strong: rgba(44, 90, 67, 0.16);
    --accent2: #8a5a12;
    --accent2-tint: rgba(138, 90, 18, 0.1);
    --border: rgba(35, 38, 31, 0.12);
    --border-strong: rgba(35, 38, 31, 0.22);
    --code-bg: #ece6d4;
    --focus: #b0741a;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(45, 40, 25, 0.05);
    --shadow-md: 0 2px 4px rgba(45, 40, 25, 0.04), 0 8px 24px -10px rgba(45, 40, 25, 0.14);
    --shadow-lg: 0 4px 8px rgba(45, 40, 25, 0.05), 0 18px 36px -14px rgba(45, 40, 25, 0.2);

    /* Typography */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --fs-base: 1rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;
    --fs-h1: clamp(1.3rem, 1.05rem + 1.1vw, 1.95rem);
    --fs-h2: clamp(1.18rem, 1.05rem + 0.55vw, 1.45rem);
    --fs-h3: clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
    --lh-body: 1.7;
    --lh-head: 1.3;

    /* Spacing scale */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 72px;

    /* Radii */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    /* Layout */
    --container: 1160px;
    --measure: 68ch;
    --gutter: 16px;
    --transition: 0.18s ease;
}

/* ---------- Reset ---------- */
*,
*::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:
        linear-gradient(rgba(35, 38, 31, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(35, 38, 31, 0.028) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    overflow-x: hidden;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
}

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

img,
video {
    height: auto;
}

iframe {
    border: 0;
}

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

ul,
ol {
    list-style: none;
}

::selection {
    background: rgba(138, 90, 18, 0.2);
    color: var(--text);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: var(--lh-head);
    letter-spacing: -0.01em;
    color: var(--text);
    overflow-wrap: break-word;
    hyphens: auto;
}

p {
    overflow-wrap: break-word;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(44, 90, 67, 0.4);
    text-underline-offset: 0.2em;
    transition: color var(--transition), text-decoration-color var(--transition), background-color var(--transition);
}

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

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

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

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

hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: var(--space-xl) 0;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 238, 0.92);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.site-header::after {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--accent) 0 64px, transparent 64px);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.logo:hover {
    color: var(--accent);
    text-decoration: none;
}

.logo img,
.logo svg {
    width: auto;
    max-height: 32px;
}

.lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.lang-switcher a:hover {
    color: var(--accent);
    background: var(--accent-tint);
}

.lang-switcher a.active {
    color: var(--accent);
    border-color: var(--accent-tint-strong);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* ---------- Main layout ---------- */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-lg) var(--gutter) var(--space-xl);
}

.article-title {
    font-size: var(--fs-h1);
    line-height: 1.3;
    max-width: 34em;
    margin-bottom: var(--space-lg);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-strong);
    color: var(--text);
    overflow-wrap: anywhere;
}

.article-title::before {
    content: "passengers / журнал";
    display: block;
    margin-bottom: var(--space-xs);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent2);
}

/* ---------- Hero ---------- */
.hero {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hero-content .lead {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-soft);
    margin-bottom: var(--space-md);
    padding-left: var(--space-md);
    border-left: 3px solid var(--accent);
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.meta-info a {
    color: var(--accent);
}

.hero-visual {
    width: 100%;
    height: 240px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        repeating-linear-gradient(135deg, rgba(44, 90, 67, 0.05) 0 10px, transparent 10px 20px),
        var(--bg-soft);
    box-shadow: var(--shadow-md);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

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

/* ---------- Article content ---------- */
.content-body {
    max-width: var(--measure);
    margin: 0 0 var(--space-xl);
    counter-reset: section;
    min-width: 0;
}

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

.content-body p {
    margin-bottom: var(--space-md);
    color: var(--text-soft);
    font-size: 1em;
}

.content-body h2,
.content-body h3 {
    color: var(--text);
    scroll-margin-top: 90px;
}

.content-body h2 {
    font-size: var(--fs-h2);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    counter-increment: section;
}

.content-body h2::before {
    content: "§ " counter(section, decimal-leading-zero);
    display: block;
    margin-bottom: var(--space-2xs);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent2);
}

.content-body h3 {
    font-size: var(--fs-h3);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xs);
    color: var(--accent);
}

.content-body h4 {
    font-size: 1rem;
    margin-top: var(--space-md);
    margin-bottom: var(--space-xs);
}

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

.content-body img,
.content-body video,
.content-body iframe {
    margin: var(--space-md) 0;
    border-radius: var(--radius);
}

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

.content-body figcaption {
    margin-top: var(--space-xs);
    font-size: var(--fs-small);
    color: var(--muted);
}

/* Blockquote */
.content-body blockquote {
    margin: var(--space-lg) 0;
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 4px);
    background: linear-gradient(90deg, var(--accent2-tint), rgba(138, 90, 18, 0.02));
    border-left: 3px solid var(--accent2);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--text);
}

.content-body blockquote p {
    color: inherit;
}

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

.content-body blockquote cite {
    display: block;
    margin-top: var(--space-xs);
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Lists */
.content-body ul,
.content-body ol {
    margin: 0 0 var(--space-md);
    padding-left: 1.4rem;
}

.content-body ul li,
.content-body ol li {
    margin-bottom: var(--space-xs);
    padding-left: 0.3rem;
    color: var(--text-soft);
}

.content-body ul li {
    list-style-type: square;
}

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

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

.content-body ol li::marker {
    color: var(--accent2);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9em;
}

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

.content-body ul li strong,
.content-body ol li strong {
    color: var(--text);
}

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

:not(pre) > code {
    padding: 0.12em 0.4em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #5a3c0c;
    overflow-wrap: anywhere;
    word-break: break-word;
}

pre {
    margin: var(--space-md) 0;
    padding: var(--space-md);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #f0ebdc;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text);
    tab-size: 4;
}

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

kbd {
    padding: 0.1em 0.4em;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
}

/* Tables */
table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-md) 0;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

th,
td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    min-width: 120px;
}

th {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-soft);
    white-space: nowrap;
}

tbody tr:nth-child(even) {
    background: rgba(239, 234, 219, 0.45);
}

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

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

caption {
    padding: var(--space-xs);
    font-size: var(--fs-small);
    color: var(--muted);
    text-align: left;
}

/* ---------- Related materials ---------- */
.related-materials {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 2px solid var(--text);
}

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

.section-header h2,
.section-header h3 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    flex-shrink: 1;
    min-width: 0;
}

.divider-line {
    flex-grow: 1;
    height: 1px;
    min-width: 24px;
    background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 10px);
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-tint-strong);
    box-shadow: var(--shadow-lg);
}

.card:hover::before,
.card:focus-within::before {
    transform: scaleX(1);
}

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

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

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

.card-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    font-size: 0.8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    background: var(--accent-tint);
    color: var(--accent);
    border: 1px solid rgba(44, 90, 67, 0.18);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.5;
}

.badge.accent-badge {
    background: var(--accent2-tint);
    color: var(--accent2);
    border-color: rgba(138, 90, 18, 0.22);
}

.date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.card h4 {
    margin-bottom: var(--space-xs);
    font-size: 1.08rem;
    line-height: 1.35;
    color: var(--text);
    transition: color var(--transition);
}

.card p {
    flex-grow: 1;
    margin-bottom: var(--space-md);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 28px;
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    transition: color var(--transition);
}

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

/* ---------- Footer ---------- */
footer {
    margin-top: var(--space-xl);
    background: var(--bg-soft);
    border-top: 1px solid var(--border-strong);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-lg) var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer-left {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--fs-small);
    color: var(--muted);
}

.footer-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2xs) var(--space-sm);
}

.footer-center a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-xs);
    font-size: var(--fs-small);
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.footer-center a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.dmca-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    cursor: default;
}

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

    .hero-visual {
        height: 300px;
    }

    .hero-content .lead {
        font-size: 1.15rem;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (min-width: 768px) {
    :root {
        --gutter: 32px;
        --fs-base: 1.0625rem;
    }

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

    .header-inner {
        min-height: 68px;
    }

    .hero-visual {
        height: 360px;
    }

    .content-body blockquote {
        font-size: 1.15rem;
        padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-lg) + 2px);
    }

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

    .footer-left {
        justify-content: flex-start;
    }
}

@media (min-width: 1024px) {
    :root {
        --gutter: 40px;
    }

    .hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
        gap: var(--space-xl);
        align-items: stretch;
    }

    .hero-visual {
        height: 100%;
        min-height: 400px;
    }

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

@media (min-width: 1280px) {
    :root {
        --fs-base: 1.125rem;
    }

    .article-title {
        margin-bottom: var(--space-xl);
    }
}

/* ---------- Hover-capable devices only ---------- */
@media (hover: none) {
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
}

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

    .card:hover {
        transform: none;
    }
}

/* ---------- Print ---------- */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .site-header,
    .related-materials,
    footer {
        display: none;
    }

    a {
        color: #000;
    }
}