:root {
    /* Colors (brand) */
    --off-white: #fffef8;
    --beige: #f5f3ea;
    --dark-gray: #181818;
    --brown: #726d5f;
    --yellow: #eeb631;
    --red: #a71930;
    --light-gray: rgba(24, 24, 24, 0.2);
    --placeholder-gray: #e8e5dc;
    --blue: #3F86BF;
    --green: #284232;

    --dark-blue: #3876A8;

    /* Tints for backgrounds */
    --yellow-tint: #fdf5df;
    --red-tint: #f4eaec;
    --green-tint: #A8EABE;
    --blue-tint: #e4eef6;

    /* Font Families. Brand fonts load only where they're installed or served; fallbacks below. */
    --sans: Saans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --serif: "PP Editorial New", Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--sans);
    background: var(--beige);
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.5;
}

a {
    color: var(--red);
}

/* Header */
.site-header {
    padding: 1.5rem 1rem;
}

.header-inner {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo {
    height: 64px;
    width: auto;
    /* alt text styling until the logo file exists */
    font-family: var(--sans);
    color: var(--red);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.site-header h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.1;
    margin: 0;
}

.logo-text {
    display: inline-flex;
    align-items: center;
    font-size: 1.4rem;
}

/* Layout */
.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.sample-notice {
    background: var(--red);
    color: var(--off-white);
    text-align: center;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 0 0 1.5rem;
}

/* Overall summary */
.summary {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.summary:empty {
    display: none;
}

.summary-green {
    background: var(--green-tint);
    border-color: var(--green);
    color: var(--green);
}

.summary-yellow {
    background: var(--yellow-tint);
    border-color: var(--yellow);
}

.summary-red {
    background: var(--red-tint);
    border-color: var(--red);
    color: var(--red);
}

/* Incident banners */
.incident-banner {
    background: var(--yellow-tint);
    border: 1px solid var(--yellow);
    border-left: 6px solid var(--yellow);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.incident-banner h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.15rem;
}

.incident-status {
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: var(--yellow);
    color: var(--dark-gray);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* Outage impact = red banner */
.impact-outage {
    background: var(--red-tint);
    border-color: var(--red);
}

.impact-outage .incident-status {
    background: var(--red);
    color: var(--off-white);
}

/* Monitoring = fix in place, watching it (overrides outage red) */
.incident-monitoring {
    background: var(--blue-tint);
    border-color: var(--blue);
}

.incident-monitoring .incident-status {
    background: var(--blue);
    color: var(--off-white);
}

.affected-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-weight: 600;
}

.affected-list>li {
    margin-bottom: 0.25rem;
}

.affected-sub {
    font-weight: 400;
    padding-left: 1.25rem;
    margin: 0.15rem 0 0;
    columns: 2;
    column-gap: 2rem;
}

.affected-all {
    font-weight: 400;
    color: var(--brown);
}

@media (max-width: 560px) {
    .affected-sub {
        columns: 1;
    }
}

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

.incident-updates li {
    padding: 0.6rem 0;
    border-top: 1px solid var(--light-gray);
}

.incident-updates li:first-child {
    border-top: none;
    padding-top: 0;
}

.update-time {
    color: var(--brown);
    font-size: 0.85rem;
    display: block;
}

/* Systems list */
.list-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}

.last-updated {
    color: var(--brown);
    font-size: 0.85rem;
}

.category {
    margin-bottom: 1.75rem;
}

.category-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.systems-group {
    background: var(--off-white);
    border: 1px solid var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
}

.system-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--light-gray);
}

.system-row:last-child {
    border-bottom: none;
}

.system-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.system-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.system-meta {
    color: var(--brown);
    font-size: 0.8rem;
}

/* Accordion rows */
.system-group {
    display: block;
    padding: 0;
}

.system-group summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.system-group summary::-webkit-details-marker {
    display: none;
}

.system-group summary:hover {
    background: var(--beige);
}

.system-group summary:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.system-group summary .system-text {
    flex: 1;
}

.chevron {
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid var(--dark-gray);
    border-bottom: 2px solid var(--dark-gray);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-right: 0.15rem;
}

.system-group[open] .chevron {
    transform: rotate(45deg);
}

.affected-count {
    color: var(--brown);
    font-size: 0.85rem;
    white-space: nowrap;
}

.child-panel {
    border-top: 1px solid var(--light-gray);
    /* background: var(--beige); */
    padding: 0.75rem 1.25rem 0.75rem 3.1rem;
}

.child-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--brown);
    margin-bottom: 0.25rem;
}

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

.child-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.child-row:last-child {
    border-bottom: none;
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.pill-small {
    font-size: 0.78rem;
    padding: 0.15rem 0.6rem;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
}

.status-green {
    background: var(--green-tint);
    color: var(--green);
}

.status-green .status-dot {
    background: var(--green);
}

.status-yellow {
    background: var(--yellow);
    color: var(--dark-gray);
}

.status-yellow .status-dot {
    background: var(--dark-gray);
}

.status-red {
    background: var(--red);
    color: var(--off-white);
}

.status-red .status-dot {
    background: var(--off-white);
}

/* Past incidents page */
.page-nav {
    margin: 0 0 1.5rem;
}

.history-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: var(--off-white);
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.history-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.history-meta {
    color: var(--brown);
    font-size: 0.85rem;
    margin: 0.25rem 0 0.5rem;
}

.history-updates summary {
    cursor: pointer;
    color: var(--red);
    font-size: 0.9rem;
}

.history-updates .incident-updates {
    margin-top: 0.5rem;
}

.empty {
    color: var(--brown);
}

/* Maintenance (blue) status */
.status-blue {
    background: var(--blue-tint);
    color: #1f4e75;
}

.status-blue .status-dot {
    background: var(--blue);
}

.summary-blue {
    background: var(--blue-tint);
    border-color: var(--blue);
    color: #1f4e75;
}

.maintenance-banner {
    background: var(--blue-tint);
    border-color: var(--blue);
}

.maintenance-banner .incident-status {
    background: var(--dark-blue);
    color: var(--off-white);
}

.maintenance-when {
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.maintenance-details {
    margin: 0 0 0.75rem;
}

.maintenance-affected {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
}

.maintenance-item .maintenance-details {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

.maintenance-item:target {
    outline: 2px solid var(--blue);
}

.page-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Calendar */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cal-title {
    margin: 0;
    min-width: 11rem;
    text-align: center;
}

.cal-btn {
    font: inherit;
    background: var(--off-white);
    border: 1px solid var(--dark-gray);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.cal-btn:hover {
    background: var(--placeholder-gray);
}

.cal-btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.cal-today-btn {
    margin-left: auto;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    background: var(--off-white);
    margin-bottom: 2rem;
}

.cal-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brown);
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--dark-gray);
    background: var(--beige);
}

.cal-cell {
    min-height: 6rem;
    padding: 0.35rem;
    border-right: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.cal-cell:nth-child(7n) {
    border-right: none;
}

.cal-empty {
    background: var(--beige);
}

.cal-past .cal-day {
    color: var(--brown);
}

.cal-day {
    font-size: 0.85rem;
    font-weight: 600;
}

.cal-today .cal-day {
    background: var(--red);
    color: var(--off-white);
    border-radius: 999px;
    padding: 0 0.45rem;
    align-self: flex-start;
}

.cal-event {
    display: block;
    font-size: 0.75rem;
    line-height: 1.3;
    background: var(--blue-tint);
    border: 1px solid var(--blue);
    color: var(--black);
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-event:hover,
.cal-event:focus-visible {
    background: #1f4e75;
    color: #ffffff;
}

.cal-event.state-past {
    background: var(--placeholder-gray);
    color: var(--brown);
}

.cal-time {
    font-weight: 700;
}

.list-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.past-log {
    margin-top: 1.5rem;
}

.past-log .history-group {
    margin-top: 0.75rem;
}

/* Small screens: calendar shows dots, the list does the work */
@media (max-width: 640px) {
    .cal-cell {
        min-height: 3rem;
        align-items: center;
    }

    .cal-event {
        width: 0.5rem;
        height: 0.5rem;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
    }

    .cal-today .cal-day {
        align-self: center;
    }

    .cal-title {
        min-width: 0;
        font-size: 1.2rem;
    }
}

/* Footer */
.site-footer {
    margin-top: 2rem;
    color: var(--brown);
    font-size: 0.9rem;
    text-align: center;
}

.loading,
.error {
    color: var(--brown);
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}

.error {
    color: var(--red);
}

/* Small screens: hide the "x of y affected" text, keep the pill */
@media (max-width: 560px) {
    .affected-count {
        display: none;
    }

    .header-inner {
        gap: 1rem;
    }

    .logo {
        height: 48px;
    }

    .child-panel {
        padding-left: 1.25rem;
    }
}