/* The public status page (src/handlers/statusPage.ts). It sits in the legal reading shell, so the
   masthead, hero, section rhythm and footer come from editorial.css and legal.css; this file owns
   only what is the status page's own: the summary line, the component rows, the state pills and the
   incident log. Colour comes from the shared semantic roles - lime healthy, blue paused, yellow
   attention - and every state is also a word, because a colour is not a status. */

.status-board {
  min-width: 0;
  color: var(--editorial-muted);
  font-size: 16px;
  line-height: 1.7;
}

/* One line carrying the answer. The state is the mark's shape and the words beside it; the page
   does not repeat it in a tinted box. */
.status-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 8px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--editorial-paper);
  box-shadow: var(--editorial-shadow);
  color: var(--editorial-ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.status-summary__mark,
.status-pill::before {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  background: currentColor;
  border-radius: 50%;
}

.status-summary[data-state="operational"] .status-summary__mark { color: var(--color-success); }
.status-summary[data-state="paused"] .status-summary__mark { color: var(--color-info); }
.status-summary[data-state="degraded"] .status-summary__mark { color: var(--color-warning); }

/* `.legal-section ul` is the reading shell's list: indented, with its own gap. These are rows, not
   bullets, so they name the section as well to own the box outright. */
.legal-section .status-components {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--editorial-line);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row__text {
  display: grid;
  gap: 2px;
}

.status-row__name {
  color: var(--editorial-ink);
  font-weight: 600;
}

.status-row__note {
  font-size: 14px;
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* The mark differs by shape as well as colour: a disc, a ring, a diamond. */
.status-pill--operational { color: var(--color-success); background: var(--color-success-soft); }
.status-pill--paused { color: var(--color-info); background: var(--color-info-soft); }
.status-pill--degraded { color: var(--color-warning); background: var(--color-warning-soft); }

.status-pill--paused::before {
  background: transparent;
  border: 2px solid currentColor;
}

.status-pill--degraded::before {
  border-radius: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.status-incident {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--editorial-line);
}

.status-incident:first-of-type {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.status-incident__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.status-incident h3 {
  margin: 0;
  color: var(--editorial-ink);
  font-size: 20px;
  line-height: 1.3;
}

.status-incident__when {
  margin: 0;
  font-size: 14px;
}

.legal-section .status-updates {
  display: grid;
  gap: 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.status-updates li {
  display: grid;
  gap: 2px;
}

.status-update__meta {
  font-size: 13px;
  font-weight: 600;
}

.status-update__text {
  color: var(--editorial-ink);
}

@media (max-width: 620px) {
  .status-board {
    font-size: 16px;
  }

  .status-summary {
    padding: 16px;
    font-size: 20px;
  }

  .status-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .status-row .status-pill {
    justify-self: start;
  }
}
