/*
 * Укриття Києва — власні стилі сервісу.
 *
 * Два правила, успадковані від бюветів і тут так само обовʼязкові:
 *
 *  1. Токени теми (--paper, --ink, --accent, --line) ТІЛЬКИ ЧИТАЮТЬСЯ.
 *     Запис `--paper: var(--paper, #fff)` у :root знищив би токен, який
 *     приїжджає бандлом хрому, і сервіс поїхав би з кольорами за замовчуванням.
 *  2. Простір імен хрому (.nav, .quick, .drawer, .dr-*, .site-foot) не
 *     займаємо. Усе своє має префікс `nz-`, а власні z-index двозначні.
 */

.nz-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Каркас                                                            */
/* ---------------------------------------------------------------- */

.nz-main {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 0;
  min-height: 60vh;
}

.nz-side {
  padding: 18px 20px 40px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  background: var(--paper, #faf7f0);
  color: var(--ink, #17171a);
}

.nz-map {
  min-height: 420px;
  height: calc(100vh - 120px);
  position: sticky;
  top: 0;
  background: #e8e6e1;
}

/* Мобільний: карта згори, текст під нею. 44px тап-цілі, 16px бічні поля. */
@media (max-width: 860px) {
  .nz-main { grid-template-columns: 1fr; }
  .nz-map { height: 52vh; min-height: 300px; position: static; order: -1; }
  .nz-side { max-height: none; padding: 16px 16px 32px; }
}

.nz-doc .nz-main { grid-template-columns: 1fr; }
.nz-doc .nz-side { max-height: none; }

h1 {
  font-family: Unbounded, system-ui, sans-serif;
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.15;
  margin: 0 0 12px;
}

.nz-lead p { margin: 0 0 14px; font-size: 1rem; line-height: 1.55; }

/* ---------------------------------------------------------------- */
/* Керування                                                         */
/* ---------------------------------------------------------------- */

.nz-controls { margin: 0 0 14px; }

.nz-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line, #d9d4c9);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
}
.nz-search input:focus-visible { outline: 2px solid var(--accent, #f2c14e); outline-offset: 1px; }

.nz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }

.nz-chip {
  /* 44px — нижня межа тап-цілі. Менше робити не можна навіть заради щільності:
     на цю саму граблю вже наступали в мобільній приймалці. */
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line, #d9d4c9);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
  color: inherit;
}
.nz-chip.is-on {
  background: var(--accent, #f2c14e);
  border-color: var(--accent, #f2c14e);
  font-weight: 700;
}
.nz-chip:focus-visible { outline: 2px solid var(--ink, #17171a); outline-offset: 2px; }

.nz-count { margin: 6px 0 0; font-size: .9rem; opacity: .75; }

/* ---------------------------------------------------------------- */
/* Список                                                            */
/* ---------------------------------------------------------------- */

.nz-list { list-style: none; margin: 14px 0 0; padding: 0; }

.nz-item {
  /* Головна причина: районна сторінка несе до 600 карток. Урок про LCP довгих
     статей — 777 елементів дали 3,3 с render delay. content-visibility знімає
     з головного потоку все, що поза екраном. */
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line, #e6e1d6);
  cursor: pointer;
}
.nz-item:hover { background: rgba(0, 0, 0, .03); }
.nz-item-name { flex: 1 1 100%; font-weight: 600; }
.nz-item-meta { flex: 1 1 100%; font-size: .85rem; opacity: .7; }
.nz-item-dist { font-size: .85rem; font-variant-numeric: tabular-nums; opacity: .8; }

.nz-badge {
  font-size: .72rem;
  line-height: 1.6;
  padding: 0 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.nz-badge-always { background: #e7f3e7; border-color: #bcd9bc; }
.nz-badge-gen    { background: #fdf3d6; border-color: #e6cf8a; }
.nz-badge-net    { background: #e6eefb; border-color: #b6c9e8; }
.nz-badge-ramp   { background: #eee9f7; border-color: #c9bde4; }

.nz-empty { padding: 18px 2px; opacity: .8; }

/* ---------------------------------------------------------------- */
/* SEO-блоки                                                         */
/* ---------------------------------------------------------------- */

.nz-seo { margin-top: 26px; }
.nz-block { margin: 0 0 22px; }
.nz-block h2, .nz-block h3 {
  font-family: Unbounded, system-ui, sans-serif;
  font-size: 1.02rem;
  margin: 0 0 8px;
}
.nz-block p { margin: 0 0 8px; line-height: 1.55; }
.nz-block ul { margin: 0; padding-left: 18px; line-height: 1.6; }

.nz-dist { list-style: none; padding: 0; }
.nz-dist li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.nz-dist-name { flex: 1 1 auto; }
.nz-dist-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.nz-dist-pct { opacity: .6; font-size: .85rem; min-width: 3.4em; text-align: right; }

.nz-sublist, .nz-streets { columns: 2; column-gap: 20px; font-size: .92rem; }
@media (max-width: 560px) { .nz-sublist, .nz-streets { columns: 1; } }
.nz-more { font-size: .88rem; opacity: .7; }

.nz-faq-item { border-bottom: 1px solid var(--line, #e6e1d6); padding: 8px 0; }
.nz-faq-item summary { cursor: pointer; font-weight: 600; min-height: 32px; }

.nz-districts { list-style: none; padding: 0; columns: 2; column-gap: 20px; }
@media (max-width: 560px) { .nz-districts { columns: 1; } }
.nz-districts li { padding: 3px 0; }
.nz-districts .is-current { font-weight: 700; }

.nz-source { font-size: .85rem; opacity: .7; margin-top: 18px; }

/* ---------------------------------------------------------------- */
/* Картка                                                            */
/* ---------------------------------------------------------------- */

.nz-card {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 32px);
  color: var(--ink, #17171a);
  background: var(--paper, #fff);
}
.nz-card::backdrop { background: rgba(0, 0, 0, .45); }
.nz-card-body { padding: 20px; }
.nz-card h2 { font-family: Unbounded, system-ui, sans-serif; font-size: 1.1rem; margin: 0 0 10px; }
.nz-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 12px 0 0; }
.nz-card dt { opacity: .65; font-size: .88rem; }
.nz-card dd { margin: 0; }
.nz-card-close {
  position: absolute; top: 10px; right: 10px;
  min-width: 44px; min-height: 44px;
  border: none; background: transparent; font-size: 1.4rem; cursor: pointer; color: inherit;
}

/* Кластер: підпис числом замість плями з тисяч точок. */
.nz-cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 14, 15, .82);
  color: #fff;
  font: 700 12px/1 Manrope, system-ui, sans-serif;
  border: 2px solid rgba(255, 255, 255, .85);
}
.nz-cluster-sm { width: 30px; height: 30px; }
.nz-cluster-md { width: 38px; height: 38px; font-size: 13px; }
.nz-cluster-lg { width: 46px; height: 46px; font-size: 14px; }

/* Поповер вибору району. z-index двозначний: хром лишається зверху. */
/* `[hidden]` і `.nz-pop` мають однакову вагу, тож без цього рядка виграє те,
   що нижче в файлі, і прихований поповер лишався видимим смужкою над списком. */
.nz-pop[hidden] { display: none; }

.nz-pop {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 6px;
  border: 1px solid var(--line, #d9d4c9);
  border-radius: 12px;
  background: #fff;
  max-height: 320px;
  overflow-y: auto;
  position: relative;
  z-index: 40;
}
.nz-pop-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.nz-pop-item:hover { background: rgba(0, 0, 0, .05); }
.nz-pop-item.is-on { background: var(--accent, #f2c14e); font-weight: 700; }
.nz-pop-num { font-variant-numeric: tabular-nums; opacity: .7; }

/* ---------------------------------------------------------------- */
/* Текстова сторінка                                                 */
/* ---------------------------------------------------------------- */

/*
 * Ширина рядка. Без обмеження `/about/` розтягувалась на всю ширину вікна
 * (1360px на десктопі) — технічно коректна верстка, яку неможливо читати.
 * 72ch — та сама межа, що й у статтях теми.
 */
.nz-doc .nz-side { max-width: 72ch; margin: 0 auto; padding: 24px 20px 48px; }
.nz-doc .nz-seo { margin-top: 20px; }
.nz-doc .nz-districts { columns: 1; }

/* Посилання в SEO-блоках мають бути схожі на посилання: у хромі теми вони
   успадковують колір тексту й лишались візуально нерозрізненними. */
.nz-seo a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.nz-seo a:hover { text-decoration-thickness: 2px; }
