:root {
  --bg: #0c0a08;
  --bg-2: #14110e;
  --bg-3: #1c1814;
  --sand: #e8d5b5;
  --sand-dim: #a89478;
  --gold: #d4a04a;
  --gold-2: #f0c674;
  --terracotta: #c45c26;
  --line: rgba(232, 213, 181, 0.12);
  --text: #f3ead9;
  --muted: #9a8b76;
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--gold-2);
  text-decoration: none;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(196, 92, 38, 0.18), transparent 55%),
    radial-gradient(800px 400px at 10% 0%, rgba(212, 160, 74, 0.12), transparent 50%),
    linear-gradient(180deg, #120e0b 0%, var(--bg) 40%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(12, 10, 8, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.logo svg {
  display: block;
}

nav a {
  color: var(--sand-dim);
  font-size: 14px;
  margin-left: 22px;
}

nav a:hover {
  color: var(--sand);
}

.hero {
  padding: 88px 0 56px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0 0 16px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
}

h1 {
  font-size: clamp(42px, 7vw, 76px);
  margin: 0 0 18px;
}

.lead {
  font-size: 18px;
  color: var(--sand-dim);
  max-width: 52ch;
}

.stats {
  display: flex;
  gap: 28px;
  margin-top: 32px;
}

.stat b {
  display: block;
  font-family: var(--display);
  font-size: 34px;
  color: var(--gold-2);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  min-height: 360px;
}

.zig {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 280px;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

.zig .tier {
  margin: 0 auto;
  background: linear-gradient(180deg, #3a2c22, #221910);
  border: 1px solid rgba(232, 181, 106, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12);
}

.zig .t1 { width: 92%; height: 54px; }
.zig .t2 { width: 72%; height: 48px; }
.zig .t3 { width: 52%; height: 42px; }
.zig .t4 { width: 32%; height: 36px; }
.zig .cap {
  width: 18%;
  height: 28px;
  background: linear-gradient(180deg, #d4a04a, #8a5a22);
}

.section {
  padding: 28px 0 72px;
}

.section h2 {
  font-size: clamp(32px, 4vw, 46px);
  margin: 0 0 10px;
}

.section-head p {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 32px;
}

.types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.type-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.type-card:hover,
.type-card.active {
  transform: translateY(-3px);
  border-color: rgba(212, 160, 74, 0.45);
}

.type-card .mini {
  height: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 14px;
}

/* Мини-витрина с реальными фото на карточке-входе «Сохранились до наших дней» */
.type-card .mini.photos {
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  overflow: hidden;
}

.type-card .mini.photos img {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.mini-zig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 120px;
  /* цвет приходит из данных через CSSOM (см. paintMini в js/app.js);
     этот дефолт — только страховка до/без раскраски */
  color: #d4a04a;
}

.mini-zig i {
  display: block;
  height: 10px;
  background: currentColor;
  opacity: 0.85;
  border-radius: 1px;
}

.type-card h3 {
  margin: 0 0 6px;
  font-size: 26px;
}

.type-card .sub {
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 10px;
}

.type-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--sand-dim);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.filter {
  background: transparent;
  color: var(--sand);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
}

.filter.active,
.filter:hover {
  border-color: var(--gold);
  color: var(--gold-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-photo {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-photo.fallback {
  display: grid;
  place-items: end center;
  padding-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(196, 92, 38, 0.25), transparent 50%),
    repeating-linear-gradient(90deg, #1a1510 0 12px, #15110d 12px 24px);
}

.card-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 24px;
}

.card .where {
  color: var(--muted);
  font-size: 13px;
}

.card p {
  margin: 0;
  color: var(--sand-dim);
  font-size: 14px;
}

.map-box {
  height: 540px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
  background: #e9e3d4;
}

.map-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.compare {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--gold);
  font-weight: 600;
  background: var(--bg-2);
}

td {
  color: var(--sand-dim);
}

.note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .types,
  .grid {
    grid-template-columns: 1fr;
  }

  nav {
    display: none;
  }

  .hero-visual {
    min-height: 260px;
  }
}

/* Ссылки на страницы памятников */
.card .more {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

.card .more:hover {
  text-decoration: underline;
}

/* Кликабельные метки под картой */
.map-pins {
  margin-top: 14px;
}

.map-pins-cap {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.map-pinrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px 6px 7px;
  font-size: 13.5px;
  color: var(--sand);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  max-width: 100%;
}

.pin-link:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  transform: translateY(-1px);
}

.pin-num {
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #221604;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

/* Нумерованные пины на Leaflet-карте */
.num-pin-wrap {
  background: transparent;
  border: none;
}

.num-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pin, #d4a04a);
  color: #221604;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a140c;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.num-pin:hover {
  transform: scale(1.18);
}

/* Leaflet: тёмная тема */
#leaflet-map {
  height: 100%;
  width: 100%;
}

.leaflet-container {
  font-family: var(--font);
  background: var(--bg-2);
}

/* Тёмная схема OSM-подложки (как в исходной версии) */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(1.05) saturate(0.35);
}

.leaflet-control-zoom a {
  background: #1c1814;
  color: var(--sand);
  border-color: var(--line);
}

.leaflet-control-zoom a:hover {
  background: #26201a;
}

.leaflet-tooltip {
  background: #1c1814;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.leaflet-tooltip-top:before {
  border-top-color: var(--line);
}

/* Русские подписи городов-ориентиров */
.leaflet-tooltip.city-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #efe3c8;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  padding: 1px 3px;
  pointer-events: none;
  opacity: 1;
}

.leaflet-tooltip.city-label::before {
  display: none;
}

@media (max-width: 700px) {
  .map-box {
    height: 380px;
  }
}

