/* status.css - Status page specific styles */

/* Skip-to-Content Link (Accessibility) */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 9999;
}

.skip-to-content:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-xs);
    text-decoration: none;
    z-index: 9999;
    /* Ink ring (--text-primary: white in dark, near-black in light): the on-primary ink alone vanishes against the
       page ground; matches UserDocumentation */
    outline: 2px solid var(--text-primary);
}

/* Visually Hidden (Accessibility) */
.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;
}

/* Semantic List Resets */
ul.section-content,
ol.section-content,
ol.incidents-list,
ol.incident-timeline,
ol.history-card-updates,
ul.affected-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.affected-list {
    display: inline;
}

ul.affected-list li {
    display: inline;
}

.status-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header: the App's .main-header (F .hdr) — 56px, glass surface on tokens (a white wash in light), blur 20px, 12px
   between the controls. The 900px column is kept. */
.status-header {
    height: 56px;
    padding: 0 var(--space-md);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.status-header-content {
    max-width: 900px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.status-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.status-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== THEME TOGGLE — one block, byte-identical in both sites' stylesheets; scripts/check-token-parity.js --check fails on any drift, so edit both copies together ===== */
/* Two-state header button (Components/ThemeToggle.razor, I-043 Decision 10), wired by js/site-theme.js; the icon shows
   the theme in use. Hover ink is --color-primary-text, the contrast-safe primary ink (not --color-primary). */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--color-fg-06);
    color: var(--color-primary-text);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.theme-toggle__icon {
    display: block;
}

.theme-toggle__icon--sun,
:root[data-theme="light"] .theme-toggle__icon--moon {
    display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
    display: block;
}
/* ===== END THEME TOGGLE ===== */

.status-logo-text {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

/* Control recipe — the App's form controls (overrides.css "Form controls", F .inp / .sel): 38px, radius 12, 1px border
   on the --control-bg surface (white in light), hover recolours the border, focus adds the one 2px --color-primary-glow
   ring. The language picker and the subscribe form's select / input share it. The border is the App's --control-border
   (its 3 : 1 boundary token, WCAG 1.4.11), not --glass-border-light: these fields are identified by their outline alone
   and the glass border measured 2.03 : 1 (dark) / 1.55 : 1 (light) against the header and the card (I-043 TASK_06). */
.language-picker,
.subscribe-select,
.subscribe-email-input {
    height: 38px;
    padding: 0 var(--space-md);
    background-color: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.language-picker:hover,
.subscribe-select:hover,
.subscribe-email-input:hover {
    border-color: var(--color-primary-light);
}

.language-picker:focus-visible,
.subscribe-select:focus-visible,
.subscribe-email-input:focus-visible {
    border-color: var(--color-primary-light);
    outline: 2px solid transparent; /* invisible normally; the one ring in forced-colors mode, which drops box-shadow */
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.subscribe-email-input::placeholder {
    color: var(--text-muted);
}

/* Select: native control, chevron drawn as two token-coloured gradient strokes (follows the theme, no SVG literal) */
.language-picker,
.subscribe-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: calc(var(--space-md) + 18px);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.language-picker option,
.subscribe-select option {
    background: var(--color-bg-dark-secondary);
    color: var(--text-primary);
}

/* The App's I-012 rule: controls grow to a 44px touch target on a phone */
@media (max-width: 480px) {
    .language-picker,
    .subscribe-select,
    .subscribe-email-input {
        height: 44px;
    }
}

/* The subscribe form keeps the 44px touch target it had before I-061 on every touch width (tablet included, ≤ 1024px;
   PR 891 thread 14258); desktop keeps the App's 38px control. .subscribe-btn has the same rule in
   Components/SubscribeForm.razor.css */
@media (max-width: 1024px) {
    .subscribe-select,
    .subscribe-email-input {
        min-height: 44px;
    }
}

.status-main {
    flex: 1;
    padding: var(--space-xl) var(--space-md);
}

.status-container {
    max-width: 900px;
    margin: 0 auto;
}

.status-footer {
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--glass-border);
}

/* Card: there is no card utility here. Every StatusPage card (component, active incident, history, uptime summary,
   "no incidents", subscribe section, banner, error boundary) writes the one card recipe — the App's .glass-card (app.css)
   on tokens — in its own scoped .razor.css rule, so no element mixes a global class with scoped CSS (CLAUDE.md scoped-CSS
   rule, I-043 merge gate). The recipe's values are declared once, as the --card-* site tokens of app.css (--card-surface,
   --card-backdrop, --card-border, --card-radius, --card-ink, --card-padding; B-070 L255). A face that differs (banner
   tints, history-card hover border, error padding, no-incidents ink) overrides after the recipe in the same rule. */

/* The AntD Tooltip wraps the uptime bar in an inline-block div, which shrink-wraps the bar's `width: 100%` to 0: the
   wrapper takes the full row so the bar (and its track edge) shows */
.antblazor-overlay-trigger-wrapper:has(> .uptime-bar) {
    display: block;
    width: 100%;
}

/* Shared Entrance Animations */
.section-animate {
    animation: slideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section-animate-1 { animation-delay: 0ms; }
.section-animate-2 { animation-delay: 80ms; }
.section-animate-3 { animation-delay: 160ms; }
.section-animate-4 { animation-delay: 240ms; }

/* Shared Loading & Error States */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
}

/* Error face (Home / History load failure): the App's empty-state recipe in the error tone — a 64px ring in 14 % of the
   error ink with the icon in --color-error-light, description in --text-secondary */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: 56px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-body);
}

.error-container .anticon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-sm);
    background: color-mix(in srgb, var(--color-error-light) 14%, transparent);
    border-radius: 50%;
    font-size: 28px;
    color: var(--color-error-light);
}

/* The site's retry button (ErrorDisplay's Try Again, History's error face — CF-099 F-b20-07): the primary gradient, the
   App's 44 px touch height. Global, so the page error faces and the error boundary share one rule */
.error-retry-btn {
    background: var(--gradient-primary);
    color: var(--color-on-primary);
    border: none;
    padding: 0 var(--space-xl);
    min-height: 44px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.error-retry-btn:hover {
    opacity: 0.9;
}

.error-retry-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.error-container .error-retry-btn {
    margin-top: var(--space-sm);
}

/* ============================================================
   Stale monitoring (F-226) — neutral, never green
   ============================================================ */

/* Beside the status-operational / -degraded / -partial / -major banner variants (Pages/Home.razor.css), in the same
   color-mix tint pattern on the neutral status tone. The `div` lifts this above the scoped `.overall-status-banner`
   base rule, which has the same class weight and loads later. */
div.overall-status-banner.status-banner--unknown {
    background: color-mix(in srgb, var(--color-neutral) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-neutral) 45%, transparent);
}

.status-banner--unknown .overall-status-icon {
    color: var(--text-muted);
}

.overall-status-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 0;
}

.overall-status-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* ComponentStatusCard's dot while the board is stale: the "Unknown" label beside it, in the muted text tone */
.status-dot.status-unknown {
    background: var(--text-muted);
}

/* ============================================================
   MOBILE PERFORMANCE — reduce GPU-heavy blur on lower-end devices
   ============================================================ */
@media (max-width: 768px) {
    .status-header {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    /* Print ink is theme-independent: paper white and ink black whichever theme is on screen. These tokens exist only
       here (a :root token block, the one place a colour literal may sit). */
    :root {
        --print-paper: #fff;
        --print-ink: #000;
        --print-rule: #ccc;
        --print-mid: #555;
        --print-dim: #666;
        --print-light: #999;
    }

    /* Reset the theme to a paper background / ink text */
    *,
    *::before,
    *::after {
        background: var(--print-paper) !important;
        background-color: var(--print-paper) !important;
        color: var(--print-ink) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide navigation, footer, and interactive elements */
    .status-header,
    .status-footer,
    .subscribe-section,
    .load-more-container,
    .back-link,
    .skip-to-content,
    .sr-only {
        display: none !important;
    }

    /* Remove glass morphism effects */
    .glass-container,
    .overall-status-banner,
    .component-card,
    .incident-card,
    .history-card,
    .uptime-summary-section,
    .no-incidents {
        background: var(--print-paper) !important;
        border: 1px solid var(--print-rule) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Page layout */
    @page {
        margin: 1.5cm;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: var(--print-paper) !important;
    }

    .status-page {
        background: var(--print-paper) !important;
    }

    .status-main {
        padding: 0 !important;
    }

    .status-container {
        max-width: 100% !important;
    }

    /* Avoid page breaks inside incident cards and day groupings */
    .history-day,
    .incident-card,
    .history-card {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* UptimeBar: hide visual bar, keep percentage text visible */
    .uptime-bar {
        display: none !important;
    }

    .uptime-bar-mini {
        display: none !important;
    }

    /* Add context label after uptime percentage in print */
    .uptime-component-percentage::after {
        content: " (90-day uptime)";
        font-weight: 400;
        font-size: 0.75em;
    }

    .uptime-percentage::after {
        content: " (90-day)";
        font-weight: 400;
        font-size: 0.85em;
    }

    /* Links: show URL after link text */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--print-mid) !important;
    }

    /* Don't print href for internal/hash/javascript links */
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "" !important;
    }

    /* Status indicators: use border-left for B&W differentiation */
    .status-operational {
        border-left: 3px solid var(--print-ink) !important;
    }

    .status-degraded {
        border-left: 3px solid var(--print-light) !important;
    }

    .status-partial {
        border-left: 3px solid var(--print-dim) !important;
    }

    .status-major {
        border-left: 3px solid var(--print-ink) !important;
        font-weight: bold;
    }

    .status-banner--unknown {
        border-left: 3px dashed var(--print-ink) !important;
    }

    /* Status dots: use borders instead of background colors */
    .status-dot {
        background: var(--print-paper) !important;
        border: 2px solid var(--print-ink) !important;
    }

    .status-dot.dot-degraded {
        border-color: var(--print-light) !important;
    }

    .status-dot.dot-partial {
        border-color: var(--print-dim) !important;
    }

    /* Timeline markers: make visible in print */
    .timeline-marker,
    .update-marker {
        background: var(--print-ink) !important;
    }

    .timeline-marker::after,
    .update-marker::after {
        background: var(--print-rule) !important;
    }

    /* Borders: ensure visible in print */
    .history-day {
        border-bottom-color: var(--print-rule) !important;
    }

    .incident-affected {
        border-bottom-color: var(--print-rule) !important;
    }

    .history-card-updates {
        border-top-color: var(--print-rule) !important;
    }

    /* Load more button in history page */
    .load-more-button {
        display: none !important;
    }
}
