@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-display-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-display-cyrillic-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-cyrillic-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fdf8f3;
  --bg-soft: #f4f0ea;
  --ink: #1a1b1e;
  --ink-soft: #3d3a36;
  --line: #e8ded3;
  --teal: #36a9ae;
  --teal-deep: #1a7bc5;
  --sand: #e5c6a9;
  --danger: #9f3a3a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 20px 40px rgba(26, 27, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: radial-gradient(circle at 0 0, rgba(54, 169, 174, 0.08), transparent 50%), var(--bg);
  font-family: 'Manrope', sans-serif;
}

a {
  color: var(--teal-deep);
}

.enter-shell,
.lock-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.enter-card,
.lock-card {
  width: min(640px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

.enter-card h1,
.lock-card h1 {
  margin-top: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.enter-status[data-mode='error'] {
  color: var(--danger);
}

.enter-status[data-mode='success'] {
  color: #0f766e;
}

.guide-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(253, 248, 243, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-title p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.topbar-title strong {
  font-size: 0.95rem;
}

.menu-toggle,
.search-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

.guide-toc {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  max-height: calc(100vh - 110px);
  overflow: auto;
  position: sticky;
  top: 78px;
}

.guide-toc h2 {
  margin: 0 0 14px;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
}

.toc-list {
  display: grid;
  gap: 8px;
}

.toc-link {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.toc-link.is-active {
  border-color: rgba(54, 169, 174, 0.5);
  background: rgba(54, 169, 174, 0.08);
}

.toc-link__order {
  font-weight: 700;
  color: var(--teal-deep);
}

.guide-main {
  min-height: 70vh;
}

.loading-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
}

.guide-fragment {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(244, 240, 234, 0.6), #fff 42%);
  padding: 20px;
  overflow: hidden;
}

.section-head h2 {
  margin: 6px 0 12px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}

.section-number {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-deep);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
}

.section-content {
  user-select: none;
  line-height: 1.62;
  color: var(--ink-soft);
}

.section-content h3 {
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
}

.section-content p {
  margin: 0 0 12px;
}

.section-content ul {
  margin: 0 0 16px;
  padding-left: 18px;
}

.section-content li {
  margin-bottom: 8px;
}

.section-content a,
.contact-chip,
.map-card__link {
  user-select: text;
}

.section-gallery {
  display: grid;
  gap: 10px;
  align-content: start;
}

.photo-card {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(26, 27, 30, 0.1);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.map-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 14px 0;
  display: grid;
  gap: 8px;
  background: #fff;
}

.map-card h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.map-card__section,
.map-card__coords {
  margin: 0;
  font-size: 0.82rem;
}

.contact-chip {
  display: inline-block;
  margin: 4px 8px 8px 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(54, 169, 174, 0.1);
  text-decoration: none;
  border: 1px solid rgba(54, 169, 174, 0.24);
}

[data-mark-inline] {
  display: inline-flex;
  margin: 0 4px;
  font-size: 0.72rem;
  color: rgba(26, 27, 30, 0.46);
  background: rgba(229, 198, 169, 0.3);
  border-radius: 999px;
  padding: 1px 6px;
}

.fixed-mark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fixed-mark-layer [data-mark-fixed] {
  position: absolute;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  opacity: 0.28;
  color: #0a5464;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

[data-leak-trap='true'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.search-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(680px, 92vw);
  box-shadow: var(--shadow-soft);
}

.search-shell {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.search-shell header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-shell input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.search-results {
  max-height: 55vh;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.search-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.search-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.offline-badge,
.devtools-warning {
  margin: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.offline-badge {
  background: rgba(197, 140, 115, 0.2);
}

.devtools-warning {
  background: rgba(159, 58, 58, 0.14);
}

html.menu-open .guide-toc {
  transform: translateX(0);
}

@media (max-width: 1023px) {
  .guide-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .guide-toc {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(88vw, 360px);
    max-height: none;
    transform: translateX(-110%);
    transition: transform 220ms ease;
    border-radius: 0;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  .fixed-mark-layer,
  .fixed-mark-layer * {
    visibility: visible;
  }

  body::before {
    content: 'Печать отключена для защиты авторских прав';
    visibility: visible;
    position: fixed;
    top: 32%;
    left: 12%;
    right: 12%;
    font-size: 28px;
    color: #7f1d1d;
    text-align: center;
  }
}
