/* The home page ("/"; UX2 decision T8, rebuilt at UX3, founder 2026-12-03): a navy hero with the headline, the facts row and the US map
   with a pin per live city; then one card per city, A to Z by name; then how it works in three steps. Nothing here names a city or a
   count of cities: every city's words come from its config (tests/test_home_generic.py). */

/* ---------- hero: the words left, the map right (470 px); under 900 px the map moves below the words; under 720 px it is left out */
.home-hero .hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 24px 44px; align-items: center; padding-top: 40px; padding-bottom: 40px; }
.home-hero .page-title { font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin-top: 10px; max-width: 15em; }
.home-hero .lede { max-width: 34em; margin-top: 14px; }
.home-facts {
  list-style: none; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid var(--navy-line);
  display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 15px; color: var(--on-navy-2);
}
.home-facts li { font-weight: 600; color: var(--on-navy); font-variant-numeric: tabular-nums; }
.home-facts .fact-self { font-weight: 400; color: var(--on-navy-2); }

/* the map: the drawing (fill #0e2e4e, state lines #24476b, nation line #3b6189, all in the file) and the pins laid over it in percent */
.us-map { position: relative; width: 470px; max-width: 100%; aspect-ratio: 975 / 610; }
.us-states { display: block; width: 100%; height: auto; }
.pins { position: absolute; inset: 0; }
/* a pin: a white dot with a navy ring (never brand green), its link a 28 px circle, 44 px where fingers tap */
.pin {
  --hit: 28px; position: absolute; width: var(--hit); height: var(--hit); margin: calc(var(--hit) / -2) 0 0 calc(var(--hit) / -2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; z-index: 1;
}
.pin::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; background: #ffffff; border: 2px solid var(--brand-navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pin:hover, .pin:focus-visible, .pin.lit { z-index: 2; }
.pin:hover::before, .pin:focus-visible::before, .pin.lit::before { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(169, 205, 247, 0.5), 0 1px 3px rgba(0, 0, 0, 0.45); }
.pin:focus-visible { outline: 2px solid #ffffff; outline-offset: 1px; border-radius: 50%; }
/* its name in a small light tooltip on hover or focus, turned inward near the map's edges */
.pin .tip {
  position: absolute; bottom: calc(50% + 13px); left: 50%; transform: translateX(-50%); visibility: hidden; pointer-events: none;
  padding: 4px 9px; border-radius: var(--radius-s); background: #ffffff; color: var(--brand-navy); font-size: 13px; font-weight: 600;
  line-height: 1.3; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.pin.tip-l .tip { left: calc(50% - 10px); transform: none; }
.pin.tip-r .tip { left: auto; right: calc(50% - 10px); transform: none; }
.pin.tip-below .tip { bottom: auto; top: calc(50% + 13px); }
.pin:hover .tip, .pin:focus-visible .tip { visibility: visible; }
@media (pointer: coarse), (max-width: 1023px) { .pin { --hit: 44px; } }

@media screen and (max-width: 899px) {
  .home-hero .hero-inner { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 28px; }
  /* below the words the map takes the column, up to 640 px: at 470 px two close cities' 44 px touch targets cover each other
     (axe target-size, Stop A at 768 px); tests/test_home_generic.py holds the live pins apart (the map is 640 px at every window from 720 to 899 px) */
  .us-map { width: 100%; max-width: 640px; }
}
@media screen and (max-width: 719px) {
  .us-map { display: none; }
  .home-hero .hero-inner { padding-top: 22px; padding-bottom: 24px; }
  .home-hero .page-title { font-size: 30px; }
  .home-hero .lede { font-size: 16px; }
  .home-facts { margin-top: 16px; padding-top: 12px; }
  .home-facts .fact-self { display: none; }
}

/* ---------- "Choose a city", A to Z ---------- */
.choose-page .page { max-width: 1128px; padding-top: 32px; }
.choose-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.choose-head .az { font: 600 12px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- the cards: 252 px, wrapping, centered; a 140 px tinted panel with the outline and the short name, then the words */
.city-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.city-card {
  position: relative; width: 252px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: 0 2px 8px rgba(10, 37, 64, 0.08); overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.city-card:hover, .city-card:focus-within, .city-card.lit {
  box-shadow: 0 0 0 2px var(--brand-green), 0 10px 24px rgba(10, 37, 64, 0.16); transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .city-card:hover, .city-card:focus-within, .city-card.lit { transform: none; } }
.city-card .panel {
  position: relative; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--tint);
  border-radius: var(--radius) var(--radius) 0 0;
}
.city-card .tag {
  position: absolute; top: 10px; left: 10px; padding: 2px 7px; border-radius: 4px; background: var(--paper-raised); color: var(--brand-navy);
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.5;
}
.city-card .shape { width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.city-card .shape svg { width: 100%; height: 100%; display: block; }
.city-card .shape path { fill: var(--paper-raised); stroke: var(--brand-navy); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.city-card .shape .none { width: 100%; height: 100%; border-radius: var(--radius); background: var(--paper-raised); }
.city-card .words { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; padding: 14px 16px 8px; }
.city-card .name { font-size: 20px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; line-height: 1.25; }
.city-card .name::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }      /* the whole card opens the map */
.city-card .name:focus-visible { outline: none; }
.city-card .name:focus-visible::after { outline: 3px solid var(--brand-navy); outline-offset: 4px; }
.city-card .count { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.city-card .count b { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.city-card .upd { margin-top: 2px; font-size: 13px; color: var(--muted); }
.city-card .facts { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--axis); display: grid; gap: 7px; font-size: 14px; line-height: 1.35; }
.city-card .facts dt { font: 600 11.5px/1.3 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.city-card .facts dd { margin: 1px 0 0; color: var(--ink); }
.city-card .links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: auto -8px 0; padding-top: 8px; font-size: 14px; }
.city-card .links a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 8px; border-radius: var(--radius-s); color: var(--link); text-decoration: none; font-weight: 500; }
.city-card .links a:hover { background: var(--tint); color: var(--ink); }
.city-card .go { margin-left: auto; padding: 0 8px; font-size: 18px; color: var(--brand-navy); }
@media (pointer: coarse), (max-width: 1023px) { .city-card .links a { min-height: 44px; } }

.choose-note { margin: 22px auto 0; max-width: 70ch; text-align: center; }

/* ---------- how it works, three steps with navy icon tiles ---------- */
.home-how { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
.steps li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; align-content: start; }
.step-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: var(--radius); background: var(--brand-navy); color: #ffffff; display: flex; align-items: center; justify-content: center; }
.steps h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.steps p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
@media screen and (max-width: 899px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- phones: compact horizontal cards, one column; the deadline line kept ---------- */
@media screen and (max-width: 719px) {
  .choose-page .page { padding-top: 22px; }
  .choose-head { margin-bottom: 12px; }
  .city-cards { flex-direction: column; flex-wrap: nowrap; gap: 12px; }
  .city-card { width: auto; flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px; }
  .city-card .panel { flex: none; width: 76px; height: 76px; border-radius: var(--radius-s); }
  .city-card .tag { display: none; }
  .city-card .shape { width: 62px; height: 62px; }
  .city-card .words { flex: 1 1 0; padding: 0; }
  .city-card .name { font-size: 18px; }
  .city-card .count { margin-top: 2px; }
  .city-card .count b { font-size: 22px; }
  .city-card .facts { margin-top: 8px; padding-top: 8px; }
  .city-card .fact-types { display: none; }
  .city-card .links { margin-top: 4px; padding-top: 0; }
  .choose-note { margin-top: 18px; }
  .home-how { margin-top: 28px; padding-top: 22px; }
}
/* the narrowest phones: the decorative arrow would take a row of its own (the whole card is the link) */
@media screen and (max-width: 359px) { .city-card .go { display: none; } }
