/* Бювети Києва — власні стилі сервісу.
 *
 * Токени теми (--paper, --ink, --accent, --line, --radius…) приходять із хрому.
 * Тут вони ТІЛЬКИ читаються. Перевизначати їх не можна навіть фолбеком:
 * `--paper: var(--paper, #faf7f0)` у :root стає недійсним за специфікацією і
 * знищує токен для всієї сторінки, включно з шапкою.
 *
 * Простір імен хрому — .drawer, #drawer, .nav, .quick, .dr-*, .site-foot —
 * зайнятий. Усе своє з префіксом bv-.
 *
 * z-index: свої шари двозначні. Усе, що вище 79, конкурує з шапкою й дровером.
 */

.bv-app { min-height: 100vh; }

.bv-main {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 0;
  align-items: stretch;
}

/* ---------------------------------------------------------------- */
/* Бічна колонка                                                     */
/* ---------------------------------------------------------------- */

.bv-side {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--chrome-h, 64px));
  overflow-y: auto;
  padding: 20px 20px 48px;
  border-right: 1px solid var(--line, #e6e1d8);
  background: var(--paper, #fff);
}

.bv-side-head { margin-bottom: 16px; }

.bv-title {
  font-family: Unbounded, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  margin: 0 0 10px;
}

.bv-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2, #4a4a4a);
}

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

.bv-controls { position: sticky; top: 0; z-index: 12; background: var(--paper, #fff); padding: 12px 0 8px; }

.bv-search {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line, #e6e1d8);
  border-radius: var(--radius, 12px);
  background: var(--paper-2, #faf8f4);
  color: inherit;
}
.bv-search:focus-visible { outline: 2px solid var(--accent, #1b7fc4); outline-offset: 1px; }

.bv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.bv-chip {
  padding: 7px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line, #e6e1d8);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.bv-chip:hover { border-color: var(--accent, #1b7fc4); }
.bv-chip.is-on { background: var(--accent, #1b7fc4); border-color: var(--accent, #1b7fc4); color: #fff; }
.bv-chip-reset { margin-inline-start: auto; opacity: .75; }

/* `display: grid` перебиває вбудований [hidden] { display: none } — без цього
   рядка поповер районів відкритий з першого кадру. */
.bv-pop[hidden] { display: none; }

.bv-pop {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line, #e6e1d8);
  border-radius: var(--radius, 12px);
  background: var(--paper-2, #faf8f4);
  display: grid;
  gap: 2px;
}
.bv-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.bv-pop-item:hover { background: rgba(0, 0, 0, .04); }
.bv-pop-n { margin-inline-start: auto; opacity: .6; font-variant-numeric: tabular-nums; }

.bv-sortrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.bv-sort-label { opacity: .7; }
.bv-sort { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--line, #e6e1d8); border-radius: 8px; background: transparent; color: inherit; }
.bv-count { margin-inline-start: auto; opacity: .7; font-variant-numeric: tabular-nums; }

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

.bv-list { display: grid; gap: 2px; margin-top: 8px; }

.bv-item {
  padding: 12px 12px 11px;
  border-radius: var(--radius, 12px);
  cursor: pointer;
  border: 1px solid transparent;
}
.bv-item:hover { background: var(--paper-2, #faf8f4); border-color: var(--line, #e6e1d8); }
.bv-item:focus-visible { outline: 2px solid var(--accent, #1b7fc4); outline-offset: 1px; }

.bv-item-addr { margin: 0 0 3px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.bv-item-meta { margin: 0; font-size: 13px; color: var(--ink-2, #666); }
.bv-dist { color: var(--accent, #1b7fc4); font-variant-numeric: tabular-nums; }
.bv-item-badges { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }

.bv-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .01em; }
.bv-badge-gen { background: rgba(27, 127, 196, .12); color: #14618f; }
.bv-badge-off { background: rgba(179, 38, 30, .12); color: #b3261e; }
.bv-badge-readers { background: rgba(212, 148, 0, .16); color: #8a6100; }

.bv-empty { padding: 24px 12px; color: var(--ink-2, #666); font-size: 15px; }
.bv-link { font: inherit; color: var(--accent, #1b7fc4); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.bv-muted { color: var(--ink-2, #777); }

/* ---------------------------------------------------------------- */
/* SEO-блок під списком                                              */
/* ---------------------------------------------------------------- */

.bv-seo { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line, #e6e1d8); }
.bv-seo-h { font-family: Unbounded, system-ui, sans-serif; font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.bv-nav-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 4px; }
.bv-nav-item { font-size: 14px; }
.bv-nav-item a { color: inherit; }
.bv-nav-cur { font-weight: 700; opacity: .6; }

.bv-faq-item { border-bottom: 1px solid var(--line, #e6e1d8); padding: 10px 0; font-size: 14px; }
.bv-faq-item summary { cursor: pointer; font-weight: 600; }
.bv-faq-item p { margin: 8px 0 0; line-height: 1.55; color: var(--ink-2, #555); }

.bv-source { margin-top: 20px; font-size: 13px; color: var(--ink-2, #777); }

/* ---------------------------------------------------------------- */
/* Мапа                                                              */
/* ---------------------------------------------------------------- */

.bv-map-wrap {
  position: relative;
  /* Leaflet створює власний стековий контекст із трицифровими z-index.
     Без ізоляції його елементи керування перекривають дровер хрому. */
  isolation: isolate;
}

.bv-map { position: sticky; top: 0; height: calc(100vh - var(--chrome-h, 64px)); width: 100%; }

.bv-locate {
  width: 34px; height: 34px;
  font-size: 18px; line-height: 1;
  background: #fff; border: 2px solid rgba(0, 0, 0, .2); border-radius: 4px;
  cursor: pointer;
}

.bv-tabs { display: none; }

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

.bv-card {
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line, #e6e1d8);
  border-radius: 16px;
  background: var(--paper, #fff);
  color: inherit;
}
.bv-card::backdrop { background: rgba(0, 0, 0, .45); }

.bv-card-close-form { float: inline-end; }
.bv-card-close { font-size: 24px; line-height: 1; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; }
.bv-card-addr { font-family: Unbounded, system-ui, sans-serif; font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.bv-card-sub { margin: 0 0 16px; font-size: 14px; color: var(--ink-2, #666); }

.bv-card-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; font-size: 14px; }
.bv-card-facts dt { color: var(--ink-2, #777); }
.bv-card-facts dd { margin: 0; font-weight: 600; }
.bv-card-asof { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2, #888); }

.bv-card-analysis, .bv-card-route { margin: 0 0 8px; font-size: 14px; }

.bv-report { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line, #e6e1d8); }
.bv-report-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.bv-report-kinds { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; margin-bottom: 10px; }
.bv-report-comment { width: 100%; padding: 9px 12px; font: inherit; font-size: 14px; border: 1px solid var(--line, #e6e1d8); border-radius: 10px; background: var(--paper-2, #faf8f4); color: inherit; }
.bv-report-send { margin-top: 10px; padding: 9px 18px; font: inherit; font-size: 14px; font-weight: 700; border: 0; border-radius: 999px; background: var(--accent, #1b7fc4); color: #fff; cursor: pointer; }
.bv-report-send:disabled { opacity: .6; cursor: default; }
.bv-report-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-2, #666); min-height: 1em; }

/* Honeypot: видиме лише роботу, який читає розмітку, а не малює її. */
.bv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------------------------------------------------------------- */
/* Мобільний                                                         */
/* ---------------------------------------------------------------- */

@media (max-width: 860px) {
  .bv-main { grid-template-columns: 1fr; }
  .bv-side { max-height: none; overflow: visible; border-right: 0; padding: 16px 16px 90px; }

  /* Карта й список міняються місцями табами, а не показуються обидва:
     на 360px екрані половина висоти під карту робить нечитабельним і те, і те. */
  .bv-map-wrap { position: fixed; inset: 0; top: var(--chrome-h, 64px); display: none; z-index: 14; }
  body.bv-show-map .bv-map-wrap { display: block; }
  body.bv-show-map .bv-side { display: none; }
  .bv-map { height: 100%; position: static; }

  .bv-tabs {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 16;
    border-top: 1px solid var(--line, #e6e1d8);
    background: var(--paper, #fff);
  }
  .bv-tab {
    flex: 1;
    padding: 13px 0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
  }
  .bv-tab.is-on { color: var(--accent, #1b7fc4); box-shadow: inset 0 2px 0 var(--accent, #1b7fc4); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

.bv-doc { max-width: 680px; margin: 0 auto; padding: 32px 20px 64px; }
.bv-doc .bv-lead { font-size: 16px; }
.bv-doc-back { margin: 20px 0 0; font-size: 14px; }
.bv-doc .bv-seo { margin-top: 24px; }

/* Лічильник на вузькому екрані переносився під селект і ламав рядок. */
@media (max-width: 860px) {
  .bv-sortrow { flex-wrap: wrap; }
  .bv-count { margin-inline-start: 0; flex-basis: 100%; }
}
