/**
 * map-explore.css — карта достопримечательностей (/map/, /{country}/map/).
 * Токены наследуем из style.css: --accent, --ink, --muted, --line, --sand.
 */

/* ------------------------------------------------------------------ Герой */

.lmap-hero {
    background: linear-gradient(160deg, #1C1A17 0%, #2A2521 60%, #3A2A20 100%);
    color: #fff;
    padding: 56px 0 40px;
}
.lmap-hero__title {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    margin: 0;
    text-align: center;
}
.lmap-hero__sub {
    margin: 12px auto 0;
    max-width: 640px;
    text-align: center;
    color: #CDD6DE;
    font-size: 17px;
}

/* --------------------------------------------------------------- Фильтры */

.lmap-wrap { padding: 28px 0 56px; }

.lmap-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 18px;
}
.lmap-field { display: flex; flex-direction: column; gap: 6px; }
.lmap-field--search { margin-left: auto; }
.lmap-field__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted, #6E675C);
}
.lmap-select,
.lmap-input {
    font: inherit;
    padding: 9px 12px;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 10px;
    background: #fff;
    min-width: 220px;
}
.lmap-select:focus,
.lmap-input:focus { outline: 2px solid var(--accent, #C2410C); outline-offset: 1px; }

.lmap-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.lmap-chip {
    --chip: var(--muted, #6E675C);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 14px;
    padding: 7px 13px;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 999px;
    background: #fff;
    color: var(--ink, #1C1A17);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.lmap-chip:hover { border-color: var(--chip); }
.lmap-chip.is-on {
    border-color: var(--chip);
    background: color-mix(in srgb, var(--chip) 10%, #fff);
    font-weight: 600;
}

/* ----------------------------------------------------------- Карта + список */

.lmap-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
}

/* Своя зона наложения: панели Leaflet (z-index 200-700) иначе всплывают
   над липкой шапкой сайта — та же грабля, что на странице маршрута. */
.lmap {
    position: relative;
    z-index: 0;
    height: 620px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line, #E5E0D8);
}

/* Высота ЖЁСТКО равна карте. Без этого содержимое распирает панель, и она
   уезжает на сотню строк далеко ниже карты — ради чего и вводилась пагинация. */
.lmap-side {
    display: flex;
    flex-direction: column;
    height: 620px;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 14px;
    background: var(--sand, #FAF7F2);
    overflow: hidden;
}
.lmap-side__head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line, #E5E0D8);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lmap-side__hint { font-size: 12px; color: var(--muted, #6E675C); }

.lmap-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.lmap-list__item a,
.lmap-list__item button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.lmap-list__item a:hover,
.lmap-list__item button:hover { background: #fff; }
.lmap-list__ico {
    flex: 0 0 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 14px;
}
.lmap-list__name {
    font-size: 14px;
    line-height: 1.3;
    flex: 1;
    /* Длинные названия обрезаем: в колонке 320px перенос на три строки
       ломал ритм списка и возвращал ту же «портянку». */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lmap-list__go { color: var(--accent, #C2410C); font-weight: 700; flex: 0 0 auto; }

/* ------------------------------------------------------------ Пагинация */

.lmap-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--line, #E5E0D8);
    background: #fff;
}
.lmap-pg {
    font: inherit;
    font-size: 15px;
    line-height: 1;
    padding: 7px 13px;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.lmap-pg:hover:not(:disabled) { border-color: var(--accent, #C2410C); background: var(--sand, #FAF7F2); }
.lmap-pg:disabled { opacity: .35; cursor: default; }
.lmap-pg__info { font-size: 12px; color: var(--muted, #6E675C); white-space: nowrap; }

/* ------------------------------------------------------------- Маркеры */

.lmap-pinwrap { background: none; border: 0; }
.lmap-pin {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--muted, #6E675C);
    border-radius: 50%;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.lmap-pop { min-width: 190px; }
.lmap-pop__cat { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.lmap-pop__title { font-family: 'Lora', Georgia, serif; font-size: 16px; margin-bottom: 8px; }
.lmap-pop__link { font-size: 14px; color: var(--accent, #C2410C); font-weight: 600; text-decoration: none; }
.lmap-pop__link:hover { text-decoration: underline; }
.lmap-pop__note { font-size: 12px; color: var(--muted, #6E675C); }

.lmap-attr {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted, #6E675C);
    line-height: 1.5;
}
.lmap-attr a { color: inherit; }

/* ------------------------------------------------------------- Адаптив */

@media (max-width: 900px) {
    .lmap-layout { grid-template-columns: 1fr; }
    .lmap { height: 460px; }
    .lmap-side { height: auto; max-height: 420px; }
    .lmap-field--search { margin-left: 0; }
    .lmap-select, .lmap-input { min-width: 0; width: 100%; }
    .lmap-field--search { flex: 1 1 100%; }
}

/* ------------------------------------------- Страница одного места */

.lm-page__main { max-width: 780px; }

.lm-facts {
    list-style: none;
    margin: 0 0 24px;
    padding: 14px 18px;
    background: var(--sand, #FAF7F2);
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 12px;
    display: grid;
    gap: 8px;
}
.lm-facts li { display: flex; gap: 12px; font-size: 15px; }
.lm-facts__k { flex: 0 0 130px; color: var(--muted, #6E675C); }
.lm-facts__v { font-weight: 600; }

.lm-content { font-size: 17px; line-height: 1.7; }
.lm-content p { margin: 0 0 16px; }

.lm-minimap {
    position: relative;
    z-index: 0;
    height: 340px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line, #E5E0D8);
}

.lm-sources {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--line, #E5E0D8);
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted, #6E675C);
}
.lm-sources a { color: inherit; }

@media (max-width: 680px) {
    .lm-facts li { flex-direction: column; gap: 2px; }
    .lm-facts__k { flex: none; }
}

/* ------------------------------- Предложение мест пользователями */

.lmap-hint {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--sand, #FAF7F2);
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 10px;
    font-size: 14px;
    color: var(--ink, #1C1A17);
}

/* Контекстное меню позиционируется от документа (position:absolute + координаты
   с учётом скролла), поэтому не обрезается контейнером карты с overflow:hidden. */
.lmap-ctx {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(28, 26, 23, .18);
    padding: 4px;
}
.lmap-ctx button {
    font: inherit;
    font-size: 14px;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}
.lmap-ctx button:hover { background: var(--sand, #FAF7F2); }

.lmap-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(28, 26, 23, .55);
    display: grid;
    place-items: center;
    padding: 20px;
}
.lmap-modal[hidden] { display: none; }
.lmap-modal__box {
    position: relative;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.lmap-modal__x {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 26px;
    line-height: 1;
    border: 0;
    background: none;
    color: var(--muted, #6E675C);
    cursor: pointer;
}
.lmap-modal__title { font-family: 'Lora', Georgia, serif; font-size: 23px; margin: 0 0 4px; }
.lmap-modal__coords { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted, #6E675C); margin: 0 0 18px; }

.lmap-f { display: block; margin-bottom: 14px; }
.lmap-f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.lmap-f > span b { color: var(--accent, #C2410C); }
.lmap-f input, .lmap-f select, .lmap-f textarea {
    width: 100%;
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--line, #E5E0D8);
    border-radius: 9px;
    background: #fff;
}
.lmap-f textarea { resize: vertical; }
.lmap-f input:focus, .lmap-f select:focus, .lmap-f textarea:focus {
    outline: 2px solid var(--accent, #C2410C); outline-offset: 1px;
}

.lmap-modal__note { font-size: 12px; color: var(--muted, #6E675C); margin: 0 0 16px; }
.lmap-modal__actions { display: flex; gap: 10px; justify-content: flex-end; }
.lmap-btn {
    font: inherit; font-weight: 600; font-size: 15px;
    padding: 10px 20px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line, #E5E0D8); background: #fff;
}
.lmap-btn--go { background: var(--accent, #C2410C); border-color: var(--accent, #C2410C); color: #fff; }
.lmap-btn--go:disabled { opacity: .6; cursor: default; }
.lmap-btn--ghost:hover { background: var(--sand, #FAF7F2); }

.lmap-modal__msg { margin: 12px 0 0; font-size: 14px; min-height: 20px; }
.lmap-modal__msg.is-ok  { color: #15803D; }
.lmap-modal__msg.is-err { color: #B32D2E; }
