@import url("/static/css/fonts.css");
/* Gen-plans.ru — освежённый дизайн с сохранением структуры Тильды.
   Шрифты те же: Noto Serif (заголовки) + PT Sans (текст). */

:root {
  /* Палитра «чертёж города»: синий оригинала Тильды + голубые тона доверия */
  --ink: #18191a;
  --ink-soft: #5a6472;
  --line: #e3e7f0;
  --paper: #ffffff;
  --card: #ffffff;
  --accent: #394cc6;
  --accent-dark: #2b3aa0;
  --accent-soft: #e9eefb;
  --sky: #7fa8f0;
  --badge: #2b3aa0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 25, 26, .04), 0 10px 28px -14px rgba(43, 58, 160, .18);
  --mono: "PT Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "PT Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Noto Serif", Georgia, serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; }
h2 { font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; font-family: "PT Sans", sans-serif; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Шапка */
.site-header {
  background: var(--card);
  border-bottom: none;
  box-shadow: inset 0 -7px 0 -5px rgba(57, 76, 198, .18);
  position: sticky; top: 0; z-index: 50;
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo { font-family: "Noto Serif", Georgia, serif; font-size: 22px; font-weight: 700; color: #000; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-sub { font-size: 16px; font-weight: 400; }
@media (max-width: 480px) { .logo { font-size: 18px; } .logo-sub { font-size: 13px; } }
.main-nav { display: flex; gap: 22px; font-size: 15px; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); }
.main-nav a:hover { color: var(--accent-dark); text-decoration: none; }

@media (max-width: 720px) {
  .main-nav { font-size: 14px; gap: 14px; }
  .logo-text small { display: none; }
}

/* Первый экран */
.hero { text-align: center; padding: 64px 0 40px; max-width: 760px; margin: 0 auto; position: relative; }
/* Чертёжная миллиметровка: крупная и мелкая сетка голубым по белому */
.hero::before {
  content: ""; position: absolute; inset: -8px -40px; z-index: -1;
  background:
    linear-gradient(rgba(57,76,198,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(57,76,198,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(rgba(57,76,198,.045) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, rgba(57,76,198,.045) 1px, transparent 1px) 0 0 / 10px 10px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.hero p { color: var(--ink-soft); font-size: 17px; }
.hero-compact { padding: 40px 0 28px; text-align: left; max-width: none; }
.breadcrumb { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.breadcrumb a { color: var(--ink-soft); }
.section-descr { font-size: 16px; }

/* Регионы на главной */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 40px; }
.region-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.region-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.region-head h2, .region-head h2 a { font-size: 21px; }
.region-code { font-size: 13px; color: var(--ink-soft); letter-spacing: .08em; }
.city-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.city-list a { color: var(--accent-dark); font-size: 15.5px; }

/* Сетка карт города */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding-bottom: 32px; }
.map-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .15s ease, border-color .15s ease;
}
.map-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.map-thumb { aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--accent-soft) url("/static/img/map-placeholder.svg") center/40% no-repeat; }
.map-thumb img { width: 100%; height: 100%; object-fit: cover; }
.map-card h3 { margin: 0; }
.map-size { color: var(--ink-soft); font-size: 13.5px; margin: 0; }
.badge { align-self: flex-start; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.badge-ok { background: var(--accent-soft); color: var(--badge); }

/* Страница карты */
.hero-map { padding-bottom: 16px; }
.map-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.map-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dim { color: var(--ink-soft); font-size: 14px; }
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 15px; border: 1px solid var(--accent);
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent-dark); }
.btn-ghost:hover { background: var(--accent-soft); }

.osd-viewer {
  position: relative; /* контейнер для .osd-controls */
  height: min(78vh, 820px); min-height: 420px;
  background: #eef1ef; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.osd-viewer:fullscreen { border-radius: 0; height: 100vh; }
.osd-viewer.fullscreen-active { border-radius: 0; }

/* Контролы вьюера (Tabler-иконки) */
.osd-controls {
  position: absolute; top: 14px; left: 14px; z-index: 30;
  display: flex; flex-direction: column; gap: 6px;
}
.osd-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(24, 25, 26, .10);
  color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .1s ease, border-color .15s ease;
}
.osd-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.osd-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.osd-btn:active { transform: scale(.94); }
.osd-btn#dl { color: var(--accent-dark); }
.osd-btn#dl:hover { color: #fff; }
#fullscreen .ic-min { display: none; }
#fullscreen.is-min .ic-max { display: none; }
#fullscreen.is-min .ic-min { display: grid; }

/* Похожие карты */
.related { padding: 28px 0 48px; }
.related h2 { font-size: 22px; }
.related-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.related-card {
  flex: 0 0 180px; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; color: var(--ink); font-size: 13.5px;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card img { aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }

/* Служебные страницы */
.prose { max-width: 760px; padding-bottom: 48px; font-size: 16.5px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.add-plan form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.add-plan label { font-weight: 600; }
.add-plan input, .add-plan textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); background: var(--paper); font: inherit;
}
.add-plan textarea { resize: vertical; }
.add-plan .btn { margin-top: 6px; }
.form-note { color: var(--ink-soft); font-size: 14px; }
.sources { padding-bottom: 48px; }
.ext-links { list-style: none; padding: 0; }
.ext-links li { margin: 6px 0; }
.empty-state {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--ink-soft); margin-bottom: 32px;
}
.noscript-note { text-align: center; color: var(--ink-soft); }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; padding: 28px 20px; align-items: start; }
.footer-brand { font-family: "Noto Serif", Georgia, serif; font-size: 19px; margin: 0 0 4px; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.footer-note { color: var(--ink-soft); font-size: 13.5px; margin: 0; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* Группировка карт по секциям (поселения района) */
.city-section { margin-top: 26px; font-size: 22px; }
.badge-wait { background: #f3f4f2; color: var(--ink-soft); }

/* Служебные страницы: контакты и тарифы */
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 24px 0; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.price-card h2 { font-size: 21px; }
.price-for { color: var(--ink-soft); font-size: 14px; }
.price-card ul { padding-left: 20px; }

/* Города региона с гербами */
.city-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; padding-bottom: 48px; }
.city-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 16px 20px; box-shadow: var(--shadow); color: var(--ink); text-align: center;
  transition: transform .15s ease, border-color .15s ease;
}
.city-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.coat-wrap { height: 110px; display: flex; align-items: center; justify-content: center; }
.coat-wrap img { max-height: 110px; max-width: 110px; width: auto; height: auto; }
.coat-map-waiting { width: 100%; height: 110px; border-radius: 10px; display: block; }
.coat-credits { margin: -32px 0 48px; font-size: 13px; color: var(--ink-soft); }

/* Превью карты города на всю карточку */
.coat-wrap-map { width: 100%; height: 110px; border-radius: 10px; overflow: hidden; position: relative; }
.city-map-thumb { width: 100%; height: 110px; object-fit: cover; }
.city-map-corner {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 16px 2px,
    linear-gradient(var(--accent), var(--accent)) top left / 2px 16px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 16px 2px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 2px 16px;
  background-repeat: no-repeat; opacity: .65;
}
.city-count { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.city-count-wait { color: var(--ink-soft); }

/* Статистика региона в hero */
.region-stats { margin-top: 20px; display: flex; align-items: center; gap: 14px; }
.mono-note { font-family: var(--mono); font-size: 13.5px; color: var(--ink-soft); letter-spacing: .06em; }


/* Главная: регионы в две колонки, как на Тильде (t812 pricelist) */
.home-regions { max-width: 1160px; margin: 0 auto; padding-bottom: 56px; columns: 2; column-gap: 56px; }
.home-region { break-inside: avoid; padding: 22px 0 26px; }
.home-region-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.home-region-head h2, .home-region-head h2 a { font-size: 24px; margin: 0; }
.home-region-head h2 a:hover { text-decoration: none; border-bottom: 2px solid var(--accent); }
.region-caption { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }
.region-caption::before { content: none; }
.home-region-line { border-top: 1px solid rgba(24, 25, 26, .1); margin: 10px 0 12px; }
.home-cities { list-style: none; margin: 0; padding: 0; font-size: 16.5px; line-height: 1.75; }
.home-cities a { color: var(--ink); }
.home-cities a:hover { color: var(--accent-dark); }
@media (max-width: 900px) { .home-regions { columns: 1; } }

/* Города региона: на узких экранах две колонки вместо простыни */
@media (max-width: 720px) {
  .city-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .city-card { padding: 18px 10px 14px; }
  .coat-wrap { height: 84px; }
  .coat-wrap img { max-height: 84px; max-width: 84px; }
}

/* === Бренд «чертёж города» ================================================= */

/* Масштабная линейка — фирменный разделитель топокарты */
.scalebar {
  display: inline-block; width: 116px; height: 8px; vertical-align: middle;
  border: 2px solid var(--accent);
  background: repeating-linear-gradient(90deg, var(--accent) 0 22px, transparent 22px 44px);
}
.scalebar::after { content: ""; }

/* Код региона: моно, как отметка на чертеже */
.region-code {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  letter-spacing: .1em;
}
.region-code::before { content: "+ "; color: var(--ink-soft); } /* геодезический крест */

/* Углы чертежа на превью карт */
.map-thumb { position: relative; }
.map-card .map-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 14px 2px,
    linear-gradient(var(--accent), var(--accent)) top left / 2px 14px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 14px 2px,
    linear-gradient(var(--accent), var(--accent)) bottom right / 2px 14px;
  background-repeat: no-repeat;
  opacity: .55;
}

/* Размер карты и пиксели — моно */
.map-size, .dim { font-family: var(--mono); font-size: 13px; }

/* Подвал: миллиметровка сверху */
.site-footer { position: relative; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(57,76,198,.06) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(57,76,198,.06) 1px, transparent 1px) 0 0 / 40px 40px;
  -webkit-mask-image: linear-gradient(transparent 30%, #000); mask-image: linear-gradient(transparent 30%, #000);
}
.site-footer > * { position: relative; z-index: 1; }

/* Линейка в hero и подвале */
.hero-scale { margin-top: 26px; }
.footer-scalebar { align-self: center; }

/* Чеклист пополнения */
.status-table-wrap { overflow-x: auto; padding-bottom: 48px; }
.status-table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.status-table th { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--accent-soft); }
.status-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-city { font-weight: 700; white-space: nowrap; }
.st-link { font-weight: 400; font-size: 13px; margin-left: 8px; }
.st-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.st-published .st-badge { background: var(--accent); color: #fff; }
.st-partial .st-badge { background: #dce8fb; color: var(--accent-dark); }
.st-converting .st-badge { background: #fdf1e3; color: #a15c12; }
.st-found .st-badge, .st-planned .st-badge { background: #eef1f6; color: var(--ink-soft); }
.st-blocked .st-badge { background: #fbe9e9; color: #a03030; }
.st-mono { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.st-note { font-size: 12.5px; color: #a03030; margin-top: 4px; }


/* Сплит карта + условные обозначения */
.osd-split { display: flex; gap: 12px; }
.osd-split .osd-viewer { flex: 1 1 auto; min-width: 0; }
.legend-pane {
  flex: 0 0 30%; max-width: 460px; min-width: 240px;
  display: none; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.osd-split.legend-open .legend-pane { display: flex; }
.legend-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-family: "Noto Serif", Georgia, serif; font-size: 16px; font-weight: 600;
}
.legend-close { background: none; border: none; cursor: pointer; color: var(--ink-soft); padding: 4px; border-radius: 6px; }
.legend-close:hover { background: var(--accent-soft); color: var(--accent-dark); }
.legend-close svg { width: 18px; height: 18px; display: block; stroke: currentColor; }
.legend-viewer { flex: 1 1 auto; min-height: 420px; background: #fff; }
.legend-open-btn {
  position: absolute; top: 14px; right: 14px; z-index: 30;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 13px; height: 36px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(24, 25, 26, .10);
  color: var(--accent-dark); font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.legend-open-btn svg { width: 19px; height: 19px; stroke: currentColor; }
.legend-open-btn:hover, .legend-open-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Полный экран: если легенда открыта — разворачивается весь сплит (карта + знаки) */
.osd-split:fullscreen { height: 100vh; background: var(--paper); padding: 10px; box-sizing: border-box; }
.osd-split:fullscreen .osd-viewer { height: 100%; }
.osd-split:fullscreen .legend-pane { max-width: 520px; min-height: 0; }
.osd-split:fullscreen .legend-viewer { min-height: 0; }
@media (max-width: 760px) {
  .osd-split { flex-direction: column; }
  .legend-pane { flex: 0 0 46vh; max-width: none; min-width: 0; }
}
