/*
  Alert 03 — System Banner — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --alert-accent: #39ff14;
  --alert-bar: oklch(0.17 0.005 260);
}

.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;
}

/* Collapses the banner's own height on dismiss so the app slides up. The
   root is also the size container the layout responds to. */
.alert03 {
  container-type: inline-size;
  display: grid;
  width: 100%;
  grid-template-rows: 1fr;
  opacity: 1;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  transition:
    grid-template-rows 260ms cubic-bezier(0.3, 0.8, 0.25, 1),
    opacity 200ms ease-out;
}

.alert03[data-state="closing"] {
  grid-template-rows: 0fr;
  opacity: 0;
}

.alert03__clip {
  min-height: 0;
  overflow: hidden;
}

.alert03__bar {
  background-color: var(--alert-bar);
  color: #ffffff;
}

.alert03__row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
}

.alert03__pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  padding: 0.125rem 0.5rem;
  font-size: 11px;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.alert03__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
}

/* Severity pill — each tone readable on the dark bar. */
.alert03__bar[data-severity="maintenance"] .alert03__pill {
  color: oklch(0.84 0.08 250);
}
.alert03__bar[data-severity="maintenance"] .alert03__dot {
  background-color: oklch(0.72 0.12 250);
}
.alert03__bar[data-severity="degraded"] .alert03__pill {
  color: oklch(0.88 0.13 85);
}
.alert03__bar[data-severity="degraded"] .alert03__dot {
  background-color: oklch(0.82 0.16 80);
}
.alert03__bar[data-severity="outage"] .alert03__pill {
  color: oklch(0.82 0.1 25);
}
.alert03__bar[data-severity="outage"] .alert03__dot {
  background-color: oklch(0.68 0.2 27);
}
.alert03__bar[data-severity="resolved"] .alert03__pill {
  color: var(--alert-accent);
}
.alert03__bar[data-severity="resolved"] .alert03__dot {
  background-color: var(--alert-accent);
}

.alert03__summary {
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 0.375rem 0;
  font-size: 13px;
  line-height: 1.25rem;
}

.alert03__title {
  font-weight: 600;
}

.alert03__inline-message {
  display: none;
  color: rgba(255, 255, 255, 0.65);
}

.alert03__toggle,
.alert03__dismiss {
  display: flex;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms,
    color 150ms;
}

.alert03__toggle {
  gap: 0.25rem;
  padding: 0 0.5rem;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.alert03__dismiss {
  width: 2rem;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
}

.alert03__toggle:hover,
.alert03__dismiss:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.alert03__toggle:focus-visible,
.alert03__dismiss:focus-visible {
  outline: 2px solid var(--alert-accent);
  outline-offset: 1px;
}

.alert03__toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 200ms ease-out;
}

.alert03__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.alert03__dismiss svg {
  width: 1rem;
  height: 1rem;
}

.alert03__meta-row {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.125rem 1.25rem 0.625rem;
}

.alert03__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert03__timing {
  font-size: 0.75rem;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
}

.alert03__link {
  display: inline-flex;
  margin: -0.25rem 0;
  padding: 0.25rem 0;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
  outline: none;
}

.alert03__link:hover {
  text-decoration-color: #ffffff;
}

.alert03__link:focus-visible {
  outline: 2px solid var(--alert-accent);
  outline-offset: 2px;
}

.alert03__link svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* Incident phases: past phases are solid white, the current one is neon,
   later ones are hollow. */
.alert03__phases {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert03__phase {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 11px;
  line-height: 1rem;
}

.alert03__phase-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.alert03__phase-label {
  color: rgba(255, 255, 255, 0.45);
}

.alert03__phase[data-state="done"] .alert03__phase-dot {
  background-color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

.alert03__phase[data-state="done"] .alert03__phase-label {
  color: rgba(255, 255, 255, 0.7);
}

.alert03__phase[data-state="current"] .alert03__phase-dot {
  background-color: var(--alert-accent);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.18);
}

.alert03__phase[data-state="current"] .alert03__phase-label {
  font-weight: 600;
  color: #ffffff;
}

/* Narrow-container details disclosure. Hidden details are also removed
   from the tab order and the accessibility tree via `visibility`. */
.alert03__details {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 240ms cubic-bezier(0.3, 0.8, 0.25, 1),
    visibility 0s linear 240ms;
}

.alert03__details[data-expanded] {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 240ms cubic-bezier(0.3, 0.8, 0.25, 1),
    visibility 0s;
}

.alert03__details-clip {
  min-height: 0;
  overflow: hidden;
}

.alert03__details-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.625rem 0.75rem 0.75rem;
}

.alert03__message {
  margin: 0;
  font-size: 13px;
  line-height: 1.25rem;
  color: rgba(255, 255, 255, 0.75);
}

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

@container (min-width: 42rem) {
  .alert03__row {
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem 0.375rem;
  }
  .alert03__pill {
    margin-top: 0;
  }
  .alert03__summary {
    padding: 0;
  }
  .alert03__inline-message {
    display: inline;
  }
  .alert03__toggle,
  .alert03__details {
    display: none;
  }
  .alert03__meta-row {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert03,
  .alert03__details,
  .alert03__details[data-expanded],
  .alert03__toggle svg {
    transition: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
p {
  margin: 0;
}
.alert03-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.alert03-layout__app {
  width: 100%;
  max-width: 47.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.16);
}
.alert03-layout__top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid oklch(0.97 0 0);
  padding: 0.75rem 1rem;
}
.alert03-layout__brand {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.alert03-layout__nav {
  display: none;
  gap: 1rem;
  font-size: 13px;
  color: oklch(0.556 0 0);
}
.alert03-layout__nav a {
  margin: -0.25rem 0;
  padding: 0.25rem 0;
  color: inherit;
  text-decoration: none;
}
.alert03-layout__nav a[aria-current="page"] {
  font-weight: 500;
  color: oklch(0.205 0 0);
}
.alert03-layout__metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}
.alert03-layout__metric {
  border: 1px solid oklch(0.97 0 0);
  border-radius: 0.75rem;
  background: rgba(250, 250, 250, 0.6);
  padding: 0.875rem;
}
.alert03-layout__metric-label,
.alert03-layout__metric-note {
  font-size: 0.75rem;
  line-height: 1rem;
}
.alert03-layout__metric-label {
  color: oklch(0.556 0 0);
}
.alert03-layout__metric-value {
  margin-top: 0.25rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: oklch(0.205 0 0);
}
.alert03-layout__metric-note {
  margin-top: 0.125rem;
  color: oklch(0.708 0 0);
}
@media (min-width: 640px) {
  .alert03-layout {
    padding: 2.5rem;
  }
  .alert03-layout__top {
    padding: 0.75rem 1.25rem;
  }
  .alert03-layout__nav {
    display: flex;
  }
  .alert03-layout__metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1.25rem;
  }
}
