/* MNGEA48 VMS - styled after the state association site mngea.com, with the same tokens as the
   mngea48.org WordPress site (since VMS 1.12): Yantramanav 700 headings, Roboto body, navy/orange/
   light-gray brand tokens, black footer. Mobile-first, WCAG 2.2 AA. */

/* mngea.com fonts, self-hosted (SIL OFL, licenses in ../fonts/), latin subset.
   Roboto files are variable fonts (wght 100-900); Yantramanav is static, only 700 is used. */
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-latin-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto"; src: url("../fonts/roboto-latin-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Yantramanav"; src: url("../fonts/yantramanav-latin-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Same values as the WordPress site's global styles (wp-site-manager, 2026-10-12). */
  --navy: #001954;        /* MNGEA navy: header title + 6px rule, table heads, admin nav current, hovers, focus */
  --menu-navy: #00235A;   /* nav text */
  --orange: #F75B13;      /* brand accent: backgrounds, borders, decoration only (3.25:1 on white) */
  --orange-text: #C34207; /* text-safe orange: links, primary buttons (5.12:1 on white, 4.57:1 on #F2F2F2) */
  --gray: #F2F2F2;        /* header background, soft panels */
  --black: #000000;       /* headings, footer */
  --fg: #212121;          /* body text */
  --fg-alt: #3D3B3B;      /* muted text (11.13:1 on white) */
  --muted: #767676;       /* borders / dashed outlines only (4.54:1 on white) */
  --bg: #FFFFFF;
  --primary: var(--navy);
  --secondary: #3D3B3B;
  --tertiary: var(--gray);
  --border: #DDDDDD;
  --input-border: #767676;
  --danger: #A02020;      /* 7.71:1 on white */
  --success: #1E6B34;
  --success-bg: #EAF6EE;
  --warn-bg: #FFF8E1;
  --warn-border: #C68A12;
  --error-bg: #FDECEA;
  --focus: var(--navy);
  --heading: "Yantramanav", "Roboto", Helvetica, Arial, sans-serif;
  --sans: "Roboto", Helvetica, Arial, sans-serif;
  --radius: 3px;          /* mngea.com buttons */
  --radius-card: 6px;
  --wrap: 60rem;          /* fallback column for browsers without CSS min()/max() */
  --prose: 70ch;          /* comfortable line length for paragraphs */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-weight: 400;
  font-size: 1.125rem; line-height: 1.8;
}
h1, h2, h3 { font-family: var(--heading); line-height: 1.2; margin: 1.5rem 0 .75rem; color: var(--black); font-weight: 700; letter-spacing: normal; text-transform: none; }
/* mngea.com accent: short orange bar under page titles (decorative) */
h1::after { content: ""; display: block; width: 3.5rem; height: 4px; margin-top: .75rem; background: var(--orange); }
.toolbar h1::after, .notice h1::after { display: none; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); overflow-wrap: break-word; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
a { color: var(--orange-text); text-decoration: underline; text-underline-offset: .15em; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }
code { font-size: .85em; background: var(--gray); padding: .1em .3em; }
.wrap-any { overflow-wrap: anywhere; }
small { font-size: .875rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: .75rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }
.visually-hidden, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { left: -9999px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
/* Layout width (1.8): full width minus 16px gutters on phones and small tablets (below 48rem / 768px),
   a 46rem column between 768px and ~980px, then up to 75% of the viewport on larger screens.
   Header and footer bands stay full-width; only their inner .wrap follows this rule. */
@supports (width: min(1px, 2px)) {
  .wrap { max-width: none; padding-left: 0; padding-right: 0; width: min(100% - 32px, max(75vw, 46rem)); }
}
main.wrap { padding-bottom: 3rem; }
main:focus { outline: none; }
main, .site-footer { overflow-wrap: break-word; }
/* Prose keeps a readable line length even when the column is wide; tables, grids and rosters use it all. */
main > p, main > ul:not([class]), main > ol, .lead, .description, .notice, .empty, .summary, .panel > p, .hint { max-width: var(--prose); }

/* Header / footer */
.site-header { background: var(--gray); border-bottom: 6px solid var(--navy); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--navy); min-height: 44px; }
.brand img { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-org { font-family: var(--heading); font-weight: 700; font-size: 1.25rem; color: var(--navy); }
.brand-app { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); } /* small "eyebrow" label */
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; font-weight: 500; }
.site-footer { border-top: 6px solid var(--orange); background: var(--black); padding: 1.5rem 0; font-size: 1rem; line-height: 1.6; color: #fff; margin-top: 2rem; }
.footer-inner { display: flex; gap: 1rem; align-items: flex-start; }
.footer-seal { width: 40px; height: 40px; flex: none; }
.footer-text { min-width: 0; }
.site-footer a { color: #fff; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--orange); }   /* 6.46:1 on black */
.site-footer strong { color: #fff; }
.site-footer :focus-visible { outline-color: var(--orange); }
.version { font-size: .875rem; margin: 0; color: rgba(255,255,255,.5); } /* ~#808080, 5.32:1 on black */

.admin-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; text-decoration: none; color: var(--menu-navy); border-radius: var(--radius); font-weight: 500; font-size: 1.0625rem; }
.admin-nav a:hover { color: var(--orange-text); text-decoration: underline; }
.admin-nav a[aria-current="page"] { background: var(--navy); color: #fff; text-decoration: none; }
/* Signed-in user + Log out (1.13). Navy on #F2F2F2 is 15.6:1. */
.admin-user { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; font-size: 1rem; color: var(--navy); }
.admin-user-name { overflow-wrap: anywhere; }
.logout-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 1rem; border: 2px solid var(--navy); border-radius: var(--radius); color: var(--navy); background: var(--bg); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.logout-link:hover { background: var(--navy); color: #fff; }
.logout-link[aria-busy="true"] { cursor: progress; opacity: .7; }

/* Buttons */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.25rem;
  border: 2px solid var(--navy); background: var(--bg); color: var(--navy); font-family: var(--sans); font-size: 1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; border-radius: var(--radius); line-height: 1.2; text-align: center;
}
.button:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.button-primary { background: var(--orange-text); border-color: var(--orange-text); color: #fff; }
.button-primary:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.button-danger { border-color: var(--danger); color: var(--danger); }
.button-danger:hover { background: var(--danger); color: #fff; }
.button-block { width: 100%; }
.button-small { min-height: 44px; padding: .4rem .9rem; font-size: 1rem; }
.linklike { background: none; border: 0; padding: 0 .25rem; min-height: 44px; font: inherit; color: var(--orange-text); text-decoration: underline; cursor: pointer; }
.linklike.danger { color: var(--danger); }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.toolbar h1, .toolbar h2 { margin-bottom: .5rem; }

/* Content blocks */
.lead { font-size: 1.2rem; color: var(--fg-alt); }
.crumbs { margin: 1rem 0 0; font-size: 1rem; }
.crumbs a { display: inline-flex; min-height: 44px; align-items: center; }
.meta, .muted { color: var(--fg-alt); }
.card-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.card { background: var(--bg); border: 1px solid var(--border); border-top: 3px solid var(--navy); border-radius: var(--radius-card); padding: 1rem 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); line-height: 1.6; }
.card-title { margin-top: 0; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--orange-text); }
.card .button { margin-top: .25rem; }
.when { font-weight: 600; margin-bottom: .25rem; }
.where, .notes { margin-bottom: .25rem; }
.spots { font-weight: 600; }
.spots-open { color: var(--success); }
.spots-full { color: var(--fg-alt); }
.summary { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1rem 1.25rem; margin: 1rem 0 1.5rem; }
.summary p { margin-bottom: .25rem; }
.empty { background: var(--gray); border: 1px dashed var(--muted); border-radius: var(--radius-card); padding: 1.25rem; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.panel > h2:first-child { margin-top: 0; }
.description { background: var(--bg); padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: 1rem; }
.tips { padding-left: 1.25rem; }
.tips li { margin-bottom: .5rem; }

.notice { background: var(--bg); border-left: 6px solid var(--secondary); padding: .75rem 1rem; margin: 1rem 0; }
.notice h1, .notice h2 { margin-top: .25rem; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-success { border-color: var(--success); background: var(--success-bg); }
.notice-warn { border-color: var(--warn-border); background: var(--warn-bg); }
.notice-error { border-color: var(--danger); background: var(--error-bg); }
.notice-error a, .notice-error .linklike { color: var(--navy); } /* orange is 4.48:1 on the error background */

/* Forms */
.form { max-width: 36rem; line-height: 1.5; }
.field { margin: 0 0 1.25rem; border: 0; padding: 0; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: .25rem; }
.optional { font-weight: 400; color: var(--fg-alt); }
.hint { font-size: 1rem; color: var(--fg-alt); margin: 0 0 .4rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], textarea, select {
  width: 100%; min-height: 48px; padding: .6rem .75rem; font: inherit; color: var(--fg); background: #fff;
  border: 2px solid var(--input-border); border-radius: 6px;
}
textarea { min-height: 6rem; }
fieldset { min-width: 0; }
/* 24-hour time: hour + minute selects side by side under the legend (fits 320px screens). */
.time-selects { display: flex; align-items: center; gap: .4rem; }
.time-selects select { width: auto; min-width: 5.5rem; flex: 0 0 auto; }
.time-sep { font-weight: 700; font-size: 1.25rem; }
.time-field { margin-bottom: 1rem; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--navy); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-weight: 600; margin: .35rem 0 0; font-size: 1rem; }
.field-check { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; min-height: 44px; }
.field-check input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--primary); }
.field-check label { font-weight: 500; margin: 0; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.field-row > * { min-width: 0; }
/* Start / end time: side by side when they fit, stacked otherwise (never overlap). */
.field-row-2 { display: flex; flex-wrap: wrap; gap: 0 2rem; }

/* Admin tables -> stacked cards on phones */
.table-wrap { width: 100%; overflow-x: auto; }
table.data td, table.data th { overflow-wrap: anywhere; }
table.data { width: 100%; border-collapse: collapse; background: var(--bg); font-size: 1rem; line-height: 1.5; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
table.data thead th { background: var(--navy); color: #fff; font-weight: 700; }
tr.is-cancelled { color: var(--fg-alt); }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
@media (max-width: 47.99rem) {
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data, table.data tbody, table.data tr, table.data th, table.data td { display: block; width: 100%; }
  table.data tr { border: 1px solid var(--border); margin-bottom: .75rem; }
  table.data th[scope="row"] { background: var(--tertiary); }
  table.data td[data-label]::before, table.data th[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--fg-alt); }
  table.data th[scope="row"]::before { content: none; }
}
meter { width: 5rem; height: 1rem; vertical-align: middle; }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border: 1px solid var(--secondary); color: var(--secondary); background: var(--bg); white-space: nowrap; vertical-align: middle; }
.badge-published, .badge-confirmed, .badge-attended, .badge-mail-sent { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.badge-cancelled, .badge-no_show, .badge-mail-failed { border-color: var(--danger); color: var(--danger); background: var(--error-bg); }
.badge-waitlisted, .badge-pending, .badge-draft, .badge-mail-queued { border-color: var(--warn-border); color: #5C3F00; background: var(--warn-bg); }
.status-confirmed, .status-attended { color: var(--success); }

.stat-row { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-card); padding: .75rem 1rem; }
.stat a { text-decoration: none; color: inherit; display: block; }
.stat-num { display: block; font-family: var(--heading); font-size: 1.9rem; font-weight: 700; color: var(--navy); }
.stat-label { color: var(--fg-alt); font-size: .95rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 1rem; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 2px solid var(--navy); border-radius: var(--radius); text-decoration: none; color: var(--navy); font-weight: 600; font-size: 1rem; }
.tabs a[aria-current="page"] { background: var(--navy); color: #fff; }
.pager { display: flex; gap: .5rem; margin: 1rem 0; }
.kv dt { font-weight: 600; }
.kv dd { margin: 0 0 .5rem; overflow-wrap: anywhere; }

/* Roster (check-in friendly) */
.roster-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.roster-item { line-height: 1.5; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.roster-item .who { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.roster-item.status-cancelled .who { color: var(--fg-alt); text-decoration: line-through; text-decoration-thickness: 1px; }
.roster-item.status-cancelled .who .badge, .roster-item.status-cancelled .who small { text-decoration: none; }
.add-volunteer summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--orange-text); }
.add-volunteer .form { margin-top: .75rem; }

/* Phones: tighter boxes, nav on its own row, main form buttons full-width. */
@media (max-width: 39.99rem) {
  .panel, .card, .summary, .description { padding: 1rem; }
  .admin-nav { flex: 1 1 100%; }
  .admin-user { flex: 1 1 100%; justify-content: space-between; }
  .admin-nav a { padding: 0 .6rem; }
  .form > button[type="submit"], .actions > .button, .actions > form.inline, .actions > form.inline .button { width: 100%; }
  .actions > form.inline { display: block; }
  .toolbar > .button { width: 100%; }
  .pager .button { flex: 1 1 0; }
}
@media (min-width: 40rem) {
  .card-list { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
  .button-block { width: auto; min-width: 18rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .row-actions, .add-volunteer, .actions { display: none; } body { background: #fff; } }
