/* The status page (Views/Status/Index.cshtml): each service's check, then the known
   issues from Content/status. Colours come from the brand palette: blue when working
   or resolved, purple for a known issue or a fix under way, red when down or while an
   issue is being investigated. */

.qst-hero {
  padding-block: clamp(3.5rem, 10vh, 6.5rem) clamp(2rem, 5vh, 3rem);
}

/* the light sits on the heading's first line, also when the heading wraps */
.qst-title {
  display: flex;
  align-items: flex-start;
  gap: 0.35em;
  margin: 0;
  font-size: clamp(2.4rem, 5.6vw, 4.75rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* a light before the heading: blue when all is well, red when something is open */
.qst-light {
  --c: #5b8bff;
  flex: none;
  position: relative;
  width: 0.32em;
  height: 0.32em;
  margin-top: 0.36em;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0.35em var(--c);
}

.qst-light--issue {
  --c: var(--qx-red);
}

.qst-light::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--c);
  animation: qst-pulse 2.4s ease-out infinite;
}

.qst-section {
  padding-bottom: clamp(2rem, 5vh, 3rem);
}

/* ---------- Services: one row per component ---------- */

.qst-components {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--qx-line);
  border-radius: 1.25rem;
  background: var(--qx-surface);
  overflow: hidden;
}

.qst-component {
  --c: #5b8bff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
}

.qst-component + .qst-component {
  border-top: 1px solid var(--qx-line);
}

.qst-component--issue { --c: var(--qx-purple); }
.qst-component--down { --c: var(--qx-red); }

.qst-component-name {
  font-size: 1.05rem;
  font-weight: 550;
}

.qst-component-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--qx-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--qx-muted);
}

.qst-component-state::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0.6rem var(--c);
}

.qst-component--issue .qst-component-state,
.qst-component--down .qst-component-state {
  color: var(--qx-ink);
}

.qst-checked {
  margin: 0.85rem 0 0;
  font-family: var(--qx-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--qx-faint);
}

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

.qst-issue {
  --c: var(--qx-purple);
  position: relative;
  padding: 1.5rem 1.6rem 1.6rem 1.85rem;
  overflow: hidden;
  border: 1px solid var(--qx-line);
  border-radius: 1.25rem;
  background: var(--qx-surface);
}

.qst-issue--investigating { --c: var(--qx-red); }
.qst-issue--fixing { --c: var(--qx-purple); }
.qst-issue--resolved { --c: #5b8bff; }

/* the status colour runs down the card's left edge */
.qst-issue::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--c);
}

.qst-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0 0 0.85rem;
  font-family: var(--qx-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--qx-faint);
}

.qst-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--qx-ink);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qst-badge::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--c);
}

.qst-issue-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.qst-body {
  max-width: 68ch;
  color: var(--qx-muted);
  line-height: 1.6;
}

.qst-body > :first-child { margin-top: 0; }
.qst-body > :last-child { margin-bottom: 0; }

.qst-body p {
  margin: 0 0 0.75rem;
}

.qst-body a,
.qst-report a {
  color: var(--qx-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--qx-ink) 40%, transparent);
  text-underline-offset: 0.2em;
}

.qst-body a:hover,
.qst-report a:hover {
  text-decoration-color: currentColor;
}

/* resolved issues step back */
.qst-issue--resolved {
  background: transparent;
}

.qst-issue--resolved .qst-issue-title {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  color: var(--qx-muted);
}

.qst-report {
  padding-bottom: clamp(5rem, 12vh, 8rem);
  color: var(--qx-muted);
}

.qst-report p {
  margin: 0;
}

@keyframes qst-pulse {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(2.6); opacity: 0; }
}

@media (max-width: 639px) {
  .qst-issue {
    padding: 1.25rem 1.2rem 1.35rem 1.45rem;
  }

  .qst-component {
    padding: 1rem 1.2rem;
  }
}
