/* ==========================================================================
   Мой город в кадре — фотокарта мест
   Токены, шапка, сетки страниц, компоненты
   ========================================================================== */

/* --- Токены ------------------------------------------------------------ */
:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #f3f5f8;
    --surface-3: #e9edf3;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #7b8794;
    --line: #edf0f4;
    --line-2: #e3e7ed;
    --accent: #2563eb;
    --accent-soft: #e8f0fe;
    --dark: #101a2b;
    --dark-hover: #1e2a3d;
    --accent-hover: #1d4ed8;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 2px 10px rgba(16, 24, 40, .06);
    --shadow-lg: 0 8px 28px rgba(16, 24, 40, .10);
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;
    --r-xs: 8px;
    --header-h: 68px;
}

[data-theme="dark"] {
    --bg: #0a0f18;
    --surface: #131a25;
    --surface-2: #1a2230;
    --surface-3: #202a3a;
    --text: #e8edf4;
    --text-2: #aab6c6;
    --muted: #8493a6;
    --line: #232c3a;
    --line-2: #2c3746;
    --accent: #5b91f5;
    --accent-soft: #1c2b46;
    --dark: #313d52;
    --dark-hover: #3b4a63;
    --accent-hover: #4a83f2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 10px 32px rgba(0, 0, 0, .55);
}

/* --- Сброс ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

/* Годы над фотографиями — обычные якорные ссылки, прокрутка к ним делается браузером */
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* Классы с собственным display перебивают [hidden] из браузерных стилей */
[hidden] { display: none !important; }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

button {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

h1, h2, h3, h4, p, figure { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

.icon {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm { width: 14px; height: 14px; }

.icon--lg { width: 20px; height: 20px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Каркас страницы --------------------------------------------------- */
.page {
    min-height: 100%;
    padding: 18px;
}

.shell {
    max-width: 1560px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
}

/* --- Шапка ------------------------------------------------------------- */
.site-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex: none;
}

.brand__logo {
    width: 40px;
    height: 40px;
    flex: none;
    object-fit: contain;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.25; }

.brand__name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.brand__sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 1px;
}

/* Выбор города */
.city-picker {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
}

.city-picker__control {
    appearance: none;
    -webkit-appearance: none;
    height: 38px;
    padding: 0 32px 0 33px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.city-picker__control:hover { background: var(--surface-3); }

.city-picker__control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.city-picker__icon {
    position: absolute;
    left: 12px;
    color: var(--accent);
    pointer-events: none;
}

.city-picker__chevron {
    position: absolute;
    right: 11px;
    color: var(--muted);
    pointer-events: none;
}

.header-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 330px;
}

.header-search__field {
    width: 100%;
    height: 38px;
    padding: 0 38px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.header-search__field::placeholder { color: var(--muted); }

.header-search__field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.header-search__icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.header-search__submit {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--text-2);
}

.header-search__submit:hover { background: var(--surface-3); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
    height: 100%;
}

.main-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: 13.5px;
    color: var(--text-2);
    transition: color .15s;
}

.main-nav__link:hover { color: var(--text); }

.main-nav__link.is-active { color: var(--accent); font-weight: 600; }

.main-nav__link.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent);
}

/* --- Кнопки ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}

.btn--dark { background: var(--accent); color: #fff; }

.btn--dark:hover { background: var(--accent-hover); }

.btn--outline { border-color: var(--line-2); color: var(--text-2); }

.btn--outline:hover { background: var(--surface-2); color: var(--text); }

.btn--block { width: 100%; }

/* --- Типографика секций ------------------------------------------------ */
.label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* --- Хлебные крошки ---------------------------------------------------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--muted);
}

.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs__sep { opacity: .55; }

.breadcrumbs__current { color: var(--text-2); }

/* --- Карты: общее для главной, города и детальной ------------------------ */
.map-canvas { position: absolute; inset: 0; }

/* Справа, потому что слева у каждой карты переключатель «Карта / Спутник» */
.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-btn-group {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--r-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.map-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    background: var(--surface);
    color: var(--text-2);
    transition: background .15s, color .15s;
}

.map-btn:hover { background: var(--surface-2); color: var(--text); }

.map-btn + .map-btn { border-top: 1px solid var(--line); }

/* Маркеры на карте */
.pin {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #fff;
    background: var(--dark);
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .35);
    transition: background .15s;
}

.pin > .icon { transform: rotate(45deg); width: 13px; height: 13px; }

.pin:hover, .pin.is-active { background: var(--accent); }

/* ==========================================================================
   1. Главная страница
   ========================================================================== */

/*
 * Вступление и лента кадров стоят в ряд, остальное — во всю ширину.
 * Текст ограничен по ширине ради читаемости и в одиночку оставлял справа
 * пустую полосу во весь первый экран.
 */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 26px 30px;
    align-items: start;
}

.home-layout > * { min-width: 0; }

.home-layout__full { grid-column: 1 / -1; }

/* Отступы между блоками задаёт сетка, иначе ряд разъезжается по высоте */
.home-layout > .panel { margin-top: 0; }

/* В половине ширины пять колонок дают марки вместо фотографий */
.home-latest .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.hero { padding-bottom: 6px; }

.hero__lead {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
    max-width: 68ch;
    margin-top: 14px;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 34px;
    margin-top: 24px;
}

.stat { display: flex; align-items: center; gap: 10px; }

.stat__icon { color: var(--muted); }

.stat__body { display: flex; flex-direction: column; line-height: 1.25; }

.stat__value {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

.stat__label { font-size: 11.5px; color: var(--muted); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.city-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    transition: background .15s;
}

.city-card:hover { background: var(--surface-3); }

.city-card__name { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }

.city-card__region { font-size: 11.5px; color: var(--muted); }

.city-card__count { font-size: 11.5px; color: var(--muted); }

/* ==========================================================================
   Внутренние страницы
   ========================================================================== */
.content { padding: 22px 26px 30px; }

.page-head {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 14px;
}

.page-head__actions { margin-left: auto; display: flex; gap: 10px; }

.page-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.15;
}

.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--text-2);
}

.meta-row__item { display: flex; align-items: center; gap: 7px; }

.meta-row__item .icon { color: var(--muted); }

/* --- 2. Детальная страница места --------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.gallery { display: flex; flex-direction: column; gap: 10px; }

/* Слайдер */
.slider { position: relative; outline: none; }

.slider__viewport {
    overflow: hidden;
    border-radius: var(--r-md);
}

.slider:focus-visible .slider__viewport {
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.slider__track {
    display: flex;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.slide { flex: 0 0 100%; min-width: 0; }

.slide__img {
    width: 100%;
    aspect-ratio: 16 / 9.6;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

.slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    opacity: .9;
    transition: opacity .15s, background .15s;
}

.slider__nav:hover { opacity: 1; background: var(--surface-2); }

.slider__nav--prev { left: 12px; }

.slider__nav--next { right: 12px; }

.slider__counter {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(16, 26, 43, .72);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.gallery__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: -1px;
    font-size: 12.5px;
    color: var(--text-2);
}

.gallery__coords {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: 9px;
}

.gallery__item { display: flex; flex-direction: column; gap: 6px; }

.gallery__item-caption {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    color: var(--muted);
}

.gallery__thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid transparent;
    background: none;
}

.gallery__thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.gallery__thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.gallery__more {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    border-radius: var(--r-sm);
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 4px;
}

.gallery__more:hover { background: var(--accent-hover); }

/* Карта места */
.detail-map {
    position: relative;
    min-height: 330px;
    height: 100%;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-3);
}

.map-tabs {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 500;
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
}

.map-tab {
    height: 26px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    font-size: 12.5px;
    color: var(--text-2);
}

.map-tab.is-active { background: var(--surface-3); color: var(--text); font-weight: 600; }

/* Панели описания */
.panel { margin-top: 22px; }

.panel__title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

.panel__text { font-size: 13px; color: var(--text-2); line-height: 1.65; max-width: 62ch; }

.prop-list { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

.prop { display: flex; gap: 10px; font-size: 13px; }

.prop__key { color: var(--muted); min-width: 78px; }

.prop__value a:hover { color: var(--accent); }

/* Фотографии по датам */
.photos-section { margin-top: 30px; scroll-margin-top: 18px; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 20px;
}

.chip {
    height: 30px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--text-2);
    transition: background .15s, color .15s, border-color .15s;
}

.chip:hover { background: var(--surface-2); color: var(--text); }

.chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.photo-group + .photo-group { margin-top: 22px; }

/* Первая группа года — цель якоря, её заголовок не должен упираться в край */
.photo-group[id] { scroll-margin-top: 18px; }

.photo-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.photo-group__date { font-size: 13.5px; font-weight: 600; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 6px;
    background: var(--surface-3);
    font-size: 11px;
    color: var(--text-2);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 12px;
}

.photo {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.photo__caption {
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--muted);
}

/* В ленте архива название места в подписи ведёт на его страницу */
.photo__caption a { color: var(--text-2); font-weight: 600; }

.photo__caption a:hover { color: var(--accent); }

.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--r-sm);
    transition: transform .15s;
}

.photo-grid a:hover img { transform: scale(1.015); }

/* Модалка просмотра фотографий */
.lightbox {
    width: min(1120px, 92vw);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.lightbox::backdrop { background: rgba(8, 13, 22, .7); }

.lightbox__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 12px 11px 18px;
    border-bottom: 1px solid var(--line);
    -webkit-user-select: none;
    user-select: none;
}

.lightbox__title { font-size: 14px; font-weight: 700; }

.lightbox__title a:hover { color: var(--accent); }

.lightbox__counter {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.lightbox__close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text-2);
    transition: background .15s, color .15s;
}

.lightbox__close:hover { background: var(--surface-2); color: var(--text); }

.lightbox__stage {
    position: relative;
    background: var(--surface-3);
    -webkit-user-select: none;
    user-select: none;
}

.lightbox__img {
    width: 100%;
    max-height: min(68vh, 620px);
    object-fit: contain;
}

.lightbox__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--text-2);
}

/* --- 3. Список мест в городе -------------------------------------------- */
.view-switch {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: var(--surface-2);
    border-radius: var(--r-sm);
}

.view-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 13px;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    font-size: 12.5px;
    color: var(--text-2);
}

.view-switch__btn.is-active {
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.view-switch__btn:not(.is-active):hover { color: var(--text); }

/* Карта города и карта архива — на месте сетки карточек, поэтому тянутся по высоте экрана */
.city-map,
.photo-map {
    position: relative;
    height: calc(100vh - 260px);
    min-height: 420px;
    max-height: 720px;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-3);
}

/* Кнопки масштаба уходят вправо: слева на карте лежит переключатель подложки */
.map-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

.map-note a { color: var(--accent); }

.map-note a:hover { text-decoration: underline; }

/* Карточка места во всплывающем окне метки */
.leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content { margin: 0; width: auto !important; }

.leaflet-popup-tip { background: var(--surface); }

.map-popup { display: block; width: 190px; }

.map-popup__img { display: block; width: 100%; height: 104px; object-fit: cover; }

.map-popup__body { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 11px; }

.map-popup__title { font-size: 13px; font-weight: 600; line-height: 1.3; }

.map-popup__meta { font-size: 11.5px; color: var(--muted); }

.map-popup:hover .map-popup__title { color: var(--accent); }

.catalog-grid {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 22px;
    margin-top: 20px;
}

/* Фильтры */
.filters {
    align-self: start;
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filters__group { display: flex; flex-direction: column; gap: 7px; }

.field { position: relative; }

.field__control {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.field__control::placeholder { color: var(--muted); }

.field__control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field--search .field__control { padding-left: 34px; }

.field__icon {
    position: absolute;
    top: 50%;
    left: 11px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.field--select .field__control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background: var(--surface-2);
}

.field--select .field__chevron {
    position: absolute;
    top: 50%;
    right: 11px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.filters__reset {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    padding: 2px 0;
    border: 0;
    background: none;
    font-size: 12.5px;
    color: var(--accent);
}

.filters__reset:hover { text-decoration: underline; }

/* Карточки мест */
.places-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.places-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.place-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-2);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: background .18s;
}

.place-card:hover {
    background: var(--surface-3);
}

.place-card__media { position: relative; }

.place-card__img { width: 100%; aspect-ratio: 16 / 10.4; object-fit: cover; }

.place-card__count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(16, 26, 43, .78);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.place-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 13px 10px;
    flex: 1 1 auto;
}

.place-card__title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }

.place-card__cat { font-size: 11.5px; color: var(--muted); }

.place-card__addr { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 26px;
}

.pagination__item {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--text-2);
    transition: background .15s, color .15s;
}

.pagination__item:hover { background: var(--surface-2); color: var(--text); }

.pagination__item.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.pagination__gap { border-color: transparent; background: none; pointer-events: none; }

/* --- 4. Лента всего архива ----------------------------------------------- */
/* Подзаголовок ленты: сам по себе он прижат к заголовку, а снизу упирался в сетку */
.photo-feed__intro { margin-bottom: 18px; }

/* Ссылка на ленту под сеткой свежих кадров на главной */
/* Кнопки «Все фотографии» и «На карте» — в строку, на узком экране переносятся */
.home-latest__more { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Leaflet: подгонка под тему ----------------------------------------- */
.leaflet-container { background: var(--surface-3); font: inherit; }

.leaflet-control-attribution {
    background: rgba(255, 255, 255, .78);
    font-size: 10px;
    color: var(--muted);
}

[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92); }

[data-theme="dark"] .leaflet-control-attribution { background: rgba(19, 26, 37, .78); }

.map-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
    background-color: var(--surface-3);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 44px 44px, 44px 44px;
}

/* --- Адаптив ------------------------------------------------------------ */
@media (max-width: 1180px) {
    .cities-grid, .places-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* Уже этой ширины текст и лента рядом становятся тесными обоим */
    .home-layout { grid-template-columns: minmax(0, 1fr); }
    .home-latest .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .detail-map { min-height: 300px; }
    .places-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .cities-grid, .places-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page { padding: 10px; }
    .site-header { gap: 14px; padding: 0 14px; }
    .header-search { display: none; }
    .main-nav { gap: 16px; }
    .catalog-grid { grid-template-columns: minmax(0, 1fr); }
    .filters { position: static; }
    .content { padding: 16px 14px 22px; }
    .page-title { font-size: 24px; }
}

@media (max-width: 640px) {
    .cities-grid, .places-grid--4 { grid-template-columns: minmax(0, 1fr); }
    .home-latest .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .places-grid { grid-template-columns: minmax(0, 1fr); }
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-head { flex-direction: column; }
    .page-head__actions { margin-left: 0; }
    .main-nav { display: none; }
}

