/*
  Alert 01 — Foundational Severity Alert — 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-fg: oklch(0.16 0 0);
  --alert-muted: oklch(0.47 0 0);
  --alert-hover: oklch(0.95 0 0);
}

/* Collapses its own height (grid 1fr → 0fr) so content below slides up. */
.alert01 {
  display: grid;
  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 240ms cubic-bezier(0.3, 0.8, 0.25, 1),
    opacity 180ms ease-out;
}

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

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

.alert01__surface {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid;
  border-radius: 0.75rem;
  background-color: #ffffff;
  padding: 0.75rem 0.5rem 0.75rem 0.75rem;
}

.alert01__tile {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

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

.alert01__body {
  min-width: 0;
  flex: 1;
  padding-top: 0.125rem;
}

.alert01__heading {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--alert-fg);
}

.alert01__label {
  display: block;
  margin-bottom: 0.125rem;
  font-size: 11px;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.alert01__title {
  font-weight: 600;
}

.alert01__text {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--alert-muted);
}

.alert01__text p {
  margin: 0;
}

.alert01__dismiss {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  padding: 0;
  font-family: inherit;
  color: var(--alert-muted);
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms,
    color 150ms;
}

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

.alert01__dismiss:hover {
  background-color: var(--alert-hover);
  color: var(--alert-fg);
}

.alert01__dismiss:focus-visible {
  outline: 2px solid var(--alert-fg);
  outline-offset: 1px;
}

/* Each tone: a tinted border, a tile, and a label color that all pass
   contrast on white. Success alone uses the brand neon — as a mark on a
   near-black tile, never as text on white. */
.alert01__surface[data-tone="success"] {
  border-color: oklch(0.88 0 0);
}
.alert01__surface[data-tone="success"] .alert01__tile {
  background-color: oklch(0.18 0 0);
  color: var(--alert-accent);
}
.alert01__surface[data-tone="success"] .alert01__label {
  color: oklch(0.36 0 0);
}

.alert01__surface[data-tone="info"] {
  border-color: oklch(0.88 0.03 245);
}
.alert01__surface[data-tone="info"] .alert01__tile {
  background-color: oklch(0.95 0.025 245);
  color: oklch(0.48 0.13 250);
}
.alert01__surface[data-tone="info"] .alert01__label {
  color: oklch(0.48 0.13 250);
}

.alert01__surface[data-tone="warning"] {
  border-color: oklch(0.87 0.06 80);
}
.alert01__surface[data-tone="warning"] .alert01__tile {
  background-color: oklch(0.95 0.06 85);
  color: oklch(0.5 0.12 65);
}
.alert01__surface[data-tone="warning"] .alert01__label {
  color: oklch(0.5 0.12 65);
}

.alert01__surface[data-tone="error"] {
  border-color: oklch(0.86 0.06 25);
}
.alert01__surface[data-tone="error"] .alert01__tile {
  background-color: oklch(0.95 0.03 25);
  color: oklch(0.52 0.19 27);
}
.alert01__surface[data-tone="error"] .alert01__label {
  color: oklch(0.52 0.19 27);
}

@media (min-width: 640px) {
  .alert01__surface {
    gap: 0.875rem;
    padding: 0.875rem 0.5rem 0.875rem 0.875rem;
  }
  .alert01__label {
    display: inline;
    margin-right: 0.5rem;
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alert01 {
    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;
}
.alert01-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}
.alert01-layout__card {
  width: 100%;
  max-width: 42.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.alert01-layout__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.alert01-layout__heading {
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.205 0 0);
}
.alert01-layout__count {
  font-size: 0.75rem;
  line-height: 1rem;
  font-variant-numeric: tabular-nums;
  color: oklch(0.556 0 0);
}
.alert01-layout__stack {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.alert01-layout__empty {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: oklch(0.556 0 0);
}
@media (min-width: 640px) {
  .alert01-layout {
    padding: 2.5rem;
  }
  .alert01-layout__card {
    padding: 1.5rem;
  }
}
