/*
 * Shared by every page: tokens, fonts, the band, the footer, and the homepage. The map adds app.css on top.
 */

@font-face {
    font-family: "Overpass";
    src: url("/assets/fonts/overpass.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("/assets/fonts/public-sans.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --band: #000000;
    --band-ink: #ffffff;
    --band-ink-muted: #b9c0ba;
    --paper: #f3f5f1;
    --surface: #ffffff;
    --ink: #1c2321;
    --ink-muted: #5d665f;
    --rule: #d5dad3;
    --caution: #e8a33d;
    --on-caution: #000000;
    --focus: #1f6fb2;

    /* Map marker colors, one per designation group (see GROUP_PRIORITY in map/app.js). */
    --group-parks: #2f7d32;
    --group-monuments: #7b3fa0;
    --group-historical: #b8621b;
    --group-water: #1f6fb2;
    --group-other: #5f6b73;

    /* The homepage's feed colors match the map's markers, lightened in dark mode. */
    --feed-parks: var(--group-parks);
    --feed-monuments: var(--group-monuments);
    --on-feed: #ffffff;

    --font-display: "Overpass", system-ui, sans-serif;
    --font-body: "Public Sans", system-ui, sans-serif;
    --band-height: 56px;
    --wrap: 1120px;
    --gutter: 16px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #141816;
        --surface: #1f2420;
        --ink: #e7ebe6;
        --ink-muted: #9aa59c;
        --rule: #343b35;
        --focus: #8cc4f0;
        --feed-parks: #7fc48b;
        --feed-monuments: #c39be0;
        --on-feed: #000000;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --paper: #141816;
    --surface: #1f2420;
    --ink: #e7ebe6;
    --ink-muted: #9aa59c;
    --rule: #343b35;
    --focus: #8cc4f0;
    --feed-parks: #7fc48b;
    --feed-monuments: #c39be0;
    --on-feed: #000000;
    color-scheme: dark;
}

@media (min-width: 720px) {
    :root {
        --gutter: 32px;
    }
}

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

/* A column, so the footer sits at the bottom of short pages. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

body > main {
    flex: 1 0 auto;
}

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    z-index: 3000;
    top: 8px;
    left: 8px;
    padding: 8px 14px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}


/*
 * The band: black, like the title band on a park brochure. Same height on every page so the map can size
 * itself below it.
 */

.band {
    position: sticky;
    z-index: 2500;
    top: 0;
    height: var(--band-height);
    background: var(--band);
    color: var(--band-ink);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .band {
        box-shadow: 0 1px 0 #2a302c;
    }
}

:root[data-theme="dark"] .band {
    box-shadow: 0 1px 0 #2a302c;
}

.band-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.band :focus-visible {
    outline-color: var(--band-ink);
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.wordmark-mark {
    width: 28px;
    height: 28px;
}

/* Overpass sits high in its line box; nudge the name down to center it on the band. */
.wordmark span {
    padding-top: 3px;
}

.site-nav ul {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: block;
    padding: 6px 12px;
    color: var(--band-ink-muted);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--band-ink);
}

.site-nav a[aria-current="page"] {
    color: var(--band-ink);
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}


/*
 * Buttons
 */

.button {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 4px;
    background: var(--button-bg, var(--ink));
    color: var(--button-ink, var(--paper));
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    text-decoration: none;
}

.button:hover {
    box-shadow: inset 0 0 0 100px rgb(255 255 255 / 0.12);
}


/*
 * Homepage: intro and the alert specimen
 */

.page-home main {
    padding-bottom: 96px;
}

.intro {
    display: grid;
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 72px;
}

.intro h1 {
    text-wrap: balance;
    font-size: clamp(44px, 7vw, 68px);
    line-height: 1;
    letter-spacing: -0.02em;
}

.lede {
    max-width: 34em;
    margin: 24px 0 0;
    font-size: 19px;
    color: var(--ink);
}

@media (min-width: 900px) {
    .intro {
        grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
        align-items: center;
        gap: 64px;
        padding-top: 88px;
        padding-bottom: 104px;
    }
}

.specimen {
    margin: 0;
}

.notice {
    padding: 22px 24px 24px;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 4px;
}

.notice :where(p) {
    margin: 0;
}

.notice-park {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    line-height: 1.25;
}

.notice-tags {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 15px;
    color: var(--ink-muted);
    white-space: nowrap;
}

.notice-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--ink-muted);
}

.notice-category {
    padding: 2px 10px;
    border-radius: 2px;
    background: linear-gradient(var(--caution), var(--caution)) left / 100% 100% no-repeat;
    color: var(--on-caution);
    font-weight: 700;
}

.notice-title {
    margin-top: 18px;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.35;
}

.notice-body {
    margin-top: 8px;
    font-size: 16px;
}

.notice-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.specimen figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--ink-muted);
}

/* The page's one moment of motion: the notice arrives and its category fills in. */
@media (prefers-reduced-motion: no-preference) {
    .notice {
        animation: notice-arrive 500ms cubic-bezier(0.2, 0.7, 0.2, 1) 150ms both;
    }

    .notice-category {
        animation: category-fill 450ms ease-out 550ms both;
    }

    @keyframes notice-arrive {
        from {
            opacity: 0;
            transform: translateY(-12px);
        }
    }

    @keyframes category-fill {
        from {
            background-size: 0% 100%;
            color: var(--ink);
        }
    }
}


/*
 * Homepage: the feeds
 */

.follow h2,
.map-teaser h2 {
    font-size: clamp(30px, 4vw, 40px);
}

.feeds {
    display: grid;
    gap: 48px;
    margin-top: 32px;
}

/* Side by side, the two feeds share rows, so their buttons line up even when one description is longer. */
@media (min-width: 760px) {
    .feeds {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 48px 64px;
    }

    .feed {
        display: grid;
        grid-row: span 4;
        grid-template-rows: subgrid;
        row-gap: 0;
        align-content: start;
    }
}

.feed {
    padding-top: 20px;
    border-top: 8px solid var(--feed-color);
}

.feed--parks {
    --feed-color: var(--feed-parks);
}

.feed--monuments {
    --feed-color: var(--feed-monuments);
}

.feed h3 {
    font-size: 28px;
}

.feed > p {
    max-width: 34em;
    margin: 8px 0 0;
    color: var(--ink-muted);
}

.follow-links {
    display: grid;
    gap: 14px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

/* Handle under its button, so every row lines up whatever the handle's length. */
.follow-links li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.follow-links .button {
    --button-bg: var(--feed-color);
    --button-ink: var(--on-feed);
    min-width: 200px;
    text-align: center;
}

.handle {
    font-size: 15px;
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

.feed-rss {
    margin: 20px 0 0;
    font-size: 15px;
    color: var(--ink-muted);
}

.feed-rss a {
    color: var(--ink);
}


/*
 * Homepage: map teaser
 */

.map-teaser {
    display: grid;
    gap: 32px;
    align-items: center;
    margin-top: 96px;
}

@media (min-width: 900px) {
    .map-teaser {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 64px;
    }
}

.map-teaser-text p {
    max-width: 30em;
    margin: 12px 0 24px;
    color: var(--ink-muted);
}

.map-teaser-image {
    display: block;
    border: 2px solid var(--ink);
    border-radius: 4px;
    overflow: hidden;
}

.map-teaser-image img {
    display: block;
    width: 100%;
    height: auto;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .map-teaser-image img {
        filter: brightness(0.85);
    }
}

:root[data-theme="dark"] .map-teaser-image img {
    filter: brightness(0.85);
}


/*
 * Footer
 */

.site-footer {
    background: var(--band);
    color: var(--band-ink-muted);
    font-size: 15px;
}

.site-footer a {
    color: var(--band-ink);
}

.site-footer :focus-visible {
    outline-color: var(--band-ink);
}

.footer-inner {
    display: grid;
    gap: 24px;
    padding-top: 40px;
    padding-bottom: 48px;
}

@media (min-width: 900px) {
    .footer-inner {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: 64px;
    }
}

.footer-note {
    max-width: 40em;
    margin: 0;
}

.footer-links {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}

.footer-feed {
    min-width: 11em;
    color: var(--band-ink);
    font-weight: 600;
}


/*
 * 404
 */

.not-found {
    padding-top: 88px;
    padding-bottom: 120px;
}

.not-found h1 {
    font-size: clamp(40px, 6vw, 56px);
}

.not-found p {
    max-width: 34em;
    margin: 16px 0 28px;
}
