/*
 * The status page of Mizana: an interim look with the colours and the font of
 * docs/produkt/gestaltung.md until P1.9 moves it to the design tokens
 * (ADR-0160). Light and dark follow the device. Spacing uses only logical
 * properties, so the page also works from right to left.
 */

/* Outfit, variable from 100 to 900 (Fontsource 5.3.0, see README.md). */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/outfit-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/outfit-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Colours. The signal colours (operational, degraded, outage, maintenance)
 * are interim until P1.9. A test keeps text and signal colours at 4.5:1 or
 * more on background, card and surface, the text of the banner at 4.5:1 on
 * each signal colour, and the bars at 3:1 on the card (WCAG AA).
 */
:root {
  color-scheme: light dark;
  --background: #F0F0F2;
  --text: #16221E;
  --card: #FFFFFF;
  --primary: #173830;
  --on-primary: #F0F0F2;
  --surface: #E8E9EC;
  --muted: #5A6B65;
  --border: #DCDDE1;
  --operational: #1A6B47;
  --degraded: #8F4E00;
  --outage: #B3261E;
  --maintenance: #22599E;
  --on-signal: #FFFFFF;
  --bar-ok: #2E8B57;
  --bar-degraded: #B86E00;
  --bar-outage: #D0453B;
  --bar-none: #8A9590;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0E1714;
    --text: #E7ECE9;
    --card: #15211C;
    --primary: #4FB295;
    --on-primary: #08110E;
    --surface: #1A2722;
    --muted: #93A8A0;
    --border: #2A3A34;
    --operational: #5CC79A;
    --degraded: #E8A33D;
    --outage: #E5645C;
    --maintenance: #8AB8F0;
    --on-signal: #08110E;
    --bar-ok: #5CC79A;
    --bar-degraded: #E8A33D;
    --bar-outage: #E5645C;
    --bar-none: #5E6F68;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  max-inline-size: 52rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.icon {
  display: block;
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tone-operational {
  --tone: var(--operational);
}

.tone-degraded {
  --tone: var(--degraded);
}

.tone-outage {
  --tone: var(--outage);
}

.tone-maintenance {
  --tone: var(--maintenance);
}

.tone-none {
  --tone: var(--muted);
}

/* Head: logo at the start, DE · EN · TR at the end */

.header {
  padding-block: 1.25rem 0.75rem;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.logo {
  display: block;
  block-size: 2.25rem;
  inline-size: auto;
}

.languages ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.languages li + li::before {
  content: "·" / "";
  color: var(--muted);
  padding-inline: 0.125rem;
}

.languages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: 0.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.languages a:hover {
  background: var(--surface);
}

.languages a[aria-current="page"] {
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Banner of the overall state */

.banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block: 0.75rem 1.5rem;
  padding-block: 1.125rem;
  padding-inline: 1.25rem;
  border-radius: 1.25rem;
  background: var(--tone);
  color: var(--on-signal);
}

.banner .icon {
  inline-size: 1.75rem;
  block-size: 1.75rem;
}

.banner-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding-block: 1rem;
  padding-inline: 1.25rem;
}

.section {
  margin-block-start: 2rem;
}

/* Open incidents sit between the banner and the parts. */
.incidents {
  margin-block: 0 1.5rem;
}

h2 {
  margin-block: 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
}

h3,
h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.empty,
.muted,
.meta,
.intro,
.component-description {
  color: var(--muted);
}

.empty {
  margin: 0;
}

/*
 * The parts with their 90 bars. Each state has its own height as well as
 * its colour, so the days with a problem stand out also without colour:
 * no data lowest, no incident low, degraded a step higher, outage full.
 */

.components {
  padding-block: 0.25rem;
}

.component {
  padding-block: 1rem;
}

.component + .component {
  border-block-start: 1px solid var(--border);
}

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

.component-description {
  margin: 0;
  font-size: 0.9375rem;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  color: var(--tone);
  font-weight: 500;
}

.bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  grid-template-rows: 2rem;
  align-items: end;
  gap: 2px;
  margin-block: 0.875rem 0.375rem;
  padding: 0;
  list-style: none;
}

.bar {
  block-size: 25%;
  border-radius: 2px;
  background: var(--bar-none);
}

.bar-ok {
  block-size: 62.5%;
  background: var(--bar-ok);
}

.bar-degraded {
  block-size: 81.25%;
  background: var(--bar-degraded);
}

.bar-outage {
  block-size: 100%;
  background: var(--bar-outage);
}

.bars-axis {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.bars-axis .rule {
  flex: 1;
  border-block-start: 1px solid var(--border);
}

/* The last 30 days are for a phone (see the end of this file). */
.range-recent {
  display: none;
}

/* What the bars mean, below the last part */

.bars-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding-block: 0.75rem 1rem;
  padding-inline: 0;
  border-block-start: 1px solid var(--border);
  list-style: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.bars-key li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.bars-key .swatch {
  display: flex;
  align-items: flex-end;
  block-size: 1.25rem;
  inline-size: 0.5rem;
}

.bars-key .swatch .bar {
  inline-size: 100%;
}

.bars-key .icon {
  inline-size: 1rem;
  block-size: 1rem;
}

.uptime {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Current notices */

.events {
  display: grid;
  gap: 0.75rem;
}

.event {
  border-inline-start: 0.375rem solid var(--tone);
}

.event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.event-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event .event-title .icon {
  color: var(--tone);
}

.event p,
.past-event p {
  margin-block: 0.25rem 0;
}

.meta {
  font-size: 0.9375rem;
}

.tag {
  padding-block: 0.125rem;
  padding-inline: 0.625rem;
  border: 1px solid var(--tone);
  border-radius: 999px;
  color: var(--tone);
  font-size: 0.875rem;
  font-weight: 500;
}

.note {
  margin-block-start: 0.5rem;
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.note-label {
  font-weight: 500;
}

/* Past incidents by day */

.days {
  padding-block: 0.25rem;
}

.day {
  padding-block: 1rem;
}

/* A border between the days that are shown: the script may hide some. */
.day:not([hidden]) ~ .day {
  border-block-start: 1px solid var(--border);
}

.past-empty {
  padding-block: 1rem;
}

.day h3 {
  margin-block-end: 0.375rem;
}

.past-event {
  padding-block: 0.375rem;
}

.past-event .icon {
  color: var(--muted);
}

/* Availability per month, collapsed */

.months summary {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}

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

.months summary::before {
  content: "▸" / "";
  margin-inline-end: 0.5rem;
  color: var(--muted);
}

/* From right to left the closed triangle points the other way. */
.months summary:dir(rtl)::before {
  content: "◂" / "";
}

.months[open] summary::before {
  content: "▾" / "";
}

.table-scroll {
  overflow-x: auto;
}

table {
  inline-size: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding-block: 0.375rem;
  padding-inline: 0 0.75rem;
  border-block-end: 1px solid var(--border);
  text-align: start;
}

td,
thead th:not(:first-child) {
  text-align: end;
}

th[scope="row"] {
  font-weight: 400;
}

thead th {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-block-end: 0;
}

/* Foot */

.footer {
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer p {
  margin-block: 0.5rem;
}

/* The choice of language at the root and the page for a wrong address */

.chooser {
  padding-block: 3rem;
}

.chooser h1 {
  margin-block: 2rem 1.5rem;
  font-size: 2rem;
  font-weight: 300;
}

.chooser ul {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chooser a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-size: 1.25rem;
  font-weight: 500;
}

/* A phone: only the last 30 of the 90 bars (PHONE_DAYS in status-logic.js),
   with the availability of these 30 days. */
@media (max-width: 30rem) {
  .bars {
    grid-template-columns: repeat(30, minmax(0, 1fr));
  }

  .bars .bar:nth-child(-n + 60) {
    display: none;
  }

  .range-all {
    display: none;
  }

  .range-recent {
    display: inline;
  }

  .card {
    padding-inline: 1rem;
  }
}

@media (forced-colors: active) {
  .languages a[aria-current="page"] {
    border-color: CanvasText;
  }

  .banner,
  .event,
  .card {
    border: 1px solid CanvasText;
  }

  .bar {
    forced-color-adjust: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
