/* EmergencyHousing.CA toolkit — themes & accessibility.
   UI prefs may live in sessionStorage only. Case answers never persist. */

body[data-theme="dawn"] {
  --navy: #0b1f3a;
  --navy-2: #143056;
  --ink: #1a2332;
  --muted: #5a6577;
  --line: #d7dde6;
  --paper: #f4efe6;
  --card: #fffdf8;
  --teal: #0d6e6e;
  --teal-dk: #085656;
  --gold: #b8892a;
  --gold-lt: #f4e6c4;
  --rose: #8b2e3a;
}

body[data-theme="midnight"] {
  --navy: #071018;
  --navy-2: #102433;
  --ink: #e8eef4;
  --muted: #9fb0c0;
  --line: #2a3d4e;
  --paper: #0c1822;
  --card: #132333;
  --teal: #3ecfc4;
  --teal-dk: #7ee8df;
  --gold: #e2b34a;
  --gold-lt: #3a2f14;
  --rose: #f08a96;
  --ok: #6ee7a8;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}
body[data-theme="midnight"] .site-header { background: #050c12; }
body[data-theme="midnight"] .privacy-bar { background: #10281f; border-color: #1d4a3a; color: #c8ead8; }
body[data-theme="midnight"] .card, body[data-theme="midnight"] fieldset,
body[data-theme="midnight"] input, body[data-theme="midnight"] select,
body[data-theme="midnight"] textarea { background: #132333; color: var(--ink); border-color: #2a3d4e; }
body[data-theme="midnight"] .btn-outline { background: #132333; color: #e8eef4; }
body[data-theme="midnight"] .callout { background: #16302c; color: #d7efe9; }
body[data-theme="midnight"] .callout.warn { background: #2c2410; }
body[data-theme="midnight"] .callout.rose { background: #2a1518; }
body[data-theme="midnight"] .callout.navy { background: #152033; }
body[data-theme="midnight"] table.plain th, body[data-theme="midnight"] table.plain td { border-color: #2a3d4e; }
body[data-theme="midnight"] .hero { background: linear-gradient(160deg,#050c12,#0d3a40); }

body[data-theme="high"] {
  --navy: #000;
  --ink: #000;
  --muted: #222;
  --line: #000;
  --paper: #fff;
  --card: #fff;
  --teal: #000;
  --teal-dk: #000;
  --gold: #000;
  --gold-lt: #fff;
  --rose: #000;
  --ok: #000;
  --shadow: none;
}
body[data-theme="high"] .site-header,
body[data-theme="high"] .footer,
body[data-theme="high"] .hero,
body[data-theme="high"] .result { background: #000; color: #fff; }
body[data-theme="high"] .site-header a, body[data-theme="high"] .hero { color: #fff; }
body[data-theme="high"] .privacy-bar { background: #fff; color: #000; border: 2px solid #000; }
body[data-theme="high"] .card, body[data-theme="high"] fieldset { border: 2px solid #000; }
body[data-theme="high"] a { text-decoration: underline; }
body[data-theme="high"] .btn-gold { background: #000; color: #fff; border: 2px solid #fff; }
body[data-theme="high"] .brand-mark { background: #fff; color: #000; }

body[data-theme="forest"] {
  --navy: #10261c;
  --navy-2: #1b3d2d;
  --ink: #14241b;
  --muted: #4a5f52;
  --line: #c9d6cc;
  --paper: #eef5ef;
  --card: #ffffff;
  --teal: #1f7a4d;
  --teal-dk: #145536;
  --gold: #c4a35a;
  --gold-lt: #efe4c4;
  --rose: #8b2e3a;
}
body[data-theme="forest"] .hero { background: linear-gradient(160deg,#10261c,#1f7a4d); }
body[data-theme="forest"] .site-header { background: #10261c; }

body[data-theme="sand"] {
  --navy: #3b2f27;
  --ink: #2a221c;
  --muted: #6b5e52;
  --line: #e0d4c6;
  --paper: #f6efe4;
  --card: #fffaf2;
  --teal: #8a4b2a;
  --teal-dk: #6b3418;
  --gold: #c4893a;
  --gold-lt: #f3e0c0;
}
body[data-theme="sand"] .hero { background: linear-gradient(160deg,#3b2f27,#8a4b2a); }
body[data-theme="sand"] .site-header { background: #3b2f27; }

html[data-size="lg"] body { font-size: 19px; }
html[data-size="xl"] body { font-size: 22px; }
html[data-underline="on"] a { text-decoration: underline; }
html[data-motion="reduce"] * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

.a11y-bar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.a11y-bar .inner {
  max-width: var(--max); margin: 0 auto; padding: 8px 20px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.a11y-bar label { margin: 0; font-weight: 650; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.a11y-bar select { width: auto; padding: 4px 8px; font-size: 13px; }
.a11y-bar .sep { width: 1px; height: 18px; background: var(--line); }

.brand-url { font-size: 11px; opacity: .7; letter-spacing: .04em; }

.quick-exit {
  background: #111; color: #fff; border: 0; border-radius: 8px;
  font-weight: 700; padding: 9px 12px; cursor: pointer; font-size: 13px;
}
.quick-exit:hover { background: #000; }

.print-nudge {
  position: sticky; bottom: 12px; z-index: 30;
  margin: 20px auto 0; max-width: var(--max);
  background: #8b2e3a; color: #fff; padding: 12px 16px;
  border-radius: 12px; display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.print-nudge.on { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.locate-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card);
}
.locate-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 14px; }
.search-count { font-weight: 700; color: var(--teal-dk); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swot-box textarea { min-height: 140px; }
.swot-s { border-top: 4px solid var(--ok); }
.swot-w { border-top: 4px solid var(--gold); }
.swot-o { border-top: 4px solid var(--teal); }
.swot-t { border-top: 4px solid var(--rose); }

.timeline-item {
  display: grid; grid-template-columns: 140px 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.incident-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
  background: var(--card);
}
.incident-card h4 { margin: 0 0 10px; font-size: 1rem; }
.incident-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.incident-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .swot-grid, .timeline-item, .incident-grid { grid-template-columns: 1fr; }
}
table.inc-print th { white-space: nowrap; }
table.inc-print { font-size: 13px; }

@media print {
  .a11y-bar, .quick-exit, .print-nudge, .no-print { display: none !important; }
}
