/* ==========================================================================
   For A Brighter Evanston — shared styles
   Tokens · base · layout · header · alert bar · footer · buttons · type
   helpers · bands · forms · dialogs · utilities
   Page-specific styles live in home.css, news.css, new-homes.css, write.css.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --navy: #13224F;
  --navy-deep: #0B1638;
  --blue: #36558A;
  --gold: #D9B96E;
  --gold-soft: #FBF6E9;
  --orange: #E8731A;
  --orange-light: #F28C3A;
  --rust: #C4560E;
  --ink: #13224F;
  --ink-soft: #2B3A5F;
  --tint: #EEF1F6;
  --cream: #FBF6EC;
  --paper: #F6F4EE;
  --line: #D5DCE8;
  --white: #FFFFFF;
  --danger: #9A3A12;

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --container: 1200px;
  --container-narrow: 960px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(36px, 6vw, 72px);
  --radius: 4px;
  --shadow: 0 2px 10px rgba(19, 34, 79, .12);
  --shadow-lg: 0 16px 48px rgba(11, 22, 56, .35);
  --focus: 3px solid var(--gold);
  --header-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; outline: none; }
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: inherit; text-underline-offset: .18em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

.band { padding-block: var(--section-y); }
.band--white { background: var(--white); }
.band--tint { background: var(--tint); }
.band--gold { background: var(--gold); color: var(--navy); }
.band--navy { background: var(--navy); color: var(--white); }
.band--rule { border-top: 6px solid var(--gold); }
.band--tight-bottom { padding-bottom: 0; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 760px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  padding: 10px 16px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ----------
   Two rows: brand + Sign/Español, then the menu. Same 1120px column as the
   alert bar and footer. On phones the menu becomes one sideways-scrolling row. */
:root { --header-h: 126px; --chrome-w: 1120px; --chrome-pad: 24px; --chrome-muted: #C9D1E6; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  color: var(--white);
}
.site-header__top,
.site-menu,
.alert-bar__inner,
.site-footer__inner {
  width: 100%;
  max-width: calc(var(--chrome-w) + 2 * var(--chrome-pad));
  margin-inline: auto;
  padding-inline: var(--chrome-pad);
}
.site-header__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  min-height: 32px;
}
.brand:hover { color: var(--white); }
.brand__star { flex: none; width: 20px; height: 20px; color: var(--gold); }
.site-header__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.site-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.site-header__btn--gold { padding: 12px 18px; background: var(--gold); color: var(--navy); font-weight: 800; }
.site-header__btn--gold:hover { background: #E6CA86; color: var(--navy); }
.site-header__btn--outline { padding: 10px 16px; border: 2px solid var(--white); color: var(--white); font-weight: 700; }
.site-header__btn--outline:hover { background: rgba(255, 255, 255, .12); color: var(--white); }
.lang-switch__short { display: none; }

.site-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 28px;
  padding-top: 8px;
  padding-bottom: 13px;
}
.site-menu__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-menu__list a,
.site-menu__button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 0 4px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--chrome-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.site-menu__list a:hover,
.site-menu__button:hover { color: var(--white); }
.site-menu__list a[aria-current="page"] { color: var(--white); border-bottom-color: var(--gold); }
.site-menu__icon .icon { width: 18px; height: 18px; }

/* Tablets and phones: the site's existing pattern. Brand and buttons share the
   top row; the whole menu becomes one full-width row that scrolls sideways. */
@media (max-width: 900px) {
  :root { --header-h: 96px; --chrome-pad: var(--gutter); }
  .site-header__top { padding-top: 8px; }
  .site-header__actions { margin-left: auto; gap: 8px; }
  .site-header__btn { min-height: 38px; padding: 7px 14px; font-size: .8125rem; }
  .site-header__btn--outline { padding: 5px 12px; }
  .site-menu {
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 8px;
    padding-block: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .site-menu::-webkit-scrollbar { display: none; }
  .site-menu__list { flex-wrap: nowrap; gap: 0; flex: none; }
  .site-menu__list a, .site-menu__button { min-height: 44px; padding: 8px 10px 5px; font-size: .8125rem; }
  .site-menu__list--primary li:first-child a { padding-left: 0; }
}
@media (max-width: 520px) {
  /* Stack the name into a two-line lockup so it shares the row with the buttons */
  .site-header__top { flex-wrap: nowrap; gap: 12px; }
  .brand { gap: 8px; font-size: .8125rem; letter-spacing: .02em; line-height: 1.1; min-width: 0; }
  .brand__name { max-width: 9.5em; }
  .site-header__actions { flex: none; }
  .lang-switch__full {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .lang-switch__short { display: inline; }
}
@media (max-width: 360px) {
  .brand { font-size: .75rem; }
  .brand__star { display: none; }
  .site-header__actions { gap: 6px; }
  .site-header__btn { padding-inline: 9px; font-size: .75rem; }
}

/* ---------- Alert bar ---------- */
.alert-bar { background: var(--gold); color: var(--navy); }
.alert-bar__inner {
  padding-block: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .8125rem;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.alert-bar__text { margin: 0; }
.alert-bar__short { display: none; }
@media (max-width: 720px) {
  .alert-bar__inner { padding-block: 10px; font-size: .6875rem; letter-spacing: .04em; }
  .alert-bar__long {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .alert-bar__short { display: inline; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: var(--chrome-muted);
}
.site-footer__inner { padding-block: 48px 32px; }
.site-footer__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
}
.site-footer__brand svg { flex: none; width: 20px; height: 20px; color: var(--gold); }
.site-footer__tag { margin: 0; font-weight: 700; font-size: 1rem; color: var(--gold); }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(201, 209, 230, .18);
  list-style: none;
  font-size: .8125rem;
  line-height: 1.5;
}
.site-footer__links li + li::before { content: "·"; margin: 0 .5em; }
.site-footer__links a { color: var(--white); }
.site-footer__links a:hover { color: var(--gold); }
@media (max-width: 720px) {
  .site-footer__inner { padding-block: 32px 24px; }
  .site-footer__main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-footer__links { flex-direction: column; margin-top: 20px; padding-top: 16px; }
  .site-footer__links li + li::before { content: none; }
  .site-footer__links a { display: inline-flex; align-items: center; min-height: 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .9375rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn--sm { min-height: 38px; padding: 7px 14px; font-size: .8125rem; }
.btn--lg { min-height: 50px; padding: 12px 22px; font-size: 1rem; }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding-inline: 14px; }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: #E6CA86; }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--blue); }
.btn--outline-light { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px var(--white); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); }
.btn--outline-navy { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn--outline-navy:hover { background: rgba(19, 34, 79, .07); }
.btn-group { display: inline-flex; gap: 3px; }
.icon { display: block; flex: none; }

/* ---------- Type helpers ---------- */
.eyebrow {
  margin: 0 0 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow--ink { color: var(--navy); }
.eyebrow--gold { color: var(--gold); }
.eyebrow--rust { color: var(--rust); }
.tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 10px;
  background: var(--blue);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.subhead {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1875rem;
  line-height: 1.25;
}
.mark {
  display: inline;
  padding: .02em .25em;
  background: var(--gold);
  color: var(--navy);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.text-gold { color: var(--gold); }
.source-note { font-size: .8125rem; color: var(--blue); }
.source-note a { color: var(--blue); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: var(--navy);
  color: var(--white);
  padding-block: clamp(32px, 6vw, 56px) clamp(28px, 5vw, 48px);
}
.page-hero__title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.25rem, 7vw, 3.875rem);
  line-height: 1.04;
  letter-spacing: -.02em;
}
.page-hero__title--md { font-size: clamp(1.875rem, 4.6vw, 2.875rem); max-width: 22ch; }
.page-hero__title--lg { font-size: clamp(2.25rem, 6vw, 3.5rem); }
.page-hero__title .mark { line-height: 1.32; }
.page-hero__lead { margin: 0; font-size: clamp(1rem, 1.6vw, 1.0625rem); color: #E4E9F3; max-width: 46ch; }
.page-hero__lead--wide { max-width: 62ch; }
.page-hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
}
.page-hero--split .page-hero__title { margin: 0; }
.page-hero__aside { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: 440px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .form__row { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field__label { font-size: .8125rem; font-weight: 700; }
.field__opt { font-weight: 600; color: var(--blue); }
.field__hint { margin: 0; font-size: .84375rem; color: var(--blue); line-height: 1.5; }
.field__inline { display: flex; gap: 8px; }
.field__inline input { flex: 1; min-width: 0; }
.field__inline .btn { flex: none; }
input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
  font: 16px/1.5 var(--font-body);  /* 16px stops iOS zoom on focus */
}
input:focus-visible, textarea:focus-visible { outline: var(--focus); outline-offset: 1px; border-color: var(--navy); }
textarea { resize: vertical; }
::placeholder { color: #7B88A6; opacity: 1; }
.form__thanks { margin: 0; padding: 12px 14px; background: var(--gold-soft); border-left: 4px solid var(--gold); font-weight: 700; }

/* ---------- Dialogs ---------- */
.dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 0;
  border-top: 6px solid var(--gold);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.dialog--wide { width: min(500px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(11, 22, 56, .62); }
.dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .dialog[open] { animation: none; } }
.dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}
.dialog__close:hover { background: var(--tint); }
.dialog__title {
  margin: 0 0 8px;
  padding-right: 36px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.15;
}
.dialog p { font-size: .9375rem; }
.dialog__fine { margin-top: 12px; font-size: .75rem !important; color: var(--ink-soft); }
html.has-dialog { overflow: hidden; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ---------- Sandbox preview banner (only on /sandbox/<id>/ builds) ---------- */
.sandbox-banner { background: repeating-linear-gradient(-45deg, #FFF3C4, #FFF3C4 12px, #FFE89A 12px, #FFE89A 24px); color: var(--navy); border-bottom: 2px solid var(--navy); }
.sandbox-banner__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-block: 8px; font-size: .8125rem; }
.sandbox-banner p { margin: 0; }
.sandbox-banner a { font-weight: 700; }
