/* ============================================================
   Каркас "news-grid" — новостной портал (архетип №2).
   Реализован на ubs.mn; вариант от эталона yle.fi (кат.1):
   nav-underline, kicker-caps-gray, grid-3-photo-cards,
   lead-bold-sans, flat-scandi. Всё через токены; приёмы —
   блоками ниже (recipes).
   ============================================================ */

:root {
  --primary: #ad262d;
  --ink: #1a1a1a;
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --accent: #ad262d;
  --muted: #666666;
  --font-head: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --line: #e8e8e8;
  --radius: 3px;
  --gap: 22px;
  --max-w: 1200px;
}
:root {
  --primary: #2a5a8a; --ink: #2a2018; --bg: #fcfaf7;
  --bg-alt: #e5edf5; --accent: #2a5a8a; --muted: #7d6e5f;
  --line: #e5d9cf;
  --font-head: 'Georgia','Cambria',serif; --font-body: 'Segoe UI','Helvetica Neue',Arial,sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 18px; }

/* --- Шапка: лого + навигация рубрик (recipe: nav-underline-active) --- */
.masthead { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--line); }
.masthead__logo { height: 40px; width: auto; }
.topline { background: var(--ink); color: #fff; font-size: 12px; }
.topline .wrap { display: flex; justify-content: space-between; padding: 5px 18px; }
.topline a { color: #fff; margin-left: 14px; }
.topline .date { color: #ccc; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 18px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.nav a { color: var(--ink); font-weight: 700; font-size: 15px;
  padding: 4px 2px; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--primary);
  text-decoration: none; }

/* --- Lead-блок (recipe: lead-bold-sans) --- */
.lead { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--gap);
  padding: 26px 0 20px; border-bottom: 1px solid var(--line); }
.lead__media { aspect-ratio: 16/10; background: var(--bg-alt); overflow: hidden; }
.lead__media img { width: 100%; height: 100%; object-fit: cover; }
.lead h1 { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.01em;
  font-size: clamp(26px, 3.6vw, 42px); line-height: 1.15; margin: 10px 0 8px; }
.lead__side { display: flex; flex-direction: column; gap: 14px; }
.lead__side .mini { display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lead__side .mini img { aspect-ratio: 4/3; object-fit: cover; width: 96px; }
.lead__side .mini h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }

/* --- Киккер (recipe: kicker-caps-gray) --- */
.kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); }
.kicker--accent { color: var(--primary); }
.kicker time { font-weight: 400; color: var(--muted); }

/* --- Сетка карточек (recipe: grid-3-photo-cards, flat-scandi) --- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
  padding: var(--gap) 0; }
.card { background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: border-color .2s; }
.card:hover { border-color: var(--muted); }
.card__media { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-alt); }
.card__media img { width: 100%; height: 100%; object-fit: cover;
  transition: transform .25s; }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 12px 14px 14px; }
.card h2 { font-family: var(--font-head); font-size: 17px; font-weight: 700;
  line-height: 1.3; margin: 6px 0 4px; }
.card h2 a { color: var(--ink); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.card__excerpt { font-size: 14px; color: var(--muted); }

/* --- Заголовок секции (recipe: flat-scandi rule) --- */
.section-head { display: flex; align-items: center; gap: 10px;
  padding: 18px 0 0; }
.section-head h2 { font-family: var(--font-head); font-size: 20px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --- Статья --- */
.article { max-width: 720px; margin: 24px auto 40px; }
.article h1 { font-family: var(--font-head); font-weight: 800;
  letter-spacing: -0.012em; font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.15; margin: 12px 0 10px; }
.article__meta { display: flex; gap: 12px; align-items: center;
  font-size: 12.5px; color: var(--muted); padding-bottom: 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.article__meta .kicker--accent { font-size: 12.5px; }
.article figure { margin: 20px 0; }
.article figcaption { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.article p { margin-bottom: 16px; font-size: 17px; }
.article h2 { font-family: var(--font-head); font-size: 23px; font-weight: 800;
  margin: 30px 0 10px; }
.article__hero img { width: 100%; max-height: 480px; object-fit: cover; }
.lead__standfirst { font-size: 18px; color: var(--muted); }

/* --- Хлебные крошки / пагинация / футер --- */
.crumbs { font-size: 13px; color: var(--muted); padding: 12px 0 0; }
.crumbs a { color: var(--muted); }
.pagination { display: flex; gap: 8px; padding: 22px 0 40px; }
.pagination a, .pagination span { padding: 5px 11px; border: 1px solid var(--line); color: var(--ink); }
.pagination .cur { background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 700; }
.footer { border-top: 3px solid var(--primary); margin-top: 30px;
  background: var(--bg-alt); padding: 26px 0 40px; }
.footer__grid { display: flex; flex-wrap: wrap; gap: 14px 40px;
  justify-content: space-between; }
.footer nav { display: flex; flex-direction: column; gap: 6px; }
.footer nav a { color: var(--ink); font-size: 14px; }
.footer__copy { color: var(--muted); font-size: 13px; padding-top: 14px; }
.related { margin: 30px 0 8px; padding: 14px 16px; background: var(--bg-alt); }
.related ul { margin: 8px 0 0 18px; }
.related li { margin: 4px 0; }
.uus { display: inline-block; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  padding: 1px 6px; margin-right: 6px; }

@media (max-width: 900px) {
  .lead { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .nav { overflow-x: auto; }
}

/* ============================================================
   ПОРТАЛ-главная — структура из архива ubs.mn (2017):
   3-зонная шапка (топлайн/лого+слоган/меню-полоса), топ-баннер
   наездом, 2 колонки main+side-виджеты, рубрики-полосы по 4.
   ============================================================ */
.header-portal { border-bottom: 1px solid var(--line); }
.masthead-portal { display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 16px 0; }
.masthead-portal .masthead__logo { height: 48px; }
.masthead-mid { text-align: center; font-family: var(--font-head);
  font-size: 14px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); }
.masthead-right { display: flex; gap: 16px; justify-content: flex-end;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; }
.navbar { background: var(--primary); }
.navbar__in { display: flex; flex-wrap: wrap; gap: 2px; }
.navbar__in a { color: #fff; font-weight: 700; font-size: 14.5px;
  padding: 10px 14px 9px; }
.navbar__in a:hover, .navbar__in a[aria-current="page"] {
  background: rgba(0,0,0,.18); text-decoration: none; }

.hp-banner { position: relative; margin-top: 20px; background: var(--ink); }
.hp-banner__media { aspect-ratio: 21/9; max-height: 430px; overflow: hidden; }
.hp-banner__media img { width: 100%; height: 100%; object-fit: cover; opacity: .84; }
.hp-banner__ov { position: absolute; inset: auto 0 0 0; padding: 30px 26px 22px;
  background: linear-gradient(transparent, rgba(10,10,10,.88)); color: #fff; }
.hp-banner__ov h1 { font-family: var(--font-head); font-weight: 800;
  font-size: clamp(24px, 3.4vw, 40px); line-height: 1.15; margin: 6px 0; }
.hp-banner__ov h1 a { color: #fff; }
.hp-banner__ov h1 a:hover { text-decoration: none; color: var(--bg-alt); }
.hp-banner__ov p { max-width: 760px; color: #e8e8e8; font-size: 16px; }
.kicker--ov { color: rgba(255,255,255,.85); }

.hp-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px;
  padding: 24px 0 8px; }
.hp-feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px;
  padding-bottom: 18px; border-bottom: 2px solid var(--primary); }
.hp-feature__media { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-alt); }
.hp-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.hp-feature h2 { font-family: var(--font-head); font-size: 22px; font-weight: 800;
  line-height: 1.2; margin: 6px 0; }
.hp-feature h2 a { color: var(--ink); }
.hp-feature h2 a:hover { color: var(--accent); text-decoration: none; }
.hp-feature p { font-size: 15px; color: var(--muted); }
.hp-feed { list-style: none; display: flex; flex-direction: column; }
.hp-feed__row { border-bottom: 1px solid var(--line); }
.hp-feed__row a { display: grid; grid-template-columns: 110px 1fr; gap: 14px;
  align-items: center; padding: 12px 0; }
.hp-feed__thumb { width: 110px; aspect-ratio: 4/3; overflow: hidden;
  background: var(--bg-alt); }
.hp-feed__thumb img { width: 100%; height: 100%; object-fit: cover; }
.hp-feed__txt { display: flex; flex-direction: column; gap: 3px; }
.hp-feed__t { font-weight: 700; font-size: 16px; line-height: 1.3;
  color: var(--ink); }
.hp-feed__row:hover .hp-feed__t { color: var(--accent); }
.hp-all { display: inline-block; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: .06em; padding: 14px 0 4px; }

.hp-side { display: flex; flex-direction: column; gap: 22px; }
.widget { background: var(--bg-alt); border-top: 3px solid var(--primary);
  padding: 14px 16px 16px; }
.widget__title { font-family: var(--font-head); font-size: 15px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.w-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.w-list a { color: var(--ink); font-size: 14px; line-height: 1.35;
  font-weight: 600; }
.w-list a:hover { color: var(--accent); }
.w-list time { color: var(--muted); font-size: 12px; font-weight: 400;
  display: block; }
.w-num { display: grid; grid-template-columns: 24px 1fr; gap: 8px;
  align-items: start; }
.w-num .n { font-family: var(--font-head); font-weight: 800; font-size: 18px;
  color: var(--primary); }
.cnt { color: var(--muted); font-size: 12px; font-weight: 400; }

.strip { padding: 10px 0 6px; }
.strip-head { display: flex; align-items: baseline; gap: 12px; padding-top: 16px;
  border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.strip-head h2 { font-family: var(--font-head); font-size: 19px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; }
.strip-more { margin-left: auto; font-size: 13px; font-weight: 700; }
.strip__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  padding: 14px 0; }

@media (max-width: 1020px) {
  .hp-grid { grid-template-columns: 1fr; }
  .hp-side { flex-direction: row; flex-wrap: wrap; }
  .hp-side .widget { flex: 1 1 260px; }
  .strip__row { grid-template-columns: repeat(2, 1fr); }
  .masthead-mid { display: none; }
  .masthead-portal { grid-template-columns: auto 1fr; }
}
@media (max-width: 700px) {
  .hp-banner__media { aspect-ratio: 16/10; }
  .hp-feature { grid-template-columns: 1fr; }
  .hp-feed__row a { grid-template-columns: 84px 1fr; gap: 10px; }
  .hp-feed__thumb { width: 84px; }
  .strip__row { grid-template-columns: 1fr; }
  .hp-side { flex-direction: column; }
}

/* --- Лицо сети (КП2 18.10): featured-первая карточка стр.1 рубрики --- */
.card--featured { grid-column: span 2; }
.card--featured .card__media { aspect-ratio: 16/9; }
.card--featured h2 { font-size: 22px; }
@media (max-width: 700px) { .card--featured { grid-column: span 1; }
  .card--featured h2 { font-size: 17px; } }

/* --- HTML-карта сайта --- */
.sm-cat { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.sm-cat b { font-size: 16px; }
.sm-pages a { display: inline-block; min-width: 26px; text-align: center;
  padding: 2px 7px; margin: 0 3px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 13px; }
