/* Self-hosted so the request path stays free of third-party fetches.
   Montserrat ships as one variable file covering 400-700; Archivo Black
   has a single weight. Both SIL OFL — see OFL-*.txt beside the woff2. */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin-variable.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Archivo Black";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/archivo-black-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
        U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;

    /* Body zone — nimbamtb.org's white content sections. */
    --bg: #ffffff;
    --surface: #f6f6f6;
    --hairline: #e2e2e2;
    --field-border: #c9c9c9;
    --text: #1b1b1b;               /* 17.2:1 on --bg, 15.9:1 on --surface */
    --text-muted: #5e5e5e;         /*  6.5:1 on --bg,  6.0:1 on --surface */

    /* Chrome zone — the masthead band. --brand-blue is NIMBA's actual
       blue and may appear ONLY here: 3.08:1 on white, which fails AA for
       text, against 6.82:1 on black. --action below is its darkened
       sibling for the light body. Do not collapse the two. */
    --band: #000000;
    --band-text: #ffffff;          /* 21.0:1 on --band */
    --band-muted: #a4a4a4;
    --brand-blue: #4A9BC9;         /*  6.8:1 on --band */

    /* Status ramp: traffic-light hues, desaturated so the board sits
       inside NIMBA's monochrome instead of becoming the loudest thing in
       it. Text values clear AA on --bg and --surface; bar values clear
       the 3:1 non-text floor on --surface. */
    --status-open: #3F6B45;        /*  6.2:1 on --bg,  5.7:1 on --surface */
    --status-open-bar: #3F6B45;
    --status-caution: #7E6320;     /*  5.7:1 on --bg,  5.3:1 on --surface */
    --status-caution-bar: #A88222; /*  3.3:1 on --surface */
    --status-closed: #9A4232;      /*  6.6:1 on --bg,  6.1:1 on --surface */
    --status-closed-bar: #9A4232;
    --status-none-bar: #8a8a8a;    /*  3.2:1 on --surface — quieter than
                                      every real status bar, on purpose */

    --action: #1F6D96;             /*  5.7:1 on --bg */
    --on-action: #ffffff;          /*  5.7:1 on --action,
                                      6.6:1 on --status-closed-bar */

    --precip-fill: #3B87B4;
    --precip-peak: #1F6D96;
    --precip-dry: #e4e4e4;

    --font-body: Montserrat, ui-sans-serif, system-ui, sans-serif;
    --font-display: "Archivo Black", Impact, ui-sans-serif, sans-serif;

    --masthead-size: 1.6rem;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
}

.page-wrapper {
    min-height: 100vh;
    padding: 0 16px 40px;
}

main {
    max-width: 40rem;
    margin: 0 auto;
}

.site-header {
    background: var(--band);
    margin-bottom: 22px;
}

.site-header-inner {
    max-width: 40rem;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.site-brand {
    display: flex;
    flex-shrink: 0;
}

.site-brand img {
    display: block;
    height: 34px;
    width: 84px;
}

/* Donate and the board title sit at --masthead-size so nothing in the header
   reads as smaller than the page title. */
.donate-chip {
    border: 1px solid var(--brand-blue);
    border-radius: 3px;
    padding: 2px 12px;
    color: var(--brand-blue);
    text-decoration: none;
    font-size: var(--masthead-size);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

h1 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 560;
    letter-spacing: -0.03em;
}

.board-title {
    margin: 0 0 20px;
    text-align: center;
    font-family: var(--font-display);
    font-size: var(--masthead-size);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.board-title::after {
    content: "";
    display: block;
    width: 46px;
    height: 1px;
    margin: 10px auto 0;
    background: var(--hairline);
}

h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 560;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.trail-board {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trail-row {
    background: var(--surface);
}

.trail-row-link {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
    min-height: 44px;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    border-left: 3px solid var(--status-none-bar);
}

.trail-row-link.status-open { border-left-color: var(--status-open-bar); }
.trail-row-link.status-caution { border-left-color: var(--status-caution-bar); }
.trail-row-link.status-closed { border-left-color: var(--status-closed-bar); }

.trail-row-main {
    min-width: 0;
}

.trail-row-main h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.trail-row .headline,
.trail-row .agreement,
.trail-row .estimate {
    margin: 0 0 2px;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}

.trail-row-status {
    margin: 0;
    align-self: center;
    font-size: 1rem;
    white-space: nowrap;
}

.headline {
    margin: 0 0 8px;
    font-weight: 500;
}

.agreement,
.estimate,
.back-link,
.trail-park {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.trail-park {
    margin: 0 0 4px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-open { color: var(--status-open); }
.status-caution { color: var(--status-caution); }
.status-closed { color: var(--status-closed); }
.status-none { color: var(--text-muted); }

/* The line that produced the headline status: the report line while the report
   is inside REPORT_FRESHNESS_HOURS, the weather line once it is not. In a board
   row every line is muted, so bold also brightens; on the trail page the status
   colour already carries meaning, so bold is weight only. */
.line-authoritative {
    font-weight: 600;
}

.trail-row .line-authoritative {
    color: var(--text);
    font-weight: 600;
}

.trail-detail h1 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.trail-detail .headline {
    font-size: 1.05rem;
    margin: 0 0 4px;
}

.trail-detail .agreement,
.trail-detail .estimate {
    margin: 0 0 2px;
    font-size: 0.88rem;
}

.trail-detail section {
    margin-top: 22px;
}

.back-link a {
    color: var(--text-muted);
}

.back-link a:focus,
.trail-row-link:focus,
.quiet-strip:focus,
.report-form button:focus,
.retract-form button:focus {
    outline: 2px solid var(--action);
    outline-offset: 2px;
}

.site-brand:focus,
.donate-chip:focus {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

.report-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.report-list li {
    border-top: 1px solid var(--hairline);
    padding: 10px 0;
    font-size: 0.95rem;
}

.report-comment {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.precip-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 88px;
    padding-top: 8px;
}

.precip-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.precip-bar {
    width: 100%;
    min-height: 2px;
    background: var(--precip-dry);
    border-radius: 2px 2px 0 0;
}

.precip-bar-wet {
    background: var(--precip-fill);
}

.precip-bar-peak {
    background: var(--precip-peak);
}

.precip-bar-label {
    margin-top: 6px;
    font-size: 0.62rem;
    color: var(--text-muted);
}

.quiet-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 12px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--hairline);
    color: var(--text);
    text-decoration: none;
}

.quiet-strip-action {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--action);
}

.quiet-strip-hint {
    flex-basis: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.quiet-strip-hint-only {
    border: 0;
    padding: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.report-form-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--hairline);
}

.report-form {
    position: relative;
    display: grid;
    gap: 8px;
}

.report-form label {
    margin-top: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.report-form select,
.report-form input[type="text"],
.report-form textarea {
    width: 100%;
    padding: 10px;
    border-radius: 0;
    border: 1px solid var(--field-border);
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}

.report-form button {
    margin-top: 14px;
    padding: 12px 14px;
    min-height: 44px;
    border: 0;
    background: var(--action);
    color: var(--on-action);
    font-weight: 700;
    cursor: pointer;
}

.observed-when {
    border: 0;
    padding: 0;
    margin: 0;
}

.observed-when legend {
    margin-top: 8px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.segmented-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.report-form label.chip {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0;
    padding: 8px 10px;
    border: 1px solid var(--field-border);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
}

.report-form label.chip:has(input:checked) {
    background: var(--action);
    border-color: var(--action);
    color: var(--on-action);
}

/* The real radio is opacity:0, so the label has to carry the ring. --text
   rather than the --action used elsewhere: a checked chip's background is
   --action, and the ring would disappear on it. */
.report-form label.chip:has(input:focus-visible) {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.report-form label.chip:has(input:disabled) {
    color: var(--text-muted);
    cursor: not-allowed;
}

.report-form label.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stale-notice {
    margin-top: 8px;
    color: var(--status-caution);
    font-size: 0.94rem;
}

.stale-notice[hidden] {
    display: none;
}

.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.admin-panel {
    background: var(--surface);
    padding: 18px 16px 16px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hairline);
    vertical-align: top;
}

.admin-table th {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.retract-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.retract-form input[type="text"] {
    min-width: 8rem;
    padding: 6px 8px;
    border: 1px solid var(--field-border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
}

.retract-form button {
    padding: 8px 10px;
    min-height: 44px;
    border: 0;
    background: var(--status-closed-bar);
    color: var(--on-action);
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 420px) {
    .precip-bar-col:nth-child(even) .precip-bar-label {
        visibility: hidden;
    }
}

.reject-notice .headline {
    margin-top: 10px;
}

.reject-notice .back-link {
    margin-top: 22px;
}
