/* ══════════════════════════════════════════════════════════════════
   The map. Three panes, one screen, no page scroll.
   Every box is a fixed size; only the passport's inner text scrolls,
   so nothing resizes when you move between stops.
   ══════════════════════════════════════════════════════════════════ */

html, body.ex { height: 100%; overflow: hidden; }
body.ex { background: #0E1A20; }

.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 545px;
  gap: 0;
  height: 100vh;
  height: 100svh;
}

/* ░░ rail ░░ */
.rail {
  background: #0E1A20;
  color: var(--limestone);
  padding: 18px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(244,239,230,.10);
}
.rail__home {
  font-size: .82rem; letter-spacing: .06em;
  color: rgba(244,239,230,.62); text-decoration: none;
  margin-bottom: 18px; flex: none;
}
.rail__home:hover { color: var(--gold); }
.rail__h {
  font-family: var(--body); font-size: .74rem; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .5em; flex: none;
}
.rail__note {
  font-size: .82rem; line-height: 1.5;
  color: rgba(244,239,230,.55); margin: 0 0 12px; flex: none;
}
.routelist {
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto; min-height: 0; flex: 1;
  margin: 0 -6px; padding: 0 6px;
}
.rbtn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 9px;
  background: transparent; border: 0; border-left: 2px solid transparent;
  border-radius: 2px; font: inherit; text-align: left; cursor: pointer;
  color: rgba(244,239,230,.82);
  transition: background .15s ease, color .15s ease;
}
.rbtn:hover { background: rgba(244,239,230,.06); color: #fff; }
.rbtn[aria-pressed="true"] {
  background: rgba(244,239,230,.09); color: #fff;
  border-left-color: var(--rc, var(--gold));
}
.rbtn__n {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--rc, var(--gold)); font-size: .7rem; font-weight: 700;
}
.rbtn__n b { color: #0E1A20; }
.rbtn__t { min-width: 0; }
.rbtn__name { display: block; font-size: 1rem; line-height: 1.25; font-weight: 600; color: inherit; }
.rbtn__meta { display: block; font-size: .82rem; color: rgba(244,239,230,.6); margin-top: 1px; }
.rail__reset {
  flex: none; margin-top: 10px;
  background: transparent; color: rgba(244,239,230,.7);
  border: 1px solid rgba(244,239,230,.24); border-radius: 2px;
  padding: 10px; min-height: 40px; font: inherit; font-size: .86rem;
  font-weight: 600; letter-spacing: .06em; cursor: pointer;
}
.rail__reset:hover { background: rgba(244,239,230,.09); color: #fff; }
.rail__count {
  flex: none; margin: 9px 0 0; font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(244,239,230,.38);
}

/* ░░ stage ░░ */
.stage {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: #F7F3EA;
}
.stage__bar {
  flex: none; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 14px;
  background: #fff; border-bottom: 1px solid var(--rule);
}
.seg { display: flex; gap: 6px; }
.seg__b {
  min-height: 38px; padding: 8px 15px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px;
  font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
}
.seg__b:hover { background: var(--paper); border-color: var(--brazos-lt); }
.seg__b[aria-pressed="true"] { background: var(--brazos); color: #fff; border-color: var(--brazos); }
.seg__b--i { width: 40px; padding: 8px 0; font-size: 1.1rem; line-height: 1; }

.stage__map { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage__map svg { display: block; width: 100%; height: 100%; cursor: grab; }
.stage__map svg.is-panning { cursor: grabbing; }
.stage__load { padding: 80px 20px; text-align: center; color: var(--ink-soft); font-style: italic; }

/* map paint */
.m-county { fill: #FCFAF5; stroke: #C6BBA5; stroke-width: 2; stroke-linejoin: round; }
.m-place  { fill: #EDE6D7; }
.m-place--major { fill: #E4DAC6; }
.m-water  { fill: #BBD3D6; }
.m-river  { fill: none; stroke: #A9C7CB; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m-labelg { pointer-events: none; }
.m-label  {
  font-family: var(--body); font-size: 13px; fill: #7C7161; text-anchor: middle;
  paint-order: stroke; stroke: #FCFAF5; stroke-width: 3px; stroke-linejoin: round;
}
.m-label--major { font-size: 16px; fill: #5B5245; font-weight: 600; }
.m-routeline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
               stroke-dasharray: 1 8; opacity: .85; }

.pin { cursor: pointer; }
.pin__hit { fill: transparent; }
.pin__dot { stroke: #fff; stroke-width: 3; transition: r .15s ease; }
.pin__n { font-family: var(--body); font-size: 17px; font-weight: 700; fill: #fff;
          text-anchor: middle; pointer-events: none; }
.pin:hover .pin__dot { stroke: var(--gold); }
.pin:focus { outline: none; }
.pin:focus .pin__ring, .pin.is-active .pin__ring { opacity: 1; }
.pin__ring { fill: none; stroke: var(--gold); stroke-width: 2.5; opacity: 0; }
.pin.is-dim { opacity: .22; }
.pin__approx { fill: none; stroke-width: 1.6; stroke-dasharray: 3 3; opacity: .8; }
.alab__bg { fill: rgba(14,26,32,.9); }
.alab__tx { font-family: var(--body); font-size: 15px; font-weight: 600; fill: #fff; }
.sbar { pointer-events: none; }
.sbar__bg { fill: rgba(252,250,245,.86); }
.sbar__ln, .sbar__tk { stroke: #5B5245; stroke-width: 2; }
.sbar__tx { font-family: var(--body); font-size: 13px; font-weight: 600; fill: #5B5245; }

/* ░░ the passport ░░ */
.pp {
  display: flex; flex-direction: column; min-height: 0;
  background: #0E1A20; border-left: 1px solid rgba(244,239,230,.10);
  padding: 14px 16px 12px;
}
.pp__book {
  /* fill the column height: fitting the text without a scrollbar matters more
     than the aspect ratio */
  flex: 1 1 auto;
  min-height: 0;
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

/* left: the booklet cover */
.pp__cover {
  background: linear-gradient(165deg, #1E4145 0%, #16333A 55%, #102A30 100%);
  padding: 20px 12px 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border-right: 2px solid #0A1216;
  position: relative;
}
.pp__cover::after {           /* stitching down the spine */
  content: ""; position: absolute; top: 14px; bottom: 14px; right: 5px; width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(200,145,47,.55) 0 5px, transparent 5px 11px);
}
.pp__crest { display: block; margin-bottom: 8px; opacity: .9; }
.pp__title {
  font-family: var(--display); font-weight: 700; font-size: 1.06rem; line-height: 1.2;
  color: #fff; letter-spacing: .01em;
}
.pp__sub {
  font-size: .58rem; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(244,239,230,.5); margin-top: 6px;
}
.pp__stamp { margin: auto 0; display: block; }
.pp__stampring {
  display: flex; align-items: center; justify-content: center;
  width: 74px; height: 74px; margin: 0 auto 8px;
  border: 2px double currentColor; border-radius: 50%;
  color: var(--gold); transform: rotate(-9deg);
}
.pp__stampn { font-family: var(--display); font-weight: 700; font-size: 1.8rem; line-height: 1; color: inherit; }
.pp__stamproute {
  display: block; font-size: .68rem; line-height: 1.35; font-weight: 700;
  letter-spacing: .04em; color: rgba(244,239,230,.72); text-transform: uppercase;
}
.pp__issue {
  font-size: .53rem; line-height: 1.4; letter-spacing: .05em;
  color: rgba(244,239,230,.34); margin-top: auto;
}

/* right: the page */
.pp__page {
  background: #FBF8F2;
  min-height: 0; position: relative;
  transform-origin: left center; backface-visibility: hidden;
}
.pp__page.is-flipping { transition: transform .17s ease-in; transform: rotateY(-86deg); }
.pp__page.is-flipback { transition: transform .17s ease-out; transform: rotateY(0deg); }
.pp__scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 18px 12px;
}
.pp__empty { color: var(--ink-soft); font-style: italic; font-size: .95rem; }
.pp__name { font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.08; margin: 0 0 .3em; }
.pp__img { margin: 0 0 .7em; }
.pp__img img {
  width: 100%; height: 96px; object-fit: cover;    /* fixed band keeps entries level */
  border-radius: 2px; display: block;
}
.pp__blurb { font-size: 1.02rem; line-height: 1.55; margin: 0 0 .7em; color: var(--ink); }
.pp__meta { border-top: 1px solid var(--rule); padding-top: 8px; font-size: .95rem; }
.pp__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.pp__row { margin-bottom: .42em; }
.pp__k { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .14em;
         text-transform: uppercase; color: var(--brazos); margin-bottom: .1em; }
.pp__v { color: var(--ink); }
.pp__desig { margin: 0; padding-left: 1em; }
.pp__desig li { margin-bottom: .12em; line-height: 1.45; }
.pp__flag { display: block; margin-top: .35em; padding: 7px 9px; font-size: .82rem; line-height: 1.45;
            background: #FDF3E2; border-left: 3px solid var(--gold); color: #6B5322; }
.pp__flag--care { background: #F6EEF2; border-left-color: #8C3B4A; color: #6A2C38; }
.pp__links { margin: 9px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pp__links a {
  font-size: .78rem; padding: 5px 11px; border: 1px solid var(--rule);
  border-radius: 2px; text-decoration: none; color: var(--brazos-dk); background: #fff;
}
.pp__links a:hover { background: var(--paper); }

/* nav */
.pp__nav {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding-top: 10px;
}
.pp__btn {
  min-height: 44px; padding: 11px 20px;
  background: transparent; color: rgba(244,239,230,.8);
  border: 1px solid rgba(244,239,230,.26); border-radius: 2px;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.pp__btn:hover:not(:disabled) { background: rgba(244,239,230,.1); color: #fff; }
.pp__btn--k { background: var(--gold); color: #0E1A20; border-color: var(--gold); }
.pp__btn--k:hover:not(:disabled) { background: #DDA43C; color: #0E1A20; }
.pp__btn:disabled { opacity: .32; cursor: not-allowed; }
.pp__count {
  font-size: .8rem; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(244,239,230,.5); white-space: nowrap;
}

/* ░░ narrow ░░ */
@media (max-width: 1180px) {
  html, body.ex { overflow: auto; height: auto; }
  .app { grid-template-columns: 240px minmax(0,1fr); height: auto; }
  .pp { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(244,239,230,.1); }
  .pp__book { height: 520px; }
  .stage { height: 70vh; }
}
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid rgba(244,239,230,.1); }
  .routelist { max-height: 210px; }
  .stage { height: 58vh; }
  .pp__book { grid-template-columns: 96px minmax(0,1fr); height: 480px; }
}
@media (prefers-reduced-motion: reduce) {
  .pp__page.is-flipping, .pp__page.is-flipback { transition: opacity .16s linear; transform: none; }
  .pp__page.is-flipping { opacity: 0; }
}

/* the place the passport is issued */
.pin__issuer { fill: none; stroke: var(--gold); stroke-width: 2.5; opacity: .95; }
