/*
 * Naryk.kz front end.
 *
 * Plain CSS on purpose — the production server has no npm.
 *
 * The brief asks three separate times (points 3, 9, 15) for one rhythm across
 * the whole site, so every gap and pad below comes from the --space scale, and
 * every size from the --text scale. Nothing hard-codes a pixel.
 */

/*
 * Roboto, the font the old site used and the client sent. Self-hosted rather
 * than pulled from Google Fonts — the server has no outbound guarantees, and
 * this keeps the site off a third party. The files carry the Cyrillic and
 * Kazakh glyphs the content needs.
 */
@font-face {
    font-family: 'Roboto';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/Roboto-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/Roboto-Bold.woff2') format('woff2');
}

:root {
    /* The green of the wordmark. The ticker takes it too (point 2). */
    --green-logo: #425e40;
    --green-dark: #2f553c;
    --green-darker: #1e412e;
    --green-accent: #00a658;
    --green-pale: #dfeadf;

    --column-bg: #e6e5de;
    --page-bg: #f4f4f0;
    --ink: #16181d;
    --ink-muted: #5f6672;
    --hairline: #d8d7cf;

    --shell: 1280px;
    --radius: 10px;

    /* One spacing scale, used everywhere. */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --gap: var(--space-5);

    /* One type scale. The rubric strip sets the tone (point 9). */
    --text-sm: 14px;
    --text-base: 16px;
    --text-md: 18px;
    --text-lg: 22px;
    --text-xl: 28px;

    /* The rubric strip and the ticker share a height (point 3). */
    --strip-height: 44px;

    --eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c-7 0-11 7-11 7s4 7 11 7 11-7 11-7-4-7-11-7zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-8a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E");
}

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

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    /* Point 9: Roboto everywhere, as on the old site. System fonts only
       stand in for the split second before the woff2 loads. */
    font-family: 'Roboto', -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.45;
    /* No stray element may push the page wider than the screen. */
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

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

a:hover {
    text-decoration: underline;
}

.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ---------- header ---------- */

.site-header {
    background: #fff;
}

/*
 * Left to right: Freedom, search, НАРЫҚ, socials, БІЗ ТУРАЛЫ (point 7). The
 * side columns take an equal share, which lands the wordmark dead centre
 * rather than letting the sponsor push it off.
 */
.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-4);
    min-height: 88px;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.site-header__left,
.site-header__right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
}

.site-header__right {
    justify-content: flex-end;
}

.site-header__about {
    letter-spacing: 0.04em;
}

.site-header__logo {
    grid-column: 2;
    justify-self: center;
    min-width: 0;
    color: var(--green-logo);
    font-size: var(--text-xl);
    font-weight: 700;
}

/* A 15.5:1 strip: capped by width, or it would run into its neighbours. */
.site-header__logo img {
    width: 100%;
    max-width: 440px;
    max-height: 64px;
    height: auto;
    object-fit: contain;
}

/* ---------- rubric strip ---------- */

.site-nav {
    background: var(--green-pale);
}

/* Rubrics run edge to edge, evenly spaced, no gap left over (point 10). */
.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--strip-height);
}

.site-nav__link {
    color: var(--green-logo);
    font-weight: 600;
    font-size: var(--text-base);
    white-space: nowrap;
}

.site-nav__link:hover {
    color: var(--green-darker);
    text-decoration: none;
}

/* ---------- search ---------- */

.site-search {
    min-width: 0;
}

.site-search__input {
    width: 170px;
    max-width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: var(--text-sm);
}

.site-search__input::placeholder {
    color: var(--ink-muted);
}

/* ---------- sponsor ---------- */

/*
 * An ad, editable in the admin panel, not part of the chrome. The wide lockup
 * on the desktop, the bare shield on a phone, where the words will not fit.
 */
.sponsor {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sponsor--wide img {
    height: 36px;
    width: auto;
}

.sponsor--wide:hover,
.sponsor--compact:hover {
    text-decoration: none;
}

.sponsor--compact {
    display: none;
}

.sponsor--compact img {
    height: 40px;
    width: auto;
}

/* ---------- socials ---------- */

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

.social-link {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--green-logo);
    transition: background 0.15s ease, color 0.15s ease;
}

.social-link:hover {
    background: var(--green-logo);
    color: #fff;
    text-decoration: none;
}

.icon {
    display: block;
}

/* ---------- burger and its drawer ---------- */

/* Hidden on the desktop; the media query at the foot turns it on. */
.burger {
    display: none;
    grid-column: 3;
    justify-self: end;
    width: 44px;
    height: 44px;
    padding: var(--space-3);
    border: 0;
    border-radius: var(--space-2);
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}

.burger__bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--green-logo);
    transition: transform 0.22s ease, opacity 0.18s ease;
    transform-origin: center;
}

/*
 * The bars sit 9px apart: (44 - 12*2 - 2*3) / 2. Folding them means moving the
 * outer two onto the middle one.
 */
.burger[aria-expanded='true'] .burger__bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.burger[aria-expanded='true'] .burger__bar:nth-child(2) {
    opacity: 0;
}

.burger[aria-expanded='true'] .burger__bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    .burger__bar {
        transition: none;
    }
}

/* The drawer holds БІЗ ТУРАЛЫ and the socials, not the rubrics (point 29). */
.site-menu {
    display: none;
    background: var(--green-pale);
    border-top: 1px solid rgba(66, 94, 64, 0.15);
}

/* The drawer stacks: each rubric, БІЗ ТУРАЛЫ, then the row of socials. */
/* БІЗ ТУРАЛЫ on the left, the socials on the right, one row. */
.site-menu__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.site-menu__inner .site-nav__link {
    font-size: var(--text-md);
}

.site-menu--open {
    display: block;
}

/* ---------- ticker ---------- */

/*
 * The green of the wordmark (point 2), and inset from the edges rather than
 * bleeding across the screen (point 8).
 */
.ticker {
    max-width: var(--shell);
    margin: 0 auto;
    background: var(--green-logo);
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: var(--strip-height);
    font-size: var(--text-sm);
}

.ticker__track {
    display: flex;
    width: max-content;
    /* The ticker itself is a flex row; without this the track gets compressed
       below its content width and the two marquee copies paint on top of each
       other at the right edge (CCBN under ASBN, etc.). */
    flex: 0 0 auto;
    min-width: max-content;
    animation: ticker-scroll 60s linear infinite;
}

.ticker:hover .ticker__track {
    animation-play-state: paused;
}

/*
 * The spacing around the divider belongs here, not on the divider itself. As
 * its own margins it measured from the arrow's box, which ends flush against
 * the triangle, so the left side always looked tighter than the right. A gap
 * on the strip spaces every child by the same amount.
 */
.ticker__group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--space-3);
    white-space: nowrap;
}

/*
 * Nothing on the strip may shrink. The track is wider than the screen by
 * design — that is what there is to scroll — so flex read the overflow as
 * pressure and squeezed each quote, which pushed its arrow out past its own
 * box and straight onto the divider.
 */
.ticker__item {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--space-1);
}

.ticker__logo {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: contain;
    background: #fff;
}

.ticker__code {
    font-weight: 700;
    letter-spacing: 0.02em;
}

/*
 * Roboto has no ▲ or ▼, so the browser substituted them from a fallback that
 * gives the glyph almost no advance width: the ink drew ~15px past its own box
 * and swallowed the space before the divider, which is why the divider looked
 * glued to the arrow while the next logo sat a clear gap away. Drawing the
 * arrows as borders gives them geometry the layout can actually measure, and
 * the same shape on every machine. The character stays in the markup.
 */
.ticker__arrow {
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 8px;
    font-size: 0;
    line-height: 0;
    color: transparent;
}

.ticker__arrow--up {
    background: #7ee2a8;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.ticker__arrow--down {
    background: #ff9d9d;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Unchanged prices get a bar rather than a triangle. */
.ticker__arrow--flat {
    height: 3px;
    background: #cbd5e1;
}

/*
 * Point 13. The divider was in the markup all along, but as a `|` glyph it
 * inherited the arrow's optical weight and sat close enough to the triangle to
 * read as part of it — red or green, not a separator. Drawing it as a rule of
 * its own gives it a fixed width and symmetric room that a glyph's side
 * bearings kept eating.
 */
.ticker__sep {
    display: inline-block;
    flex: 0 0 auto;
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.55);
    /* The character stays in the markup; the rule stands in for it. */
    font-size: 0;
    line-height: 0;
    color: transparent;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .ticker__track {
        animation: none;
    }
    .ticker {
        overflow-x: auto;
    }
}

/* ---------- three columns ---------- */

.columns {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: var(--gap);
    align-items: start;
    padding: var(--gap) 0 var(--space-6);
}

/* Only the centre scrolls: the sides stick once they reach the top. */
.columns__side {
    position: sticky;
    top: var(--space-4);
    /*
     * Point 6: the column cut off mid-headline and left a gap under it. It now
     * runs the full height of the viewport, so the last item finishes.
     */
    max-height: calc(100vh - var(--space-4) * 2);
    overflow-y: auto;
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.columns__main {
    min-width: 0;
}

.column-title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--green-logo);
}

/* ---------- feed cards ---------- */

.feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.card {
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5) var(--space-4);
}

.card__media {
    display: block;
    margin: calc(var(--space-4) * -1) calc(var(--space-5) * -1) var(--space-3);
}

.card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
}

/*
 * Point 2: the headlines were larger than everything else. They now take the
 * rubric strip's size, which is what the brief asks the whole front page to
 * settle on.
 */
.card__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
    line-height: 1.3;
    font-weight: 700;
}

.card__lead {
    margin: 0 0 var(--space-3);
    color: var(--ink-muted);
    font-size: var(--text-base);
}

/* Tall image: the text sits on the photo, low. */
.card--tall {
    padding: 0;
    position: relative;
    overflow: hidden;
}

.card--tall__image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.card--tall__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-6) var(--space-5) var(--space-4);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
}

.card__title--inverse {
    color: #fff;
}

.card__link:hover {
    text-decoration: none;
}

/* ---------- meta ---------- */

.meta {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.meta__rubric {
    color: var(--green-accent);
    font-weight: 600;
}

/*
 * The view count, shown to staff only. The eye marks it as a count rather than
 * another date, and is drawn here so the markup stays a plain number that reads
 * sensibly without CSS.
 */
.meta__hits {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.meta__hits::before {
    content: '';
    width: 15px;
    height: 15px;
    background: currentColor;
    /* Simple Icons eye (CC0), inlined so the strict CSP has nothing to fetch. */
    -webkit-mask: var(--eye) center / contain no-repeat;
    mask: var(--eye) center / contain no-repeat;
}

.meta--inverse,
.meta--inverse .meta__date {
    color: rgba(255, 255, 255, 0.85);
}

.meta--inverse .meta__rubric {
    color: #6ee7a8;
}

/* ---------- PR badge ---------- */

/*
 * Point 21: it used to sit on its own line above the headline. It now runs
 * inline, so the headline carries on right after it.
 */
.pr-badge {
    display: inline-block;
    /* Point 9: the gap after the badge was too wide. */
    margin-right: var(--space-1);
    padding: 1px var(--space-2);
    border-radius: var(--space-1);
    background: var(--green-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

/* ---------- side cards ---------- */

.aside-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.aside-card {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--hairline);
}

.aside-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* Point 13: thumbnail on the left, headline beside it. */
.aside-card--thumb {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
}

.aside-card--thumb .aside-card__media img {
    width: 84px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.aside-card__title {
    margin: 0 0 var(--space-1);
    font-size: var(--text-sm);
    line-height: 1.3;
    font-weight: 600;
}

/* ---------- banner, load more, feed blocks ---------- */

.banner {
    text-align: center;
}

.banner img {
    margin: 0 auto;
    border-radius: var(--radius);
}

/*
 * Point 22: the side columns fold into the feed on a phone, where they have
 * nowhere else to go. On the desktop the columns are back, so these are dead
 * weight and stay hidden.
 */
.feed-block {
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.feed-block--phone {
    display: none;
}

.load-more {
    display: block;
    width: 100%;
    margin: var(--space-5) 0 0;
    padding: var(--space-3);
    border: 0;
    border-radius: var(--radius);
    background: var(--green-logo);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.load-more:hover {
    background: var(--green-darker);
}

.load-more[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ---------- article ---------- */

.article-layout {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 300px;
    gap: var(--gap);
    align-items: start;
    padding: var(--gap) 0 var(--space-6);
}

.article-rail {
    position: sticky;
    top: var(--space-4);
}

.article {
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: var(--space-5);
    min-width: 0;
}

.article__image {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.article__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xl);
    line-height: 1.2;
}

.article__meta {
    margin-bottom: var(--space-4);
}

/*
 * Point 3: too close first, then too far after the last fix. One step of the
 * scale, the same as everything else.
 */
.article__body {
    margin-top: var(--space-3);
    font-size: var(--text-md);
    line-height: 1.65;
}

.article__body p {
    margin: 0 0 1.1em;
}

.article__body img {
    height: auto;
    border-radius: 6px;
    margin: 1em 0;
}

.article__body a {
    color: var(--green-accent);
    text-decoration: underline;
}

.article__body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.article__body iframe {
    max-width: 100%;
}

/* Point 17: tags below the article. */
.article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-5) 0;
}

.tag-pill {
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--hairline);
    font-size: 13px;
}

/* ---------- share ---------- */

.share {
    display: flex;
    gap: var(--space-2);
}

.share--rail {
    flex-direction: column;
}

.share--bottom {
    margin-top: var(--space-2);
}

.share__link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--space-2);
    background: #fff;
    border: 1px solid var(--hairline);
    color: var(--green-logo);
}

.share__link:hover {
    background: var(--green-logo);
    color: #fff;
    text-decoration: none;
}

/* ---------- latest list ---------- */

.latest {
    margin: 0;
    padding-left: var(--space-5);
}

.latest__item {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--hairline);
}

.latest__item:last-child {
    border-bottom: 0;
}

.latest__title {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
    line-height: 1.3;
}

/* ---------- archive ---------- */

.breadcrumbs {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-5) 0 0;
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.breadcrumbs__current {
    color: var(--ink);
    font-weight: 600;
}

.archive__title {
    margin: var(--space-3) 0 var(--space-5);
    font-size: var(--text-xl);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--green-logo);
}

.archive__empty {
    color: var(--ink-muted);
    padding-bottom: var(--space-6);
}

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

.grid-card {
    background: var(--column-bg);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.grid-card__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.grid-card__body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.grid-card__title {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.25;
}

.grid-card__lead {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--text-sm);
    flex: 1;
}

/* ---------- pagination ---------- */

.pager {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    margin: var(--space-6) 0;
}

.pager__link {
    min-width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0 var(--space-2);
    border-radius: var(--space-2);
    background: var(--column-bg);
    font-weight: 600;
}

.pager__link--current {
    background: var(--green-logo);
    color: #fff;
}

.pager__link--disabled {
    opacity: 0.4;
}

.pager__gap {
    align-self: center;
    padding: 0 var(--space-1);
    color: var(--ink-muted);
}

/* ---------- page, contact, search, 404 ---------- */

.article--wide {
    margin: var(--space-3) 0 var(--space-6);
}

.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin: var(--space-3) 0 var(--space-6);
    align-items: start;
}

.contact__desc {
    color: var(--ink-muted);
}

.contact__list dt {
    font-weight: 600;
    margin-top: var(--space-3);
}

.contact__list dd {
    margin: var(--space-1) 0 0;
    color: var(--ink-muted);
}

.contact__form-wrap {
    background: var(--column-bg);
    border-radius: var(--radius);
    padding: var(--space-5);
}

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

/* Hidden from people, not from bots: `display:none` is too obvious. */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.field__label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.field__input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--hairline);
    border-radius: var(--space-2);
    background: #fff;
    font: inherit;
}

.field__input:focus {
    outline: 2px solid var(--green-accent);
    outline-offset: 1px;
}

.field__error {
    color: #b91c1c;
    font-size: 13px;
}

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--space-2);
    margin-bottom: var(--space-4);
}

.alert--success {
    background: #dcfce7;
    color: #14532d;
}

.search-form {
    display: flex;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-5);
}

.search-form .field__input {
    flex: 1;
}

.search-form__button {
    width: auto;
    margin: 0;
    padding: var(--space-2) var(--space-5);
}

.notfound {
    text-align: center;
    padding: var(--space-6) 0;
}

.notfound__code {
    margin: 0;
    font-size: 88px;
    font-weight: 700;
    line-height: 1;
    color: var(--green-logo);
}

.notfound__title {
    margin: var(--space-2) 0;
}

.notfound__text {
    color: var(--ink-muted);
}

.notfound__link {
    display: inline-block;
    width: auto;
    padding: var(--space-3) var(--space-6);
}

/* ---------- footer ---------- */

.site-footer {
    margin-top: var(--space-6);
    background: var(--green-logo);
    color: #dfe9e2;
    padding: var(--space-6) 0 var(--space-4);
    font-size: var(--text-sm);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-5);
}

/* Point 27: the tagline sits beside the logo, not under it. */
.site-footer__brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
}

/*
 * The wordmark is a 15.5:1 strip, so at 44px it stretched almost 700px wide
 * and dominated the footer. A shorter cap and a tighter chip settle it down.
 */
.site-footer__logo {
    max-height: 30px;
    width: auto;
    padding: var(--space-1) var(--space-2);
    border-radius: 6px;
    background: #fff;
}

.site-footer__desc {
    margin: 0;
    max-width: 34ch;
}

.site-footer__right {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.site-footer .social-link {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.site-footer .social-link:hover {
    background: #fff;
    color: var(--green-logo);
}

.site-footer__legal {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
    .columns {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
    .columns__side--left {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
    }
    .article-layout {
        grid-template-columns: 64px minmax(0, 1fr);
    }
    .article-layout .columns__side--right {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
    }
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .site-nav__inner {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-4);
        padding-top: var(--space-2);
        padding-bottom: var(--space-2);
    }
}

@media (max-width: 800px) {
    .columns,
    .article-layout,
    .grid,
    .contact {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Point 22: on a phone the side columns fold into the feed instead. */
    .columns__side {
        display: none;
    }

    .feed-block--phone {
        display: block;
    }

    /*
     * Point 7 and 19: Freedom, НАРЫҚ, burger — the old shape.
     *
     * The middle track was `auto`, so it sized itself to the wordmark's own
     * width — around 740px at this height — and grew past the screen, squeezing
     * the side tracks to nothing and laying the words over the Freedom shield.
     * Giving the middle track what is left instead of what it wants keeps all
     * three in a row, and the wordmark scales down to fit.
     */
    .site-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 64px;
        gap: var(--space-2);
    }

    .sponsor--compact {
        display: flex;
    }

    .sponsor--wide,
    .site-header__right,
    .site-search {
        display: none;
    }

    .burger {
        display: flex;
    }

    .site-header__logo img {
        width: 100%;
        max-width: 100%;
        max-height: 40px;
    }

    /*
     * The rubric strip scrolls sideways on a phone. Point 11: the last rubric
     * was cut in half at the edge, so the row carries its own padding — the
     * scroll now ends past the final word, with equal air on both sides.
     */
    .site-nav__inner {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        gap: var(--space-5);
        padding-right: var(--space-4);
        scroll-padding-inline: var(--space-4);
    }

    .site-nav__inner::-webkit-scrollbar {
        display: none;
    }

    /* Point 15: the burger matches the Freedom shield on the other side. */
    .burger {
        width: 40px;
        height: 40px;
        padding: var(--space-2);
    }

    .burger[aria-expanded='true'] .burger__bar:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }

    .burger[aria-expanded='true'] .burger__bar:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

    .card__title {
        font-size: var(--text-md);
    }

    /* One column: the sticky rail and the latest list drop out of the grid. */
    .article-layout {
        display: block;
    }

    .article {
        padding: var(--space-4);
    }

    .article__title {
        font-size: var(--text-lg);
    }

    /*
     * On a phone the share buttons live under the article. Hide the sticky
     * rail and keep the bottom copy, so there is one set, not two.
     */
    .article-rail {
        display: none;
    }

    .article-layout .columns__side--right {
        margin-top: var(--space-5);
    }

    /* The footer stacks: brand, then socials and email, each on its own row. */
    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    /* Logo above the tagline, not fighting it for a narrow row. */
    .site-footer__brand {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        width: 100%;
    }

    .site-footer__desc {
        max-width: none;
    }

    .site-footer__right {
        flex-wrap: wrap;
        gap: var(--space-4);
    }
}
