/* Cartograff: mobile first, then wider screens at the bottom */

:root {
    --brand: #447FFF;
    --brand-dark: #2156C9;
    --text: #1F2328;
    --muted: #59636E;
    --background: #FFFFFF;
    --header-height: 56px;
    --gap: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--background);
}

img {
    max-width: 100%;
}

a {
    color: var(--brand-dark);
    font-weight: 600;
}

a:hover,
a:focus-visible {
    color: var(--brand);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---- header: logo and counts */

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px var(--gap);
    min-height: var(--header-height);
    padding: 6px var(--gap);
    border-bottom: 2px solid var(--brand);
    background: var(--background);
}

.site-logo {
    display: block;
    width: 150px;
    height: auto;
}

.site-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-counts li,
.facts > div,
.photo-nav > * {
    padding: 4px 10px;
    font-weight: 600;
    color: #FFFFFF;
    background: var(--brand);
}

main {
    flex: 1;
    padding: var(--gap);
}

/* ---- maps */

.map {
    width: 100%;
    height: 60vh;
    min-height: 280px;
}

/* the home page map fills the window under the header */
main.main-map {
    display: flex;
    padding: 0;
}

.map-full {
    height: auto;
    min-height: 0;
    flex: 1;
}

.map-pair {
    display: grid;
    gap: var(--gap);
}

.map-pair .map {
    height: 45vh;
}

/* info window: a marker's thumbnail and photo count */
.info-window-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
    color: var(--brand-dark);
}

.info-window-thumbnail {
    width: 75px;
    height: 75px;
    object-fit: cover;
}

.info-window-thumbnail.loading {
    background: url("/images/download.gif") center no-repeat;
}

/* ---- a location: facts and photo strips */

.location-title {
    margin: var(--gap) 0 0;
    font-size: 1.4rem;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: var(--gap) 0;
}

.facts > div {
    display: flex;
    gap: 6px;
}

.facts dt::after {
    content: ":";
}

.facts dd {
    margin: 0;
    font-weight: 400;
}

.facts a {
    color: #FFFFFF;
}

.timeline h2 {
    margin: 20px 0 6px;
    font-size: 1.2rem;
}

.photo-strip {
    display: flex;
    gap: 4px;
    padding: 4px;
    overflow-x: auto;
    background: var(--brand);
}

.photo-strip a {
    flex: none;
}

.photo-strip img {
    display: block;
    height: 160px;
    width: auto;
}

/* ---- a photo */

.photo-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.photo-nav a {
    color: #FFFFFF;
    text-decoration: none;
}

.photo-nav a:hover,
.photo-nav a:focus-visible {
    background: var(--brand-dark);
}

.photo-nav span[aria-disabled] {
    opacity: 0.5;
}

.photo {
    margin: var(--gap) 0 0;
}

.photo img {
    display: block;
    max-height: 80vh;
    width: auto;
}

/* ---- errors */

.message {
    max-width: 40rem;
}

.request-id {
    color: var(--muted);
    font-size: 0.875rem;
}

/* ---- wider screens */

@media (min-width: 800px) {
    .map-pair {
        grid-template-columns: 1fr 1fr;
    }

    .map-pair .map {
        height: 50vh;
    }

    .photo-strip img {
        height: 200px;
    }
}
