/* Fort Hunt Filters - the corridor history story map (history.html).
   The page header and footer use Tailwind from site.css; everything below styles the story itself. */

:root {
  --paper: #F4F3EC;
  --panel: #FBFAF6;
  --ink: #1B211E;
  --ink-soft: #4A534D;
  --river: #0F766E;
  --brick: #8A4536;
  --rule: #D5D8CE;
  --rule-faint: #E4E6DE;
}

.story { background: var(--paper); color: var(--ink); }
.story-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* ---------- masthead ---------- */
.masthead { padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(1.25rem, 3vw, 2rem); }
.masthead .kicker { font-family: "Outfit", sans-serif; font-weight: 700; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; color: var(--river); margin: 0 0 1rem; }
.masthead h1 { font-family: "Outfit", sans-serif; font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.9rem); line-height: 1.03; letter-spacing: -.02em; margin: 0 0 1.2rem; max-width: 16ch; }
.standfirst { max-width: 64ch; font-size: clamp(1.05rem, 2vw, 1.22rem); line-height: 1.66; color: var(--ink-soft); margin: 0 0 1rem; }
.standfirst strong { color: var(--ink); font-weight: 700; }
.howto { display: inline-flex; align-items: center; gap: .6rem; margin-top: .75rem; font-size: .95rem; font-weight: 700; color: var(--river); }

/* ---------- story map: sticky map beside scrolling steps ---------- */
.storymap { position: relative; }
@media (min-width: 1024px) {
  .storymap { display: grid; grid-template-columns: 1fr minmax(380px, 40%); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
  .storymap__steps { order: 1; }
  .storymap__map { order: 2; position: sticky; top: 1.25rem; height: calc(100vh - 2.5rem); }
  /* leave room under the map for the legend, which sits inside the sticky box */
  #corridor-map { height: calc(100% - 2.6rem); }
}
.storymap__map { margin: 0 0 1rem; }
@media (max-width: 1023px) {
  /* On phones the map pins to the top at a comfortable height (28vh) and can be collapsed, legend included. */
  .storymap__map {
    position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * clamp(1rem, 4vw, 2.5rem));
    background: var(--paper); border-bottom: 1px solid var(--rule); padding-bottom: .3rem;
  }
  #corridor-map { height: 28vh; min-height: 180px; }
  .storymap__map.is-collapsed #corridor-map { display: none; }
  .map-legend { padding: .45rem clamp(1rem, 4vw, 2.5rem) .1rem; }
}
#corridor-map { width: 100%; height: 100%; min-height: 240px; background: #E8E7DF; border: 1px solid var(--rule); border-radius: 14px; }
@media (max-width: 1023px) { #corridor-map { border-radius: 0; border-left: 0; border-right: 0; } }
.map-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .82rem; color: var(--ink-soft); padding: .5rem .2rem 0; }
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.map-legend i { width: .85rem; height: .85rem; border-radius: 50%; display: inline-block; }
.map-legend .k-hood { background: rgba(138, 69, 54, .35); border: 2px solid var(--brick); }
.map-legend .k-rail { width: 1.4rem; height: 0; border-top: 3px dotted #1B211E; border-radius: 0; }
.map-legend .k-place { background: var(--river); }

/* ---------- steps ---------- */
.step { padding: clamp(2rem, 5vw, 3.25rem) 0; border-top: 1px solid var(--rule-faint); scroll-margin-top: 36vh; }
@media (min-width: 1024px) { .step { scroll-margin-top: 20vh; } }
.step:first-child { border-top: 2px solid var(--river); }
.step h2 { font-family: "Outfit", sans-serif; font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .35rem; }
.step .years { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--brick); margin: 0 0 1rem; }
.step h3 { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 1.02rem; color: var(--river); margin: 1.6rem 0 .5rem; }
.step p { margin: 0 0 1rem; max-width: 68ch; line-height: 1.7; }
.step p:last-child { margin-bottom: 0; }
.step.is-active h2 { color: var(--river); }

/* the deed box: quick facts for a neighborhood */
.deed { margin: 0 0 1.5rem; font-size: .95rem; line-height: 1.55; color: var(--ink-soft); background: var(--panel); border: 1px solid var(--rule-faint); border-radius: 12px; padding: .35rem 1rem; }
.deed div { padding: .55rem 0; border-top: 1px solid var(--rule-faint); }
.deed div:first-child { border-top: none; }
.deed b { display: block; color: var(--ink); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

.inhouse, .aerial { margin-top: 1.4rem; padding: 1rem 1.15rem; background: var(--panel); border-left: 3px solid var(--brick); border-radius: 0 10px 10px 0; }
.aerial { border-left-color: var(--river); }
.inhouse p, .aerial p { margin: 0; font-size: .98rem; line-height: 1.6; max-width: 66ch; }

/* ---------- photographs ---------- */
/* Figures are numbered in order down the page, like a textbook. */
.story { counter-reset: fig; }
figure.film { margin: 0 0 2.2rem; }
figure.film video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; background: #13232c;
  border: 1px solid var(--rule); border-radius: 10px; }
figure.film .film-tools { display: flex; justify-content: flex-end; margin-top: .55rem; }
figure.film .cc-toggle { display: inline-flex; align-items: center; gap: .45rem; font: 700 .85rem/1 inherit; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: .5rem .85rem; cursor: pointer; min-height: 40px; }
figure.film .cc-toggle:hover { border-color: var(--river); }
figure.film .cc-toggle:focus-visible { outline: 3px solid var(--river); outline-offset: 2px; }
figure.film .cc-badge { font-size: .7rem; letter-spacing: .04em; border: 1.5px solid currentColor; border-radius: 4px; padding: .12rem .28rem; }
figure.film .cc-toggle[aria-pressed="true"] { background: var(--river); border-color: var(--river); color: #fff; }
figure.film figcaption { margin-top: .4rem; font-size: .88rem; line-height: 1.5; color: var(--ink-soft); max-width: 60ch; }
figure.film figcaption b { color: var(--ink); font-weight: 700; }
figure.film .credit { display: block; margin-top: .2rem; font-size: .8rem; color: var(--brick); }
figure.plate { margin: 1.6rem 0 0; counter-increment: fig; }
figure.plate figcaption b:first-child::before { content: "Figure " counter(fig) ". "; color: var(--river); }
figure.plate img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
figure.plate figcaption { margin-top: .55rem; font-size: .88rem; line-height: 1.5; color: var(--ink-soft); max-width: 60ch; }
figure.plate figcaption b { color: var(--ink); font-weight: 700; }
figure.plate .credit { display: block; margin-top: .2rem; font-size: .8rem; color: var(--brick); }

/* ---------- timeline + schematic map (shown when the live map cannot load) ---------- */
.plat { margin: clamp(1.5rem, 4vw, 2.5rem) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.35rem 0 1rem; }
.plat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.plat svg { display: block; min-width: 700px; width: 100%; height: auto; }
.plat-note { font-size: .9rem; color: var(--ink-soft); margin: .8rem 0 0; max-width: 60ch; }

/* ---------- house types ---------- */
.types { border-top: 2px solid var(--river); padding: clamp(2rem, 5vw, 3rem) 0 1rem; }
.types h2, .archives h2, .closing h2 { font-family: "Outfit", sans-serif; font-weight: 800; font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 0 0 .6rem; }
.types-lede, .archives > p, .closing p { max-width: 66ch; color: var(--ink-soft); }
.type { display: grid; gap: 1rem clamp(1.25rem, 3vw, 2.5rem); padding: 1.5rem 0; border-top: 1px solid var(--rule-faint); align-items: start; }
@media (min-width: 720px) { .type { grid-template-columns: 16rem 1fr; } }
.type svg { display: block; width: 100%; max-width: 16rem; height: auto; }
.type h3 { margin: 0 0 .35rem; font-family: "Outfit", sans-serif; font-weight: 700; font-size: 1.15rem; }
.type .era { font-size: .92rem; color: var(--brick); font-weight: 700; margin: 0 0 .6rem; }
.type p { margin: 0; max-width: 62ch; font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }

/* ---------- archives, gaps, closing ---------- */
.archives { border-top: 2px solid var(--river); padding: clamp(2rem, 5vw, 3rem) 0 1rem; }
.arch-list { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.arch-list li { border-top: 1px solid var(--rule-faint); padding: 1rem 0; max-width: 70ch; }
.arch-list h3 { margin: 0 0 .3rem; font-family: "Outfit", sans-serif; font-weight: 700; font-size: 1.06rem; }
.arch-list p { margin: 0; font-size: .98rem; color: var(--ink-soft); line-height: 1.6; }
.arch-list .rights { display: block; margin-top: .4rem; font-size: .86rem; color: var(--brick); font-weight: 700; }
.closing { border-top: 2px solid var(--river); padding: clamp(2rem, 5vw, 3rem) 0 1.5rem; }
.gaps { margin: 1.4rem 0 0; padding: 0; list-style: none; }
.gaps li { border-top: 1px solid var(--rule-faint); padding: .7rem 0; max-width: 68ch; font-size: 1rem; color: var(--ink-soft); line-height: 1.6; }
.gaps li b { color: var(--ink); font-weight: 700; }
.sources { border-top: 1px solid var(--rule); padding: 1.4rem 0 3rem; font-size: .9rem; color: var(--ink-soft); }
.sources p { max-width: 70ch; margin: 0 0 .6rem; line-height: 1.6; }
.story a { color: var(--river); }
.story a:focus-visible { outline: 3px solid var(--brick); outline-offset: 2px; }

/* Leaflet tweaks: keep the map quiet next to the writing. */
.leaflet-container { font: inherit; font-size: .8rem; }
.leaflet-popup-content { font-size: .95rem; line-height: 1.5; }
.map-label { font-family: "Outfit", sans-serif; font-weight: 700; font-size: .78rem; color: #1B211E; text-shadow: 0 0 3px #F4F3EC, 0 0 6px #F4F3EC, 0 0 9px #F4F3EC; white-space: nowrap; pointer-events: none; }

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

/* If the map tiles cannot load, the drawn corridor map takes over (history.js adds .map-failed).
   The same swap happens with JavaScript off, through the <noscript> styles in history.html. */
#map-fallback { display: none; }
.map-failed #map-fallback { display: block; }
.map-failed .storymap__map { display: none; }
.map-failed .storymap { display: block; }
