/*
  status.asyoube.de — the status page's only stylesheet, served under a content hash.

  Colour tokens are copied from asyoube.Website src/styles/global.css (@theme,
  commit b0177d4): the same values under the same names, so the page reads as
  asyoube. Copied, not linked: the page must not depend on the website it reports on.
  Fonts: the system stack. The brand face (Visuelt Pro) is not copied: its licence
  for another host or image is not verified.

  Rules this file keeps (and status tests check): no @import, no url() to another
  host, colour carried by classes only (the HTML has no style attributes, so the CSP
  needs no 'unsafe-inline'), and every state also has a text label in the HTML.
*/

:root {
  --color-primary-700: #fa8950;
  --color-primary-900: #d96f3c;
  --color-primary-action: #b14a1e;
  --color-primary-action-hover: #8f3914;
  --color-neutral-50: #fafafa;
  --color-neutral-100: #f0efed;
  --color-neutral-200: #e6e5e7;
  --color-neutral-300: #d5d4d6;
  --color-neutral-600: #8a898b;
  --color-neutral-700: #6b6a6d;
  --color-neutral-800: #4d4c4f;
  --color-neutral-900: #151417;
  --color-success-strong: #2e7d32;
  --color-success-strongest: #1f6e42;
  --color-success-soft: #eff8f1;
  --color-accent-yellow: #ffc955;
  --color-accent-yellow-soft: #fff9ed;
  --color-danger-strong: #c93030;
  --color-danger-strongest: #7f1d1d;
  --color-danger-soft: #fee2e2;
  --color-accent-blue-strong: #4f5bcb;

  --page-bg: var(--color-neutral-100);
  --surface: var(--color-neutral-50);
  --text: var(--color-neutral-900);
  --text-muted: var(--color-neutral-800);
  --line: var(--color-neutral-900);
  --link: var(--color-primary-action);
  --link-hover: var(--color-primary-action-hover);
  --brand-you: var(--color-primary-900);
  --shadow: 4px 4px 0 var(--color-neutral-900);

  --ok-fill: var(--color-success-strong);
  --ok-soft: var(--color-success-soft);
  --ok-text: var(--color-success-strongest);
  --warn-fill: var(--color-accent-yellow);
  --warn-soft: var(--color-accent-yellow-soft);
  --warn-text: var(--color-neutral-900);
  --bad-fill: var(--color-danger-strong);
  --bad-soft: var(--color-danger-soft);
  --bad-text: var(--color-danger-strongest);
  --none-fill: var(--color-neutral-300);
  --none-text: var(--color-neutral-800);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: var(--color-neutral-900);
    --surface: #1f1e22;
    --text: var(--color-neutral-50);
    --text-muted: var(--color-neutral-300);
    --line: var(--color-neutral-300);
    --link: var(--color-primary-700);
    --link-hover: #fdba99;
    --brand-you: var(--color-primary-700);
    --shadow: 4px 4px 0 var(--color-neutral-600);
    --ok-soft: #12301a;
    --ok-text: #b9e6c3;
    --warn-soft: #3a2f12;
    --warn-text: #ffe3a1;
    --bad-soft: #3d1414;
    --bad-text: #fecaca;
    --none-fill: var(--color-neutral-700);
    --none-text: var(--color-neutral-300);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 3px solid var(--color-primary-700);
  outline-offset: 2px;
}

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

/* ── Header and footer ─────────────────────────────────────────────── */

.site-header,
.site-footer,
.page {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 2rem;
  height: 2rem;
}

/* The wordmark's "you", as on the website (Logo.astro: primary-900 on light, the brighter
   primary-700 on dark, 7.65:1 on neutral-900). primary-900 on this page's neutral-100 is
   2.91:1: a logotype has no contrast requirement (WCAG 2.2 SC 1.4.3), and the link still
   reads "asyoube" as one word to assistive technology. */
.brand-you {
  color: var(--brand-you);
}

.brand-sub {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-weight: 600;
  background: var(--surface);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ── Overall banner ────────────────────────────────────────────────── */

.overall {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.overall-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.125rem;
  background: var(--surface);
  color: var(--text);
}

.overall-text {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}

.overall.s-operational { background: var(--ok-soft); color: var(--ok-text); }
.overall.s-degraded { background: var(--warn-soft); color: var(--warn-text); }
.overall.s-outage { background: var(--bad-soft); color: var(--bad-text); }
.overall.s-nodata { background: var(--surface); color: var(--none-text); }

/* The lines with a "·" between their parts are flex rows with a gap, like the footer: the
   space around a separator then never depends on the whitespace Razor keeps or drops
   around markup in a code block (it rendered "17:42 Uhr· Aktualisieren"). */
.stand,
.incident-meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.4rem;
}

.stand {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

/* ── Groups and rows ───────────────────────────────────────────────── */

h2 {
  font-size: 1.125rem;
  margin: 1.75rem 0 0.75rem;
}

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

.row {
  margin: 0 0 0.875rem;
  padding: 1rem 1.25rem 1.125rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.row-name {
  margin: 0;
  font-size: 1.0625rem;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 1rem;
  margin: 0.375rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-icon {
  font-weight: 700;
}

.badge.s-operational { background: var(--ok-soft); color: var(--ok-text); }
.badge.s-degraded { background: var(--warn-soft); color: var(--warn-text); }
.badge.s-outage { background: var(--bad-soft); color: var(--bad-text); }
.badge.s-nodata { background: var(--surface); color: var(--none-text); }
.badge.s-info { background: var(--surface); color: var(--text); }

/* ── Day strip ─────────────────────────────────────────────────────── */
/* The newest bar is on the right. Degraded bars are striped and missing days hatched,
   so the strip reads without colour too; the HTML carries each day as text. */

.days {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 2rem;
}

.days li {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
}

.days .d-ok { background: var(--ok-fill); }

.days .d-degraded {
  background: repeating-linear-gradient(
    135deg,
    var(--warn-fill) 0,
    var(--warn-fill) 3px,
    var(--color-neutral-900) 3px,
    var(--color-neutral-900) 4px
  );
}

.days .d-outage { background: var(--bad-fill); }

.days .d-nodata {
  background: repeating-linear-gradient(
    45deg,
    var(--none-fill) 0,
    var(--none-fill) 3px,
    transparent 3px,
    transparent 6px
  );
}

@media (max-width: 40rem) {
  /* The newest 30 of 90 days. */
  .days li:nth-child(-n + 60) {
    display: none;
  }
}

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

.incidents .empty {
  margin: 0;
  color: var(--text-muted);
}

.incident {
  margin: 0 0 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
}

.incident-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.incident-title {
  font-weight: 700;
}

.incident-meta {
  margin: 0.375rem 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.updates li {
  margin: 0.25rem 0 0;
}

.update-at {
  font-weight: 600;
}

.note {
  margin: 1.5rem 0 0;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
