/* styles.css — uaradio.com.ua — Light editorial theme: mint fog + deep teal / copper */

:root {
    /* Palette */
    --bg: #f2f5f2;
    --bg-soft: #e9efeb;
    --surface: #ffffff;
    --surface-2: #f7faf8;
    --text: #1f2a28;
    --text-soft: #34423f;
    --muted: #56625f;
    --accent: #0f5f5c;
    --accent-hover: #0a4644;
    --accent-soft: rgba(15, 95, 92, 0.09);
    --accent2: #9a4a1f;
    --accent2-soft: rgba(154, 74, 31, 0.09);
    --border: #d8e1dc;
    --border-strong: #c3cfc8;
    --code-bg: #eaf0ec;
    --focus: #c2671f;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(22, 44, 40, 0.05);
    --shadow-md: 0 6px 20px -8px rgba(22, 44, 40, 0.14);
    --shadow-lg: 0 14px 34px -14px rgba(15, 95, 92, 0.22);

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

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-sm: var(--space-3);
    --space-md: var(--space-4);
    --space-lg: var(--space-6);

    /* Radii */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    /* Layout */
    --container: 1160px;
    --measure: 70ch;
    --gutter: 16px;
    --tap: 44px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% -10%, rgba(15, 95, 92, 0.07), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(154, 74, 31, 0.05), transparent 40%);
    background-repeat: no-repeat;
    color: var(--text);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    overflow-x: hidden;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

img, video {
    height: auto;
}

iframe {
    border: 0;
}

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

::selection {
    background: rgba(15, 95, 92, 0.18);
    color: var(--text);
}

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

h1 { font-size: clamp(1.25rem, 1rem + 1.4vw, 1.875rem); }
h2 { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); }
h3 { font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.2rem); }
h4 { font-size: 1.05rem; }

p {
    overflow-wrap: break-word;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(15, 95, 92, 0.4);
    transition: color 0.18s ease, text-decoration-color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

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

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

ul { list-style: none; }

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

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

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(242, 245, 242, 0.88);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

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

.logo svg,
.logo img {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
}

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap);
    min-height: 38px;
    padding: 0 var(--space-3);
    color: var(--muted);
    text-decoration: none;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.lang-switcher a.active {
    color: #ffffff;
    background: var(--accent);
}

/* ---------- Main ---------- */
main {
    display: block;
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-6) var(--gutter) var(--space-7);
}

.article-title {
    font-family: var(--font-head);
    font-size: clamp(1.25rem, 1rem + 1.4vw, 1.875rem);
    line-height: 1.3;
    font-weight: 700;
    color: var(--text);
    max-width: 44ch;
    margin-bottom: var(--space-5);
    padding-left: var(--space-3);
    border-left: 3px solid var(--accent2);
    overflow-wrap: anywhere;
}

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

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

.hero-content .lead {
    font-size: 1.075rem;
    line-height: 1.65;
    color: var(--text-soft);
    margin-bottom: var(--space-4);
    max-width: var(--measure);
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    color: var(--muted);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border-strong);
}

.meta-info svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.hero-visual {
    position: relative;
    width: 100%;
    height: 230px;
    min-width: 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.visual-texture {
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(at 85% 10%, rgba(15, 95, 92, 0.16), transparent 55%),
        radial-gradient(at 5% 95%, rgba(154, 74, 31, 0.12), transparent 55%),
        repeating-linear-gradient(90deg, rgba(15, 95, 92, 0.06) 0 1px, transparent 1px 14px);
}

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

/* ---------- Article content ---------- */
.content-body {
    max-width: var(--measure);
    margin: 0 auto var(--space-7);
    color: var(--text-soft);
    overflow-wrap: break-word;
}

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

.content-body p {
    margin-bottom: var(--space-4);
    color: var(--text-soft);
    font-size: 1em;
    line-height: var(--lh-base);
}

.content-body h2,
.content-body h3,
.content-body h4 {
    font-family: var(--font-head);
    color: var(--text);
    margin-top: var(--space-7);
    margin-bottom: var(--space-3);
}

.content-body h2 {
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.content-body h3 {
    margin-top: var(--space-6);
    color: var(--accent);
}

.content-body h4 {
    margin-top: var(--space-5);
}

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

.content-body ul,
.content-body ol {
    margin: 0 0 var(--space-5);
    padding-left: 1.4em;
}

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

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

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

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

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

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

.content-body blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.08em;
    line-height: 1.6;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

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

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

.content-body img,
.content-body video,
.content-body iframe {
    max-width: 100%;
    border-radius: var(--radius);
    margin: var(--space-5) 0;
}

.content-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

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

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

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

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

pre {
    margin: var(--space-5) 0;
    padding: var(--space-4);
    background: var(--code-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent2);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.875rem;
    line-height: 1.6;
    max-width: 100%;
}

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

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

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

th {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody tr:nth-child(even) {
    background: rgba(15, 95, 92, 0.03);
}

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

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

/* ---------- Related materials ---------- */
.related-materials {
    margin-top: var(--space-8);
}

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

.section-header h2,
.section-header h3 {
    font-family: var(--font-head);
    font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
    color: var(--text);
    flex-shrink: 1;
    min-width: 0;
}

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

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

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

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 95, 92, 0.35);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.card:hover::before {
    opacity: 1;
}

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

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

.badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.badge.accent-badge {
    background: var(--accent2-soft);
    color: var(--accent2);
}

.date {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

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

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

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

.card p {
    flex-grow: 1;
    margin-bottom: var(--space-4);
    font-size: 0.925rem;
    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: 24px;
    color: var(--accent);
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover .card-footer {
    opacity: 1;
    transform: translateX(3px);
}

.card-footer a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    font-weight: 600;
}

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

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

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

.footer-left svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.footer-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-1) var(--space-4);
}

.footer-center a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 var(--space-1);
    color: var(--text-soft);
    font-size: 0.9rem;
    text-decoration: none;
}

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

.dmca-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.03em;
    cursor: default;
}

.dmca-badge svg {
    width: 14px;
    height: 14px;
    color: var(--accent2);
}

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

    .hero-visual {
        height: 270px;
    }

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

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

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

    .article-title {
        padding-left: var(--space-4);
        margin-bottom: var(--space-6);
    }

    .hero-visual {
        height: 330px;
    }

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

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

    .content-body blockquote {
        padding: var(--space-5) var(--space-6);
    }
}

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

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

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

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

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

    .hero-visual {
        min-height: 420px;
    }
}

/* ---------- 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,
    .card:hover .card-footer {
        transform: none;
    }
}