/*
 * The public status page.
 *
 * Shares /assets/venta.css with the console and the support site - tokens, buttons, cards, tags -
 * and adds only what a status page has that they do not: the verdict, the component list and the
 * 90-day strip.
 *
 * One colour rule runs through all of it: green is not a decoration. A visitor should be able to
 * answer "is it broken" from the colour alone, at arm's length, before reading a word.
 *
 * No build step - see docs/specs/moderation-and-support.md §8.
 */

body {
    display: flex;
    flex-direction: column;
}

main {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 64px;
    flex: 1;
}

/* ── Masthead ───────────────────────────────────────────────────────────── */

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}

.brand:hover { text-decoration: none; }
.brand [data-icon] { font-size: 26px; }

.brand-sub {
    color: var(--muted);
    font-weight: 500;
    margin-left: 6px;
}

.masthead-meta {
    color: var(--faint);
    font-size: 12px;
}

.page { display: none; }
.page[data-active] { display: block; }

/* ── The verdict ────────────────────────────────────────────────────────── */

.verdict {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 30px 26px;
    margin: 12px 0 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);

    /* The left edge is the fastest signal on the page. Everything below it repeats this in words. */
    border-left: 5px solid var(--ok);
}

.verdict h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.verdict-sub {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.verdict-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 50%;
    background: var(--ok-bg);
    color: var(--ok);
}

.verdict-mark [data-icon] { font-size: 24px; }

.verdict[data-tone="degraded"] { border-left-color: var(--warn); }
.verdict[data-tone="degraded"] .verdict-mark { background: var(--warn-bg); color: var(--warn); }

.verdict[data-tone="down"] { border-left-color: var(--danger); }
.verdict[data-tone="down"] .verdict-mark { background: var(--danger-bg); color: var(--danger); }

.verdict[data-tone="maintenance"] { border-left-color: var(--info); }
.verdict[data-tone="maintenance"] .verdict-mark { background: var(--info-bg); color: var(--info); }

/* ── Cards and sections ─────────────────────────────────────────────────── */

main .card { margin-bottom: 20px; }

.card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--brand);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.link-btn:hover { text-decoration: underline; }

/* ── Components ─────────────────────────────────────────────────────────── */

.components {
    display: flex;
    flex-direction: column;
}

.component {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-soft);
}

.component:last-child { border-bottom: 0; }

.component-name {
    font-weight: 550;
    font-size: 14.5px;
}

.component-desc {
    grid-column: 1;
    color: var(--faint);
    font-size: 12.5px;
}

.component-state {
    grid-row: 1 / span 2;
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ok);
    flex: none;
}

.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dot.info { background: var(--info); }
.dot.unknown { background: var(--faint); }

/* ── The 90-day strip ───────────────────────────────────────────────────── */

.strip {
    grid-column: 1 / -1;
    display: flex;
    gap: 2px;
    height: 26px;
    margin-top: 8px;
    align-items: stretch;
}

.strip i {
    flex: 1 1 0;
    min-width: 2px;
    border-radius: 2px;
    background: var(--ok);
    opacity: .85;
}

.strip i.warn { background: var(--warn); }
.strip i.danger { background: var(--danger); }
.strip i.info { background: var(--info); }

/* Grey, not green. "We have no record of that day" and "that day was fine" are different answers
   and the strip must not round the first one up to the second. */
.strip i.unknown { background: var(--border); opacity: 1; }

.strip-legend {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    color: var(--faint);
    font-size: 11.5px;
    margin-top: 5px;
}

@media (max-width: 620px) {
    /* Ninety bars in 320px is two pixels each with no gap. The strip stops being information and
       starts being a texture, so it goes rather than shrinks. */
    .strip, .strip-legend { display: none; }
}

/* ── Incidents ──────────────────────────────────────────────────────────── */

.incident {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 18px 20px;
    border-left: 4px solid var(--warn);
}

.incident.critical { border-left-color: var(--danger); }
.incident.info { border-left-color: var(--info); }
.incident.resolved { border-left-color: var(--ok); }

.incident-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.incident h3 {
    margin: 0 0 4px;
    font-size: 16.5px;
    line-height: 1.3;
}

.incident-meta {
    color: var(--faint);
    font-size: 12.5px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.incident-components {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* ── Timeline ───────────────────────────────────────────────────────────── */

.timeline {
    margin: 16px 0 0;
    padding: 0 0 0 18px;
    border-left: 2px solid var(--border);
    list-style: none;
}

.timeline li {
    position: relative;
    padding: 0 0 16px;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 0 0 0 3px var(--panel);
}

.timeline li[data-state="resolved"]::before,
.timeline li[data-state="completed"]::before { background: var(--ok); }

.timeline-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.timeline-state {
    font-weight: 650;
    font-size: 13px;
    letter-spacing: .01em;
}

.timeline-time {
    color: var(--faint);
    font-size: 12px;
}

.timeline-body {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
}

/* ── History rows ───────────────────────────────────────────────────────── */

.history-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
}

.history-row:last-child { border-bottom: 0; }
.history-row a { color: var(--text); font-weight: 550; font-size: 14px; }
.history-row .when { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

.actions {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 20px 34px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--faint);
    font-size: 12.5px;
    border-top: 1px solid var(--border-soft);
}

footer a { color: var(--muted); margin-left: 14px; }
footer a:first-child { margin-left: 0; }

@media (max-width: 560px) {
    .verdict { padding: 22px 18px; gap: 14px; }
    .verdict h1 { font-size: 21px; }
    .component { grid-template-columns: 1fr; }
    .component-state { grid-row: auto; grid-column: 1; }
}
