/* ==========================================================================
   The Corridor map — shared by index.html and corridor.html
   ========================================================================== */

.ddmap__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ddmap__label {
  position: absolute;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--map-label);
  white-space: nowrap;
  pointer-events: none;
}
.ddmap__label--sea { font-style: italic; letter-spacing: .3em; color: var(--map-sea); }

.ddmap__pin {
  position: absolute;
  width: 44px; height: 44px;           /* 44px hit area for every pin */
  display: grid; place-items: center;
  background: transparent; border: 0; padding: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.ddmap__dot {
  position: relative;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  transition: background var(--t-ui);
}
.ddmap__pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--red);
  animation: pinPulse 2.2s var(--dare-out) 2;
}
@keyframes pinPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.2); opacity: 0; } }
.ddmap__pin:hover .ddmap__dot { background: var(--text); }
.ddmap__n {
  position: absolute; left: 30px; top: 12px;
  font-size: 11px; font-weight: 500; letter-spacing: .08em;
  color: var(--text-mute);
}

/* Selected pin swaps to the spark and labels itself */
.ddmap__pin[aria-pressed="true"] .ddmap__dot,
.ddmap__pin[aria-pressed="true"] .ddmap__pulse { display: none; }
.ddmap__pin[aria-pressed="true"] .ddmap__sel { display: grid; }
.ddmap__sel { display: none; place-items: center; position: relative; width: 44px; height: 44px; }
.ddmap__glow {
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: rgba(255,0,0,.18);
  box-shadow: 0 0 32px var(--glow);
}
.ddmap__sel svg { width: 24px; height: 24px; }

/* Road strokes follow the theme */
.ddmap__road--faint { stroke: var(--map-faint); }
.ddmap__road--minor { stroke: var(--map-minor); }
.ddmap__road--major { stroke: var(--map-major); }
.ddmap__tag {
  position: absolute; left: 44px; top: 7px;
  white-space: nowrap;
  background: var(--red); color: var(--on-red);
  font-family: var(--display);
  font-size: 15px;
  padding: 5px 10px 4px;
}

/* A pin under the pointer (or keyboard focus) lights up with its name, as the
   chosen one does; the chosen one's name steps aside meanwhile */
.ddmap__pin:not([aria-pressed="true"]):is(:hover, :focus-visible) .ddmap__dot,
.ddmap__pin:not([aria-pressed="true"]):is(:hover, :focus-visible) .ddmap__pulse { display: none; }
.ddmap__pin:not([aria-pressed="true"]):is(:hover, :focus-visible) .ddmap__sel { display: grid; }
:is(.corridor__map, .cpage__map):has(.ddmap__pin:not([aria-pressed="true"]):is(:hover, :focus-visible))
  .ddmap__pin[aria-pressed="true"] .ddmap__tag { opacity: 0; }
.ddmap__tag { transition: opacity var(--t-micro); }

/* The site card as a dialog (home map): wide enough for the picture to sit
   beside the details, centred, and the close button clear of the photo */
.pmodal--site { align-items: center; }
/* A lighter veil than the brief's, so the map still glows through the blur */
.pmodal--site .pmodal__backdrop {
  background: rgba(0,0,0,.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.pmodal--site .pmodal__panel { width: min(940px, 100%); }
.pmodal__site { padding: var(--s-6); }
.pmodal--site .pmodal__close { z-index: 2; background: rgba(0,0,0,.55); }
.pmodal--site .mapcard h2, .pmodal--site .mapcard h3 { padding-right: 48px; }
@media (max-width: 768px) { .pmodal__site { padding: var(--s-5); } }

/* Pin preview card. The card is a size container: in a narrow column (home,
   site page, portfolio map) it stacks; given the width (the roads page) the
   picture sits beside the details instead of filling the row. */
.mapcard { container-type: inline-size; }
.mapcard__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: var(--s-5);
  --cut-size: var(--r-sm); clip-path: var(--cut-poly);
}
.mapcard__media img { width: 100%; height: 100%; object-fit: cover; }
.mapcard__no {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--display); font-size: 14px;
  padding: 3px 8px; background: rgba(0,0,0,.7);
}
.mapcard__line { margin-top: var(--s-2); font-size: 15px; line-height: 1.55; font-weight: 300; color: var(--text-dim); }

/* Specs and traffic side by side between two hairlines; the sectors below as pills */
.mapcard__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-5) var(--s-5);
  align-items: end;                /* a label that wraps must not push its figure off the other's line */
  margin-block: var(--s-5);
  padding-block: var(--s-5);
  border-block: 1px solid var(--line);
}
.mapcard dt {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-mute);
  margin-bottom: 6px;
}
.mapcard dd { font-size: 15px; font-weight: 500; }
.mapcard__best { grid-column: 1 / -1; }
.mapcard__best dd { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mapcard__best dd span {
  display: inline-flex; align-items: center;
  height: 30px; padding-inline: 12px;
  font-size: 12.5px; font-weight: 400; color: var(--text-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--r-pill);
}

@container (min-width: 720px) {
  .mapcard__in {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--s-7);
    align-items: center;
  }
  .mapcard__media { aspect-ratio: 3 / 2; margin-bottom: 0; }
  .mapcard__line { max-width: 46ch; }
  /* Two figures need only their own width, not half the row each. A wrapping
     row rather than max-content columns: those grew to hold every pill on one
     line and pushed the last one out of the card. */
  .mapcard__facts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-5) var(--s-8); }
  .mapcard__best { flex-basis: 100%; }
}


/* Roads draw in via stroke-dashoffset; pins pop west to east */
.ddmap__road {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: roadDraw 900ms var(--dare-out) forwards;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes roadDraw { to { stroke-dashoffset: 0; } }

.ddmap__trail {
  stroke: var(--red);
  filter: drop-shadow(0 0 6px var(--red));
  animation: trailRun 6s linear infinite;
}
@keyframes trailRun { to { stroke-dashoffset: -1460; } }

.ddmap__pin {
  opacity: 0;
  animation: pinPop 420ms var(--dare-out) forwards;
  animation-delay: calc(700ms + var(--d));
}
@keyframes pinPop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ddmap__road { stroke-dashoffset: 0; animation: none; }
  .ddmap__pin  { opacity: 1; animation: none; }
  .ddmap__pulse { animation: none; opacity: 0; }
}

/* --- Corridor site list — shared by home, corridor.html and portfolio --- */
/* The list runs its natural height — a nested scrollbar next to a page that
   has room to scroll is a trap, and rows 8–11 were hidden behind it. The map
   sticks instead, so it stays in view as you work down the list. */
.cpage__list { list-style: none; }
.cpage__item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  text-align: start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--t-ui) var(--dare-out);
}
.cpage__item:hover { background: rgba(255,0,0,.06); }
.cpage__item[aria-pressed="true"] { background: rgba(255,0,0,.1); }
.cpage__item[aria-pressed="true"] .cpage__no { color: var(--red-ink); }
.cpage__no { font-family: var(--display); font-size: 14px; color: var(--text-mute); }
.cpage__nm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cpage__nm b { font-weight: 500; font-size: 15px; }
.cpage__nm span { font-size: 12px; color: var(--text-mute); }

