/*
 * Hallmark University status page -- dark theme only.
 *
 * There is deliberately no light theme: logo.png is a reverse (light-on-dark)
 * lockup, so a light background would render the white wordmark invisible.
 * Every colour below is AA-contrast checked against --bg and --surface.
 */

:root {
  color-scheme: dark;

  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2129;
  --border: #2a313c;
  --border-soft: #21262d;

  --text: #e6edf3;
  --muted: #9198a1;

  /* Hallmark blue, sampled from logo.png */
  --brand: #009ddb;
  --brand-light: #38bdf8;

  --operational: #3fb950;
  --degraded: #f0b429;
  --outage: #ff6b6b;
  --maintenance: #58a6ff;
  --unknown: #8b949e;

  --radius: 10px;
  --wrap: 860px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: 3rem;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

/* Hidden geometrically, not with display:none -- some engines refuse to
   resolve <use> against a display:none sprite. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- masthead ----------------------------------------------------------- */

.masthead {
  background: #080b0f;
  border-bottom: 1px solid var(--border-soft);
  padding-block: 1rem;
}

.masthead-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.logo { height: 40px; width: auto; display: block; }

.masthead-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* --- overall banner ------------------------------------------------------ */

.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--unknown));
  border-radius: var(--radius);
}

.banner-icon { width: 34px; height: 34px; flex: none; color: var(--accent, var(--unknown)); }

.banner-headline { margin: 0; font-size: 1.3rem; line-height: 1.3; font-weight: 650; }
.banner-sub { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.925rem; }

.banner--operational { --accent: var(--operational); }
.banner--degraded    { --accent: var(--degraded); }
.banner--outage      { --accent: var(--outage); }
.banner--maintenance { --accent: var(--maintenance); }
.banner--unknown,
.banner--loading     { --accent: var(--unknown); }

/* --- notices ------------------------------------------------------------- */

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(0, 157, 219, 0.09);
  border: 1px solid rgba(0, 157, 219, 0.38);
}
.notice h2 { margin: 0 0 0.2rem; font-size: 0.95rem; color: var(--brand-light); }
.notice p { margin: 0; font-size: 0.925rem; }

/* --- groups -------------------------------------------------------------- */

.group { margin-top: 1rem; }
#groups > .group:first-child { margin-top: 2rem; }

.group-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* A named section is one card: its header, and its services under it when
   expanded. The headerless group (sign-in) keeps the plain service card. */
.group--boxed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.group--boxed .group-head { padding: 0.85rem 1.1rem; }
.group--boxed .services {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  background: none;
}
.group-head--toggle { cursor: pointer; }
.group-head--toggle:hover { background: var(--surface-2); }
.group-head--toggle:hover .group-toggle { color: var(--text); border-color: var(--brand); }
.group-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.75rem; }
.group-title { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: 0.01em; }
.group-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent, var(--unknown));
}
.group-status-icon { width: 15px; height: 15px; flex: none; }
.group-blurb { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.875rem; max-width: 62ch; }

.group-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  flex: none;
}
.group-toggle:hover { color: var(--text); border-color: var(--brand); }
.group-toggle:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

.services {
  margin-top: 0.85rem;
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.service { border-top: 1px solid var(--border-soft); }
.service:first-child { border-top: 0; }

.service-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
}

.service-icon { width: 21px; height: 21px; flex: none; margin-top: 0.15rem; color: var(--accent, var(--unknown)); }

.service--operational { --accent: var(--operational); }
.service--degraded    { --accent: var(--degraded); }
.service--outage      { --accent: var(--outage); }
.service--maintenance { --accent: var(--maintenance); }
.service--unknown     { --accent: var(--unknown); }

.service-main { flex: 1 1 auto; min-width: 0; }
.service-name { font-weight: 600; }
.service-blurb { color: var(--muted); font-size: 0.85rem; margin-top: 0.1rem; }

.service-state { flex: none; text-align: right; }
.service-label { font-size: 0.875rem; font-weight: 600; color: var(--accent, var(--unknown)); white-space: nowrap; }

/* Set-by-hand marker. Must be readable without colour. */
.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid currentColor;
  vertical-align: 0.1em;
  margin-left: 0.4rem;
}
.tag--manual { color: var(--brand-light); }

.service-detail {
  padding: 0 1.1rem 0.95rem 3.05rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.service-detail p { margin: 0.35rem 0 0; }
.service-detail .msg { color: var(--text); }

.incidents { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.incident {
  padding: 0.5rem 0.7rem;
  margin-top: 0.4rem;
  background: var(--surface-2);
  border-left: 2px solid var(--accent, var(--unknown));
  border-radius: 0 6px 6px 0;
}
.incident-title { color: var(--text); font-size: 0.875rem; }
.incident-meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.incident-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-light);
  text-decoration: none;
}
.incident-link:hover,
.incident-link:focus-visible { text-decoration: underline; }
.incident-link:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* --- footer -------------------------------------------------------------- */

.site-footer { margin-top: 2.5rem; color: var(--muted); font-size: 0.85rem; }
.site-footer p { margin: 0.3rem 0; }
.footer-meta a { color: var(--brand-light); }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-light);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.linkbtn:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

.noscript {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid var(--degraded);
  border-radius: var(--radius);
}

/* Icon geometry lives on the <symbol> as presentation attributes -- see the
   comment in index.html. Only the colour is set here, and it inherits into the
   shadow tree that <use> creates. */

/* --- motion & small screens ---------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .banner, .service-row { transition: border-color 160ms ease, color 160ms ease; }
}

@media (max-width: 560px) {
  .service-row { flex-wrap: wrap; }
  .service-state { text-align: left; padding-left: 3.05rem; width: 100%; }
  .service-detail { padding-left: 1.1rem; }
  .masthead-title { padding-left: 0; border-left: 0; }
}
