/* Runtime class adapters. The reviewed Q2 newspaper theme is kept in classic.css verbatim. */
.main { min-height:60vh; padding-block:38px 80px; }
.home-opening { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr); gap:32px; }
.home-intro h1,.page-head h1 { font:400 clamp(38px,4.5vw,66px)/1.08 var(--serif); letter-spacing:-.045em; margin:12px 0 20px; }
.home-intro p,.hero-lead { max-width:66ch; font-size:18px; line-height:1.6; color:var(--ink-soft); }
.home-intro>a,.event-home-links a { display:inline-block; padding:10px 0; text-decoration:underline; text-underline-offset:4px; }
.event-home { width:100%; margin:0; padding:24px; background:var(--card); border:1px solid var(--line); }
.event-home h2 { font:400 30px/1.15 var(--serif); margin:12px 0; }
.event-home-links { display:flex; flex-wrap:wrap; gap:10px 24px; }
.home-section { margin-top:60px; }
.section-heading { gap:24px; padding-bottom:24px; border-bottom:1px solid var(--line); }
.section-heading p { max-width:65ch; color:var(--ink-soft); line-height:1.6; }
.section-heading>a { white-space:nowrap; }
.section-kicker { display:block; color:var(--accent-text); font-size:11px; letter-spacing:.1em; text-transform:uppercase; margin-bottom:12px; }
.plate-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:30px; }
.plate { min-width:0; }
.plate h3 { overflow-wrap:anywhere; }
.plate-label { margin-bottom:10px; }
.card-media figure { margin:0; }
.card-media img { width:100%; height:auto; display:block; }
.card-media figcaption { color:var(--ink-soft); font-size:11px; line-height:1.5; margin-top:8px; }
.plaque { display:inline-block; font-size:11px; color:var(--accent-text); margin-top:15px; }
.text-card .news-card__body { padding-top:0; }
.topic-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.topic-grid a { padding:24px; border:1px solid var(--line); background:var(--card); }
.topic-grid strong { display:block; font:400 27px/1.2 var(--serif); margin-bottom:15px; }
.topic-grid span { display:block; color:var(--ink-soft); line-height:1.6; }
.topic-grid b { display:block; color:var(--accent-text); margin-top:15px; }
.useful-links { display:flex; flex-wrap:wrap; gap:16px 26px; margin-top:40px; padding:22px 0; border-block:1px solid var(--line); font-size:13px; }
.page-head { margin-bottom:38px; }
.byline { display:flex; flex-wrap:wrap; gap:12px 24px; color:var(--ink-soft); font-size:12px; line-height:1.6; }
.article-head,.article-media,.facts { max-width:1000px; }
.article-media { margin-block:30px; }
.article-media figure { margin:0; }
.article-media img { max-width:100%; height:auto; }
.article-media figcaption { font-size:12px; line-height:1.6; color:var(--ink-soft); }
.article-body { font-family:var(--serif); }
.article-body h2,.article-end h2 { font:400 32px/1.2 var(--serif); margin-block:1.3em .6em; }
.article-body h3 { font:400 25px/1.3 var(--serif); }
.article-body a,.article-end a,.source-link,.update-notice a { text-decoration:underline; text-underline-offset:3px; }
.article-body img { max-width:100%; height:auto; }
.article-body table { display:block; overflow-x:auto; max-width:100%; }
.article-end { max-width:760px; margin-top:40px; padding-top:20px; border-top:2px solid var(--accent); line-height:1.7; }
.article-end li { margin-bottom:12px; }
.notice,.update-notice,.empty { max-width:760px; margin-block:24px; padding:18px 22px; background:var(--card); border-left:3px solid var(--accent); line-height:1.7; }
.facts { margin-block:25px; padding:22px; border:1px solid var(--line); }
.facts ul { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:20px; padding-left:20px; }
.facts strong { display:block; }
.inline-nav { display:flex; flex-wrap:wrap; gap:20px; }
.inline-nav a { padding:10px 0; text-decoration:underline; }
.event-row { display:grid; grid-template-columns:160px minmax(0,1fr); gap:26px; padding:26px 0; border-top:1px solid var(--line); line-height:1.7; }
.event-date { font-size:13px; color:var(--accent-text); font-weight:700; }
.event-row h3 { font:400 29px/1.2 var(--serif); margin:0 0 12px; }
.event-row p { margin:8px 0; }
.source-link { display:inline-block; margin-right:20px; font-size:12px; }
.archive-row { display:grid; grid-template-columns:130px minmax(0,1fr); gap:22px; padding:20px 0; border-top:1px solid var(--line); }
.archive-row span { font-size:13px; color:var(--ink-soft); }
.archive-row a { font:400 25px/1.3 var(--serif); }
.search-form { display:flex; max-width:700px; gap:10px; margin-block:25px; }
.search-form input { width:100%; min-width:0; padding:12px; background:var(--card); color:var(--ink); border:1px solid var(--line); font:inherit; }
.search-form button { padding:12px 24px; background:var(--ink); color:var(--paper); border:0; cursor:pointer; font:inherit; }
.correction { max-width:760px; border-top:1px solid var(--line); padding:20px 0; line-height:1.7; }
.map-panel { border:1px solid var(--line); padding:20px; margin-block:25px; }
.map-panel svg { display:block; width:100%; max-height:420px; }
.map-panel circle { fill:var(--ink); }
.map-panel text { fill:var(--paper); font:700 14px var(--sans); }
.map-panel a:hover circle,.map-panel a:focus circle { fill:var(--accent-text); }
.map-number { color:var(--accent-text); font-weight:700; }
.theme-toggle { display:inline-flex; min-width:44px; min-height:44px; align-items:center; justify-content:center; }
@media(max-width:1000px) { .plate-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:750px) {
  .home-opening,.topic-grid,.plate-grid { grid-template-columns:1fr; }
  .home-opening { gap:24px; }
  .main { padding-top:24px; }
  .home-section { margin-top:36px; }
  .event-row,.archive-row { grid-template-columns:1fr; gap:8px; }
  .section-heading { align-items:start; flex-wrap:wrap; }
  .theme-toggle { display:inline-flex; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } * { transition:none!important; } }

/* Reserve space for the theme control; let the editorial note wrap within its column. */
.brand-row { column-gap:20px; }
.brand-row > .brand { flex-shrink:0; }
.brand-row > .brand-note { flex:1 1 0; min-width:0; margin-left:16px; overflow-wrap:break-word; }
.brand-row > .theme-toggle { flex:0 0 44px; margin-left:auto; }
.brand-row > .nav-details { margin-left:0; }

/* Афиша: совместные фильтры (Сегодня / Выходные / Бесплатно / Район) поверх темы .filter-tabs.
   Район появляется только когда редакция подтвердила его у события. */
.event-filters { display:flex; flex-wrap:wrap; align-items:center; gap:12px 28px; margin-bottom:38px; padding:16px 22px; background:var(--card); border:1px solid var(--line); }
.event-filters__group { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.event-filters__label { font-size:10px; font-weight:800; letter-spacing:.15em; text-transform:uppercase; color:var(--ink-soft); }
.event-filters .filter-tabs { flex-wrap:wrap; }
.event-filters .filter-tabs button { padding:11px 16px; font-size:11px; }
.filter-tabs button[aria-pressed="true"] { border-color:var(--ink); background:var(--ink); color:var(--paper); }
.event-filters__reset { padding:0; border:0; background:none; color:var(--accent-text); font:inherit; font-size:11px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.event-filters__status { flex-basis:100%; margin:0; font-size:11px; color:var(--ink-soft); }
.event-row[hidden], .event-section[hidden] { display:none; }

/* Очередь 17.11: «Что изменилось» на главной, связанные материалы, подсказки поиска. */
.changed-list, .related-list { list-style:none; margin:0; padding:0; }
.changed-list { border-top:1px solid var(--line); }
.changed-list li { display:grid; grid-template-columns:190px minmax(0,1fr); gap:6px 26px; padding:20px 0; border-bottom:1px solid var(--line); }
.changed-meta { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--ink-soft); }
.changed-meta time { color:var(--accent-text); font-weight:700; }
.changed-meta span { text-transform:uppercase; letter-spacing:.08em; font-size:10px; }
.changed-list a { font:400 22px/1.25 var(--serif); text-decoration:none; }
.changed-list a:hover { text-decoration:underline; text-underline-offset:3px; }
.changed-list p { grid-column:2; margin:0; color:var(--ink-soft); line-height:1.6; }
.related-list li { display:grid; gap:6px; padding:14px 0; border-bottom:1px solid var(--line); }
.related-list a { font:400 22px/1.25 var(--serif); }
.related-list span { color:var(--ink-soft); line-height:1.6; }
.related-contacts { display:flex; flex-wrap:wrap; gap:8px 22px; margin-top:14px; font-size:13px; }
@media(max-width:750px) { .changed-list li { grid-template-columns:1fr; } .changed-list p { grid-column:1; } }

/* ─── Адаптивность: телефон и планшет (2026-11-18) ────────────────────────────────
   Замеры до правки (ops/design/2026-11-18-assessment/responsive-audit.json):
   минимальный текст 9px, медиана 12–17px, 12–50 тап-таргетов < 44px на страницу.
   Слой идёт после classic.css и меняет только размеры и зоны нажатия. */
:root { --sticky-offset: 0px; }

/* Пол WCAG 2.5.8 (AA, 24×24) действует на всех разрешениях и типах указателя:
   самостоятельные ссылки в абзаце («Подробно: …») и короткие строки-ссылки получают 24–25 px.
   Это 1–2 px разницы и не меняет вид; правила вынесены из медиа-блока по замечанию ревью —
   на широких разрешениях они тоже должны работать. */
p > a:only-child { display: inline-flex; align-items: center; min-height: 24px; }
p > a { padding-block: 1px; }

/* 1. Телефон: читаемый текст, компактная липкая шапка */
@media (max-width: 750px) {
  :root { --sticky-offset: 62px; }
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 17px; line-height: 1.6; }
  .hero-lead, .lead-story p, .article-body, .article-body p, .event-row p, .plate p, .notice,
  .event-details, .map-panel p, .news-card p, .text-card p, .service-card p, .people-card p,
  .brief-list p, .footer-inner p, .correction p { font-size: 16.5px; }
  /* ничего мельче 13px: 1em = размер родителя, поэтому крупные заголовки не задеваем */
  a, span, time, small, figcaption, button, summary, label, td, th { font-size: max(13px, 1em); }
  .media-credit, .dateline, .stamp, .brand__city { font-size: max(12.5px, 1em); }
  .plate h3, .event-row h3 { font-size: 21px; line-height: 1.2; }
  .section-heading h2, .dashboard-head h2 { font-size: 30px; }
  .lead-story h1, .page-head h1 { font-size: 33px; }
  img, svg, video, picture { max-width: 100%; height: auto; }
  .article-body, .event-row, .plate, .news-card, .text-card { overflow-wrap: break-word; }
  .site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); box-shadow: 0 1px 0 var(--line);
                 /* blur убран на телефоне: backdrop-filter делает шапку containing block
                    для position: fixed, из-за этого меню-оверлей схлопывалось внутрь шапки. */
                 backdrop-filter: none; }
  .brand-row { min-height: 62px; }
  .brand__main { font-size: 32px; }
  .brand-note { display: none; }
  .theme-toggle { display: inline-flex; }
  /* Открытое меню: базовый CSS намеренно отдаёт <details> целую строку под шапкой
     (`.brand-row .nav-details[open] { flex-basis: 100% }`). Так и оставляем — но панель
     получает предел высоты и собственную прокрутку, иначе 11 ссылок растягивали шапку
     до 1014 px, а нижние пункты были недостижимы (замер 360×640 и 390×844).
     Свои override'ы ширины/nowrap убраны: они ломали строку по горизонтали (раунд 3 ревью). */
  .nav-details .mobile-nav {
    /* 44 px — рамка, внутренние отступы панели и margin-top открытого <details>:
       без вычета шапка открытого меню выходила за экран на 44 px (замер). */
    max-height: calc(100dvh - var(--sticky-offset) - 44px); overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-details .mobile-nav a { display: flex; align-items: center; width: 100%;
                               min-height: 48px; padding-inline: 20px; }
  /* Возвращено после правки меню (патч случайно убрал эти правила — поймано проверкой). */
  html { scroll-padding-top: calc(var(--sticky-offset) + 14px); }
  [id], .event-row, .event-card, .map-event { scroll-margin-top: calc(var(--sticky-offset) + 14px); }
  .event-filters { gap: 6px; }
  .event-filters__group { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; }
  .event-filters__label { flex: 0 0 auto; }
  .event-filters .filter-tabs { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; min-width: 0;
                                padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .event-filters .filter-tabs > button { flex: 0 0 auto; }
}

/* 2. Телефон, планшет и любой палец: зоны нажатия ≥44px */
@media (max-width: 1024px), (pointer: coarse) {
  a, span, time, small, figcaption, summary { font-size: max(13px, 1em); }
  /* явный список: у этих классов собственный размер и более высокая специфичность */
  .eyebrow, .section-kicker, .plate-label, .story-meta, .plaque, .plate-index, .byline,
  .event-filters__label, .event-filters__status, .map-number, .read-more, .ticker__label,
  .section-heading > span, .section-heading > a, .source-link, .text-link, .media-credit,
  .dateline, .stamp, .meta, .kicker { font-size: 13px; }
  .brand__city, .brand--footer .brand__city { font-size: 12px; letter-spacing: .3em; }
  .event-date { font-size: 14px; }
  nav a, .main-nav a, .footer nav a, .footer-links a, .footer-bottom a, .ticker__items a,
  .inline-nav a, .archive-row a, .event-home-links a, .map-link a, .source-link, .article-end a,
  .changed-list a, .plate a, .news-card a, .text-card a, .service-card a, .brief-list a,
  .section-heading > a, .more, .page-head a, .hero a,
  .story-list a, .event-list a, li > a, summary {
    min-height: 44px; display: inline-flex; align-items: center;
  }
  .footer-links li, .footer nav a, .ticker__items li { min-height: 44px; display: flex; align-items: center; }
  button, .icon-button, .menu-toggle, .theme-toggle, .filter-tabs button, .event-filters button,
  .search-form button, .subscribe-form button { min-height: 44px; min-width: 44px; font-size: max(13px, 1em); }
  /* Пол AA (WCAG 2.5.8): любая нестрочная цель не ниже 24 px. У строчных ссылок внутри
     текста min-height не действует (display: inline) — им это и не нужно. */
  a, button, summary, select, label { min-height: 24px; }
  /* Ссылка одна в своём абзаце (например «Подробно: …») — это самостоятельная цель,
     а не строчная в тексте: даём ей рамку 24 px, не меняя вид строки. */
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .map-panel svg { touch-action: manipulation; }
  /* Зона нажатия метки: невидимая обводка расширяет цель, вид метки не меняется
     (прежний вариант r:11 уменьшал метку с r=15 — ошибка, отменена). */
  .map-panel a { pointer-events: all; }
  /* Проверено 18.11.2026: прозрачная обводка и `pointer-events: all` НЕ расширяют зону нажатия
     SVG в Chrome — фактические клики срабатывают только в центре метки (±4 px), и на production
     со старым CSS ровно так же. Это исходный дефект содержимого карты, а не этого слоя:
     зона нажатия задаётся геометрией SVG (circle r=15 при масштабе viewBox 800 → ~12 CSS px).
     Починка — в генераторе карты (невидимый круг-цель ≥24 px), отдельная задача; здесь не хак. */
  a, button, summary { touch-action: manipulation; }
}
