/* Город блога, экран 1. Цвета и шрифты утверждены Полиной как рабочие 24.11.2026, меняются в :root. */

/* Локальные шрифты (SIL OFL 1.1, лицензии в fonts/). Lora 3.021 — cyrealtype/Lora-Cyrillic, Inter 4.1 — rsms/inter. */
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F7F2EA;
  --surface: #FFFBF5;
  --surface-2: #EFE6D8;
  --text: #2E2E30;
  --text-muted: #5C5C5E;
  --accent: #7A4E6B;
  --accent-hover: #6A4160;
  --accent-press: #5A3652;
  --on-accent: #FFFFFF;
  --line: #D9CDBA;
  --line-strong: #8C8372;
  --focus: #2E2E30;
  --error: #8A2F2F;
  --error-bg: #F6E3DE;
  --on-dark: #FFFFFF;

  /* карта */
  --map-block: #F3EADB;
  --map-tree: #D3DDC6;
  --map-river: #CBD8DC;
  --shadow-soft: rgba(46, 46, 48, .12);
  --shadow-dark: rgba(46, 46, 48, .28);

  /* здания */
  --b-stroke: #6B6258;
  --b-door: #8A6F5A;
  --b-light: #FFFBF5;
  --b-lamp: #FFF3C4;
  --b-ideas-body: #E3CFA6;      --b-ideas-roof: #B08A5C;
  --b-scripts-body: #E8D9C3;    --b-scripts-roof: #C9B391;
  --b-montage-body: #C5CFD6;    --b-montage-roof: #8FA0AB;
  --b-publish-body: #E0C9BF;    --b-publish-roof: #C9A89B;
  --b-metrics-body: #C9D3C1;    --b-metrics-roof: #A9B8A0;
  --b-comments-body: #E8D9C3;   --b-comments-roof: #C9B391;

  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.lock { overflow: hidden; }

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

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

.defs-only { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- страница --- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 24px;
}

.head { margin-bottom: 24px; }
.head h1 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 2rem;
  line-height: 38px;
}
.subtitle {
  margin-top: 8px;
  max-width: 640px;
  font-size: 1.125rem;
  line-height: 28px;
}
.head-rule {
  width: 48px; height: 2px;
  margin-top: 16px;
  background: var(--line);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.foot[hidden] { display: none; }
.foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  line-height: 24px;
}

/* --- карточка «Сегодня» --- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(46, 46, 48, .08);
}
.card h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 30px;
  margin-bottom: 12px;
}
.today-list { display: grid; gap: 12px; }
.today-list li {
  display: flex;
  gap: 12px;
  line-height: 24px;
}
.today-list li::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--text);
}
.today-empty { line-height: 24px; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--error-bg);
  border-left: 4px solid var(--error);
  border-radius: 12px;
  line-height: 24px;
}
.notice svg { flex: none; width: 24px; height: 24px; }

/* --- кнопки --- */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
  cursor: pointer;
}
.btn-primary {
  margin-top: 20px;
  width: 100%;
  min-width: 200px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-primary:focus-visible { outline-offset: 3px; }

.btn-outline {
  border: 2px solid var(--text);
  background: transparent;
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); }
.btn-outline:active { background: var(--surface-2); transform: translateY(1px); }

/* --- список разделов --- */
.rows { display: grid; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s;
}
.row-icon {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
}
.row-icon svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.row-name { font-weight: 600; font-size: 1.125rem; line-height: 24px; }
.row-hint { grid-column: 2 / 4; color: var(--text-muted); line-height: 22px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
}
.badge.is-zero { color: var(--text-muted); }
.is-error .badge { visibility: hidden; }

.row.is-active,
.row:active {
  background: var(--surface-2);
  box-shadow: inset 4px 0 0 var(--text);
}
.row:active { transform: translateY(1px); }

/* --- карта --- */
.map-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
}
.map-wide { display: none; aspect-ratio: 720 / 480; }
.map-tall { display: block; aspect-ratio: 400 / 720; }
.map-frame svg { display: block; width: 100%; height: 100%; }
.map-overlay { position: absolute; inset: 0; }

.ground { fill: var(--surface-2); }
.block { fill: var(--map-block); }
.street { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.dash { stroke: var(--line); stroke-width: 2; stroke-dasharray: 10 10; }
.river { fill: none; stroke: var(--map-river); stroke-width: 10; }
.tree { fill: var(--map-tree); }
.lamp { fill: var(--line-strong); }

.bld use {
  stroke: var(--b-stroke);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.bld .shadow { fill: var(--shadow-soft); transition: fill .12s; }
.bld .lift { transition: transform .15s ease-out; }
.bld.is-active .lift {
  transform: translateY(-4px);
  filter: drop-shadow(0 6px 6px rgba(46, 46, 48, .18));
}
.bld.is-active use { stroke: var(--text); stroke-width: 2.5; }
.bld.is-active .shadow { fill: var(--shadow-dark); }

.area {
  position: absolute;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plaque {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 144px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
  text-align: center;
  transition: background-color .12s;
}
.map-badge {
  position: absolute;
  left: 100%;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
}
.map-badge.is-zero { color: var(--text-muted); }
.is-error .map-badge { visibility: hidden; }
.area.is-active .plaque { background: var(--surface-2); }

.tip {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: 10px 14px;
  background: var(--text);
  color: var(--on-dark);
  border-radius: 10px;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity .12s;
}
.tip.show { visibility: visible; opacity: 1; }
.tip-name { font-weight: 600; font-size: 1rem; line-height: 20px; }
.tip-hint { font-size: .9375rem; line-height: 20px; color: var(--bg); }

/* --- заглушка раздела --- */
.stub {
  width: min(480px, calc(100vw - 32px));
  padding: 32px 24px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(46, 46, 48, .25);
}
.stub[open] { animation: stub-in .15s ease-out; }
.stub::backdrop { background: rgba(46, 46, 48, .45); }
.stub h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 32px;
}
.stub p { margin: 12px 0 24px; font-size: 1.125rem; line-height: 28px; }
@keyframes stub-in { from { opacity: 0; } to { opacity: 1; } }

/* --- планшет --- */
@media (min-width: 768px) {
  .page { padding: 32px 32px 32px; }
  .head { margin-bottom: 32px; }
  .head h1 { font-size: 2.25rem; line-height: 44px; }
  .layout { gap: 32px; }
  .foot { margin-top: 48px; }
  .card { padding: 24px; }
  .today-list li { font-size: 1.0625rem; line-height: 26px; }
  .today-list li::before { margin-top: 9px; }
  .btn-primary { width: auto; }
  .rows { grid-template-columns: 1fr 1fr; gap: 8px; }
  .row { padding: 12px 16px; }
  .map-wide { display: block; }
  .map-tall { display: none; }
  .plaque { max-width: 194px; }
  .stub { padding: 32px; }
  .stub h2 { font-size: 1.75rem; line-height: 34px; }
}

/* --- десктоп --- */
@media (min-width: 1024px) {
  .layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 24px;
    align-items: start;
  }
  .map-section { grid-column: 1 / 8; grid-row: 1; }
  .today { grid-column: 1 / 8; grid-row: 2; }
  .sections { grid-column: 8 / 13; grid-row: 1 / 3; }
  .rows { grid-template-columns: 1fr; }
}

@media (min-width: 1440px) {
  .page { padding-top: 48px; }
  .head { margin-bottom: 40px; }
  .head h1 { font-size: 2.75rem; line-height: 52px; }
  .subtitle { font-size: 1.25rem; line-height: 30px; }
  .card { padding: 28px; }
  .card h2 { font-size: 1.625rem; line-height: 32px; margin-bottom: 16px; }
}

/* --- касание: без hover --- */
@media (hover: none) {
  .tip { display: none; }
}

/* --- уменьшить движение --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .bld.is-active .lift { transform: none; filter: none; }
}

/* --- рабочий режим: подвал, заставка, тост --- */
.boot {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.boot[hidden] { display: none; }
.boot p {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 2rem;
  line-height: 38px;
}
.page[hidden] { display: none; }

.foot-actions { display: grid; gap: 12px; }
.foot-actions .btn-outline { width: 100%; }
.foot-note { margin-top: 12px; }
.foot-msg:not(:empty) { margin-top: 12px; }
.foot-msg .notice { flex-wrap: wrap; align-items: center; }
.foot-msg .notice p { flex: 1 1 200px; color: var(--text); }
.foot-msg .btn-outline:disabled,
.foot-actions .btn-outline:disabled { cursor: default; opacity: .75; }

.toast {
  position: fixed;
  left: 16px; right: 16px; bottom: 24px;
  z-index: 20;
  max-width: 360px;
  margin: 0 auto;
  padding: 12px 16px;
  background: var(--text);
  color: var(--on-dark);
  border-radius: 10px;
  text-align: center;
  line-height: 24px;
}
.toast[hidden] { display: none; }

@media (min-width: 768px) {
  .foot-actions { display: flex; flex-wrap: wrap; }
  .foot-actions .btn-outline { width: auto; min-width: 200px; }
}
