/* ============================================================
   Library Occupancy — compact, graphic status cards
   AUX CDN handles global typography, colors, header/footer chrome,
   and the page-header. Everything below is specific to this
   experiment: the occupancy legend, card grid, and radial gauge.
   AUX has no progress/meter/gauge component today (checked Cards,
   Factoid Collections, Alert, Tables in the reference storybook),
   so the gauge itself is a custom, documented addition — see
   process.html for the full fidelity breakdown.
   ============================================================ */

:root {
  --aux-maroon: #500000;
  --aux-maroon-dark: #3b0000;
  --aux-maroon-subtle: #f9f2f2;
  --aux-gold: #af8846;
  --aux-gray-100: #f5f5f0;
  --aux-gray-200: #e8e6e0;
  --aux-gray-400: #9b9890;
  --aux-gray-600: #5c5a55;
  --aux-gray-800: #2c2b28;
  --aux-gray-900: #1c1b18;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Semantic tokens — AUX brand guide's own Success/Warning/Error palette,
     reused here as real status meaning (busy vs. quiet), not decoration. */
  --status-success: #2d6a4f;
  --status-warning: #b45309;
  --status-error: #991b1b;

  --gauge-circumference: 314.159; /* 2 * PI * r(50) */
}

html, body { background: #ffffff; color: var(--aux-gray-800); color-scheme: light; }

/* ── Layout ── */
.content-section { padding: 56px 24px 80px; background: #ffffff; }
.content-wrap { max-width: 1200px; margin: 0 auto; }

/* ============================================================
   Legend — spells out what color + icon combination means, since
   the live percentages today never leave the "plenty" band (see
   process.html for the full-range preview).
   ============================================================ */
.occupancy-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 14px 18px;
  background: var(--aux-gray-100);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}
.occupancy-legend__label {
  font-family: 'Work Sans', Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aux-gray-600);
}
.occupancy-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Work Sans', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--aux-gray-800);
}
.occupancy-legend__item svg { width: 14px; height: 14px; flex-shrink: 0; }
.occupancy-legend__item--plenty svg { fill: var(--status-success); }
.occupancy-legend__item--filling svg { fill: var(--status-warning); }
.occupancy-legend__item--full svg { fill: var(--status-error); }
.occupancy-legend__range {
  font-weight: 400;
  color: var(--aux-gray-600);
  font-size: 12px;
}

/* ============================================================
   Grid — auto-fits 5 across on desktop, reflows on its own down
   to tablet; an explicit 2-up rule below keeps phones tidy rather
   than trusting auto-fit to land somewhere awkward.
   ============================================================ */
.occupancy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

/* ============================================================
   Card — compact shell; the gauge is the dominant visual element,
   name/status/stats are supporting text, in that reading order.
   ============================================================ */
.occupancy-card {
  --status-color: var(--aux-gray-600);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--aux-gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.occupancy-card:hover {
  border-color: var(--status-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.occupancy-card[data-status="plenty"]  { --status-color: var(--status-success); }
.occupancy-card[data-status="filling"] { --status-color: var(--status-warning); }
.occupancy-card[data-status="full"]    { --status-color: var(--status-error); }

.occupancy-card__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.occupancy-card__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--status-color);
  margin-top: 16px;
}
.occupancy-card__icon svg { width: 100%; height: 100%; fill: currentColor; }
.occupancy-card__name {
  font-family: 'Oswald', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--aux-gray-900);
  margin: 0;
}
.occupancy-card__name a {
  color: inherit;
  text-decoration: none;
}
.occupancy-card__name a:hover { text-decoration: underline; text-decoration-color: var(--status-color); }
.occupancy-card__name a:focus-visible {
  outline: 3px solid var(--aux-gold);
  outline-offset: 3px;
  border-radius: 2px;
}
.occupancy-card__fullname {
  font-size: 12px;
  color: var(--aux-gray-600);
  margin: -4px 0 0;
  max-width: 22ch;
}

/* ── Radial gauge ── */
.occupancy-gauge {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 4px 0;
}
.occupancy-gauge__ring { width: 100%; height: 100%; display: block; }
.occupancy-gauge__ring circle { fill: none; stroke-width: 11; }
.occupancy-gauge__track { stroke: var(--aux-gray-200); }
.occupancy-gauge__fill {
  stroke: var(--status-color);
  stroke-linecap: round;
  stroke-dasharray: var(--gauge-circumference);
  stroke-dashoffset: var(--gauge-circumference);
  transform-origin: 60px 60px;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.is-visible .occupancy-gauge__fill {
  stroke-dashoffset: calc(var(--gauge-circumference) - (var(--gauge-circumference) * var(--pct) / 100));
}
.occupancy-gauge__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}
.occupancy-gauge__pct {
  font-family: 'Oswald', sans-serif;
  font-size: 27px;
  font-weight: 700;
  color: var(--aux-gray-900);
}
.occupancy-gauge__pct-sign { font-size: 0.55em; }
.occupancy-gauge__pct-caption {
  font-family: 'Work Sans', Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aux-gray-600);
  margin-top: 3px;
}

/* ── Status line — icon + text, never color alone ── */
.occupancy-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Work Sans', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--status-color);
  margin: 0;
}
.occupancy-card__status svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

/* ── Stat footer ── */
.occupancy-card__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--aux-gray-200);
  font-size: 12.5px;
  color: var(--aux-gray-600);
}
.occupancy-card__stats strong { color: var(--aux-gray-900); font-weight: 700; }
.occupancy-card__stats-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--aux-gray-400);
  flex-shrink: 0;
}

.occupancy-snapshot-note {
  font-size: 13px;
  color: var(--aux-gray-600);
  margin-top: var(--space-lg);
  max-width: 72ch;
}
.occupancy-snapshot-note a { color: var(--aux-maroon); }


.custom-content .custom-content__container {
    width: 100%;
}

/* ============================================================
   Reduced motion — copied verbatim from experiments/motion-graphics
   and experiments/animated-icons. The gauge still renders at its
   final value instantly; only the fill-in transition is removed.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .content-section { padding: 40px 16px 56px; }
}
@media (max-width: 520px) {
  .occupancy-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .occupancy-card { padding: var(--space-sm) var(--space-sm) var(--space-md); }
  .occupancy-gauge { width: 92px; height: 92px; }
  .occupancy-gauge__pct { font-size: 22px; }
  .occupancy-card__name { font-size: 18px; }
  .occupancy-legend { gap: 6px 16px; padding: 12px 14px; }
}
