/* CC4EJ Honeywell Site Hub — mobile-first, WCAG AA */

:root {
  --purple: #2D2460;
  --purple-soft: #e8e6f0;
  --gold: #D4A017;
  --gold-dark: #8F6D00; /* meets 3:1 on light backgrounds — use for meaningful marks */
  --gold-light: #fdf6e3;
  --green: #1A6B3C;
  --green-light: #e2f2e8;
  --ink: #23213a;
  --ink-soft: #4c4966;
  --paper: #ffffff;
  --bg: #f6f5fa;
  --line: #dedbe9;
  --radius: 14px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 600px) {
  body { font-size: 1.125rem; }
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--purple);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.top {
  background: var(--purple);
  color: #fff;
  padding: 14px 18px calc(14px + 2px);
  border-bottom: 4px solid var(--gold);
}
.top .wordmark {
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.top .tag {
  display: block;
  font-size: 0.85rem;
  color: #d8d4ea;
  margin-top: 2px;
}

/* ---------- Layout ---------- */
main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

h1 {
  color: var(--purple);
  font-size: clamp(1.65rem, 6vw, 2.3rem);
  line-height: 1.2;
  margin: 14px 0 6px;
}
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 6px 0 0;
}
.lede {
  font-size: 1.15em;
  color: var(--ink);
  margin-top: 10px;
}

h2 {
  color: var(--purple);
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 34px 0 10px;
  padding-left: 12px;
  border-left: 5px solid var(--gold);
}
h3 {
  color: var(--purple);
  font-size: 1.08rem;
  margin: 20px 0 6px;
}
p { margin: 10px 0; }

ul { padding-left: 22px; margin: 10px 0; }
li { margin: 6px 0; }

a { color: var(--purple); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: #1e1745; }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Gold ring only on dark surfaces — on the white bottom nav it fails 3:1 */
.top :focus-visible, .quote :focus-visible {
  outline-color: var(--gold);
}
main:focus { outline: none; }

/* ---------- Cards & boxes ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
  margin: 16px 0;
}

.callout {
  background: var(--gold-light);
  border-left: 6px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  margin: 18px 0;
}
.callout--green {
  background: var(--green-light);
  border-left-color: var(--green);
}
.callout h3 { margin-top: 0; }
.callout h2 {
  margin-top: 0;
  font-size: 1.08rem;
  border-left: none;
  padding-left: 0;
}

.quote {
  background: var(--purple);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 24px 0;
}
.quote blockquote {
  margin: 0;
  font-size: 1.2em;
  line-height: 1.45;
  font-weight: 600;
}
.quote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 0.9em;
  color: #cfc9e6;
}
.quote .answer {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 2px solid var(--gold);
  color: #fff;
  font-weight: 700;
}

/* ---------- Big action buttons ---------- */
.actions { display: grid; gap: 12px; margin: 20px 0; }

.btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 56px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1.3;
  border: 2px solid transparent;
}
.btn small {
  display: block;
  font-weight: 400;
  font-size: 0.85em;
}
.btn svg { flex: none; width: 28px; height: 28px; }

.btn--primary { background: var(--purple); color: #fff; }
.btn--primary:hover { background: #241c4e; color: #fff; }
.btn--primary small { color: #d8d4ea; }

.btn--outline {
  background: var(--paper);
  color: var(--purple);
  border-color: var(--purple);
}
.btn--outline:hover { background: var(--purple-soft); }
.btn--outline small { color: var(--ink-soft); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 20px 0; }
.timeline li {
  position: relative;
  padding: 0 0 22px 30px;
  border-left: 3px solid var(--purple-soft);
  margin: 0 0 0 8px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -9.5px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid var(--bg);
}
/* Shape + color together, so the categories survive color-blindness:
   filled circle = happened, square = decided without testing, ring = neighbors */
.timeline li.tl-gap::before { background: var(--gold-dark); border-radius: 4px; }
.timeline li.tl-win::before { background: var(--paper); border-color: var(--green); }
.timeline .year {
  display: block;
  font-weight: 800;
  color: var(--purple);
  font-size: 1.05em;
}
.timeline p { margin: 4px 0 0; }

.legend { font-size: 0.9rem; color: var(--ink-soft); margin: 8px 0 0; }
/* Each item stays on one line, so wraps happen between items, not mid-phrase */
.legend-item { display: inline-block; white-space: nowrap; margin-right: 16px; }
.legend .dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin: 0 4px -1px 0;
}
.legend .dot--purple { background: var(--purple); }
.legend .dot--gold { background: var(--gold-dark); border-radius: 3px; }
.legend .dot--green { background: var(--paper); border: 3px solid var(--green); }

/* ---------- FAQ accordions & sources ---------- */
details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin: 12px 0;
}
details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--purple);
  padding: 16px 18px;
  list-style-position: inside;
}
details[open] summary { border-bottom: 1px solid var(--line); }
details .body { padding: 4px 18px 14px; }

details.sources {
  background: transparent;
  border: none;
  margin-top: 28px;
}
details.sources summary {
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 12px 0; /* roomier tap target — clears the 24px AA minimum (2.5.8), near the 44px AAA target (2.5.5) */
}
details.sources[open] summary { border-bottom: none; }
details.sources .body {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0;
}

/* ---------- To-fill placeholders ---------- */
.todo {
  background: var(--gold-light);
  border: 1.5px dashed var(--gold);
  border-radius: 6px;
  padding: 1px 6px;
  font-weight: 700;
  color: #7a5c00;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 20px 18px 30px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
footer a { color: var(--purple); }

/* ---------- Bottom navigation ---------- */
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper);
  border-top: 2px solid var(--line);
  display: flex;
  z-index: 50;
}
.bottom a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 48px;
}
.bottom a svg { width: 24px; height: 24px; }
.bottom a[aria-current="page"] {
  color: var(--purple);
  border-top: 3px solid var(--gold-dark); /* gold-dark: 4.8:1 on white; plain gold fails 3:1 */
  margin-top: -2px;
  background: var(--purple-soft);
  font-weight: 800;
}

@media (min-width: 720px) {
  .bottom { max-width: 42rem; left: 50%; transform: translateX(-50%); border: 2px solid var(--line); border-bottom: none; border-radius: 14px 14px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Print: petition page prints clean ---------- */
@media print {
  .bottom, .top, .skip { display: none; }
  body { padding-bottom: 0; background: #fff; }
  /* Browsers don't print backgrounds — flip white-on-purple blocks to dark-on-white */
  .quote, .btn--primary {
    background: none !important;
    color: #000 !important;
    border: 2px solid #000;
  }
  .quote cite, .quote .answer, .btn--primary small { color: #000 !important; }
  /* Paper can't tap a link — print the address after it */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
