:root {
    --ink: #121418;
    --paper: #f3efe6;
    --muted: #5d5850;
    --line: rgba(18, 20, 24, 0.12);
    --accent: #9a3412;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
    color: var(--ink);
    background: var(--paper);
}

body.map-page {
    overflow: hidden;
    height: 100%;
}

#map {
    position: absolute;
    inset: 0;
    background: #d7d2c8;
}

.hud {
    position: absolute;
    z-index: 10;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 14px;
    border-radius: 999px;
    background: rgba(18, 20, 24, 0.86);
    color: var(--paper);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.hud__brand {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.hud__about {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.hud__about:hover,
.hud__about:focus-visible {
    background: #fff;
}

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

.lang-switch {
    position: absolute;
    z-index: 10;
    top: 56px;
    left: 12px;
    border-radius: 999px;
    background: rgba(18, 20, 24, 0.86);
    color: var(--paper);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.lang-switch__label {
    display: block;
}

.lang-switch__label select {
    appearance: none;
    display: block;
    min-width: 9.5rem;
    padding: 8px 32px 8px 14px;
    border: 0;
    border-radius: 999px;
    background-color: transparent;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23f3efe6' d='M1.1 1.2 6 6.1l4.9-4.9 1.1 1.1L6 8.3.01 2.3z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    color-scheme: dark;
}

.lang-switch__label select:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: -2px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.site-header a {
    color: inherit;
    text-decoration: none;
}

.site-header__brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-header__back {
    font-size: 14px;
    font-weight: 650;
    color: var(--accent);
}

.site-header__back:hover,
.site-header__back:focus-visible {
    text-decoration: underline;
}

.article {
    max-width: 42rem;
    margin: 0 auto;
    padding: 48px 22px 80px;
}

.article h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    font-weight: 600;
}

.lead {
    margin: 0 0 32px;
    font-size: 1.2rem;
    line-height: 1.45;
    color: var(--muted);
}

.article h2 {
    margin: 36px 0 10px;
    font-size: 1.35rem;
    font-weight: 600;
}

.article p,
.article li {
    font-size: 1.05rem;
    line-height: 1.6;
}

.article a {
    color: var(--accent);
}

.article code,
.article pre {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92rem;
}

.article pre {
    overflow: auto;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
}

.maplibregl-ctrl-attrib {
    font-family: system-ui, sans-serif;
}

.poi-popup .maplibregl-popup-content {
    padding: 0;
    max-height: min(62vh, 440px);
    overflow: hidden;
    border-radius: 16px;
    background: rgba(18, 20, 24, 0.92);
    color: var(--paper);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.poi-popup .maplibregl-popup-tip {
    border-top-color: rgba(18, 20, 24, 0.92);
}

.poi-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.poi-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.poi-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: rgba(18, 20, 24, 0.92);
    border-top-color: transparent;
}

.poi-popup .maplibregl-popup-close-button {
    color: #fff;
    font-size: 22px;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 6px;
    line-height: 28px;
    border-radius: 999px;
    background: rgba(18, 20, 24, 0.55);
}

.poi-popup .maplibregl-popup-close-button:hover {
    background: rgba(18, 20, 24, 0.8);
    color: #fff;
}

.poi-card {
    display: flex;
    flex-direction: column;
    min-width: 240px;
    max-width: 360px;
    max-height: min(62vh, 440px);
    overflow: auto;
    padding: 0 0 14px;
}

.poi-card__photo {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.poi-card__body {
    padding: 12px 36px 2px 16px;
}

.poi-card__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.25;
}

.poi-card__meta,
.poi-card__status,
.poi-card__desc,
.poi-card__quote {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.poi-card__meta,
.poi-card__status {
    color: rgba(243, 239, 230, 0.72);
}

.poi-card__meta {
    margin-bottom: 8px;
    font-size: 12px;
}

.poi-card__status {
    font-size: 13px;
}

.poi-card__desc {
    overflow: visible;
}

.poi-card__quote {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(243, 239, 230, 0.14);
    color: rgba(243, 239, 230, 0.88);
    font-size: 12px;
    font-style: italic;
    white-space: pre-wrap;
}

.poi-card__facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.4;
}

.poi-card__facts dt {
    color: rgba(243, 239, 230, 0.55);
}

.poi-card__facts dd {
    margin: 0;
}

.poi-card__download {
    position: sticky;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin: 10px 16px 12px;
    padding: 7px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(18, 20, 24, 0.92);
    box-shadow: 0 -10px 16px rgba(18, 20, 24, 0.55);
    color: var(--paper);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.poi-card__download:hover,
.poi-card__download:focus-visible {
    background: rgba(243, 239, 230, 0.24);
}

@media (max-width: 640px) {
    .hud {
        top: 8px;
        left: 8px;
        right: 8px;
        width: max-content;
        max-width: calc(100% - 16px);
    }

    .lang-switch {
        top: 52px;
        left: 8px;
    }
}
