/* ==========================================================================
   Твій формат — каркас: шапка, меню, сітки сторінок, підвал
   ========================================================================== */

/* ---------- Логотип ---------- */

.logo { display: inline-flex; align-items: baseline; gap: 7px; }
.logo__a { font-weight: 800; font-size: 27px; letter-spacing: -0.03em; }
.logo__b { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 29px; letter-spacing: -0.01em; }
.logo__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.logo--small .logo__a { font-size: 22px; }
.logo--small .logo__b { font-size: 24px; }

/* ---------- Шапка ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header__top { display: flex; align-items: center; gap: 12px 24px; padding-block: 20px; }
.site-header__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.today { margin-right: 8px; font-size: 13px; color: var(--ink-3); }

/* Пошук у шапці */
.header-search { flex: 0 1 380px; margin-inline: auto; display: flex; align-items: center; height: 40px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); }
.header-search:focus-within { border-color: var(--ink); background: var(--bg); }
.header-search input { flex: 1; min-width: 0; height: 100%; padding: 0 4px 0 18px; border: 0; background: transparent; color: var(--ink); font: 400 14.5px var(--sans); outline: none; }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search button { display: flex; align-items: center; justify-content: center; width: 44px; height: 100%; border: 0; background: transparent; color: var(--ink-2); }
.header-search button:hover { color: var(--ink); }
.header-search + .site-header__tools { margin-left: 0; }

/* Вибір міста */
.city { position: relative; }
.city[open] > summary { border-color: var(--ink); }
.city__list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 200px; padding: 6px; border: 1px solid var(--line); background: var(--bg);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.12);
}
.city__list a { display: block; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.city__list a:hover { background: var(--bg-soft); }

/* Рубрики */
.site-nav { background: var(--nav-bg); color: var(--nav-ink); }
.site-nav__inner { display: flex; flex-wrap: wrap; gap: 0 28px; }
.site-nav a { padding: 13px 0; font-size: 14.5px; font-weight: 600; color: var(--nav-ink-2); white-space: nowrap; }
.site-nav a:hover { color: var(--nav-ink); }
.site-nav a.is-active { color: var(--nav-ink); box-shadow: inset 0 -3px 0 var(--accent); }
.site-nav :focus-visible { outline-color: var(--nav-ink); }
.site-header { border-bottom: 0; }

/* ---------- Рядок «Терміново» ---------- */

.breaking { background: var(--alert-bg); color: var(--alert-ink); }
.breaking__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 40px; padding-block: 8px; font-size: 14.5px; line-height: 1.3; }
.breaking__label {
  display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 1px 10px 0; border-radius: 4px;
  background: var(--alert-ink); color: var(--alert-bg);
  font-size: 11.5px; font-weight: 800; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* Крапка в мітці м’яко пульсує, щоб рядок притягував погляд */
/* Великі літери зорово стоять трохи вище середини рядка, тому крапку піднімаємо до їхнього центру */
.breaking__label .dot { position: relative; top: -1px; flex: none; background: var(--alert-bg); animation: breaking-pulse 1.6s ease-in-out infinite; }
@keyframes breaking-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .breaking__label .dot { animation: none; } }
.breaking__title { font-weight: 600; }
.breaking__inner:hover .breaking__title { text-decoration: underline; text-underline-offset: 3px; }
.breaking :focus-visible, a.breaking__inner:focus-visible { outline-color: var(--alert-ink); }
.breaking time { margin-left: auto; font-size: 13px; line-height: 1; color: var(--alert-ink); opacity: 0.85; font-variant-numeric: tabular-nums; }

/* ---------- Сітки ---------- */

/* Головна новина + стрічка */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; padding-top: 16px; align-items: start; }

/* Вміст + бічна колонка */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
.with-sidebar--article { gap: 44px; padding-top: 28px; }
.sidebar { display: flex; flex-direction: column; gap: 28px; min-width: 0; height: 100%; }
.sticky { position: sticky; top: 16px; }

/* Ряд карток */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 32px; }
.tiles--ruled { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }

/* Блок міста: велика новина + список */
.city-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

.section { margin-top: 56px; }
.section__title { font-family: var(--serif); font-weight: 700; font-size: 30px; letter-spacing: -0.01em; }

/* Заголовок блоку з лінією знизу */
.block-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--ink);
}
.block-head--thin { border-bottom-width: 1px; border-bottom-color: var(--line); }
.block-head--section { justify-content: flex-start; padding-bottom: 16px; margin-bottom: 28px; }
.block-head--section .more { margin-left: auto; }
.block-head--plain { border: 0; padding-bottom: 0; margin-bottom: 28px; }

/* Темна смуга (відео) */
.band { margin-top: 64px; padding-block: 52px 56px; background: var(--band); color: var(--band-ink); }
.band .more, .band .meta, .band .label { color: var(--band-ink-2); }
.band .ph { background: var(--band-ph); }

/* ---------- Підвал ---------- */

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); }
main:has(> .band:last-child) + .site-footer { margin-top: 0; border-top: 0; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 36px 64px; padding-block: 44px 28px; }
.site-footer__about { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__about p { max-width: 320px; font-size: 14px; color: var(--ink-2); }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.site-footer nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom { padding-block: 18px 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

/* ---------- Середні екрани ---------- */

@media (max-width: 1040px) {
  .lead-grid, .with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar { height: auto; }
  .sticky { position: static; }
}

/* ---------- Телефон ---------- */

@media (max-width: 760px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

  .site-header { position: sticky; top: 0; z-index: 35; }
  .site-header__top { gap: 4px; padding-block: 6px; padding-inline: 6px 12px; }
  .logo__a { font-size: 21px; }
  .logo__b { font-size: 23px; }
  .logo__dot { width: 6px; height: 6px; }
  .city > summary span { display: none; }
  .city > summary { padding: 0 10px; }

  /* Рубрики прокручуються вбік */
  .site-nav__inner { flex-wrap: nowrap; gap: 8px; padding-block: 10px; overflow-x: auto; scrollbar-width: none; }
  .site-nav__inner::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 6px 14px; border: 1px solid var(--nav-line); border-radius: 999px; font-size: 13.5px; }
  .site-nav a.is-active { background: var(--nav-ink); border-color: var(--nav-ink); color: var(--nav-bg); box-shadow: none; }

  /* Відкрите меню: усі рубрики списком на весь екран */
  .site-nav.is-open { position: fixed; inset: 57px 0 0 0; z-index: 34; overflow-y: auto; background: var(--nav-bg); padding-bottom: 90px; }
  .site-nav.is-open .site-nav__inner { flex-direction: column; gap: 0; padding-block: 8px; overflow: visible; }
  .site-nav.is-open a { padding: 15px 0; border: 0; border-bottom: 1px solid var(--nav-line); border-radius: 0; font-size: 17px; color: var(--nav-ink); }
  .site-nav.is-open a.is-active { background: transparent; color: var(--nav-ink); box-shadow: inset 4px 0 0 var(--accent); padding-left: 14px; }

  /* Нижня панель навігації */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid !important; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line); background: var(--bg);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    height: 60px; border: 0; background: transparent;
    font-size: 11px; font-weight: 600; color: var(--ink-3);
  }

  .breaking time { margin-left: 0; }
  .lead-grid { gap: 28px; padding-top: 0; }
  .with-sidebar--article { padding-top: 16px; gap: 36px; }
  .tiles { gap: 24px; }
  .tiles--ruled { margin-top: 32px; padding-top: 24px; }
  .city-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section { margin-top: 40px; }
  .section__title { font-size: 24px; }
  .block-head--section { margin-bottom: 20px; }
  .block-head--section .more { margin-left: 0; }
  .band { margin-top: 40px; padding-block: 36px 40px; }
  .site-footer { margin-top: 40px; }
}
