/* Common stylesheet, page styles live in a file per area */

/* 1. Custom properties & reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colours */
  --clr-bg: #f8f9fa;
  --clr-surface: #ffffff;
  --clr-header: #202122;
  --clr-header-text: #ffffff;
  --clr-text: #202122;
  --clr-text-muted: #54595d;
  --clr-accent: #0645ad;
  --clr-accent-dark: #0b0080;
  --clr-border: #a2a9b1;
  --clr-border-strong: #72777d; /* #a2a9b1 is 2.4:1 on white, below the 3:1 UI minimum */
  --clr-tag-subj: #f2f7ff;
  --clr-tag-subj-fg: #1a3c6e;
  --clr-tag-evt: #fffaeb;
  --clr-tag-evt-fg: #7c5800;
  --clr-tag-evt-border: #d8b660;
  --clr-role-admin: #a52564;
  --clr-role-admin-bg: #f9e4ee;

  /* Status: success */
  --clr-success: #14866d;
  --clr-success-bg: #d5fdf4;
  --clr-success-text: #0d5a48;

  /* Status: error */
  --clr-error: #d33;
  --clr-error-bg: #fee7e6;
  --clr-error-text: #a52a2a;

  /* Warning / info banner */
  --clr-warn-bg: #fffbea;
  --clr-warn-border: #d9bd45;
  --clr-warn-text: #7c6200;

  /* Status: warning, pending */
  --clr-warning: #f28c28;
  --clr-warning-bg: #fdf0e0;
  --clr-pending: #f0bc00;

  /* Urgent */
  --clr-urgent: #c0392b;

  /* Sizing */
  --container-width: 1200px;
  --navbar-height: 3.75rem; /* 60px */
  --sidebar-width: 15rem; /* 240px: the desktop navbar (layout.css) */
  --height-control: 2.25rem; /* 36px */
  --space-container: 1.25rem; /* horizontal container gutter */
  /* Square corners throughout, bar status pills and round avatars */
  --radius: 0;
  --radius-lg: 0;
  --radius-pill: 999px;

  /* Card / panel padding */
  --pad-card: 1rem 1.25rem;

  /* Border variants */
  --clr-border-light: #c8ccd1;
  --clr-tag-subj-border: #8ba4cd; /* border for the pale-blue tags and info tint */

  /* Neutral chip fill (counts, "no status" badges) */
  --clr-neutral-bg: #e8eaed;
  --clr-well: #f0f2f4; /* list area inside a white panel, cards sit on it */

  /* Personal-status info tint ("you requested this") */
  --clr-info-bg: #e8f4fd;
  --clr-info-border: #85b7e0;
  --clr-info-text: #1361a4;

  /* Pale accent fill for hover states */
  --clr-accent-bg: #eef2fb;

  /* Warning as text on white (5.02:1) */
  --clr-warning-text: #b45309;

  /* Media surfaces: captions sit on a photo or scrim, not chrome */
  --clr-on-media: #ffffff;
  --clr-media-mat: #000000;

  /* Shadows for floating things only, cards get a border */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.14);

  /* Motion */
  --transition: 0.18s ease;

  /* Typography scale */
  --text-xs: 0.75rem; /* 12px: metadata labels, small badges */
  --text-sm: 0.8125rem; /* 13px: secondary text, meta rows */
  --text-md: 0.875rem; /* 14px: supporting text, form labels */
  --text-base: 0.9375rem; /* 15px: body text, inputs */
  --text-lg: 1rem; /* 16px: card titles, large buttons */
  --text-xl: 1.125rem; /* 18px: lead paragraphs */
  --text-2xl: 1.25rem; /* 20px: sub-headings */
  --text-3xl: 1.5rem; /* 24px: page h1 */
  --text-4xl: 2rem; /* 32px: error-page h1 */
  --text-5xl: 3rem; /* 48px: hero h1 */

  /* Font stacks */
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

/* 2. Base */
html {
  font-size: 16px;
  /* The fixed top bar would cover an anchor jump */
  scroll-padding-top: calc(var(--navbar-height) + 1rem);
}

/* Desktop has no top bar: the navbar is a sidebar (layout.css) */
@media (min-width: 961px) {
  html {
    scroll-padding-top: 1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Links in main take the accent unless a component opts out (utils.css) */
a {
  color: inherit;
  text-decoration: none;
}
main a {
  color: var(--clr-accent);
}
main a:hover {
  text-decoration: underline;
}
/* "bolder" resolves to 900 inside 600-weight text */
strong {
  font-weight: 700;
}
img {
  display: block;
  max-width: 100%;
}
main {
  flex: 1;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 3. Container */
.container {
  max-width: var(--container-width);
  width: 100%;
  padding: 0 var(--space-container);
  margin: 0 auto;
}
