/* Башҡорт иле. Прототип, версия 2.
   Иерархия: служебная панель → логотип/поиск/язык/поддержка → 6 рубрик + «Ещё» → главный материал
   (текст слева, визуал справа) + лента → легенда режимов → Сегодня → Завтра → программа/рассылка/поддержка.
   Карточки без картинок. Двуязычие через [lang]. */
:root {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --fg: #13211B;
  --muted: #4A5A52;
  --line: #D3DBD6;
  --today: #1C7A4A;
  --today-soft: #E3F2EA;
  --tomorrow: #1F5FA8;
  --tomorrow-soft: #E2ECF8;
  --gold: #B8890F;
  --font-display: "PT Serif", Georgia, "Times New Roman", serif;
  --font-body: "PT Sans", "Segoe UI", Arial, sans-serif;
  --radius: 4px;
  --maxw: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1613; --surface: #172019; --fg: #ECF1EE; --muted: #A3B2AA; --line: #2A3630;
    --today: #4CC187; --today-soft: #163327; --tomorrow: #6FA8E8; --tomorrow-soft: #16283E;
    --gold: #E8BE45; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1613; --surface: #172019; --fg: #ECF1EE; --muted: #A3B2AA; --line: #2A3630;
  --today: #4CC187; --today-soft: #163327; --tomorrow: #6FA8E8; --tomorrow-soft: #16283E;
  --gold: #E8BE45; color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; line-height: 1.15; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* двуязычие */
html[data-lang="ru"] [lang="ba"] { display: none !important; }
html[data-lang="ba"] [lang="ru"] { display: none !important; }
/* фильтр режимов */
html[data-mode="today"] [data-mode="tomorrow"] { display: none !important; }
html[data-mode="tomorrow"] [data-mode="today"] { display: none !important; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #13211B; padding: 8px 14px; z-index: 50; font-weight: 700; }
.skip:focus { left: 16px; }

/* служебная панель */
.topbar { background: var(--fg); color: var(--bg); font-size: 13px; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding-block: 6px; }
.topbar .note { opacity: .75; }
.topbar .spacer { flex: 1; }

/* шапка */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { width: 36px; height: 36px; flex: none; }
.logo .name { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -.01em; line-height: 1; }
.logo .tag { display: block; font-family: var(--font-body); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.masthead .spacer { flex: 1; }
.search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 12px; background: var(--bg); }
.search input { border: 0; background: none; font: inherit; color: inherit; width: 150px; min-width: 0; }
.search input:focus { outline: none; }
.search button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.search button:hover { background: var(--line); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); min-height: 36px; }
.lang button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.support { background: var(--gold); color: #13211B; padding: 8px 14px; border-radius: 999px; font-weight: 700; min-height: 36px; display: inline-flex; align-items: center; }
.support:hover { text-decoration: none; filter: brightness(1.06); }
.menu-btn { display: none; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; }

/* рубрики */
.nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.nav .wrap { display: flex; gap: 2px; align-items: stretch; }
.nav a, .nav summary { padding: 11px 12px; font-size: 15px; font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; display: block; }
.nav a:hover { text-decoration: none; border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--tomorrow); }
.nav .more { margin-left: auto; position: relative; }
.nav summary { cursor: pointer; list-style: none; color: var(--muted); }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: " ▾"; }
.nav .more[open] summary { color: var(--fg); }
.nav .more-list { position: absolute; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 220px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 6; }
.nav .more-list a { font-weight: 400; border: 0; padding: 8px 10px; border-radius: var(--radius); }
.nav .more-list a:hover { background: var(--bg); }

/* метки режима и жанра */
.kicker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.mode { font-weight: 700; padding: 2px 8px; border-radius: 2px; color: #fff; }
.mode.today { background: var(--today); }
.mode.tomorrow { background: var(--tomorrow); }
.genre { font-weight: 700; color: var(--fg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 2px; background: var(--surface); }
.rubric { color: var(--muted); }
.kicker .dot::before { content: "·"; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); }
.meta b { color: var(--fg); font-weight: 700; }

/* главный материал + лента */
.hero { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 32px; padding-block: 24px 20px; }
.lead { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-content: start; }
.lead-text { display: grid; gap: 14px; align-content: start; }
.lead h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; }
.lead .dek { font-size: 18px; line-height: 1.45; max-width: 60ch; }
.lead-visual { display: grid; align-content: space-between; gap: 10px; background: var(--tomorrow); color: #fff; padding: 20px; border-radius: var(--radius); min-height: 240px; position: relative; overflow: hidden; }
.lead-visual svg { position: absolute; right: -14%; bottom: -24%; width: 70%; height: auto; opacity: .22; }
.lead-visual .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; position: relative; }
.lead-visual .big { font-family: var(--font-display); font-size: 72px; line-height: 1; font-variant-numeric: tabular-nums; position: relative; }
.lead-visual .big small { font-size: 28px; }
.lead-visual .cap { font-size: 14px; line-height: 1.35; position: relative; }
.lead-visual .src { font-size: 11px; opacity: .8; position: relative; }

.feed { border-left: 1px solid var(--line); padding-left: 24px; display: grid; gap: 0; align-content: start; min-width: 0; }
.feed h2 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.feed h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--today); box-shadow: 0 0 0 3px var(--today-soft); }
.feed li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding-block: 8px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.35; }
.feed time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding-top: 2px; }
.feed .genre { font-size: 10px; margin-right: 6px; vertical-align: 2px; }
.more { font-size: 14px; font-weight: 700; color: var(--today); }
.feed .more { padding-block: 10px 16px; }
.feed .figure-box { border-top: 3px solid var(--today); padding-top: 10px; display: grid; gap: 4px; }
.feed .figure-box .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.figure { font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--today); font-variant-numeric: tabular-nums; }
.figure small { font-size: 20px; }

/* легенда режимов */
.modes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-block: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.modes .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 4px; }
.modes button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--surface); min-height: 34px; }
.modes button[aria-pressed="true"] { border-color: currentColor; }
.modes button.today { color: var(--today); }
.modes button.tomorrow { color: var(--tomorrow); }
.modes button.all[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.modes .hint { color: var(--muted); margin-left: auto; }

/* полосы и карточки */
.band { padding-block: 28px; border-top: 1px solid var(--line); }
.band:first-of-type { border-top: 0; }
.band-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.band-head h2 { font-size: 26px; }
.band-head .sub { color: var(--muted); font-size: 14px; }
.band-head .all { margin-left: auto; font-size: 14px; font-weight: 700; }
.band.today .band-head h2, .band.today .band-head .all { color: var(--today); }
.band.tomorrow .band-head h2, .band.tomorrow .band-head .all { color: var(--tomorrow); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { display: grid; gap: 10px; align-content: start; min-width: 0; border-top: 3px solid var(--line); padding-top: 12px; }
.card[data-mode="today"] { border-top-color: var(--today); }
.card[data-mode="tomorrow"] { border-top-color: var(--tomorrow); }
.card h3 { font-size: 21px; font-weight: 700; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card .dek { font-size: 15px; color: var(--muted); line-height: 1.4; }
.card.wide { grid-column: span 2; }
.card.wide h3 { font-size: 27px; }
.card.wide .dek { font-size: 16px; }

.scenario-note { display: flex; gap: 10px; align-items: flex-start; background: var(--tomorrow-soft); border-left: 3px solid var(--tomorrow); padding: 10px 12px; font-size: 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.scenario-note b { color: var(--tomorrow); }

/* нижние панели */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; align-content: start; }
.panel .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel h3 { font-size: 22px; }
.video { aspect-ratio: 16/9; max-width: 100%; border-radius: var(--radius); position: relative; overflow: hidden; background: linear-gradient(135deg, var(--tomorrow-soft), var(--tomorrow)); display: block; }
.video svg { position: absolute; right: -8%; bottom: -18%; width: 60%; height: auto; opacity: .3; }
.video::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 18px; padding-left: 4px; }
.host { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--today)); flex: none; }
form.sub { display: grid; gap: 8px; }
form.sub input { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit; min-width: 0; }
form.sub button { padding: 10px 12px; background: var(--fg); color: var(--bg); border-radius: var(--radius); font-weight: 700; min-height: 40px; }
form.sub .ok { font-size: 13px; color: var(--today); }

/* подвал */
.footer { border-top: 3px solid var(--fg); margin-top: 32px; background: var(--surface); }
.footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-block: 28px 36px; font-size: 14px; }
.footer h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.footer ul { display: grid; gap: 6px; }
.footer .about { color: var(--muted); max-width: 46ch; }

/* страница материала */
.article { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 40px; padding-block: 20px 40px; }
.article-head { display: grid; gap: 16px; padding-bottom: 20px; }
.crumbs { font-size: 13px; color: var(--muted); }
.article h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 700; }
.article .dek { font-size: 20px; line-height: 1.45; max-width: 62ch; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 10px; }
.byline .author { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; }
.byline .avatar { width: 28px; height: 28px; }
.byline .share { margin-left: auto; display: flex; gap: 10px; }
.byline .share button { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; min-height: 32px; }
.art { aspect-ratio: 16/9; max-width: 100%; border-radius: var(--radius); position: relative; overflow: hidden; background: var(--line); }
.art.tomorrow { background: linear-gradient(135deg, var(--tomorrow-soft), var(--tomorrow)); }
.art svg { position: absolute; right: -8%; bottom: -18%; width: 60%; height: auto; opacity: .35; }
.art .cap { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: #fff; opacity: .85; letter-spacing: .06em; text-transform: uppercase; }
.body { display: grid; gap: 18px; max-width: 66ch; font-size: 18px; line-height: 1.6; }
.body h2 { font-size: 26px; margin-top: 14px; }
.body h2 .num { color: var(--tomorrow); font-family: var(--font-body); font-size: 14px; letter-spacing: .08em; display: block; margin-bottom: 4px; }
.body .quote { font-family: var(--font-display); font-size: 24px; line-height: 1.35; border-left: 3px solid var(--gold); padding-left: 18px; margin-block: 8px; }
.body .quote cite { display: block; font-family: var(--font-body); font-size: 14px; color: var(--muted); font-style: normal; margin-top: 8px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 16px; display: grid; gap: 6px; }
.callout .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.callout.today { border-left: 4px solid var(--today); }
.compare { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
.compare .row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.compare .row > div { padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.compare .row > div:last-child { border-right: 0; }
.compare .row:last-child > div { border-bottom: 0; }
.compare .row.head > div { background: var(--surface); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.compare .row > div:first-child { color: var(--muted); }
.compare-wrap { overflow-x: auto; }
.sources { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.sources ol { margin: 6px 0 0; padding-left: 18px; list-style: decimal; display: grid; gap: 4px; }
.ba-note { background: var(--surface); border: 1px dashed var(--line); padding: 14px 16px; border-radius: var(--radius); font-size: 15px; color: var(--muted); }
.aside { display: grid; gap: 22px; align-content: start; min-width: 0; }
.aside .panel h3 { font-size: 18px; }
.related { display: grid; gap: 12px; }
.related a { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; line-height: 1.3; }
.related a:first-child { border-top: 0; padding-top: 0; }

/* планшет и телефон */
@media (max-width: 1000px) {
  .lead { grid-template-columns: 1fr; }
  .lead-visual { min-height: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .feed { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .feed li:nth-child(n+4) { display: none; }
  .trio { grid-template-columns: 1fr; }
  .article { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  .modes .hint { margin-left: 0; flex-basis: 100%; }
  /* меню */
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; }
  .nav { position: static; }
  .nav .wrap { display: none; flex-direction: column; padding-block: 6px; }
  .nav.open .wrap { display: flex; }
  .nav a, .nav summary { border-bottom: 0; border-left: 3px solid transparent; padding: 10px 12px; }
  .nav a[aria-current="page"] { border-left-color: var(--tomorrow); }
  .nav .more { margin-left: 0; }
  .nav .more-list { position: static; border: 0; box-shadow: none; padding: 0 0 0 12px; }
  .masthead .search { order: 5; flex-basis: 100%; }
  .masthead .search input { width: 100%; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .card.wide h3 { font-size: 21px; }
  .footer .wrap { grid-template-columns: 1fr; }
  .logo .name { font-size: 24px; }
  .lead h1 { font-size: 26px; }
  .lead .dek { font-size: 16px; }
  .lead-visual .big { font-size: 56px; }
  .meta .long { display: none; }
  .compare .row { grid-template-columns: 1fr; }
  .compare .row.head { display: none; }
  .compare .row > div { border-right: 0; }
  .compare .row > div:first-child { font-weight: 700; color: var(--fg); background: var(--surface); }
  .topbar .channels { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
