@font-face {
    font-family: "Vandr Rye";
    src: url("vandr-rye.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

.vandr-map-home {
    width: 100%;
    margin: 0 auto;
    padding: 16px 0 34px;
}

.map-heading {
    text-align: center;
    color: #183e27;
}

.map-heading h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.05;
    margin-bottom: 16px;
    font-family: "Vandr Rye", Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.map-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

.map-filters select,
.map-filters button {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #c5c7b6;
    border-radius: 999px;
    background: rgba(255, 253, 245, 0.95);
    color: #234331;
    font-weight: 700;
    font-size: 0.9rem;
}

.map-filters select {
    border-radius: 10px;
}

.map-type-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.map-type-filters button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.map-type-filters button[aria-pressed="true"] {
    color: #fff;
    background: #254e32;
    border-color: #254e32;
}

.map-viewport {
    position: relative;
    width: 76%;
    aspect-ratio: 5 / 3;
    margin: -20px auto 0;
    overflow: hidden;
    touch-action: pan-y;
    border-radius: 16px;
}

.map-viewport.is-zoomed {
    touch-action: none;
    cursor: grab;
}

.map-canvas {
    position: absolute;
    inset: 0;
    transform-origin: center;
}

.map-canvas > svg {
    display: block;
    width: 100%;
    height: 100%;
}

.map-markers {
    position: absolute;
    inset: 0;
}

.map-pin {
    position: absolute;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 40px;
    padding: 0;
    border: 2px solid #fffaf0;
    border-radius: 18px 18px 18px 4px;
    background: var(--pin-color, #307445);
    color: #fff;
    box-shadow: 0 2px 6px rgba(20, 40, 25, 0.3);
    transform: translate(-50%, -100%);
    cursor: pointer;
}

.map-pin:hover,
.map-pin[aria-expanded="true"] {
    z-index: 3;
    outline: 3px solid #e7b640;
    outline-offset: 2px;
}

.map-pin .vandr-icon {
    width: 21px;
    height: 21px;
}

.map-pin-count {
    font-size: 0.9rem;
    font-weight: 900;
}

.map-controls {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 5;
    display: grid;
    overflow: hidden;
    border: 1px solid #c4c8b3;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.map-controls button {
    width: 42px;
    height: 40px;
    border: 0;
    border-bottom: 1px solid #d8dccd;
    background: #fffdf5;
    color: #284735;
    font-size: 1.5rem;
}

.map-controls button:disabled {
    color: #a5ac9f;
}

.map-help {
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 12px auto 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 253, 245, 0.94);
    text-align: center;
    font-size: 0.85rem;
}

.map-selection {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(540px, calc(100% - 32px));
    max-height: 45vh;
    overflow: auto;
    padding: 18px;
    border: 1px solid #b7c2aa;
    border-radius: 14px;
    background: #fffdf6;
    box-shadow: 0 12px 40px rgba(20, 43, 28, 0.25);
}

.map-selection[hidden] {
    display: none;
}

.map-selection h2 {
    margin: 0 32px 12px 0;
    font-size: 1.2rem;
}

.map-selection-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
}

.map-event-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid #e3e4d5;
}

.map-event-card img {
    width: 110px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
}

.map-event-card h3 {
    margin: 0 0 5px;
    font-size: 1.05rem;
}

.map-event-card p {
    margin: 3px 0;
    font-size: 0.9rem;
}

.map-event-card a {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #284e33;
    color: #fff;
    font-weight: 700;
}

.map-back {
    width: min(1260px, calc(100% - 32px));
    margin: 20px auto 0;
    color: #254e32;
    font-weight: 700;
}

.detail-view {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
}

.detail-view .map-back {
    flex: 0 0 auto;
    margin-top: 16px;
    padding: 0 16px;
    text-shadow: 0 1px 4px #fffdf5;
}

.detail-view main {
    display: flex;
    justify-content: center;
    min-height: 0;
    padding: 16px;
}

.detail-view .detail-page {
    width: min(1000px, 100%);
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    background: rgba(255, 253, 248, 0.96);
}

.detail-view .vandr-footer {
    flex: 0 0 auto;
    margin-top: 0;
    font-size: 0.8rem;
}

@media (max-width: 700px) {
    .detail-view main {
        padding: 12px 8px;
    }

    .detail-view .detail-page {
        padding: 16px;
    }

    .detail-view .vandr-footer-inner {
        font-size: 0.7rem;
        line-height: 1.4;
    }

    .vandr-map-home {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .map-heading,
    .map-filters {
        position: relative;
        background: rgba(248, 244, 233, 0.93);
    }

    .map-filters select {
        width: min(280px, 100%);
    }

    .map-type-filters button {
        min-height: 44px;
        padding: 8px 12px;
    }

    .map-viewport {
        width: calc(100% - 16px);
        margin: 12px auto;
        background: rgba(248, 244, 233, 0.68);
    }

    .map-pin {
        width: 42px;
        height: 46px;
    }

    .map-controls {
        bottom: 4px;
        left: 4px;
    }

    .map-selection {
        position: relative;
        left: auto;
        bottom: auto;
        transform: none;
        width: calc(100% - 32px);
        max-height: none;
        margin: 12px auto;
    }

    .map-help {
        font-size: 0.8rem;
    }
}

/* Orientační vrstva je součástí geografické mapy a nepřebírá kliknutí. */
.map-canvas > svg {
    pointer-events: none;
}

.map-river {
    fill: none;
    stroke: #6b9eb5;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

.map-city-dot {
    fill: #445648;
    stroke: #fffdf2;
    stroke-width: 1.2;
}

.map-city-label,
.map-mountain-label,
.map-river-label {
    font-family: Roboto, Arial, sans-serif;
    paint-order: stroke fill;
    stroke: #f5f5e5;
    stroke-width: 3px;
    stroke-linejoin: round;
}

.map-city-label {
    fill: #405144;
    font-size: 12px;
    font-weight: 700;
}

.map-mountain-symbol {
    fill: none;
    stroke: #7b876d;
    stroke-width: 1.2;
    opacity: 0.8;
}

.map-mountain-label {
    fill: #697660;
    font-size: 10px;
    font-style: italic;
}

.map-river-label {
    fill: #477f99;
    font-size: 10px;
    font-style: italic;
}

@media (max-width: 700px) {
    .map-city-label {
        font-size: 17px;
        stroke-width: 4px;
    }

    .map-mountain-label,
    .map-river-label {
        font-size: 13px;
    }
}
