/* Фінансовий реєстр — broadsheet / regulatory-ledger layout */

:root {
    --paper: #eeebe3;
    --paper-2: #e6e2d7;
    --paper-3: #dbd5c6;
    --ink: #1e2124;
    --ink-2: #3a3f43;
    --muted: #6d6b63;
    --rule: #bdb7a8;
    --rule-strong: #2a2d30;
    --accent: #6f3a32;
    --slate: #4a585c;
    --night: #1e2124;
    --night-text: #cbc6ba;
    --night-rule: #3b3f43;

    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

    --wrap: 1240px;
    --gutter: 32px;
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.66;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--paper);
    padding: 8px 14px;
    z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

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

/* ---------- Top strip with language switcher ---------- */

.topbar {
    background: var(--night);
    color: var(--night-text);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .05em;
}

.topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
}

.topbar__date { text-transform: uppercase; }

.lang {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #4b4f53;
}

.lang li + li a { border-left: 1px solid #4b4f53; }

.lang a {
    display: block;
    padding: 5px 12px;
    color: var(--night-text);
    text-decoration: none;
    transition: background-color .15s;
}

.lang a:hover { background: #33373b; }

.lang a[aria-current] {
    background: var(--night-text);
    color: var(--night);
    font-weight: 500;
}

/* ---------- Masthead ---------- */

.masthead { border-bottom: 1px solid var(--rule-strong); }

.masthead__row {
    padding-top: 28px;
    padding-bottom: 20px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
}

.brand__name {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(34px, 4.6vw, 58px);
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.brand__tagline {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--rule-strong);
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.rubrics {
    border-top: 1px solid var(--rule);
    border-bottom: 3px double var(--rule-strong);
}

.rubrics__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.rubrics__row > * {
    display: block;
    padding: 10px 22px;
    border-right: 1px solid var(--rule);
    text-decoration: none;
}

.rubrics__row > :first-child { padding-left: 0; }
.rubrics__row > :last-child { border-right: 0; }

.rubrics__row a { transition: color .15s; }
.rubrics__row a:hover { color: var(--accent); }
.rubrics__row a[aria-current] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Sheet grid: spine | article | rail ---------- */

.sheet {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 316px;
    grid-template-areas:
        "spine cover   cover"
        "spine article rail";
    column-gap: 44px;
    padding-top: 40px;
    padding-bottom: 72px;
}

/* Main page: photo lives inside the article column, so the rail starts level with it */
.sheet--home { grid-template-areas: "spine article rail"; }

.sheet--article {
    grid-template-areas:
        "spine cover   rail"
        "spine article rail";
    grid-template-rows: auto 1fr;
}

.spine { grid-area: spine; border-right: 1px solid var(--rule); }
.sheet__cover { grid-area: cover; }
.sheet__article { grid-area: article; min-width: 0; }
.sheet__rail { grid-area: rail; min-width: 0; }

.spine__inner {
    position: sticky;
    top: 28px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 4px 0 4px 14px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.spine__mark { width: 9px; height: 9px; background: var(--accent); }
.spine__rule { width: 1px; height: 56px; background: var(--rule); }

/* ---------- Framed images ---------- */

.frame {
    margin: 0;
    padding: 10px;
    background: var(--paper-2);
    border: 1px solid var(--rule);
}

.frame__img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    background: var(--paper-3);
    box-shadow: 0 0 0 1px rgba(30, 33, 36, .18);
}

/* Cover: natural proportions, never stretched, centred inside the frame */
/* Cover sits in the text column: same width as the text, left edges aligned */
.frame--cover { margin: 0 0 34px; }
.frame--cover .frame__img { width: 100%; height: auto; }

.frame--hero { margin-bottom: 34px; }
.frame--card { padding: 6px; margin: 12px 0 14px; }

.frame__caption {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 9px;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--muted);
}

.frame__caption span:last-child { flex-shrink: 0; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Headline block ---------- */

.kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
}

.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.headline {
    margin: 0 0 24px;
    font-size: clamp(30px, 3.5vw, 46px);
    font-weight: 600;
    line-height: 1.13;
    letter-spacing: -.008em;
    text-wrap: balance;
}

.headline--article { font-size: clamp(28px, 3vw, 40px); }

.standfirst {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.5;
    font-style: italic;
    color: var(--ink-2);
}

.byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    margin-bottom: 32px;
    padding: 13px 0;
    border-top: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule);
}

.byline__author { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }

.byline__name {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.byline__role { font-style: italic; color: var(--muted); font-size: 16px; }

.byline__date { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .03em; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-bottom: 22px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.crumbs a { text-underline-offset: 3px; }
.crumbs a:hover { color: var(--accent); }

/* ---------- Prose ---------- */

.prose { counter-reset: sec; hyphens: auto; }

.prose p { margin: 0 0 18px; }

.prose .lead {
    margin-bottom: 30px;
    font-size: 21px;
    line-height: 1.58;
    color: var(--ink-2);
}

.prose .lead::first-letter {
    float: left;
    margin: 6px 12px 0 0;
    font-size: 4.15em;
    line-height: .8;
    font-weight: 600;
    color: var(--accent);
}

.prose h2 {
    counter-increment: sec;
    margin: 50px 0 18px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-strong);
    font-size: 27px;
    font-weight: 600;
    line-height: 1.25;
    hyphens: manual;
    text-wrap: balance;
}

.prose h2::before {
    content: "§ " counter(sec, decimal-leading-zero);
    display: block;
    margin-bottom: 8px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .16em;
    color: var(--accent);
}

.prose ul {
    counter-reset: item;
    margin: 4px 0 28px;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.prose li {
    counter-increment: item;
    position: relative;
    padding: 12px 0 12px 52px;
    border-bottom: 1px dotted var(--rule);
}

.prose li::before {
    content: counter(item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 15px;
    width: 36px;
    padding-top: 1px;
    border-top: 2px solid var(--slate);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--slate);
}

.prose strong { font-weight: 600; }

.prose blockquote {
    margin: 36px 0;
    padding: 4px 0 4px 26px;
    border-left: 3px solid var(--accent);
    font-size: 24px;
    line-height: 1.42;
    font-style: italic;
    hyphens: manual;
}

.prose blockquote p { margin: 0; }

.prose .quote--final {
    padding: 26px 0 26px 26px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.prose .note {
    padding: 2px 0 2px 22px;
    border-left: 1px dashed var(--slate);
    color: var(--ink-2);
}

.prose .definition {
    margin: 30px 0;
    padding: 20px 24px 20px 24px;
    background:
        linear-gradient(var(--paper-2), var(--paper-2)) padding-box,
        repeating-linear-gradient(135deg, var(--rule) 0 1px, transparent 1px 6px) border-box;
    border: 6px solid transparent;
    box-shadow: inset 0 0 0 1px var(--rule);
    font-size: 16.5px;
    line-height: 1.6;
}

.prose dfn { font-style: normal; font-weight: 600; }

.disclaimer {
    margin: 40px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- Right rail: editorial cards ---------- */

.sheet__rail {
    padding-left: 28px;
    border-left: 1px solid var(--rule);
}

.rail__title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 3px double var(--rule-strong);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.rail__count { font-family: var(--mono); font-weight: 400; color: var(--muted); letter-spacing: .06em; }

.card {
    display: block;
    padding: 22px 0 24px;
    border-bottom: 1px solid var(--rule);
    color: inherit;
    text-decoration: none;
}

.card__meta {
    display: flex;
    gap: 12px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.card__num { font-family: var(--mono); color: var(--accent); letter-spacing: .04em; }

.card__title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.card__excerpt {
    margin: 0 0 12px;
    font-size: 15.5px;
    line-height: 1.52;
    color: var(--ink-2);
}

.card__more {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--slate);
}

a.card .frame__img { transition: filter .2s; filter: saturate(.85); }
a.card:hover .frame__img { filter: none; }
a.card:hover .card__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a.card:hover .card__more { color: var(--accent); }

.card--locked { cursor: default; }
.card--locked .card__more { color: var(--muted); }
.card--locked .card__more::before { content: "UA · "; color: var(--accent); }

.rail__back {
    display: inline-block;
    margin-top: 22px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-underline-offset: 4px;
}
.rail__back:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.footer { background: var(--night); color: var(--night-text); }

.footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 40px;
    padding-top: 46px;
    padding-bottom: 40px;
}

.footer__brand { display: flex; flex-direction: column; gap: 10px; }

.footer__brand a {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    color: #ece8de;
}

.footer__brand span { font-style: italic; font-size: 15px; color: #a9a49a; }

.footer__about {
    padding-left: 32px;
    border-left: 1px solid var(--night-rule);
    font-size: 15.5px;
    line-height: 1.62;
}

.footer__about p { margin: 0 0 12px; }
.footer__about p:last-child { margin-bottom: 0; color: #a9a49a; font-size: 14px; }

.footer__base { border-top: 1px solid var(--night-rule); }

.footer__base-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding-top: 14px;
    padding-bottom: 16px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .04em;
    color: #9a958b;
}

.footer__langs { display: flex; gap: 14px; }
.footer__langs a { text-decoration: none; }
.footer__langs a:hover { color: #ece8de; text-decoration: underline; }

/* ---------- 404 ---------- */

.notfound { padding: 90px 0 110px; text-align: center; }
.notfound .headline { margin-bottom: 14px; }
.notfound a { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .sheet,
    .sheet--article {
        grid-template-columns: minmax(0, 1fr) 280px;
        grid-template-areas:
            "cover   cover"
            "article rail";
        column-gap: 36px;
    }
    .sheet--article {
        grid-template-areas:
            "cover   rail"
            "article rail";
    }
    .sheet--home { grid-template-areas: "article rail"; }
    .spine { display: none; }
    .sheet__rail { padding-left: 24px; }
}

@media (max-width: 860px) {
    .sheet,
    .sheet--article {
        display: block;
        padding-top: 28px;
    }
    .sheet__rail {
        margin-top: 56px;
        padding-left: 0;
        border-left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 28px;
    }
    .rail__title, .rail__back { grid-column: 1 / -1; }
    .footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .footer__about { padding-left: 0; padding-top: 22px; border-left: 0; border-top: 1px solid var(--night-rule); }
}

@media (max-width: 600px) {
    :root { --gutter: 16px; }
    body { font-size: 17px; }
    .sheet__rail { grid-template-columns: 1fr; }
    .frame { padding: 6px; }
    .frame--cover { margin-bottom: 28px; }
    .frame__caption { flex-direction: column; gap: 2px; }
    .prose .lead { font-size: 19px; }
    .prose h2 { font-size: 23px; margin-top: 40px; }
    .prose li { padding-left: 44px; }
    .prose li::before { width: 30px; }
    .prose blockquote { font-size: 20px; padding-left: 18px; }
    .prose .definition { padding: 16px; }
    .standfirst { font-size: 18px; }
    .rubrics__row { display: grid; grid-template-columns: 1fr 1fr; font-size: 11px; letter-spacing: .1em; }
    .rubrics__row > * { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
    .rubrics__row > :nth-child(odd) { padding-left: 0; }
    .rubrics__row > :nth-child(even) { border-right: 0; }
    .rubrics__row > :nth-last-child(-n+2) { border-bottom: 0; }
    .brand__tagline { font-size: 10.5px; }
    .topbar__row { min-height: 44px; }
    .lang a { padding: 6px 10px; }
}

@media print {
    .topbar, .sheet__rail, .spine, .footer { display: none; }
    .sheet { display: block; }
    body { background: #fff; }
}
