*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    color: #293b36;
    background: #f8f8f5;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html,
body {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 320px;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 56px;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid #e8e9e4;
    background: #f8f8f5;
    font-size: 0.78rem;
}

.site-header a {
    color: #293b36;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

.site-header span {
    color: #61736b;
}

main {
    flex: 1;
    min-height: 0;
}

.travel-map {
    position: relative;
    height: 100%;
    min-height: 360px;
    overflow: hidden;
    background: #f4f4ef;
}

.travel-map__canvas,
.travel-map__canvas .maplibregl-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #f4f4ef;
}

.travel-map__canvas .maplibregl-canvas {
    outline: none;
}

.travel-map__canvas .maplibregl-ctrl-top-right {
    top: 20px;
    right: 22px;
}

.travel-map__canvas .maplibregl-ctrl-group {
    overflow: hidden;
    border: 1px solid #e1e3dd;
    border-radius: 5px;
    background: rgba(255, 255, 253, 0.94);
    box-shadow: 0 2px 8px rgba(34, 50, 43, 0.08);
}

.travel-map__canvas .maplibregl-ctrl-group button {
    width: 32px;
    height: 32px;
}

.travel-map__canvas .maplibregl-ctrl-group button + button {
    border-top-color: #e7e8e3;
}

.travel-map__canvas .maplibregl-ctrl-attrib {
    border-radius: 4px 0 0;
    background: rgba(255, 255, 253, 0.84);
    color: #52635b;
    font-size: 9px;
}

.travel-map__canvas .maplibregl-ctrl-attrib a {
    color: #344f43;
}

.travel-map__panel {
    position: absolute;
    z-index: 1;
    top: 24px;
    left: 28px;
    width: min(320px, calc(100% - 56px));
    padding: 22px;
    border: 1px solid rgba(226, 228, 221, 0.92);
    border-radius: 5px;
    background: rgba(255, 255, 253, 0.94);
    box-shadow: 0 4px 18px rgba(34, 50, 43, 0.07);
    backdrop-filter: blur(12px);
}

.travel-map__panel h1 {
    margin: 0;
    color: #293b36;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.7rem;
    font-weight: 500;
    letter-spacing: -0.035em;
}

.travel-map__intro {
    margin: 8px 0 0;
    color: #6b7972;
    font-size: 0.83rem;
    line-height: 1.55;
}

.travel-map__demo-notice {
    margin: 12px 0 0;
    color: #8d5d42;
    font-size: 0.72rem;
    line-height: 1.45;
}

.travel-map__demo-notice[hidden],
.travel-map__story-content[hidden],
.travel-map__photo-wrap[hidden],
.travel-map__error[hidden] {
    display: none;
}

.travel-map__map-status {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid #e8e9e4;
    color: #8d5d42;
    font-size: 0.72rem;
    line-height: 1.45;
}

.travel-map__map-status[hidden] {
    display: none;
}

.travel-map__story {
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid #e8e9e4;
}

.travel-map__empty,
.travel-map__story-content {
    color: #53645c;
    font-size: 0.8rem;
    line-height: 1.55;
}

.travel-map__empty p,
.travel-map__description {
    margin: 0;
}

.travel-map__empty code {
    padding: 0.1em 0.25em;
    background: #f0f1ec;
    color: #293b36;
    font-size: 0.92em;
}

.travel-map__story-content {
    color: #293b36;
}

.travel-map__story-content > p {
    margin: 0;
}

.travel-map__story-content > p + p {
    margin-top: 5px;
}

.travel-map__story-content h3 {
    margin: 4px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.3;
}

.travel-map__story-date {
    color: #78857e;
    font-size: 0.7rem;
}

.travel-map__place {
    color: #8d5d42;
    font-size: 0.78rem;
}

.travel-map__description {
    margin-top: 9px !important;
    color: #53645c;
    font-size: 0.78rem;
    white-space: pre-line;
}

.travel-map__photo-wrap {
    margin: 0 0 12px;
    overflow: hidden;
    border-radius: 3px;
    background: #eceee8;
}

.travel-map__photo {
    display: block;
    width: 100%;
    max-height: 170px;
    object-fit: cover;
}

.travel-map__error {
    margin: 0;
    color: #8d5d42;
    font-size: 0.78rem;
}

.travel-map__timeline {
    margin-top: 18px;
    padding-top: 13px;
    border-top: 1px solid #e8e9e4;
}

.travel-map__timeline-top,
.travel-map__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.travel-map__timeline-date {
    color: #293b36;
    font-size: 0.76rem;
    font-weight: 600;
}

.travel-map__timeline-count {
    color: #78857e;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.travel-map__range {
    display: block;
    width: 100%;
    height: 18px;
    margin: 7px 0 5px;
    accent-color: #a76f4e;
    cursor: pointer;
}

.travel-map__controls {
    gap: 8px;
}

.travel-map__control,
.travel-map__play {
    min-height: 31px;
    border: 1px solid #e1e3dd;
    border-radius: 4px;
    background: transparent;
    color: #34463f;
    cursor: pointer;
}

.travel-map__control {
    width: 36px;
}

.travel-map__play {
    flex: 1;
    font-size: 0.75rem;
}

.travel-map__control:hover:not(:disabled),
.travel-map__play:hover:not(:disabled) {
    border-color: #a76f4e;
}

.travel-map__control:disabled,
.travel-map__play:disabled {
    color: #a7afa9;
    cursor: not-allowed;
}

.travel-map :focus-visible,
.site-header a:focus-visible {
    outline: 2px solid #a76f4e;
    outline-offset: 3px;
}

.not-found {
    display: grid;
    height: 100%;
    align-content: center;
    justify-items: center;
    padding: 24px;
    text-align: center;
}

.not-found h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 8vw, 4rem);
    font-weight: 500;
}

.not-found p {
    color: #6b7972;
    font-size: 0.9rem;
}

.not-found a {
    color: #8d5d42;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .site-header {
        flex-basis: 50px;
        height: 50px;
        padding: 0 18px;
    }

    .travel-map {
        height: 100%;
        min-height: 400px;
    }

    .not-found {
        height: 100%;
    }

    .travel-map__canvas .maplibregl-ctrl-top-right {
        top: 12px;
        right: 12px;
    }

    .travel-map__panel {
        top: 14px;
        left: 14px;
        width: min(300px, calc(100% - 28px));
        padding: 17px;
    }
}
