/* KuljetusNet – Louhosteeman lapsiteema.
   Tämä tiedosto korvaa pääteeman Bootstrap-bundlen (assets/css/louhos.css lapsiteemassa). Lähde: hyväksytty ulkoasu
   design/konsepti-a/style.css (v58) – pidä muutokset tässä ja prototyypissä linjassa. */

:root {
  --color-brand: #2179B7;        /* KuljetusNet blue, slightly darkened from #268DD5 (white text 4.7:1) */
  --color-brand-deep: #1769AA;   /* blue for text-size use on white (5.8:1) */
  --color-ink: #13202B;
  --color-ink-soft: #3E4C57;
  --color-muted: #5A6670;
  --color-page: #F1F3F5;
  --color-card: #FFFFFF;
  --color-rule: #DEE3E8;
  --color-tint: #E3F0FA;
  --color-link: #1769AA;          /* text links and small blue text (dark mode: light blue) */
  --color-night: #13202B;         /* fixed dark surfaces in both modes: category row, footer, dark buttons, text on yellow */
  --color-ad: #E7EBEF;            /* ad placeholders */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --stretch-head: 80%;           /* condensed headlines */

  --size-body: 1.0625rem;
  --size-small: 0.875rem;
  --size-card: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  --size-lead: clamp(1.875rem, 1.4rem + 1.9vw, 2.875rem);
  --size-small-card: clamp(1.25rem, 1.15rem + 0.35vw, 1.4375rem);

  --space-1: 0.5rem; --space-2: 0.875rem; --space-3: 1.25rem; --space-4: 2rem; --space-5: 3rem;
  --color-ajolinja: #C51820;     /* Ajolinja magazine red, sampled from the logo on the cover (white text 6.1:1) */
  --color-field-line: #7D8A95;   /* input border, 3.6:1 on white (non-text contrast) */
  --field-h: 3rem;
  --color-pro: #FFC629;          /* KN Pro accent (paid content) – road-sign yellow, ink text 11:1 */
  --radius: 4px;
  --bar-control: 2.375rem;       /* height of header buttons (CTA, search, menu) */
  --color-road: #C2CBD3;         /* dashed road-line dividers (also hard-coded in the dash SVG) */
  --shadow-box: 0 1px 2px rgb(19 32 43 / .06), 0 2px 8px rgb(19 32 43 / .06);
  --wrap: 1040px;
  --gutter: clamp(0.75rem, 0.4rem + 1.6vw, 1.5rem);

  /* Louhosteema tokens (parent components and the block editor read these) */
  --louhos-primary: var(--color-brand);
  --louhos-primary-rgb: 33, 121, 183;
  --louhos-link-color: var(--color-link);
  --louhos-accent: var(--color-pro);
  --louhos-headings: var(--color-ink);
  --louhos-body-color: var(--color-ink);
  --louhos-grey: var(--color-muted);
  --louhos-border: var(--color-rule);
  --louhos-dark-1: var(--color-night);
  --louhos-radius: var(--radius);
  --louhos-font-family: var(--font);
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Dark mode follows the visitor's OS setting via data-scheme on <html> (set by the script in <head>);
   only tokens change (plus the route map and road-line dividers below). */
:root { color-scheme: light; }
:root[data-scheme="dark"] {
  color-scheme: dark;
  --color-ink: #E6ECF1;
  --color-ink-soft: #C3CDD5;
  --color-muted: #96A3AE;        /* 6:1 on card */
  --color-page: #0E161D;
  --color-card: #17222C;
  --color-rule: #2C3945;
  --color-tint: #1D3447;
  --color-link: #7DBFF0;         /* 7.9:1 on card */
  --color-ad: #222E39;
  --color-field-line: #6B7A87;   /* 3.4:1 on card */
  --color-road: #3A4855;
  --shadow-box: 0 1px 2px rgb(0 0 0 / .35), 0 0 0 1px rgb(255 255 255 / .04);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--color-page); }
body { margin: 0; font-family: var(--font); font-size: var(--size-body); line-height: 1.5; color: var(--color-ink); }
/* Abstract route network (tyo/reittiverkosto.py) fixed behind the page – own layer, cheaper than background-attachment */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/reittiverkosto.svg") center / cover no-repeat; opacity: .55; }
:root[data-scheme="dark"] body::before { filter: invert(1) hue-rotate(180deg); opacity: .5; }  /* light map → dark lines on the dark page */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); }
:focus-visible { outline: 3px solid var(--color-link); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-2); top: -100px; z-index: 100; background: var(--color-night); color: #fff; padding: var(--space-1) var(--space-2); }
.skip:focus { top: var(--space-2); }
.wordmark { font-style: italic; font-weight: 900; font-stretch: 125%; letter-spacing: -0.015em; line-height: 1; white-space: nowrap; }

.button { display: inline-flex; align-items: center; justify-content: center; font: 600 1rem/1 var(--font); padding: 0.85rem 1.25rem;
  border-radius: var(--radius); border: 2px solid var(--color-ink); background: var(--color-card); color: var(--color-ink);
  text-decoration: none; cursor: pointer; }
.button:hover { background: var(--color-tint); }
.button--brand { background: var(--color-brand-deep); border-color: var(--color-brand-deep); color: #fff; }
.button--pro { background: var(--color-pro); border-color: var(--color-pro); color: var(--color-night); }
.button--pro:hover { background: var(--color-night); border-color: var(--color-night); color: #fff; }
.button--brand:hover { background: var(--color-night); border-color: var(--color-night); }
.button--ajolinja { background: var(--color-ajolinja); border-color: var(--color-ajolinja); color: #fff; }
.button--ajolinja:hover { background: var(--color-night); border-color: var(--color-night); }
.button--light { background: #fff; border-color: #fff; color: var(--color-night); }  /* on the blue and red page heads */
.button--light:hover { background: var(--color-night); border-color: var(--color-night); color: #fff; }

/* ---------- Form fields (search, newsletter, login) ---------- */
.search-form input, .newsletter input, .login input, .footer__newsletter-row input, .field input, .field select, .field textarea {
  height: var(--field-h); font: 400 1rem/1.2 var(--font); color: var(--color-ink); background-color: var(--color-card);
  padding: 0 0.95rem; border: 1px solid var(--color-field-line); border-radius: 6px;
  box-shadow: inset 0 1px 2px rgb(19 32 43 / .06); transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.search-form input::placeholder, .newsletter input::placeholder, .login input::placeholder, .footer__newsletter-row input::placeholder { color: var(--color-muted); opacity: 1; }
:is(.search-form, .newsletter, .login, .field) :is(input, select, textarea):hover { border-color: var(--color-ink-soft); }
.search-form input:focus, .newsletter input:focus, .login input:focus, .footer__newsletter-row input:focus, .field :is(input, select, textarea):focus { outline: none; }
:is(.search-form, .newsletter, .login, .field) :is(input, select, textarea):focus { border-color: var(--color-link); box-shadow: 0 0 0 3px rgb(23 105 170 / .22); }
.field textarea { height: auto; min-height: 7.5rem; padding-block: 0.75rem; line-height: 1.5; resize: vertical; }
.select { position: relative; display: grid; }
.select::after { content: ""; position: absolute; right: 0.8rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none;
  background: var(--color-muted); -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat; }
.field select { width: 100%; appearance: none; padding-right: 2.5rem; cursor: pointer; }
.newsletter .button, .footer__newsletter-row .button, .login__submit { min-height: var(--field-h); padding-block: 0; }

/* ---------- Header: sticky service row; category row scrolls with the page ---------- */
.bar { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 30; background: var(--color-brand); color: #fff; }
.bar :focus-visible { outline-color: #fff; }
.bar__inner { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; }
.bar__logo { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; margin-right: auto; flex: none; }
.bar__logo img { width: 36px; height: 36px; }
.bar__logo .wordmark { font-size: 1.5rem; }
.bar__service > ul { display: flex; align-items: center; gap: 0.25rem; }
.bar__service > ul > li > a, .bar__service button { display: inline-block; font: 500 0.9375rem/1 var(--font); color: #fff;
  text-decoration: none; padding: 0.75rem 0.6rem; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.bar__service > ul > li > a:hover, .bar__service button:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar__service > ul > li > a[aria-current]:not(.bar__cta) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bar__service button::after { content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.5em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.2em) rotate(45deg);
  transition: transform 160ms var(--ease-out, ease-out); }
.bar__service button[aria-expanded="true"]::after { transform: translateY(0.05em) rotate(225deg); }
.bar__service .bar__cta { display: inline-flex; align-items: center; height: var(--bar-control); margin-left: 0.4rem; background: var(--color-pro);
  color: var(--color-night); border-radius: var(--radius); padding: 0 0.9rem; font: italic 800 0.9375rem/1 var(--font); font-stretch: 118%; }
.bar__service .bar__cta:hover { background: #fff; color: var(--color-night); text-decoration: none; }
.bar__service .bar__cta--line { background: var(--color-night); color: #fff; font: 700 0.9375rem/1 var(--font); font-stretch: normal; }
.bar__service .bar__cta--line:hover { background: #fff; color: var(--color-night); }

/* Dropdown (Ilmoittajille) */
.has-sub { position: relative; }
.sub { position: absolute; top: calc(100% + 10px); left: 50%; z-index: 40; min-width: 18rem; padding: 0.4rem; background: var(--color-card);
  border-radius: 8px; box-shadow: 0 14px 34px -10px rgb(19 32 43 / .38), 0 0 0 1px rgb(19 32 43 / .06);
  opacity: 0; visibility: hidden; transform: translate(-50%, -4px);
  transition: opacity 160ms ease-out, transform 160ms ease-out, visibility 0s linear 160ms; }
.sub::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; background: var(--color-card);
  transform: translateX(-50%) rotate(45deg); border-radius: 2px 0 0 0; box-shadow: -1px -1px 0 rgb(19 32 43 / .06); }
.has-sub button[aria-expanded="true"] + .sub { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.sub a { position: relative; display: grid; gap: 0.15rem; padding: 0.7rem 0.85rem; border-radius: 6px; color: var(--color-ink); text-decoration: none; }
.sub a:hover { background: var(--color-tint); }
.sub a:focus-visible { outline-color: var(--color-link); outline-offset: -2px; }
.sub strong { font-weight: 600; font-size: 0.9375rem; }
.sub span { font-size: 0.8125rem; color: var(--color-muted); }

.bar__tools { display: flex; gap: 0.25rem; flex: none; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: var(--bar-control); height: var(--bar-control);
  background: none; border: 0; color: #fff; font: 600 0.9375rem/1 var(--font); cursor: pointer; border-radius: var(--radius); }
.tool:hover, .tool[aria-expanded="true"] { background: rgb(255 255 255 / .16); }
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tool--menu { display: none; padding-inline: 0.6rem; }
.tool--login { padding-inline: 0.55rem; }

/* Panel under the sticky row: search (+ categories once the category row has scrolled away; full menu on mobile) */
.panel { background: var(--color-card); color: var(--color-ink); box-shadow: 0 10px 24px -14px rgb(19 32 43 / .45); }
.panel__inner { display: grid; gap: var(--space-3); padding-block: var(--space-3); }
.panel__title { font-size: var(--size-small); font-weight: 700; color: var(--color-muted); margin-bottom: 0.5rem; }
.panel__cats ul { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.panel__cats a { display: block; padding: 0.55rem 0.8rem; border-radius: 999px; background: var(--color-page); color: var(--color-ink);
  text-decoration: none; font: 600 0.9375rem/1 var(--font); font-stretch: 88%; }
.panel__cats a:hover { background: var(--color-tint); color: var(--color-link); }
.panel__cats a[aria-current] { background: var(--color-ink); color: var(--color-card); }
.panel__cats, .panel__service { display: none; }
.bar.is-past-cats .panel__cats, .panel[data-mode="menu"] .panel__cats { display: block; }
.panel :focus-visible { outline-color: var(--color-link); }

/* Paid article badge (name proposal "KN Pro") */
.pro { display: inline-block; vertical-align: 0.1em; margin-right: 0.15rem; padding: 0.2rem 0.4rem 0.15rem; border-radius: 2px;
  background: var(--color-pro); color: var(--color-night); font: italic 800 0.6875rem/1 var(--font); font-stretch: 118%; letter-spacing: 0.01em;
  white-space: nowrap; text-decoration: none; }
.most__list .pro, .block__list .pro { margin-right: 0.35rem; }

/* Login dialog */
.login { width: min(26rem, calc(100vw - 2rem)); border: 0; border-radius: 6px; padding: 0; color: var(--color-ink); background: var(--color-card);
  box-shadow: 0 24px 60px -12px rgb(19 32 43 / .45); }
.login::backdrop { background: rgb(19 32 43 / .55); }
.login__form { position: relative; display: grid; gap: 0.35rem; padding: var(--space-4) var(--space-4) var(--space-3); }
.login__close { position: absolute; top: 0.6rem; right: 0.6rem; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius); cursor: pointer; color: var(--color-ink); }
.login__close:hover { background: var(--color-tint); }
.login__close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.login__title { font-weight: 800; font-stretch: 85%; font-size: 1.75rem; line-height: 1.1; }
.login__lead { color: var(--color-ink-soft); font-size: 0.9375rem; margin-bottom: var(--space-2); }
.login label { font-weight: 600; font-size: 0.9375rem; }
.login input { margin-bottom: 0.6rem; }
.login__submit { margin-top: 0.3rem; }
.login__forgot { justify-self: start; margin-top: 0.4rem; font-size: 0.9375rem; }
.login__offer { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-rule); display: grid; gap: var(--space-2);
  justify-items: start; font-size: 0.9375rem; color: var(--color-ink-soft); }
.login__offer strong { color: var(--color-ink); }

.cats { background: var(--color-night); }
.cats ul { display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; }
.cats ul::-webkit-scrollbar { display: none; }
.cats ul.is-draggable { cursor: grab; user-select: none; }  /* mouse drag scrolls the row (script.js) */
.cats ul.is-dragging, .cats ul.is-dragging a { cursor: grabbing; }
.cats a { display: block; font: 600 1rem/1 var(--font); font-stretch: 88%; color: #fff; text-decoration: none;
  padding: 0.85rem 0.55rem 0.8rem; white-space: nowrap; }
.cats a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cats a[aria-current] { box-shadow: inset 0 -3px 0 #fff; }
.cats li:first-child a { padding-left: 0; }
.cats :focus-visible { outline-color: #fff; outline-offset: -3px; }

.search-form label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
.search__row { display: flex; gap: var(--space-1); }
/* Field icons are separate layers (not input backgrounds) so contrast checkers can read the field colours */
.search__field { position: relative; flex: 1; min-width: 0; display: flex; }
.search__field::before { content: ""; position: absolute; left: 0.9rem; top: 50%; width: 20px; height: 20px; margin-top: -10px; pointer-events: none;
  background: var(--color-muted); -webkit-mask: var(--icon-search) center / contain no-repeat; mask: var(--icon-search) center / contain no-repeat; }
.search-form input { flex: 1; width: 100%; min-width: 0; font-size: 1.0625rem; padding-left: 2.75rem; }
.search-form button { font: 600 1rem/1 var(--font); height: var(--field-h); padding: 0 1.4rem; border: 0; border-radius: var(--radius); background: var(--color-brand-deep); color: #fff; cursor: pointer; }

/* ---------- Breaking news bar ---------- */
.now { margin-top: var(--space-3); }
.now__item { display: block; background: var(--color-card); border-left: 6px solid var(--color-brand); border-radius: var(--radius);
  box-shadow: var(--shadow-box); padding: 0.7rem 0.9rem; color: var(--color-ink); text-decoration: none;
  font: 700 1.1875rem/1.25 var(--font); font-stretch: var(--stretch-head); }
.now__item:hover { color: var(--color-link); }
.now__label { color: var(--color-link); margin-right: 0.35rem; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-3); margin-block: var(--space-3) var(--space-5); align-items: start; }
.feed { display: grid; gap: var(--space-2); }

/* ---------- Cards ---------- */
.card { background: var(--color-card); border-radius: var(--radius); padding: var(--space-2); box-shadow: var(--shadow-box); }
.card__link { display: block; color: var(--color-ink); text-decoration: none; }
.card__img { width: 100%; aspect-ratio: 529 / 300; object-fit: cover; border-radius: var(--radius); margin-bottom: 0.75rem; background: var(--color-page); }
.card__title { font-weight: 700; font-stretch: var(--stretch-head); font-size: var(--size-card); line-height: 1.12; letter-spacing: -0.005em; text-wrap: pretty; }
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card--lead .card__title { font-size: var(--size-lead); line-height: 1.06; }
.card--small .card__title, .card--inblock .card__title { font-size: var(--size-small-card); line-height: 1.15; }
.card--text .card__title { font-size: var(--size-card); }
.card--small.card--text .card__title { font-size: var(--size-small-card); }  /* text-only story in a pair */

.meta { display: flex; gap: 0.45rem; align-items: baseline; margin-top: 0.4rem; font-size: var(--size-small); line-height: 1.3; }
.meta__topic { font-weight: 700; color: var(--color-link); text-decoration: none; }
.meta__topic:hover { text-decoration: underline; }
.meta time { color: var(--color-muted); font-variant-numeric: tabular-nums; }

.card__related { margin-top: var(--space-2); padding-top: var(--space-2); }
.card__related-title { font-weight: 700; font-stretch: var(--stretch-head); font-size: 1.3125rem; line-height: 1.2; }
.card__related-title a { color: var(--color-ink); text-decoration: none; }
.card__related-title a:hover { text-decoration: underline; }

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

/* ---------- Blocks with a blue header bar ---------- */
.block { background: var(--color-card); border-radius: var(--radius); overflow: clip; box-shadow: var(--shadow-box); }
.block__bar { background: var(--color-brand); padding: 0.7rem var(--space-2); font-weight: 800; font-stretch: var(--stretch-head);
  font-size: 1.3125rem; line-height: 1.1; }
.block__bar a { color: #fff; text-decoration: none; }
.block__bar a:hover { text-decoration: underline; }
.block__bar a:focus-visible { outline-color: #fff; }
.block--magazine .block__bar { background: var(--color-ajolinja); }
.block__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2); }
.block .card { padding: 0; box-shadow: none; }
.block__list li { padding: 0.7rem 0; }
.block__list li:first-child { padding-top: 0; }
.block__list a { display: block; color: var(--color-ink); text-decoration: none; font-weight: 700; font-stretch: var(--stretch-head);
  font-size: 1.1875rem; line-height: 1.2; }
.block__list a:hover { text-decoration: underline; }
.block__list time { display: block; margin-top: 0.25rem; font-size: var(--size-small); color: var(--color-muted); }

.magazine { grid-template-columns: 180px minmax(0, 1fr); align-items: start; }
.magazine__cover { width: 100%; border-radius: 2px; box-shadow: 0 10px 24px -12px rgb(19 32 43 / .5); }
.magazine__claim { font-size: 1.0625rem; color: var(--color-ink-soft); margin-bottom: var(--space-2); max-width: 46ch; }
.magazine__toc-title { font-size: var(--size-small); font-weight: 700; color: var(--color-muted); margin-bottom: 0.25rem; }
.magazine__toc { margin-bottom: var(--space-3); }
.magazine__toc li { font-weight: 700; font-stretch: var(--stretch-head); font-size: 1.1875rem; line-height: 1.25; padding: 0.45rem 0;
  border-top: 1px solid var(--color-rule); }

/* Road-line dividers between news items: 2px dashes like lane markings */
/* Tile = half dash | gap | half dash (23×1), repeat: round → whole 14px dashes, 9px gaps inside, dashes flush with both edges */
.card__related, .block__list li + li, .most__list li + li, .latest__list li + li {
  border-top: 1px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23' height='1'%3E%3Cpath d='M0 0h7v1H0zM16 0h7v1h-7z' fill='%23C2CBD3'/%3E%3C/svg%3E") 1 0 0 0 / 1px 0 0 0 round; }
:root[data-scheme="dark"] :is(.card__related, .block__list li + li, .most__list li + li, .latest__list li + li) {
  border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23' height='1'%3E%3Cpath d='M0 0h7v1H0zM16 0h7v1h-7z' fill='%233A4855'/%3E%3C/svg%3E"); }

/* ---------- Article page (uutinen.html) ---------- */
.story-col { display: grid; gap: var(--space-3); }
.story { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow-box);
  padding: var(--space-3); }
.story__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: var(--size-lead); line-height: 1.06;
  letter-spacing: -0.01em; text-wrap: balance; }
.story__lead { margin-top: var(--space-2); font-size: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem); line-height: 1.45; font-weight: 500; max-width: 62ch; }
.story__byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2);
  margin-top: var(--space-3); padding-block: var(--space-2); border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.story__byline .meta { flex: 1 1 0; min-width: 0; flex-wrap: wrap; margin: 0; font-size: 0.9375rem; }
.share__toggle { display: inline-flex; align-items: center; gap: 0.45rem; height: 2.25rem; padding: 0 0.8rem 0 0.95rem;
  border: 1px solid var(--color-field-line); border-radius: 999px; background: var(--color-card); color: var(--color-ink);
  font: 600 0.9375rem/1 var(--font); cursor: pointer; }
.share__toggle:hover, .share__toggle[aria-expanded="true"] { border-color: var(--color-ink); background: var(--color-tint); }
.share__toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* Share menu reuses the header dropdown, aligned to the button's right edge */
.sub--share { left: auto; right: 0; min-width: 12rem; transform: translateY(-4px); }
.sub--share::before { left: auto; right: 1.4rem; transform: rotate(45deg); }
.has-sub button[aria-expanded="true"] + .sub--share { transform: none; }
.sub--share a, .sub--share button { display: block; width: 100%; padding: 0.65rem 0.85rem; border: 0; border-radius: 6px; background: none;
  color: var(--color-ink); font: 500 0.9375rem/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.sub--share button:hover { background: var(--color-tint); }
.sub--share button:focus-visible { outline-color: var(--color-link); outline-offset: -2px; }
.share__status { flex-basis: 100%; font-size: var(--size-small); color: var(--color-link); font-weight: 600; }
.share__status:empty { display: none; }
.story__figure { margin: var(--space-3) 0 0; }
.story__figure img { width: 100%; aspect-ratio: 529 / 300; object-fit: cover; border-radius: var(--radius); background: var(--color-page); }
.story__caption { margin-top: 0.4rem; font-size: var(--size-small); color: var(--color-muted); }
.story__body { margin-top: var(--space-3); max-width: 66ch; font-size: 1.0625rem; line-height: 1.65; }
.story__body p + p { margin-top: 1.1em; }
.story__ad { margin-block: var(--space-4); }
/* MAINOS / MAINOS PÄÄTTYY markers around ads inside the article text */
.ad-mark { display: flex; align-items: center; gap: 0.75rem; margin-block: 0.5rem; font-size: 0.75rem; font-weight: 600; line-height: 1;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); }
.ad-mark::before, .ad-mark::after { content: ""; flex: 1; border-top: 1px solid var(--color-rule); }
.story__body .ad-mark + .ad, .story__body .ad + .ad-mark { margin-top: 0.5rem; }
.story__source { color: var(--color-muted); font-size: 0.9375rem; }
.story__foot { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-rule); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags a { display: inline-block; padding: 0.4rem 0.75rem; border-radius: 999px; background: var(--color-tint); color: var(--color-link);
  font-weight: 600; font-size: 0.875rem; text-decoration: none; }
.tags a:hover { text-decoration: underline; }
/* KN Pro paywall: teaser fades out above the subscription box */
.story__teaser-end { -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent); }
.paywall { margin-top: var(--space-3); border-radius: 6px; overflow: clip; }
.paywall__head { display: grid; gap: 0.5rem; justify-items: start; padding: var(--space-3); background: var(--color-pro); color: var(--color-night); }
.paywall__head .pro { font-size: 0.8125rem; background: var(--color-night); color: var(--color-pro); }  /* inverted on the yellow */
.paywall__body { display: grid; gap: 0.5rem; justify-items: start; padding: var(--space-3); background: var(--color-page); }
.paywall__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); line-height: 1.1; }
.paywall__text { color: var(--color-ink-soft); max-width: 46ch; }
.paywall__price { font-weight: 700; }
.paywall__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: 0.4rem; }
.paywall__login { font-size: 0.9375rem; color: var(--color-ink-soft); }
.paywall__login-btn { padding: 0; border: 0; background: none; color: var(--color-link); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.related { display: grid; gap: var(--space-2); }
.related__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.75rem; line-height: 1.1; }

/* ---------- Subpages: shared page head and boxes ---------- */
/* Block pages (page.twig): every block in the page column, the Ajolinja hero full width under the category row */
.subpage > * { width: min(100% - 2 * var(--gutter), var(--wrap) - 2 * var(--gutter)); justify-self: center; }
.subpage > .mag-hero { width: 100%; margin-top: calc(-1 * var(--space-3)); }
/* Editor content inside a content box */
.page-box--content > :where(p, ul, ol) { max-width: 62ch; color: var(--color-ink-soft); }
.page-box--content > ul { display: grid; gap: 0.5rem; }
.page-box--content > ul li { position: relative; padding-left: 1.6rem; color: var(--color-ink); }
.page-box--content > ul li::before { content: ""; position: absolute; left: 0.3rem; top: 0.2em; width: 0.4rem; height: 0.75rem;
  border-right: 2.5px solid var(--color-link); border-bottom: 2.5px solid var(--color-link); transform: rotate(45deg); }
.page-box--content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.page-box--content .wp-block-button__link { display: inline-flex; align-items: center; font: 600 1rem/1 var(--font); padding: 0.85rem 1.25rem;
  border-radius: var(--radius); border: 2px solid var(--color-brand-deep); background: var(--color-brand-deep); color: #fff; text-decoration: none; }
.page-box--content .wp-block-button__link:hover { background: var(--color-night); border-color: var(--color-night); }
.form-wrap { display: grid; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { color: #B3261E; font-weight: 600; }
:root[data-scheme="dark"] .form__error { color: #FF8A80; }
.button[aria-busy="true"] { opacity: .6; }
.subpage { display: grid; gap: var(--space-3); margin-block: var(--space-3) var(--space-5); }
.page-head { display: grid; gap: var(--space-2); justify-items: start; margin-top: var(--space-3); padding: var(--space-4) var(--space-3);
  border-radius: var(--radius); background: var(--color-brand); color: #fff; }
.subpage > .page-head { margin-top: 0; }
/* Quieter variant (topic page): white box, smaller title */
.page-head--quiet { gap: 0.4rem; padding: var(--space-3); background: var(--color-card); color: var(--color-ink); box-shadow: var(--shadow-box); }
.page-head--quiet .page-head__title { font-size: var(--size-card); line-height: 1.1; }
.page-head--quiet .page-head__lead { font-size: 1.0625rem; color: var(--color-ink-soft); }
.page-head--quiet :focus-visible { outline-color: var(--color-link); }
.page-head--quiet .page-head__link { color: var(--color-link); }
.page-head__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: var(--size-lead); line-height: 1.04; letter-spacing: -0.01em;
  text-wrap: balance; max-width: 22ch; }
.page-head__lead { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.45; max-width: 56ch; }
.page-head__actions, .mag-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: 0.25rem; }
.page-head__link, .mag-hero__link { color: #fff; font-weight: 600; text-underline-offset: 3px; }
.page-head :focus-visible, .mag-hero :focus-visible { outline-color: #fff; }

.page-box { display: grid; gap: var(--space-2); align-content: start; background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow-box); padding: var(--space-3); }
.page-box > .button { justify-self: start; }
.page-box > a:not(.button) { justify-self: start; font-weight: 600; }
.page-box__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.75rem; line-height: 1.1; }
.page-box__text { color: var(--color-ink-soft); max-width: 62ch; }
.page-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.proto-note { font-size: var(--size-small); color: var(--color-muted); border-left: 3px solid var(--color-rule); padding-left: 0.75rem; }

/* Tick list */
.checks { display: grid; gap: 0.5rem; }
.checks li { position: relative; padding-left: 1.6rem; }
.checks li::before { content: ""; position: absolute; left: 0.3rem; top: 0.2em; width: 0.4rem; height: 0.75rem;
  border-right: 2.5px solid var(--color-link); border-bottom: 2.5px solid var(--color-link); transform: rotate(45deg); }

/* ---------- Topic and search pages: news rows ---------- */
.row { position: relative; display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: var(--space-2); align-items: start;
  background: var(--color-card); border-radius: var(--radius); padding: var(--space-2); box-shadow: var(--shadow-box); }
.row__img { width: 100%; aspect-ratio: 529 / 300; object-fit: cover; border-radius: var(--radius); background: var(--color-page); }
.row__img--none { display: block; background: var(--color-tint); }
.row__title { overflow-wrap: anywhere; font-weight: 700; font-stretch: var(--stretch-head); font-size: var(--size-small-card); line-height: 1.15; text-wrap: pretty; }
.row__title a { color: var(--color-ink); text-decoration: none; }
.row__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }  /* whole row is the link */
.row:hover .row__title a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.row__intro { margin-top: 0.35rem; color: var(--color-ink-soft); font-size: 0.9375rem; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.row .meta a { position: relative; z-index: 1; }
.feed__items { display: contents; }  /* list wrapper; rows stay items of the feed grid */
.feed__empty { color: var(--color-ink-soft); }
.button--more[aria-busy="true"] { opacity: .6; pointer-events: none; }
mark { background: rgb(255 198 41 / .5); color: inherit; border-radius: 2px; }
:root[data-scheme="dark"] mark { background: var(--color-pro); color: var(--color-night); }


.search-page { display: grid; gap: var(--space-2); background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow-box);
  padding: var(--space-3); }
.search-page__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: var(--size-card); line-height: 1.1; }
.search--page { display: grid; gap: var(--space-2); }
/* Result count at the bottom of the search box, right above the results */
.search-count { padding-top: var(--space-2); border-top: 1px solid var(--color-rule); font-size: 1.0625rem; color: var(--color-ink-soft); }
.search-count strong { color: var(--color-ink); }
.search-page__filters { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.search-page__filters select { height: 2.75rem; font-size: 0.9375rem; }
.search-page__filters .field { flex: 1 1 9rem; }

/* Form fields on subpages */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
.form-grid + .form-grid { margin-top: var(--space-2); }
.field { display: grid; gap: 0.35rem; align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.field--wide { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 600; font-size: 0.9375rem; padding: 0; }
.field legend { margin-bottom: 0.5rem; }
.field__optional { font-weight: 400; color: var(--color-muted); }
.field__hint { font-size: var(--size-small); color: var(--color-muted); }
.form { display: grid; gap: var(--space-3); justify-items: start; }
.form > .form-grid { width: 100%; }
.check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9375rem; cursor: pointer; }
.check input, .choice input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.05rem 0 0; accent-color: var(--color-brand-deep); }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem var(--space-2); }
.form-done { display: grid; gap: 0.35rem; padding: var(--space-3); border-radius: 6px; background: var(--color-tint); }
.form-done__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.375rem; line-height: 1.15; }

/* ---------- Ajolinja page ---------- */
.mag-hero { background: var(--color-ajolinja); color: #fff; }
.mag-hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: var(--space-4); align-items: center; padding-block: var(--space-5); }
.mag-hero__text { display: grid; gap: var(--space-2); justify-items: start; }
.mag-hero__title { font-weight: 900; font-stretch: var(--stretch-head); font-size: clamp(3.25rem, 2rem + 5vw, 6rem); line-height: 0.9; letter-spacing: -0.02em; }
.mag-hero__claim { font-weight: 700; font-stretch: var(--stretch-head); font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem); line-height: 1.15; max-width: 28ch; text-wrap: balance; }
.mag-hero__lead { font-size: 1.0625rem; max-width: 52ch; }
.mag-hero__cover { width: 100%; border-radius: 2px; box-shadow: 0 28px 50px -18px rgb(0 0 0 / .6); }
.issue__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-1); }
.issue__list li { padding-top: var(--space-2); border-top: 3px solid var(--color-ajolinja); }
.issue__title { font-weight: 700; font-stretch: var(--stretch-head); font-size: 1.3125rem; line-height: 1.15; margin-bottom: 0.4rem; }
.issue__list p { color: var(--color-ink-soft); font-size: 0.9375rem; }
.archive__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.archive__list a { display: grid; gap: 0.45rem; color: var(--color-ink); text-decoration: none; font-weight: 700; }
.archive__list img, .archive__cover { width: 100%; aspect-ratio: 529 / 750; border-radius: 2px; }
.archive__list img { box-shadow: 0 8px 18px -10px rgb(19 32 43 / .5); }
.archive__cover { display: grid; place-items: center; background: var(--color-ad); color: var(--color-muted); font-size: var(--size-small); font-weight: 600; }
.archive__list a:hover .archive__no { text-decoration: underline; }

/* ---------- Subscription ---------- */
.order { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--space-3); align-items: start; }
.order__main { display: grid; gap: var(--space-3); }
.order__step { min-width: 0; margin: 0; border: 0; padding: var(--space-3); background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow-box); }
/* floated legend sits inside the box like a heading */
.order__legend { float: left; width: 100%; display: flex; align-items: center; gap: 0.65rem; margin-bottom: var(--space-3); padding: 0;
  font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.5rem; line-height: 1.1; }
.order__legend + * { clear: both; }
.order__num { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--color-brand-deep); color: #fff;
  font-size: 1rem; font-stretch: normal; }
.choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
.choice { display: flex; gap: 0.75rem; padding: var(--space-2); border: 2px solid var(--color-rule); border-radius: 6px; cursor: pointer; }
.choice:hover { border-color: var(--color-field-line); }
.choice:has(:checked) { border-color: var(--color-brand-deep); background: var(--color-tint); }
.choice__body { display: grid; gap: 0.35rem; justify-items: start; align-content: start; }
.choice__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.3125rem; line-height: 1.15; }
.choice__text { font-size: 0.9375rem; color: var(--color-ink-soft); }
.choice__price { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.order__text { color: var(--color-ink-soft); margin-bottom: var(--space-2); }
.order__summary { position: sticky; top: calc(64px + var(--space-2)); display: grid; gap: var(--space-2); padding: var(--space-3);
  background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow-box); }
.order__summary-title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.5rem; line-height: 1.1; }
.order__lines { margin: 0; }
.order__lines div { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0.65rem 0; border-top: 1px solid var(--color-rule); }
.order__lines dt { color: var(--color-muted); }
.order__lines dd { margin: 0; font-weight: 700; text-align: right; }
.order__submit { width: 100%; }
.order__login { font-size: 0.9375rem; color: var(--color-ink-soft); }
.done { justify-items: start; }

/* ---------- Advertisers (media card) ---------- */
.audience__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.audience__facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-1); margin: 0; }
.audience__facts div { padding: 0.75rem var(--space-2); border-radius: var(--radius); background: var(--color-page); }
.audience__facts dt { font-size: var(--size-small); color: var(--color-muted); }
.audience__facts dd { margin: 0; font-weight: 700; }
.slots__grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-top: var(--space-1); }
.slots__map { margin: 0; display: grid; gap: 0.5rem; }
.slots__map figcaption { font-size: var(--size-small); color: var(--color-muted); }
/* Schematic page with numbered ad slots, numbers match the table */
.pagemap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34%; gap: 6px;
  align-items: start; padding: 8px; border-radius: 6px; background: var(--color-page); box-shadow: inset 0 0 0 1px var(--color-rule); overflow: hidden; }
.pagemap__bar { grid-column: 1 / -1; height: 14px; border-radius: 2px; background: var(--color-brand); }
.pagemap__feed, .pagemap__side { display: grid; gap: 6px; align-content: start; }
.pagemap__card { height: 2.75rem; border-radius: 2px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); }
.pagemap__card--side { height: 2.5rem; }
.pagemap__slot, .slots__num { display: grid; place-items: center; background: var(--color-brand-deep); color: #fff; font-weight: 800; font-size: 0.8125rem; }
.pagemap__slot { border-radius: 2px; }
.pagemap__slot--banner { grid-column: 1 / -1; aspect-ratio: 5 / 1; }
.pagemap__slot--box { aspect-ratio: 6 / 5; }
.pagemap__slot--square { aspect-ratio: 1; }
.pagemap__slot--tall { aspect-ratio: 1 / 2; }
.pagemap__slot--popup { position: absolute; left: 14%; width: 44%; bottom: 7%; aspect-ratio: 6 / 5; outline: 2px dashed #fff; outline-offset: -5px;
  box-shadow: 0 0 0 999px rgb(19 32 43 / .25), 0 10px 20px -6px rgb(19 32 43 / .5); }
.slots__table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.slots__table th, .slots__table td { text-align: left; vertical-align: top; padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--color-rule); }
.slots__table thead th { padding-top: 0; font-size: 0.8125rem; font-weight: 600; color: var(--color-muted); }
.slots__table tbody th { font-weight: 700; }
.slots__table td:last-child { white-space: nowrap; }
.slots__num { display: inline-grid; width: 1.4rem; height: 1.4rem; margin-right: 0.4rem; border-radius: 50%; font-size: 0.75rem; vertical-align: 0.05em; }
.slots__where { display: block; margin-top: 0.15rem; font-size: 0.8125rem; font-weight: 400; color: var(--color-muted); }
.slots__table tbody th .slots__where { padding-left: 1.8rem; }
.contact-card { gap: 0.5rem; font-size: 0.9375rem; }
.contact-card p { color: var(--color-ink-soft); }
.contact-card__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.375rem; line-height: 1.1; }
.contact-card__name { font-weight: 700; color: var(--color-ink) !important; }

/* ---------- Contact ---------- */
.contacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.contact-form .form { max-width: 44rem; }

/* ---------- Ads ---------- */
/* Popup ad on page load: dimmed, blurred page behind */
.popup { width: min(600px, calc(100vw - 2rem)); border: 0; padding: 0; background: none; overflow: visible; }
.popup::backdrop { background: rgb(19 32 43 / .4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.popup[open] { animation: popup-in 260ms var(--ease-out, ease-out); }
.popup[open]::backdrop { animation: fade-in 260ms ease-out; }
@keyframes popup-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.popup__inner { display: grid; gap: 0.5rem; }
.popup__close { justify-self: end; display: inline-flex; align-items: center; gap: 0.35rem; height: 2.25rem; padding: 0 0.6rem 0 0.85rem;
  background: var(--color-card); color: var(--color-ink); border: 0; border-radius: 999px; font: 600 0.9375rem/1 var(--font); cursor: pointer;
  box-shadow: 0 4px 14px -4px rgb(19 32 43 / .4); }
.popup__close:hover { background: var(--color-tint); }
.popup__close:focus-visible { outline-color: #fff; }
.popup__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.ad--popup { aspect-ratio: 600 / 500; width: 100%; background: var(--color-ad); box-shadow: 0 24px 60px -12px rgb(19 32 43 / .5); }
.ad { position: relative; display: grid; place-content: center; text-align: center; gap: 0.2rem; background: var(--color-ad);
  border-radius: var(--radius); color: var(--color-muted); font-size: var(--size-small); }
.ad__label { position: absolute; top: 0.5rem; left: 0.6rem; font-size: 0.75rem; color: var(--color-muted); }
.ad__name { font-weight: 700; color: var(--color-ink-soft); font-size: 1rem; }
.ad--box { aspect-ratio: 600 / 500; width: 100%; }
.ad--tall { aspect-ratio: 300 / 600; }
.ad--square { aspect-ratio: 1; }
.ad--banner { aspect-ratio: 1000 / 200; width: 100%; margin-top: var(--space-2); }
/* Filled ad slot (site.js): the creative replaces the placeholder, "Mainos" sits above it */
.ad.is-filled { display: block; aspect-ratio: auto; background: none; text-align: left; }
.ad.is-filled .ad__label { position: static; display: block; margin-bottom: 0.25rem; }
.ad__link, .ad__link img { display: block; width: 100%; height: auto; }
.ad__link img { border-radius: var(--radius); }
.ad__link:focus-visible { outline-offset: 3px; }
.side .ad.is-filled { max-width: 300px; width: 100%; justify-self: center; }

.button--more { justify-self: center; margin-top: var(--space-1); }

/* ---------- Sidebar ---------- */
.side { display: grid; gap: var(--space-2); }
.side__box { background: var(--color-card); border-radius: var(--radius); padding: var(--space-2); box-shadow: var(--shadow-box); }
.side__title { font-weight: 800; font-stretch: var(--stretch-head); font-size: 1.5rem; line-height: 1.1; margin-bottom: var(--space-1); }
.most__list { counter-reset: most; }
.most__list li { counter-increment: most; display: grid; grid-template-columns: 1.35rem minmax(0, 1fr); gap: 0.6rem; align-items: start;
  padding: 0.65rem 0; }
.most__list li::before { content: counter(most); display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--color-brand-deep); color: #fff; font-weight: 700; font-size: 0.75rem; line-height: 1; }
.most__list a { color: var(--color-ink); text-decoration: none; font-weight: 700; font-stretch: var(--stretch-head); font-size: 1.125rem; line-height: 1.2; }
.most__list a:hover { text-decoration: underline; }
.latest__list li { padding: 0.65rem 0; }
.latest__list li:first-child { padding-top: 0; }
.latest__list li:last-child { padding-bottom: 0; }
.latest__title { display: block; color: var(--color-ink); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.3; }
.latest__title:hover { text-decoration: underline; }
.latest__list .meta { margin-top: 0.25rem; }
.newsletter p { font-size: 0.9375rem; color: var(--color-ink-soft); margin-bottom: var(--space-2); }
.newsletter label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.3rem; }
.newsletter input { width: 100%; margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-night); color: #D5DDE3; padding-block: var(--space-5) var(--space-3); font-size: 0.9375rem; }
.footer__offers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-5); }
.footer__offer { background: #1D2D3B; border-radius: 6px; padding: var(--space-3); display: grid; gap: 0.6rem; align-content: start; justify-items: start; }
.footer__offer--pro { position: relative; padding-left: calc(var(--space-3) + 0.9rem); }
.footer__offer-accent { position: absolute; left: 0.75rem; top: 0.75rem; bottom: 0.75rem; width: 5px;
  border-radius: 999px; background: var(--color-pro); }
.footer__offer-title { font-weight: 800; font-stretch: 88%; font-size: 1.375rem; line-height: 1.15; color: #fff; }
.footer__offer-title .pro { font-size: 0.875rem; vertical-align: 0.15em; margin-right: 0.35rem; }
.footer__offer label { font-weight: 600; color: #fff; }
.footer__newsletter-row { display: flex; gap: var(--space-1); width: 100%; }
.footer__newsletter-row input { flex: 1; min-width: 0; border-color: #fff; }
.footer__newsletter-row input:focus { box-shadow: 0 0 0 3px rgb(255 255 255 / .45); }
.footer__newsletter-row .button--brand { border-color: var(--color-brand-deep); }
.footer__offer .button--pro:hover { background: #fff; border-color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-4); }
.footer__logo { color: #fff; text-decoration: none; font-size: 1.75rem; display: inline-block; margin-bottom: var(--space-2); }
.site-footer p { max-width: 40ch; }
.site-footer nav a { display: inline-block; color: #fff; padding: 0.3rem 0; }
.footer__title { font-size: 1rem; color: #fff; margin-bottom: 0.4rem; }
.footer__copy { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid #33414D; max-width: none !important; font-size: var(--size-small); }
.site-footer :focus-visible { outline-color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .order { grid-template-columns: 1fr; }
  .order__summary { position: static; }
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-cols, .audience__grid { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .side .ad--tall { display: none; }
  .side .ad--square ~ .ad--square { display: none; }
  .side .ad--square { width: 100%; max-width: 300px; justify-self: center; }
}

@media (max-width: 1000px) {
  .tool__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (max-width: 860px) {
  .bar__service { display: none; }
  .tool--menu { display: inline-flex; }
  .panel[data-mode="menu"] .panel__service { display: block; padding-top: var(--space-2); border-top: 1px solid var(--color-rule); }
  .panel__service a { display: block; padding: 0.7rem 0; color: var(--color-ink); text-decoration: none; font-weight: 500; font-size: 1.0625rem; }
  .panel__service a:hover { color: var(--color-link); text-decoration: underline; }
}

@media (max-width: 760px) {
  .bar__inner { min-height: 56px; gap: var(--space-1); }
  .bar__logo .wordmark { font-size: 1.3125rem; }
  .bar__logo img { width: 32px; height: 32px; }
  .panel { max-height: calc(100dvh - 56px); overflow-y: auto; }
  .card { padding: 0.75rem; }
  .pair { grid-template-columns: 1fr; }
  .block__body { grid-template-columns: 1fr; }
  .magazine { grid-template-columns: 110px minmax(0, 1fr); }
  .ad--box { aspect-ratio: 300 / 250; }
  .popup { width: min(300px, calc(100vw - 2rem)); }
  .ad--popup { aspect-ratio: 300 / 250; }
  .side { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .footer__offers { grid-template-columns: 1fr; }
  .footer__newsletter-row { flex-direction: column; align-items: stretch; }
  .footer__newsletter-row input { flex: none; }  /* column direction: keep the field height */
  .page-head { padding: var(--space-3) var(--space-2); }
  .page-box, .search-page, .order__step, .order__summary { padding: var(--space-2); }
  .row { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.75rem; }
  .row__title { font-size: 1.1875rem; }
  .row__intro { -webkit-line-clamp: 3; font-size: 0.875rem; }
  .form-grid, .choices, .contacts, .issue__list, .slots__grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slots__map { max-width: 15rem; }
  .mag-hero__inner { grid-template-columns: minmax(0, 1fr) 6.5rem; gap: var(--space-2); align-items: start; padding-block: var(--space-4); }
  .mag-hero__text { display: contents; }
  .mag-hero__title { grid-column: 1; }
  .mag-hero__cover { grid-column: 2; grid-row: 1; }
  .mag-hero__claim, .mag-hero__lead, .mag-hero__actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .sub, .bar__service button::after { transition: none; }
  .popup[open], .popup[open]::backdrop { animation: none; }
}
