/* Rodinia interactive atlas. Scoped to .atlas-page. */

.atlas-page,
.atlas-page * {
    box-sizing: border-box;
}

.atlas-page {
    --atlas-paper: #ead9b5;
    --atlas-paper-light: #f3e5c4;
    --atlas-ink: #2b261f;
    --atlas-muted: #6f6453;
    --atlas-purple: #4c2b66;
    --atlas-purple-light: #65417f;
    --atlas-gold: #8a6c30;
    --atlas-border: rgba(75, 58, 34, 0.52);

    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 60px;
    color: var(--atlas-ink);
    font-family: Roboto, Arial, sans-serif;
}

.atlas-heading,
.atlas-card,
.atlas-locations,
.atlas-coordinate-helper,
.atlas-noscript {
    background: var(--atlas-paper);
    border: 1px solid var(--atlas-border);
    border-top: 4px solid var(--atlas-gold);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.atlas-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.atlas-breadcrumbs a {
    color: #f1d58f;
    text-underline-offset: 3px;
}

.atlas-breadcrumbs .atlas-breadcrumb-separator {
    color: rgba(255, 255, 255, 0.5);
}

.atlas-heading {
    padding: clamp(22px, 4vw, 40px);
    text-align: center;
}

.atlas-heading h1,
.atlas-toolbar h2,
.atlas-locations h2 {
    margin: 0;
    color: #3d2455;
    font-family: Cinzel, Georgia, serif;
}

.atlas-heading h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.atlas-heading p:last-child {
    max-width: 760px;
    margin: 14px auto 0;
    line-height: 1.6;
}

.atlas-eyebrow {
    margin: 0 0 7px;
    color: #765a24;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.atlas-card,
.atlas-locations,
.atlas-coordinate-helper,
.atlas-noscript {
    margin-top: 22px;
}

.atlas-card {
    padding: clamp(12px, 2vw, 20px);
}

.atlas-toolbar,
.atlas-locations-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.atlas-toolbar {
    margin-bottom: 12px;
}

.atlas-toolbar h2,
.atlas-locations h2 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.atlas-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.atlas-actions button,
.atlas-actions a,
.atlas-popup-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 13px;
    color: #fff;
    background: var(--atlas-purple);
    border: 1px solid var(--atlas-purple);
    border-radius: 7px;
    font: 600 0.9rem Roboto, Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.atlas-actions button:hover,
.atlas-actions a:hover,
.atlas-popup-actions a:hover,
.atlas-actions button:focus-visible,
.atlas-actions a:focus-visible,
.atlas-popup-actions a:focus-visible {
    background: var(--atlas-purple-light);
}

.atlas-map-canvas {
    width: 100%;
    height: clamp(420px, 66vh, 760px);
    overflow: hidden;
    background: #173a4a;
    border: 1px solid #604b2c;
    border-radius: 10px;
}

.atlas-status {
    margin: 10px 2px 0;
    color: var(--atlas-muted);
    font-size: 0.86rem;
}

.atlas-locations {
    padding: clamp(18px, 3vw, 30px);
}

.atlas-locations > p {
    line-height: 1.6;
}

.atlas-search-label {
    display: grid;
    gap: 4px;
    min-width: min(100%, 240px);
    color: var(--atlas-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.atlas-search-label input {
    width: 100%;
    min-height: 40px;
    padding: 7px 10px;
    color: var(--atlas-ink);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(75, 58, 34, 0.45);
    border-radius: 7px;
    font: inherit;
}

.atlas-location-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.atlas-location-list li {
    min-width: 0;
    padding: 13px;
    background: rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(75, 58, 34, 0.3);
    border-radius: 9px;
}

.atlas-location-list li[hidden] {
    display: none;
}

.atlas-location-list a,
.atlas-location-list button {
    color: #374e6d;
    background: transparent;
    border: 0;
    padding: 0;
    font: 700 1rem Roboto, Arial, sans-serif;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(55, 78, 109, 0.35);
    text-underline-offset: 3px;
    cursor: pointer;
}

.atlas-location-category {
    display: block;
    margin-top: 3px;
    color: #756a58;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.atlas-coordinate-helper {
    padding: 0;
    overflow: hidden;
}

.atlas-coordinate-helper summary {
    padding: 14px 18px;
    color: var(--atlas-ink);
    background: rgba(181, 147, 73, 0.18);
    font-weight: 700;
    cursor: pointer;
}

.atlas-coordinate-helper p,
.atlas-coordinate-helper output {
    display: block;
    margin: 15px 18px;
}

.atlas-coordinate-helper output {
    padding: 10px;
    background: rgba(255, 255, 255, 0.42);
    border-radius: 6px;
    font-family: monospace;
}

.atlas-noscript {
    padding: 18px;
}

/* Leaflet presentation */
.atlas-page .leaflet-control-zoom a,
.atlas-page .leaflet-control-layers {
    color: #3d2455;
    background: var(--atlas-paper-light);
}

.atlas-page .leaflet-popup-content-wrapper,
.atlas-page .leaflet-popup-tip {
    color: var(--atlas-ink);
    background: #f1e2bf;
}

.atlas-page .leaflet-popup-content {
    min-width: 210px;
}

.atlas-page .leaflet-popup-content h3 {
    margin: 0 0 7px;
    color: #3d2455;
    font-family: Cinzel, Georgia, serif;
    font-size: 1.05rem;
}

.atlas-page .leaflet-popup-content p {
    margin: 0 0 9px;
    line-height: 1.45;
}

.atlas-popup-category {
    margin: 0 0 4px !important;
    color: #765a24;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.atlas-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.atlas-popup-actions a {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.78rem;
}

/* Base marker */
.atlas-marker {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    background-color: var(--marker-colour, #4c2b66);
    border: 2px solid var(--marker-border, #f0d788);
    border-radius: 50%;
    box-shadow:
        0 0 0 1px rgba(40, 26, 15, 0.9),
        0 2px 6px rgba(0, 0, 0, 0.55);
    opacity: 0.88;
}

.atlas-marker:hover,
.atlas-marker:focus {
    opacity: 1;
}

/* Category colours */
.atlas-marker-continent { --marker-colour: #70438a; --marker-border: #f0d788; }
.atlas-marker-empire { --marker-colour: #9c2f2f; --marker-border: #f4d38b; }
.atlas-marker-nation { --marker-colour: #244f7b; --marker-border: #d7e5ef; }
.atlas-marker-region { --marker-colour: #55703a; --marker-border: #dbe8b6; }
.atlas-marker-city { --marker-colour: #b26a21; --marker-border: #ffe0a6; }
.atlas-marker-town,
.atlas-marker-village { --marker-colour: #7a674c; --marker-border: #ead9b5; }
.atlas-marker-island { --marker-colour: #24727b; --marker-border: #c9eef1; }
.atlas-marker-landmark,
.atlas-marker-natural { --marker-colour: #347047; --marker-border: #d5efc9; }
.atlas-marker-ruin { --marker-colour: #555; --marker-border: #ded4c0; }
.atlas-marker-fortress { --marker-colour: #4b4d57; --marker-border: #f0d788; }
.atlas-marker-temple { --marker-colour: #dad3a6; --marker-border: #633d76; }

/* Shape families */
.atlas-marker-location,
.atlas-marker-city,
.atlas-marker-town,
.atlas-marker-village {
    border-radius: 50%;
}

.atlas-marker-continent,
.atlas-marker-empire,
.atlas-marker-nation,
.atlas-marker-region {
    border-radius: 2px;
}

.atlas-marker-island,
.atlas-marker-landmark,
.atlas-marker-natural,
.atlas-marker-ruin,
.atlas-marker-fortress,
.atlas-marker-temple {
    width: 16px !important;
    height: 15px !important;
    background-color: var(--marker-colour, #4c2b66);
    border: 0;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    box-shadow: none;
    filter:
        drop-shadow(0 0 1px var(--marker-border, #f0d788))
        drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65));
}

@media screen and (max-width: 800px) {
    .atlas-page {
        width: min(100% - 18px, 1180px);
        margin-top: 12px;
    }

    .atlas-toolbar,
    .atlas-locations-heading {
        display: block;
    }

    .atlas-actions,
    .atlas-search-label {
        margin-top: 10px;
    }

    .atlas-map-canvas {
        height: 62vh;
        min-height: 390px;
    }

    .atlas-location-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atlas-page .leaflet-zoom-animated,
    .atlas-page .leaflet-fade-anim .leaflet-popup {
        transition: none !important;
    }
}
