/* A Safe Place for Veterans — site styles.
   Palette: Old Glory Red #B31942 / Old Glory Blue #0A3161 / white (U.S. Department of State
   flag color specification). Every fg/bg pair below was contrast-checked: all >= 6.1:1 (WCAG AA). */

:root {
  --blue: #0A3161;
  --red: #B31942;
  --white: #ffffff;
  --bg: #ffffff;
  --bg-soft: #f3f5f9;
  --text: #1b2333;
  --muted: #4a5568;
  --heading: #0A3161;
  --accent: #B31942;
  --link: #0A3161;
  --rule: #d5dbe5;
  --focus: #B31942;
  --radius: 10px;
  --max: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 3.5vw, 1.875rem);
  --step-3: clamp(1.875rem, 5vw, 2.75rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1426;
    --bg-soft: #132040;
    --text: #eef2f8;
    --muted: #b8c2d4;
    --heading: #9cc3ff;
    --accent: #ff8a9e;
    --link: #9cc3ff;
    --rule: #2a3a5c;
    --focus: #ff8a9e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { color: var(--heading); line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); margin-top: 1.6em; }
h3 { font-size: var(--step-1); margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: var(--white); padding: 0.75rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

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

/* Crisis bar: always first, always visible. */
.crisis {
  background: var(--red); color: var(--white);
  font-size: 0.95rem; text-align: center; padding: 0.5rem 1rem;
}
.crisis a { color: var(--white); font-weight: 700; }

/* Header: navy band with a red/white stripe rule beneath it. */
.site-header { background: var(--blue); color: var(--white); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--white); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand svg { width: 2rem; height: 2rem; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-nav a { color: var(--white); text-decoration: none; font-weight: 600; padding: 0.25rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }
.site-header :focus-visible { outline-color: var(--white); }
.stripes {
  height: 10px;
  /* literal hex: same values as --red/--white; the W3C CSS validator cannot parse var() in color stops */
  background: repeating-linear-gradient(90deg, #B31942 0, #B31942 2.5rem, #ffffff 2.5rem, #ffffff 5rem);
}

main { display: block; padding: 2.5rem 0 3rem; }

.hero { background: var(--bg-soft); border-bottom: 1px solid var(--rule); padding: 3rem 0 2.5rem; }
main > .hero:first-child { margin-top: -2.5rem; margin-bottom: 1rem; } /* sit flush under the stripes */
.hero .lede { font-size: var(--step-1); color: var(--text); max-width: 46rem; }
.hero .eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.9rem; margin-bottom: 0.4rem; }

.btn {
  display: inline-block; padding: 0.8rem 1.25rem; border-radius: var(--radius);
  font-weight: 700; text-decoration: none; margin: 0.25rem 0.5rem 0.25rem 0;
  border: 2px solid var(--blue); background: var(--blue); color: var(--white);
}
.btn.secondary { background: transparent; color: var(--link); border-color: currentColor; }
@media (prefers-color-scheme: dark) {
  .btn { background: var(--white); color: var(--blue); border-color: var(--white); }
}

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; }
.card {
  background: var(--bg-soft); border: 1px solid var(--rule); border-top: 4px solid var(--red);
  border-radius: var(--radius); padding: 1.25rem 1.25rem 0.5rem;
}
.card h3 { margin-top: 0; }
.card:nth-child(even) { border-top-color: var(--blue); }
@media (prefers-color-scheme: dark) { .card:nth-child(even) { border-top-color: var(--heading); } }

.notice {
  border-left: 5px solid var(--accent); background: var(--bg-soft);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0;
}
.notice strong { color: var(--heading); }

.help-numbers { list-style: none; padding: 0; }
.help-numbers li { background: var(--bg-soft); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.help-numbers .num { font-size: var(--step-1); font-weight: 700; }

.prose { max-width: 46rem; }

.site-footer { background: var(--blue); color: var(--white); padding: 2rem 0 2.5rem; font-size: 0.95rem; }
.site-footer a { color: var(--white); }
.site-footer .disclosure { max-width: 52rem; }
.site-footer nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer :focus-visible { outline-color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .card, .notice, .help-numbers li { border: 1px solid; }
  .btn { border: 2px solid; }
}

@media print {
  .crisis, .site-nav, .stripes, .skip-link { display: none; }
  .site-header, .site-footer { background: none; color: #000; }
  .site-header a, .site-footer a, .brand { color: #000; }
  body { font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
