/* Hudson Pathways: place first, then the work.
   The to-scale county map from Along the Hudson chooses the place; the Pathways tiles and stepper
   carry the work, and every step answers for the chosen county. Map rules are shared with ../hudson/. */

:root {
  --red: #a90100;
  --red-hot: #ea0403;
  --red-deep: #550100;
  --gold: #cabd77;
  --gold-soft: #f3efdc;
  --ink: #000;
  --muted: #5f5f5f;
  --gray: #e9e9e9;
  --gray-2: #d4d4d4;
  --gray-soft: #f6f6f6;
  --white: #fff;
  --stone: #ece9e1;
  --stone-dark: #d6cfbe;
  --slate: #6b6457;
  --water: #cddce6;
  --water-edge: #b3c8d6;
  --water-ink: #3d6682;
  --land: #f2f0ea;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "neuzeit-grotesk", "Jost", "Futura", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- diocesan chrome ---------- */
.utility { background: var(--ink); color: var(--white); font-size: 14px; }
.utility .wrap { display: flex; justify-content: flex-end; gap: 28px; padding-top: 8px; padding-bottom: 8px; }
.utility a { color: var(--white); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.masthead img { height: 80px; display: block; }
.masthead nav { display: flex; gap: 38px; font-weight: 700; font-size: 16px; }
.masthead nav a { color: var(--ink); text-decoration: none; }
.masthead nav a.current { color: var(--red); }

/* ---------- first: the place ---------- */
.place { border-top: 1px solid var(--gray); padding: 36px 0 48px; }
.place .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; transition: grid-template-columns .6s cubic-bezier(.2, .7, .2, 1); }
.place-text { grid-column: 1; grid-row: 1; padding-top: 8px; }
.place-map { grid-column: 2; grid-row: 1; }
/* once the place is chosen, the map steps back to a locator and the paths come up */
body.placed .place { padding-bottom: 36px; }
body.placed .place .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.place h1 { font-size: clamp(40px, 5.2vw, 64px); letter-spacing: -.015em; transition: font-size .5s ease; }
body.placed .place h1 { font-size: clamp(34px, 3.8vw, 48px); }
.place .lede { margin: 16px 0 26px; max-width: 560px; }
.place .where { max-width: 320px; }
.onward { display: inline-block; margin-top: 26px; font-weight: 700; color: var(--red); text-underline-offset: 3px; }
.onward[hidden] { display: none; }

/* the map: Census county shapes, the Hudson as water, the city enlarged in an inset */
.shade { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 0 0 12px; font-size: 14px; }
.shade span { color: var(--muted); margin-right: 10px; }
.shade button { border: 1px solid var(--ink); background: var(--white); padding: 6px 12px; cursor: pointer; font-weight: 500; }
.shade button + button { border-left: 0; }
.shade button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.map { position: relative; aspect-ratio: var(--ar, 578 / 700); width: min(100%, calc(78vh * .825)); margin-left: auto; }
#mapSvg { display: block; width: 100%; height: 100%; }
.water { fill: var(--water); }
.land { fill: var(--land); stroke: var(--land); stroke-width: .6; }
.river { fill: var(--water); stroke: var(--water-edge); stroke-width: .5; vector-effect: non-scaling-stroke; pointer-events: none; }
.county { stroke: var(--white); stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .35s ease, opacity .35s ease; outline: none; }
.map[data-shade="rules"] .county.z-nyc { fill: var(--red); }
.map[data-shade="rules"] .county.z-westchester { fill: var(--gold); }
.map[data-shade="rules"] .county.z-mid_hudson { fill: var(--stone-dark); }
.map[data-shade="region"] .county.r-nyc { fill: var(--red); }
.map[data-shade="region"] .county.r-westchester-putnam { fill: var(--gold); }
.map[data-shade="region"] .county.r-east-hudson { fill: var(--slate); }
.map[data-shade="region"] .county.r-west-hudson { fill: var(--stone-dark); }
.county.hov { filter: brightness(.9); }
.county:focus-visible { stroke: var(--ink); stroke-width: 3; }
.picked { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.inset-src { fill: none; stroke: #8a8a8a; stroke-width: .8; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.inset-frame { fill: none; stroke: #8a8a8a; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.inset .county { stroke-width: 1.4; }
/* names: map type with a halo, placed by hudson.js where they fit */
.names { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.names text { font-family: var(--sans); paint-order: stroke fill; stroke-linejoin: round; transition: opacity .25s ease; }
.names text.hide { opacity: 0; }
.nm { font-size: 12.5px; font-weight: 500; letter-spacing: .015em; fill: #262626; stroke: var(--white); stroke-width: 3.5px; }
.nm.on { font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.nm.city { font-size: 12px; }
.note { font: italic 11px var(--serif); fill: #6a6a6a; stroke: var(--land); stroke-width: 3px; }
.water-nm { font: italic 12.5px var(--serif); letter-spacing: .04em; fill: var(--water-ink); stroke: rgba(255, 255, 255, .75); stroke-width: 3px; }
.state-nm { font-size: 11px; font-weight: 500; letter-spacing: .12em; fill: #8d8a82; stroke: var(--land); stroke-width: 3px; }
.inset-cap { font-size: 11.5px; font-weight: 500; letter-spacing: .02em; fill: #555; stroke: var(--land); stroke-width: 3px; }
/* the inset and its source frame only belong to the whole-diocese view */
.inset, .inset-frame, .inset-src { transition: opacity .3s ease; }
.map.zoomed .inset, .map.zoomed .inset-frame, .map.zoomed .inset-src { opacity: 0; pointer-events: none; }
.zoom-out { position: absolute; top: 10px; right: 10px; border: 0; background: var(--white); color: var(--ink); font-size: 13px; font-weight: 500; padding: 7px 12px; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .28); }
.zoom-out:hover { background: var(--gray); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend dd { margin: 0; }
.sw { width: 16px; height: 16px; }
.sw.nyc, .sw.r-nyc { background: var(--red); }
.sw.westchester, .sw.r-westchester-putnam { background: var(--gold); }
.sw.mid_hudson, .sw.r-west-hudson { background: var(--stone-dark); }
.sw.r-east-hudson { background: var(--slate); }
.legend-note { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; max-width: 560px; }

/* ---------- intro and path tiles ---------- */
.intro { border-top: 1px solid var(--gray); padding: 44px 0 56px; }
.intro h2 { font-size: clamp(30px, 3.6vw, 42px); }
.paths-lede { max-width: 720px; font-size: 18px; color: #333; margin: 12px 0 36px; }
.steps-place { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
.crumb { font-size: 14.5px; color: var(--muted); margin: 0 0 18px; }
.crumb a { color: var(--muted); }
.intro h1 { font-size: clamp(38px, 5vw, 58px); }
.lede { max-width: 700px; font-size: 19px; color: #333; margin: 14px 0 40px; }
.paths { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.path { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; border: 0; background: var(--gray); padding: 30px 22px 20px; cursor: pointer; min-height: 230px; transition: background .2s ease; }
.path .bar { position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: var(--gray-2); }
.path .bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--red-hot); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.path .pt { font: 700 24px/1.15 var(--serif); }
.path .pb { font-size: 15px; line-height: 1.5; color: #333; }
.path .pm { margin-top: auto; font-weight: 700; font-size: 14.5px; color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.path:hover { background: var(--gray-2); }
.path[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.path[aria-pressed="true"] .pb { color: #d6d6d6; }
.path[aria-pressed="true"] .pm { color: var(--white); }

/* ---------- the work area: steps and the guide ---------- */
.work { background: var(--gray-soft); padding: 48px 0 56px; scroll-margin-top: 0; }
.work .wrap { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 48px; align-items: start; }
.steps { position: sticky; top: 20px; }
.steps h2 { font-size: 28px; }
.steps-empty p { color: #333; margin: 10px 0 22px; }
.where { display: grid; gap: 6px; font-size: 15px; }
.where label { font-weight: 700; }
.where select { appearance: none; -webkit-appearance: none; border: 1px solid var(--ink); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a90100' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; padding: 9px 34px 9px 12px; cursor: pointer; }
.where .zone { color: var(--muted); font-size: 14px; }
.steps-kicker { margin: 0 0 6px; font-weight: 700; font-size: 14.5px; color: var(--red); }
.step-list { list-style: none; margin: 22px 0 0; padding: 0; position: relative; }
/* the rail joins the steps into one sequence */
.step-list::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--gray-2); }
.step-list li { position: relative; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; width: 100%; border: 0; background: none; text-align: left; padding: 8px 0; cursor: pointer; }
.step .num { position: relative; width: 36px; height: 36px; display: grid; place-items: center; background: var(--white); box-shadow: inset 0 0 0 2px var(--gray-2); font: 700 15px var(--serif); }
.step .sn { padding-top: 6px; font-weight: 500; line-height: 1.35; }
.step .when { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.step:hover .sn { text-decoration: underline; text-underline-offset: 3px; }
.done .step .num { background: var(--red-hot); color: var(--white); box-shadow: none; }
.here .step .num { background: var(--ink); color: var(--white); box-shadow: none; }
.here .step .sn { font-weight: 700; }
.leave { margin-top: 18px; border: 0; background: none; color: var(--red); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; font-size: 14.5px; }

.guide { background: var(--white); border-top: 8px solid var(--red-hot); padding: 26px 30px 22px; min-width: 0; }
.composer { display: flex; gap: 10px; margin-bottom: 26px; }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--gray-2); background: var(--gray-soft); padding: 12px 14px; font-size: 16.5px; }
.composer input:focus { outline: none; border-color: var(--ink); background: var(--white); }
.btn { background: var(--red); color: var(--white); border: 0; font-weight: 700; padding: 0 22px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.btn:hover { background: var(--red-deep); }
.guide-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; border-top: 1px solid var(--gray); padding-top: 14px; margin-top: 8px; }
.reset { border: 0; background: none; color: var(--red); text-decoration: underline; cursor: pointer; padding: 0; font-size: 14px; }
.disclaimer { margin: 0; font-size: 13px; color: var(--muted); }

.msg { display: flex; gap: 14px; margin-bottom: 24px; scroll-margin-top: 16px; }
.msg .who { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: var(--white); font: 700 14px var(--serif); }
.msg .body { flex: 1; min-width: 0; }
.msg .body > p { margin: 3px 0 10px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--gray); padding: 10px 16px; max-width: 80%; font-weight: 500; }
.msg.bot { animation: in .3s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.body h3 { font-size: 26px; margin: 2px 0 10px; }
.answer p { margin: 0 0 10px; }
.region-note { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 10px 14px; margin: 12px 0; }
.region-note strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.regions div { background: var(--gray-soft); padding: 10px 12px; font-size: 15px; }
.regions strong { display: block; font-size: 13.5px; }
details.more summary { cursor: pointer; color: var(--red); font-weight: 700; font-size: 15px; }
details.more p { font-size: 15.5px; color: #333; }
.caution { border-left: 4px solid var(--red); background: #faedeb; padding: 10px 14px; margin: 12px 0; font-size: 15.5px; }
.sources { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }
.sources a { color: var(--muted); }
.sources span + span::before { content: ", "; }
.label { font-weight: 700; font-size: 14.5px; margin: 18px 0 8px; }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt { border: 1.5px solid var(--gold); background: var(--white); padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: 14.5px; text-align: left; }
.prompt:hover { background: var(--gold-soft); }
.prompt.region { border-color: var(--gray-2); }
.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-2); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* the step's own footer: where you are and the one next action */
.step-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 22px; padding: 14px 16px; background: var(--ink); color: var(--white); font-size: 14.5px; }
.step-foot .next { border: 0; background: var(--red-hot); color: var(--white); font-weight: 700; padding: 9px 16px; cursor: pointer; text-align: left; }
.step-foot .next:hover { background: var(--white); color: var(--ink); }

/* ---------- file rows ---------- */
.files { display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: var(--gray); padding: 12px 14px; }
.file .ic { width: 40px; height: 48px; display: block; }
.file .t { font-weight: 700; line-height: 1.3; }
.file .t a { color: var(--ink); text-decoration: none; }
.file .t a:hover { color: var(--red); text-decoration: underline; }
.file .m { font-size: 13.5px; color: var(--muted); }
.file .d { font-size: 14.5px; color: #333; margin-top: 3px; }
.file .note { color: var(--red); }
.file .act { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.file .btn { padding: 9px 14px; font-size: 14.5px; }
.file .btn.ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.file .alt { font-size: 12.5px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--gold); margin-right: 6px; }
.tag.local { background: var(--ink); color: var(--white); }
.tag.adapt { background: var(--white); color: var(--muted); box-shadow: inset 0 0 0 1px var(--gray-2); }
.guide .file .d:not(.note) { display: none; }

/* ---------- library ---------- */
.library { padding: 72px 0 24px; }
.library h2 { font-size: clamp(30px, 4vw, 40px); }
.lib-intro { color: #333; margin: 10px 0 30px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px 24px; margin-bottom: 36px; }
.topic { position: relative; text-align: left; border: 0; background: var(--gray); padding: 20px 20px 18px; cursor: pointer; }
.topic::before { content: ""; position: absolute; left: 0; top: -8px; width: 84px; height: 8px; background: var(--red-hot); }
.topic .n { display: block; font: 700 20px/1.2 var(--serif); }
.topic .c { display: block; margin-top: 6px; color: var(--red); text-decoration: underline; font-weight: 700; font-size: 14.5px; }
.topic[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.topic[aria-pressed="true"] .c { color: var(--white); }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--gray); border-bottom: 1px solid var(--gray); margin-bottom: 16px; }
.filters input[type=search] { flex: 1 1 260px; min-width: 0; border: 1px solid #cacaca; padding: 10px 12px; }
.seg { display: inline-flex; border: 1px solid #cacaca; }
.seg button { background: var(--white); border: 0; padding: 8px 12px; cursor: pointer; font-size: 14.5px; }
.seg button + button { border-left: 1px solid #cacaca; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.count { font-size: 14.5px; color: var(--muted); margin: 0 0 12px; }
.empty { background: var(--gray-soft); padding: 18px; }
.more-btn { display: block; margin: 18px auto 0; border: 1.5px solid var(--red); background: none; color: var(--red); font-weight: 700; padding: 10px 18px; cursor: pointer; }

.connect { background: var(--red-hot); margin-top: 72px; }
.connect .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-top: 52px; padding-bottom: 52px; }
.connect h2 { font-size: 36px; }
.connect p { margin: 10px 0 0; max-width: 700px; }
.connect a.out { border: 2px solid var(--ink); color: var(--ink); font-weight: 700; padding: 10px 18px; text-decoration: none; }
footer.site { background: var(--ink); color: var(--white); font-size: 15px; }
footer.site .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 38px; padding-bottom: 38px; }
footer.site a { color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .place .wrap, .place h1, .county, .names text, .inset, .inset-frame, .inset-src { transition: none; }
  .msg.bot { animation: none; }
  .path, .path .bar::after { transition: none; }
}
@media (max-width: 1040px) {
  .place .wrap, body.placed .place .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .place-text, .place-map { grid-column: 1; grid-row: auto; }
  .map { margin: 0 auto; width: min(100%, 560px); }
  body.placed .map { width: min(100%, 420px); margin: 0; }
  .paths { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .path { min-height: 0; }
  .work .wrap { grid-template-columns: 1fr; gap: 28px; }
  .steps { position: static; }
}
@media (max-width: 860px) {
  .masthead nav { display: none; }
  .masthead img { height: 60px; }
  .utility .wrap { gap: 16px; justify-content: center; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .map, body.placed .map { width: 100%; }
  .nm { font-size: 11.5px; }
  .nm.on { font-size: 13px; }
  .nm.city, .inset-cap { font-size: 11px; }
  .note { font-size: 10px; }
  .water-nm { font-size: 11.5px; }
  .paths { grid-template-columns: 1fr; }
  .guide { padding: 20px 16px; margin: 0 -16px; }
  .composer { flex-direction: column; }
  .composer .btn { padding: 12px; }
  .regions { grid-template-columns: 1fr; }
  .file { grid-template-columns: 34px 1fr; }
  .file .ic { width: 30px; height: 36px; }
  .file .act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; }
  footer.site .wrap { grid-template-columns: 1fr; }
}
