@font-face {
  font-family: Cinzel;
  src: url('./fonts/cinzel.woff2') format('woff2');
  font-display: swap;
  font-weight: 400 900;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('./fonts/source-sans-3.woff2') format('woff2');
  font-display: swap;
  font-weight: 200 900;
}

:root {
  --paper: #f4efe3;
  --surface: #fffcf5;
  --ink: #25241e;
  --muted: #615c4b;
  --line: #d8ceba;
  --olive: #4a583b;
  --olive-deep: #34422c;
  --olive-wash: #e8ebdf;
  --rust: #8b3e32;
  --focus: #265d7a;
  --heading: Cinzel, Georgia, serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 12px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 17px/1.55 var(--body); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2 { font-family: var(--heading); line-height: 1.2; font-weight: 750; }
h3 { line-height: 1.25; }
a { color: var(--rust); text-underline-offset: .2em; }
a:hover { color: var(--olive-deep); }
img { vertical-align: middle; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select, .button {
  min-height: 44px;
  padding: .33rem .72rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 650;
}
button, select { cursor: pointer; }
button:hover, .button:hover { border-color: var(--olive); background: var(--olive-wash); }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.primary, .button.primary { color: #fff; background: var(--olive); border-color: var(--olive); }
.primary:hover, .button.primary:hover { color: #fff; background: var(--olive-deep); }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.frame { width: min(calc(100% - 72px), 1376px); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 1500; top: 8px; left: 8px; background: var(--surface); padding: 10px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 61px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; line-height: 1.15; font: 700 16px/1.15 var(--heading); }
.brand:hover { color: var(--olive); }
.brand img { border-radius: 7px; }
.brand strong { color: var(--olive); font-weight: 800; }
.site-header nav { align-self: stretch; display: flex; align-items: stretch; gap: 24px; }
.site-header nav a {
  display: flex; align-items: center; min-height: 44px; padding-inline: 3px;
  border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap;
  font-weight: 700; text-decoration: none;
}
.site-header nav a:hover, .site-header nav a[aria-current] { border-color: var(--olive); color: var(--olive-deep); }

.hero { min-height: 119px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding-block: 21px; }
.hero h1 { font-size: clamp(27px, 3.2vw, 47px); letter-spacing: -.035em; }
.hero p { margin-top: 5px; color: var(--muted); font-size: 18px; }
.edition {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  color: var(--olive-deep); border: 1px solid #bdc6af; border-radius: 5px;
  background: var(--olive-wash); padding: 5px 11px; font-size: 14px; font-weight: 700;
}

.map-shell {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: clamp(540px, 76svh, 800px);
  background: var(--surface); border: 1px solid #afa388; border-radius: 11px;
  box-shadow: 0 7px 21px #5142231a; overflow: hidden;
}
.map-topbar {
  min-width: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 6px 12px 6px 16px; color: #fffcf5; background: var(--olive-deep);
}
.map-topbar h2 { display: flex; align-items: center; gap: 8px; font-size: clamp(13px, 1.55vw, 18px); }
.atlas-mark { color: #eee0b7; font-size: 23px; line-height: 1; }
.top-actions { display: flex; gap: 6px; }
.top-actions button { border-color: #829077; background: transparent; color: #fff; white-space: nowrap; }
.top-actions button:hover, .top-actions button[aria-expanded=true] { background: #eff1e6; color: var(--olive-deep); }
.top-actions button:focus-visible { outline-color: #f2df9f; }
.map-workspace {
  display: grid; min-height: 0; grid-template: auto minmax(0, 1fr) / 306px minmax(0, 1fr);
  position: relative;
}
.map-search { grid-area: 1 / 1; padding: 13px 14px 10px; border-right: 1px solid var(--line); }
.map-search label { display: block; font-weight: 750; margin-bottom: 4px; }
.search-field { display: flex; min-width: 0; border: 1px solid #b4ac99; border-radius: 6px; }
.search-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search-field input {
  flex: 1; min-width: 0; height: 44px; padding: 0 9px; border: 0; border-radius: 6px; background: var(--surface); outline: none;
}
.search-field input:focus-visible, .search-field button:focus-visible { outline-offset: -2px; }
.search-field button { width: 44px; flex: none; border: 0; border-left: 1px solid var(--line); border-radius: 0 5px 5px 0; }
.magnifier { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.magnifier::after { content: ''; position: absolute; width: 7px; height: 2px; right: -6px; bottom: -3px; transform: rotate(45deg); background: currentColor; }
.map-drawer { grid-area: 2 / 1; min-height: 0; border-right: 1px solid var(--line); overflow: auto; overscroll-behavior: contain; }
.drawer-content { padding: 0 14px 13px; }
.drawer-tabs { display: flex; align-items: center; justify-content: space-between; }
.drawer-tabs button:first-child { background: transparent; border: 0; padding-left: 0; color: var(--olive-deep); }
#collapse-drawer { display: none; }
#map-layers-panel h3, #map-pins-panel h3 { font-size: 18px; margin-bottom: 5px; }
.filter-chips, .small-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.filter-chips button, .small-actions button { padding-inline: 8px; font-size: 14px; }
.filter-chips button { padding-inline: 6px; }
.filter-chips button[aria-pressed=true] { background: var(--olive-wash); color: var(--olive-deep); border-color: #aeb9a1; }
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 5px; }
.list-bar select { padding-inline: 5px; font-size: 14px; }
.list-count { color: var(--muted); font-size: 14px; }
.result-list { margin: 0; padding: 0; list-style: none; }
.result-list li + li { border-top: 1px solid #e9e0cf; }
.result-button {
  width: 100%; display: flex; align-items: center; gap: 9px; text-align: left;
  min-height: 52px; background: transparent; border: 0; border-radius: 0; padding: 5px 3px;
}
.result-button:hover, .result-button[aria-current=true] { background: var(--olive-wash); }
.result-thumb { display: grid; place-items: center; width: 31px; height: 31px; flex: none; background: #ece4d0; border-radius: 5px; }
.result-button .result-name { line-height: 1.1; font-size: 16px; display: block; overflow-wrap: anywhere; }
.result-button small { display: block; color: var(--muted); font-size: 13px; line-height: 1.2; margin-top: 3px; }
.result-button .result-arrow { margin-left: auto; padding-right: 5px; color: var(--muted); }
#more-results { width: 100%; margin-top: 6px; }
.layer-check { display: flex; align-items: center; gap: 7px; min-height: 44px; padding-inline: 7px; cursor: pointer; }
.layer-check:hover { background: var(--olive-wash); }
.layer-check input { width: 17px; height: 17px; accent-color: var(--olive); }
#layer-options details { margin-bottom: 4px; }
#layer-options summary { min-height: 44px; cursor: pointer; padding: 8px 0; font-weight: 700; border-top: 1px solid var(--line); }
#map-pins-panel .muted { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 15px; }
.empty-state { color: var(--muted); padding-block: 10px; }

.map-stage { grid-area: 1 / 2 / 3 / 3; position: relative; min-height: 0; isolation: isolate; }
#bohemia-map { width: 100%; height: 100%; background: #d2c29a url('./bohemia-preview.webp') center / cover no-repeat; }
#bohemia-map.leaflet-container { background: #d2c29a; outline-offset: -3px; font-family: var(--body); }
#bohemia-map.placing-pin, #bohemia-map.placing-pin .leaflet-interactive { cursor: crosshair; }
.canvas-tools { position: absolute; z-index: 700; right: 11px; top: 11px; display: grid; gap: 6px; }
.canvas-tools button {
  width: 44px; padding: 0; font-size: 24px; line-height: 1;
  border-color: #7a725c; box-shadow: 0 2px 5px #32270d33;
}
.map-key, .map-toast, .map-retry, .map-noscript {
  position: absolute; z-index: 701; border: 1px solid #a89878; border-radius: 6px;
  background: var(--surface); box-shadow: 0 2px 7px #32270d26;
}
.map-key { bottom: 10px; left: 11px; display: flex; gap: 10px; padding: 3px 8px; font-size: 13px; }
.map-key span { display: flex; align-items: center; gap: 3px; }
.map-toast, .map-retry, .map-noscript { top: 11px; left: 11px; max-width: calc(100% - 77px); padding: 7px 10px; font-size: 15px; }
.map-toast { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.map-toast button, .map-retry button { margin-left: 4px; }
.map-retry { top: 67px; }
.map-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 30px; padding: 2px 13px; border-top: 1px solid #b5a888;
  color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums;
}
.map-foot a { color: var(--olive-deep); }
.mobile-results { display: none; }
.map-marker {
  display: grid; place-items: center; background: #faf2db; border: 1px solid #413523;
  border-radius: 50%; box-shadow: 0 1px 3px #1c160e8c;
}
.map-marker img { width: 22px; height: 22px; object-fit: contain; }
.map-marker.is-found { background: #cee0bc; border: 2px solid #355a30; }
.map-marker.is-selected { background: #fff2d0; outline: 3px solid #8b3e32; z-index: 999 !important; }
.map-marker.is-personal { background: #e1e8ec; border-color: #265d7a; }
.cluster-marker {
  display: grid; place-items: center; border: 2px solid #fff3d9; border-radius: 50%;
  background: var(--olive-deep); color: #fff; font: 700 14px var(--body);
  box-shadow: 0 1px 4px #1c160e91;
}
.leaflet-tooltip.atlas-tooltip {
  border: 1px solid #90826b; background: var(--surface); color: var(--ink); font: 700 15px var(--body);
}

.point-detail {
  position: absolute; z-index: 710; right: 10px; bottom: 10px; width: min(344px, calc(100% - 20px));
  max-height: calc(100% - 22px); overflow: auto; overscroll-behavior: contain;
  border: 1px solid #a89878; border-radius: 8px; background: var(--surface);
  padding: 11px 13px 13px; box-shadow: 0 4px 14px #32270d45;
}
.point-detail h3 { font-size: 20px; overflow-wrap: anywhere; }
.point-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.point-head p span { color: var(--rust); }
.point-detail p + p, .point-detail details { margin-top: 6px; }
.point-detail p { white-space: pre-line; overflow-wrap: anywhere; }
.point-detail .small-actions { margin: 11px 0 0; }
.point-detail summary { cursor: pointer; }
.map-shell:fullscreen, .map-shell.is-fullscreen {
  width: 100%; height: 100%; border: 0; border-radius: 0;
}
.map-shell.is-fullscreen { position: fixed; z-index: 1200; inset: 0; }
body:has(.map-shell.is-fullscreen) { overflow: hidden; }

dialog {
  width: min(500px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 15px 18px 18px; border: 1px solid #aea084; border-radius: 9px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px #201d1170;
}
dialog::backdrop { background: #20201687; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.dialog-heading h2 { font-size: 22px; }
dialog label { display: block; font-weight: 700; margin-top: 8px; }
dialog input:not([type=checkbox]), dialog textarea, dialog select {
  width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid #b9ad95; border-radius: 5px; background: var(--surface);
}
dialog textarea { resize: vertical; }
dialog p + p { margin-top: 8px; }
.coordinate-fields { display: flex; gap: 8px; }
.coordinate-fields label { flex: 1; min-width: 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; margin-top: 15px; }
.error-text { color: var(--rust); margin-top: 7px; }

.editorial-section { padding-block: 34px; border-bottom: 1px solid var(--line); }
.editorial-section h2 { font-size: clamp(24px, 2.3vw, 32px); margin-bottom: 8px; }
.section-lead { max-width: 72ch; color: var(--muted); margin-bottom: 17px; }
.town-links { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.town-links a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 5px 11px;
  color: var(--olive-deep); background: var(--surface); border: 1px solid var(--line);
  border-radius: 5px; text-decoration: none; font-weight: 700;
}
.town-links a:hover { background: var(--olive-wash); border-color: var(--olive); }
.explore-grid, .reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.route-card, .guide-card { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.route-card { display: flex; align-items: start; gap: 12px; }
.route-card h3, .guide-card h3, .reference-grid h3 { font-size: 20px; margin-bottom: 5px; }
.route-card a, .guide-card a, .data-section a { font-weight: 700; }
.route-card a, .guide-card a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.guide-card { display: grid; grid-template-rows: auto auto 1fr auto; }
.guide-card p + p, .reference-grid p + p { margin-top: 8px; }
.reference-grid { margin-top: 19px; padding: 5px 3px 0; gap: 26px; }
.map-usage { margin-top: 21px; max-width: 84ch; }
.map-usage h3 { font-size: 20px; margin-bottom: 5px; }
.faq-list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: clip; }
.faq-list details + details { border-top: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 50px; padding: 9px 15px; cursor: pointer; font-weight: 700; }
.faq-list summary::after { content: '+'; color: var(--olive); font-size: 22px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list summary:focus-visible { outline-offset: -3px; }
.faq-list p { padding: 0 15px 14px; max-width: 95ch; }
.data-section { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; border-bottom: 0; }
.data-section p { margin-bottom: 8px; max-width: 76ch; }
.map-facts { padding: 7px 15px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); align-self: start; }
.map-facts div { display: flex; justify-content: space-between; gap: 8px; padding-block: 6px; }
.map-facts div + div { border-top: 1px solid var(--line); }
.map-facts dt { color: var(--muted); }
.map-facts dd { text-align: right; font-weight: 700; }

.site-footer {
  --footer-muted: #e0e2d4;
  --footer-line: #69745d;
  background: var(--olive-deep);
  color: var(--surface);
  border-top: 1px solid var(--footer-line);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(30px, 4vw, 52px) 28px;
}
.site-footer .brand { color: var(--surface); font-size: clamp(16px, 2vw, 19px); }
.footer-brand .brand strong { color: inherit; }
.footer-brand .brand img { flex: none; }
.footer-brand p { margin-top: 12px; max-width: 37ch; color: var(--footer-muted); font-size: 15px; }
.site-footer .footer-contact { margin-top: 4px; overflow-wrap: anywhere; }
.site-footer nav h2 { margin-bottom: 6px; font: 700 16px/1.35 var(--body); }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--footer-muted); }
.site-footer a:hover { color: var(--surface); text-decoration: underline; }
.site-footer a:focus-visible { outline-color: var(--surface); }
.site-footer nav a, .site-footer .footer-contact {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 15px;
  text-decoration: none;
}
.site-footer nav a:hover, .site-footer .footer-contact:hover { text-decoration: underline; }
.footer-credits { padding-block: 18px 22px; border-top: 1px solid var(--footer-line); text-align: center; }
.footer-credits p { color: var(--footer-muted); font-size: 14px; }
.footer-credits p + p { margin-top: 4px; }
.language-menu { position: relative; z-index: 1000; }
.language-menu summary { min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-weight: 700; }
.language-menu summary::after { content: '⌄'; }
.language-menu ul { position: absolute; top: 100%; right: 0; min-width: 140px; margin: 5px 0 0; padding: 5px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 16px #51422329; }
.language-menu a { display: block; padding: 7px 10px; color: var(--olive-deep); text-decoration: none; }
.language-menu a:hover, .language-menu a[aria-current] { background: var(--olive-wash); }
.document { width: min(calc(100% - 32px), 820px); margin: 35px auto 54px; padding: clamp(18px, 4vw, 45px); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.document h1 { font-size: clamp(28px, 5vw, 43px); margin: 6px 0 13px; }
.document h2 { font-size: 22px; margin: 24px 0 7px; }
.document p + p { margin-top: 10px; }
.document-date { color: var(--muted); }
.document-lead { font-size: 19px; }
.document .button { margin-top: 14px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }

@media (min-width: 841px) and (max-width: 1100px) {
  .frame { width: calc(100% - 40px); }
  .map-workspace { grid-template-columns: 275px minmax(0, 1fr); }
}
@media (max-width: 840px) {
  .frame { width: calc(100% - 28px); }
  .hero { padding-block: 14px; min-height: 0; gap: 4px; flex-wrap: wrap; }
  .hero p { font-size: 16px; }
  .edition { margin-top: 4px; }
  .map-shell { height: clamp(515px, 69svh, 690px); }
  .map-workspace { display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); }
  .map-search { grid-area: 1 / 1; border-right: 0; border-bottom: 1px solid var(--line); padding: 7px 9px 8px; }
  .map-search label { font-size: 14px; margin-bottom: 2px; }
  .map-stage { grid-area: 2 / 1; }
  .map-drawer { display: none; z-index: 800; position: absolute; bottom: 0; inset-inline: 0; max-height: 80%; border: 1px solid #a89878; border-radius: 11px 11px 0 0; background: var(--surface); box-shadow: 0 -5px 22px #30271244; }
  .map-shell[data-drawer=open] .map-drawer { display: block; }
  .drawer-content { padding: 4px 11px calc(12px + env(safe-area-inset-bottom)); }
  #collapse-drawer { display: inline-block; }
  .mobile-results { display: block; position: absolute; z-index: 702; left: 10px; bottom: 9px; border-color: #7a725c; box-shadow: 0 2px 6px #32270d33; }
  .map-key { left: auto; right: 10px; bottom: 9px; }
  .point-detail { bottom: 59px; max-height: calc(100% - 69px); }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { display: block; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .site-footer nav a, .site-footer .footer-contact { min-height: 44px; }
}
@media (max-width: 520px) {
  .header-inner { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 5px; padding-top: 8px; }
  .header-inner .brand { grid-area: 1 / 1; }
  .header-inner .language-menu { grid-area: 1 / 2; }
  .header-inner nav { grid-area: 2 / 1 / 3 / 3; }
  .site-header .brand img { width: 32px; height: 32px; }
  .site-header nav { justify-content: space-between; gap: 10px; align-self: stretch; }
  .site-header nav a { font-size: 14px; white-space: normal; text-align: center; }
  .top-actions button { white-space: normal; }
  .map-topbar { align-items: flex-start; flex-direction: column; padding: 7px 8px; gap: 4px; }
  .map-topbar h2 { font-size: 15px; }
  .top-actions { width: 100%; }
  .top-actions button { flex: 1; padding-inline: 5px; font-size: 15px; }
  .map-foot { font-size: 12px; padding-inline: 6px; }
  .map-key { gap: 6px; font-size: 12px; }
  .map-key img { width: 16px; height: 16px; }
  .editorial-section { padding-block: 26px; }
  .explore-grid, .reference-grid, .data-section { grid-template-columns: 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
