/*
Theme Name: The American Dream
Description: Portraits and answers from the road. Freeway signs, the map, a page for every person, light and dark.
Author: Joseph Philipson
Version: 1.0
Requires PHP: 8.0
Text Domain: american-dream
*/

@font-face { font-family: "Overpass"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/overpass-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/overpass-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/overpass-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/overpass-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Display"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); }

:root {
  --green: #0E5C3A; --brown: #5B3A21; --bus: #F4B400; --asphalt: #3A3A36; --paint: #E8E6DE;
  --sign: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --words: "Libre Caslon Text", Georgia, serif;
  --words-big: "Libre Caslon Display", Georgia, serif;
  --bg: #FFFFFF; --ink: #1D1D1B; --muted: #5E5E58; --soft: #3E3E3A; --rule: #DADAD4;
  --link: #0E5C3A; --linkh: #0A4229; --chip-bg: #FFFFFF; --chip-fg: #0E5C3A; --chip-bd: #0E5C3A;
  --btn-bg: #3A3A36; --btn-fg: #FFFFFF; --strong: #1D1D1B; --photo: #F1F0EA; --control: #0E5C3A;
  --land: #F1F0EA; --land-line: #CFCEC6; --state-line: #B8B7AE; --road-line: #9B9A92;
  --label: #A3A29A; --label-faint: #BDBCB4; --water: #8FA3AD; --shield-bg: #FFFFFF; --shield-line: #6E6D66; --shield-text: #3E3E3A;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #262624; --ink: #F2F1EC; --muted: #C9C8BF; --soft: #D9D8D0; --rule: #45453F;
  --link: #F4B400; --linkh: #FFD45C; --chip-bg: transparent; --chip-fg: #F2F1EC; --chip-bd: #8E8D86;
  --btn-bg: #F4B400; --btn-fg: #1D1D1B; --strong: #F2F1EC; --photo: #1B1B1A; --control: #8E8D86;
  --land: #34342F; --land-line: #4E4E47; --state-line: #6A6A62; --road-line: #8E8D86;
  --label: #8A8980; --label-faint: #6E6D66; --water: #7F98A3; --shield-bg: #262624; --shield-line: #A9A89F; --shield-text: #E4E3DB;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #262624; --ink: #F2F1EC; --muted: #C9C8BF; --soft: #D9D8D0; --rule: #45453F;
    --link: #F4B400; --linkh: #FFD45C; --chip-bg: transparent; --chip-fg: #F2F1EC; --chip-bd: #8E8D86;
    --btn-bg: #F4B400; --btn-fg: #1D1D1B; --strong: #F2F1EC; --photo: #1B1B1A; --control: #8E8D86;
    --land: #34342F; --land-line: #4E4E47; --state-line: #6A6A62; --road-line: #8E8D86;
    --label: #8A8980; --label-faint: #6E6D66; --water: #7F98A3; --shield-bg: #262624; --shield-line: #A9A89F; --shield-text: #E4E3DB;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sign); font-size: 17px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:hover { color: var(--linkh); }
:focus-visible { outline: 3px solid var(--bus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--bus); color: #1D1D1B; padding: 8px 12px; font-weight: 700; }
.skip:focus { left: 8px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

/* Signs */
.blade { display: inline-block; background: var(--green); color: #FFFFFF; font-weight: 700; padding: 8px 12px 5px; border-radius: 5px; line-height: 1.2; text-decoration: none; }
.logo { text-decoration: none; background: var(--green); color: #FFFFFF; font-weight: 700; font-size: 18px; padding: 9px 14px 6px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #FFFFFF; }
.logo:hover { color: #FFFFFF; }
.exit-sign { display: inline-block; }
.exit-sign .tab { display: inline-block; background: var(--green); color: #FFFFFF; font-weight: 700; font-size: 15px; padding: 7px 12px 4px; border-radius: 7px 7px 0 0; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #FFFFFF; }
.exit-sign .board { background: var(--green); color: #FFFFFF; border-radius: 0 10px 10px 10px; padding: 16px 22px 13px; box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 6px #FFFFFF; }
.exit-sign.brown .tab, .exit-sign.brown .board { background: var(--brown); box-shadow: inset 0 0 0 3px var(--brown), inset 0 0 0 6px #FFFFFF; }
.exit-sign .name { margin: 0; font-weight: 800; font-size: clamp(26px, 3vw, 34px); line-height: 1.05; }
.exit-sign .sub { margin: 8px 0 0; font-weight: 600; font-size: 16px; }

/* Header */
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 40px; border-bottom: 1px solid var(--rule); }
.site-head nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.site-head nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; }
.site-head nav a:hover { color: var(--link); }
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); background: transparent; border: 2px solid var(--control); border-radius: 999px; padding: 8px 14px 6px; min-height: 44px; cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .site-head { padding: 14px 20px; } }

/* Road */
.strip { height: 34px; background: linear-gradient(var(--bus), var(--bus)) left 0 top 6px / 100% 4px no-repeat, linear-gradient(var(--paint), var(--paint)) left 0 bottom 6px / 100% 4px no-repeat, repeating-linear-gradient(90deg, var(--paint) 0 60px, transparent 60px 126px) left 0 top 50% / 100% 4px no-repeat, var(--asphalt); }
.road { background: linear-gradient(var(--bus), var(--bus)) left 0 top 14px / 100% 5px no-repeat, linear-gradient(var(--paint), var(--paint)) left 0 bottom 14px / 100% 5px no-repeat, repeating-linear-gradient(90deg, var(--paint) 0 72px, transparent 72px 150px) left 0 top 56% / 100% 6px no-repeat, var(--asphalt); padding: 52px 0 46px; }
.road .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.road .back { color: #FFFFFF; font-weight: 600; background: var(--asphalt); padding: 8px 12px; }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: 16px; color: var(--btn-fg); background: var(--btn-bg); border: 0; border-radius: 6px; padding: 12px 18px 10px; min-height: 44px; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--btn-fg); filter: brightness(1.08); }
.btn.ghost { color: var(--chip-fg); background: var(--chip-bg); border: 2px solid var(--chip-bd); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 26px; border-bottom: 2px solid var(--strong); }
.chip { font: inherit; font-weight: 700; font-size: 15px; color: var(--chip-fg); background: var(--chip-bg); border: 2px solid var(--chip-bd); border-radius: 999px; padding: 10px 16px 8px; min-height: 44px; cursor: pointer; }
.chip[aria-pressed="true"] { color: #FFFFFF; background: var(--green); border-color: var(--green); }

/* Hero: the photograph big, the answer beside it; Shuffle swaps sides */
.hero { padding: 48px 0 72px; }
.hero-grid { max-width: 1520px; margin: 0 auto; padding: 0 40px; display: flex; align-items: center; justify-content: center; gap: clamp(32px, 4vw, 64px); }
.hero-grid.flip { flex-direction: row-reverse; }
.hero-photo { flex: 0 1 auto; min-width: 0; display: block; line-height: 0; }
.hero-photo img { display: block; width: auto; height: auto; max-width: 100%; max-height: clamp(460px, calc(100vh - 190px), 940px); max-height: clamp(460px, calc(100svh - 190px), 940px); border-radius: 4px; }
.hero-text { flex: 0 0 clamp(300px, 30vw, 460px); }
.hero .ask { margin: 0 0 22px; font-weight: 600; font-size: 18px; color: var(--muted); }
.hero blockquote { margin: 0 0 30px; font-family: var(--words-big); line-height: 1.12; letter-spacing: -0.005em; font-size: clamp(28px, 2.6vw, 42px); }
.hero blockquote.short { font-size: clamp(32px, 3.3vw, 54px); line-height: 1.08; }
.hero blockquote.long { font-size: clamp(24px, 2.1vw, 34px); line-height: 1.18; }
.hero .meta { margin: 10px 0 26px; font-size: 16px; color: var(--muted); }
.hero > .wrap { max-width: 1520px; }
.hero .lede { margin-top: 64px; }
@media (max-width: 900px) {
  .hero-grid, .hero-grid.flip { flex-direction: column; align-items: stretch; padding: 0 20px; gap: 28px; }
  .hero-photo { align-self: center; }
  .hero-photo img { max-height: 76vh; }
  .hero-text { flex: none; }
}
.lede { max-width: 760px; margin: 0; font-family: var(--words); font-size: 22px; line-height: 1.55; color: var(--soft); }

/* Home: the map */
.atlas { scroll-margin-top: 20px; }
.atlas h2, .answers h2, .also h2 { margin: 0; font-weight: 800; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; }
.atlas .hint { margin: 10px 0 0; color: var(--muted); }
.atlas-grid { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.map { flex: 1 1 620px; min-width: 0; position: relative; aspect-ratio: 1200 / 860; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--bg); }
.map svg.base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map .land { fill: var(--land); stroke: var(--land-line); stroke-width: 1.5; }
.map .statelines { fill: none; stroke: var(--state-line); stroke-width: 1.6; stroke-dasharray: 7 5; }
.map .roads { fill: none; stroke: var(--road-line); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.map .slabel { font-family: var(--sign); font-weight: 600; font-size: 26px; fill: var(--label); text-anchor: middle; }
.map .slabel.faint { fill: var(--label-faint); font-weight: 400; }
.map .slabel.water { font-family: var(--words); font-style: italic; font-weight: 400; fill: var(--water); }
.map .route rect { fill: var(--shield-bg); stroke: var(--shield-line); stroke-width: 2; }
.map .route text { font-family: var(--sign); font-weight: 700; font-size: 17px; fill: var(--shield-text); text-anchor: middle; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.pin span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding-top: 2px; border-radius: 50%; background: var(--green); color: #FFFFFF; font-weight: 700; font-size: 13px; box-shadow: 0 0 0 2.5px #FFFFFF; transition: transform .15s ease; }
.pin.brown span { background: var(--brown); }
.pin[aria-current="true"] span { width: 38px; height: 38px; font-size: 16px; font-weight: 800; box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 7px var(--bus); }
.pin:hover span { transform: scale(1.12); }
.offmap { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 10px; background: var(--brown); color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 15px; padding: 9px 12px 7px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--brown), inset 0 0 0 4px #FFFFFF; }
.offmap.green { background: var(--green); box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #FFFFFF; }
.offmap:hover { color: #FFFFFF; }
.panel { flex: 1 1 400px; max-width: 500px; display: flex; flex-direction: column; gap: 6px; }
.panel .exit-sign { margin-bottom: 12px; }
.panel .row-s { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.panel .row-s img { flex: 0 0 64px; width: 64px; height: 80px; object-fit: cover; border-radius: 4px; }
.panel .row-s .q { display: block; font-family: var(--words); font-size: 20px; line-height: 1.4; }
.panel .row-s .n { display: block; margin-top: 8px; font-weight: 700; font-size: 15px; }
.panel .row-s:hover .n { color: var(--link); }
.panel .more { margin-top: 16px; align-self: flex-start; }
.panel .empty { color: var(--muted); font-family: var(--words); font-size: 19px; }

/* Home: every answer */
.answers { margin-top: 96px; scroll-margin-top: 20px; }
.answers h2 { margin-bottom: 22px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--rule); }
.rows li[hidden] { display: none; }
.rows a { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; padding: 26px 0; text-decoration: none; color: var(--ink); }
.rows img { display: block; flex: 0 0 88px; width: 88px; height: 110px; object-fit: cover; border-radius: 4px; }
.rows .q { flex: 999 1 420px; font-family: var(--words); font-size: clamp(21px, 2.1vw, 27px); line-height: 1.35; }
.rows .who { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; }
.rows .who b { font-weight: 700; font-size: 18px; }
.rows .who span { font-size: 15px; color: var(--muted); }
.rows a:hover .who b { color: var(--link); }

/* Person page */
.photo-full { margin: 0; background: var(--photo); display: flex; justify-content: center; }
.photo-full img { display: block; width: auto; max-width: 100%; max-height: 88vh; object-fit: contain; }
.person { max-width: 860px; margin: 0 auto; padding: 56px 40px 0; display: flex; flex-direction: column; gap: 22px; }
.person .top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.person h1.blade { margin: 0; font-size: 22px; padding: 9px 14px 6px; border-radius: 6px; }
.person .meta { margin: 0; font-size: 17px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink); border: 2px solid var(--control); border-radius: 6px; padding: 8px 12px 6px; min-height: 44px; }
.person .top .pill { margin-left: auto; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding-top: 2px; border-radius: 50%; background: var(--green); color: #FFFFFF; font-size: 12px; font-weight: 700; flex: none; }
.num.brown { background: var(--brown); }
.person blockquote { margin: 8px 0 0; font-family: var(--words-big); font-size: clamp(32px, 4.4vw, 56px); line-height: 1.13; }
.person blockquote.long { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; }
.person .said { margin: -6px 0 0; font-size: 16px; font-weight: 600; color: var(--muted); }
.person .cap { margin: 0; font-size: 19px; line-height: 1.6; color: var(--soft); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.share p { margin: 0; font-size: 16px; color: var(--muted); word-break: break-all; }
.prevnext { max-width: 1280px; margin: 80px auto 0; padding: 0 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.prevnext a { display: flex; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; color: var(--ink); }
.prevnext a.next { justify-content: flex-end; text-align: right; }
.prevnext img { display: block; width: 64px; height: 80px; object-fit: cover; border-radius: 4px; }
.prevnext small { display: block; font-size: 14px; color: var(--muted); }
.prevnext b { display: block; font-size: 19px; }
.prevnext svg { flex: none; width: 34px; height: 16px; }
.also { margin-top: 88px; }
.faces { margin-top: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px; }
.faces a { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.faces img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.faces .blade { align-self: flex-start; font-size: 16px; }
.faces .q { font-family: var(--words); font-size: 17px; line-height: 1.4; color: var(--soft); }

/* Exit page */
.lands { display: flex; flex-direction: column; gap: 28px; margin-top: 48px; }
.lands figure { margin: 0; }
.lands img { display: block; width: 100%; height: auto; border-radius: 4px; }
.lands figcaption, .wp-caption-text { margin-top: 10px; font-size: 15px; color: var(--muted); }
.exitnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 72px; }

/* About and plain pages */
.prose { max-width: 760px; margin: 0 auto; padding: 64px 40px 0; }
.prose h1 { font-weight: 800; font-size: clamp(34px, 4vw, 52px); line-height: 1.1; margin: 0 0 28px; }
.prose p { font-family: var(--words); font-size: 21px; line-height: 1.6; color: var(--soft); }

/* Footer */
.site-foot { width: calc(100% - 80px); max-width: 1200px; margin: 96px auto 0; padding: 28px 0 64px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 15px; color: var(--muted); }
.site-foot p { margin: 0; }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 20px; }
.site-foot a { font-weight: 600; }

@media (max-width: 640px) {
  .hero { padding-top: 0; padding-bottom: 48px; }
  .hero-grid { padding: 0; }
  .hero-photo img { border-radius: 0; }
  .hero-text { padding: 0 20px; }
  .person { padding: 36px 20px 0; }
  .prevnext, .prose { padding-left: 20px; padding-right: 20px; }
  .site-foot { width: calc(100% - 40px); }
  .site-head nav { gap: 8px 18px; }
  .person .top .pill { margin-left: 0; }
  .rows a { gap: 14px 18px; }
  .rows img { flex-basis: 64px; width: 64px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
