body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    font-size: normal;
}
.layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin: 20px;
}
main {
    max-width: 600px;
    margin: 0;
    flex: 1;
}
header {
    color: #fff;
    background: #1b6097;
    width: 100vw;
    margin-left: calc(
        -1 * (100vw - 100%) / 2
    ); /* Prevent horizontal scrollbars */
    margin-right: calc(-1 * (100vw - 100%) / 2);
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    min-height: 60px;
}
header h1 {
    margin: 0;
    padding: 0px 0;
    height: auto;
    flex: 1;
}
.map {
    width: 100%;
    height: 500px;
    box-sizing: border-box;
}

img {
    width: 100%;
}
.caption {
    text-align: center;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 4px;
    margin-bottom: 20px;
    color: #555;
}
.caption a,
.caption a:visited {
    color: #555;
    text-decoration: underline;
}

#legend {
    position: static;
    margin-top: 10px;
    margin-left: 0;
    background: #c2c8ca;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 10px 16px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 0 24px;
    font-weight: bold;
    font-size: small;
}
#legend.block {
    display: block !important;
}

#legend > div {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    flex-basis: calc(50% - 12px);
    max-width: 50%;
    box-sizing: border-box;
}

#legend label {
    cursor: pointer;
}
nav {
    margin: 0 32px 0 0;
    background: #f5f6f7;
    border-radius: 8px;
    padding: 12px 0 12px 0;
    width: 300px;
    flex-shrink: 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    gap: 0;
}

nav li {
    display: block;
    margin-bottom: 8px;
}

nav a {
    text-decoration: none;
    color: #1b6097;
    font-weight: bold;
    padding: 4px;
    margin: 0px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    display: block;
}

nav a:hover {
    background: #e0e6ea;
}

#burger-menu {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: #f5f6f7;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5px;
}

#burger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: #1b6097;
    border-radius: 2px;
    transition: 0.3s;
}

.marker {
    display: block;
    border: 2px solid #fff7ea;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

@media (max-width: 800px) {
    .layout {
        flex-direction: column;
        align-items: stretch;
        margin: 12px; /* Reduce margin on small screens */
    }
    nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 80vw;
        max-width: 320px;
        height: 100vh;
        background: #f5f6f7;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        overflow-y: auto;
        padding: 32px 0 12px 0;
        margin: 0;
        border-radius: 0 8px 8px 0;
        transition: transform 0.3s;
        transform: translateX(-100%);
    }
    nav.open {
        display: block;
        transform: translateX(0);
    }
    #burger-menu {
        display: flex;
    }
    main {
        max-width: 100%;
    }
    body.nav-open {
        overflow: hidden;
    }
}

@media (max-width: 424px) {
    header h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 973px) {
    nav {
        width: 200px;
        padding-left: 0;
        padding-right: 0;
    }
    nav a {
        font-size: 0.95em;
        padding: 3px;
        margin: 0px 4px;
    }
}
