/* ═══════════════════════════════════════════
   YATOUB // STATUS — page styles
   Palette and base components come from /styles.css
   ═══════════════════════════════════════════ */

:root {
    --st-up: var(--green-dot);
    --st-warn: var(--yellow-dot);
    --st-down: var(--red-dot);
    --st-unknown: var(--text-3);
}

.st-lang { margin-left: auto; }
.st-main { padding-top: calc(var(--nav-h) + 4rem); padding-bottom: 4rem; }

/* ── State colours (navbar dot, banner, pills) ── */
[data-state="up"]       { --st-color: var(--st-up); }
[data-state="degraded"] { --st-color: var(--st-warn); }
[data-state="down"]     { --st-color: var(--st-down); }
[data-state="stale"],
[data-state="unknown"],
[data-state="loading"]  { --st-color: var(--st-unknown); }

.status-dot[data-state] { background: var(--st-color); box-shadow: 0 0 6px var(--st-color); }

/* ── Hero ── */
.st-pre { font-size: 0.8rem; color: var(--text-3); margin-bottom: 1rem; }
.st-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: var(--text-1);
    margin-bottom: 1.25rem;
}
.st-sub { max-width: 60ch; font-size: 0.85rem; color: var(--text-2); margin-bottom: 2.5rem; }

.st-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-left: 3px solid var(--st-color);
}
.st-banner-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--st-color);
    box-shadow: 0 0 12px var(--st-color);
}
.st-banner-state {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 2.6vw, 1.1rem);
    letter-spacing: 0.06em;
    color: var(--st-color);
}
.st-banner-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 0.25rem; }

/* ── Service rows ── */
.st-list { display: flex; flex-direction: column; gap: 1rem; }

.st-row {
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.st-row:hover { border-color: var(--border-bright); }

.st-row-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.9rem;
}
.st-name { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.05em; color: var(--text-1); }
.st-badge {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.5rem;
    color: var(--text-3);
    border: 1px solid var(--border-bright);
}
.st-pill {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--st-color);
}
.st-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--st-color);
    box-shadow: 0 0 6px var(--st-color);
}

/* ── Uptime bars: one per day, oldest on the left ── */
.st-bars { display: flex; gap: 2px; height: 28px; }
.st-bar { flex: 1; min-width: 2px; border-radius: 1px; background: var(--bg-3); }
.st-bar[data-day="ok"]   { background: var(--st-up); }
.st-bar[data-day="warn"] { background: var(--st-warn); }
.st-bar[data-day="bad"]  { background: var(--st-down); }
.st-bars .st-bar { opacity: 0.85; transition: opacity var(--transition), transform var(--transition); }
.st-bars .st-bar:hover { opacity: 1; transform: scaleY(1.15); }

.st-row-foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.7rem;
    font-size: 0.7rem;
    color: var(--text-3);
}
.st-row-foot strong { color: var(--text-1); font-weight: 500; }

/* ── Legend & footer ── */
.st-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.7rem;
    color: var(--text-3);
}
.st-legend li { display: flex; align-items: center; gap: 0.5rem; }
.st-legend .st-bar { flex: none; width: 4px; height: 14px; }

.st-foot {
    padding-top: 2rem;
    padding-bottom: 3rem;
    font-size: 0.7rem;
    line-height: 1.9;
    color: var(--text-3);
    border-top: 1px solid var(--border);
}
.st-foot a { color: var(--green); }
.st-foot a:hover { text-decoration: underline; }

/* 90 bars do not fit a phone: keep the 30 most recent days */
@media (max-width: 768px) {
    .st-bars .st-bar:nth-last-child(n + 31) { display: none; }
    .st-row, .st-banner { padding: 1rem; }
}
