/* ============================================================
   Секция «Где играем» — карта площадок (2GIS / DG 2.0)
   ============================================================ */
.s-map { position: relative; }

.s-map__layout {
	display: grid;
	grid-template-columns: minmax(240px, 320px) 1fr;
	gap: clamp(16px, 2.5vw, 28px);
	margin-top: clamp(28px, 5vw, 44px);
}

/* ---------- Список площадок ---------- */
.s-map__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
	align-content: start;
}
.s-map__venue {
	width: 100%;
	display: grid;
	gap: 2px;
	padding: 14px 16px;
	text-align: left;
	/* Без рамок (правка аудита): отделяем заливкой, активную площадку отмечает полоса слева */
	background: #171a37;
	border: 0;
	box-shadow: inset 2px 0 0 transparent;
	border-radius: var(--r-card);
	color: var(--c-grey-light);
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.s-map__venue:hover { background: rgba(255, 255, 255, 0.06); }
.s-map__venue.is-active {
	background: rgba(109, 92, 255, 0.16);
	box-shadow: inset 2px 0 0 #6d5cff;
}
.s-map__venue-name {
	font-family: var(--font-head);
	font-size: var(--fs-h4);
	font-weight: 700;
	color: var(--c-white);
}
.s-map__venue-addr { font-size: var(--fs-caption); }
.s-map__venue-metro { font-size: var(--fs-m-text); color: var(--c-grey-dark); }
.s-map__venue-metro::before { content: '\2009м. '; }

/* ---------- Полотно карты ---------- */
.s-map__canvas {
	position: relative;
	/* Обязательно: Leaflet раскладывает свои слои по z-index 200–700. Без
	   собственного контекста наложения они всплывают в корневой и перекрывают
	   шапку (z-index: 50) — мобильное меню уезжает под карту. */
	z-index: 0;
	border-radius: var(--r-card);
	overflow: hidden;
	background: var(--surface-card-2);
	min-height: 420px;
}
.s-map__map { width: 100%; height: 100%; min-height: 420px; }

.s-map__fallback {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	margin: 0;
	text-align: center;
	padding: 20px;
	pointer-events: none;
}

/* Тайлы 2GIS отдаются только светлыми, своей тёмной темы у DG 2.0 нет —
   перекрашиваем подложку фильтром. Фильтр только на слое тайлов: метки и
   попапы лежат в других слоях Leaflet и остаются в своих цветах. */
/* Синий подмес держим внутри фильтра самих тайлов, а не отдельным оверлеем:
   оверлей пришлось бы класть выше слоя карты, и он приглушал бы заодно метки
   и попапы. sepia даёт цветовой налёт, второй hue-rotate уводит его в синий. */
.s-map__map .leaflet-tile-pane {
	filter: invert(1) hue-rotate(185deg) brightness(0.78) contrast(0.92)
		saturate(0.4) sepia(0.4) hue-rotate(185deg);
}

/* ---------- Попап под стиль сайта ---------- */
.s-map__map .leaflet-popup-content-wrapper {
	background: var(--surface-card);
	color: var(--c-grey-light);
	border: 1px solid var(--surface-line);
	border-radius: var(--r-card);
	box-shadow: 0 18px 48px rgba(7, 8, 21, 0.55);
}
.s-map__map .leaflet-popup-tip { background: var(--surface-card); }
.s-map__map .leaflet-popup-content { margin: 12px 14px; min-width: 180px; }
/* display:block явно — инлайновые span'ы иначе слипаются в одну строку,
   стили DG перебивают grid у контейнера попапа */
.s-map__pop-name,
.s-map__pop-addr,
.s-map__pop-metro { display: block; }
.s-map__pop-name {
	font-family: var(--font-head);
	font-size: var(--fs-h4);
	color: var(--c-white);
	margin-bottom: 2px;
}
.s-map__pop-addr { font-size: var(--fs-caption); }
.s-map__pop-metro { font-size: var(--fs-m-text); color: var(--c-grey-dark); }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
	.s-map__layout { grid-template-columns: 1fr; }
	/* Карта первой: на телефоне сразу видно, где играем */
	.s-map__canvas { order: -1; min-height: 320px; }
	.s-map__map { min-height: 320px; }
	/* Площадки — горизонтальной лентой, чтобы не растягивать экран */
	.s-map__list {
		grid-auto-flow: column;
		grid-auto-columns: 78%;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		padding-bottom: 4px;
	}
	.s-map__list::-webkit-scrollbar { display: none; }
	.s-map__venue { scroll-snap-align: start; height: 100%; }
}
