/* =========================================================================
   Ludic Media Studio — v2 Strategic Visualization (v2/strategic-visualization.html)
   Loaded on that page ONLY, after sections.css, audience.css and site.css,
   via V.page(..., css=["css/strategy.css"]) in
   _build/build_v2_strategic_visualization.py.

   What lives here: the page's signature block, "From deck to map" — a slide
   sorter (before), a drawn arrow, one map with numbered pins (after) and the
   key that explains each pin. The pins and key items carry audience.js's
   data-ax-mark / data-ax-stage hooks, which add .is-on to both on hover and
   focus; with no script the pins are plain links to the key.

   Same rules as every stylesheet here: no ID selectors, only the documented
   breakpoints, black / white / yellow pairs only, never white on yellow.
   ========================================================================= */

/* ---------- layout: before -> arrow -> after --------------------------- */
.sv-d2m { display: grid; gap: var(--space-sm); align-items: center; }
@media (min-width: 64rem) {
  .sv-d2m { grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 2.15fr); gap: var(--space-sm); }
}

.sv-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--white);
  color: var(--black);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--leading-mid);
}

/* ---------- before: the slide sorter ---------------------------------- */
.sv-deck .sv-tag { margin-bottom: var(--space-sm); transform: rotate(-2deg); }
.sv-slides { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
@media (min-width: 48rem) { .sv-slides { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.625rem; } }
@media (min-width: 64rem) { .sv-slides { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sv-slide {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  aspect-ratio: 4 / 3;
  padding: 0.375rem 0.4375rem;
  background: var(--line);
  color: var(--dark-grey);
  font-size: 0.6875rem;
  line-height: 1.15;
}
/* Bullet points, suggested rather than written. */
.sv-slide::after {
  content: "";
  flex: 0 1 0.6875rem;
  min-height: 0;
  width: 78%;
  margin-top: auto;
  background: repeating-linear-gradient(to bottom, var(--mid-grey) 0 2px, transparent 2px 5px);
}
.sv-slide__n { font-size: 0.625rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sv-slide__t { font-weight: 800; overflow-wrap: anywhere; }
.sv-slide--mapped { background: var(--white); color: var(--black); box-shadow: 0 0 0 2px var(--yellow); }
.sv-slide__pin {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  border: 2px solid var(--black);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}
.sv-slide--more {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: transparent;
  color: var(--yellow);
  border: 2px dashed var(--yellow);
  font-size: var(--text-xs);
}
.sv-slide--more::after { content: none; }
.sv-deck__count { margin-top: var(--space-sm); font-size: var(--text-sm); line-height: var(--leading-mid); color: var(--white); }
.sv-deck__count strong { color: var(--yellow); font-weight: 800; }

/* ---------- the drawn arrow: down on a phone, across on a laptop ------ */
.sv-arrow { display: block; width: 4rem; height: 1.75rem; margin-inline: auto; overflow: visible; transform: rotate(90deg); }
.sv-arrow path { fill: none; stroke: var(--yellow); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 64rem) { .sv-arrow { width: 100%; height: auto; transform: none; } }

/* ---------- after: the map and its pins -------------------------------- */
.sv-map { position: relative; margin-top: var(--space-xs); }
@media (min-width: 64rem) { .sv-map { margin-top: 0; } }
.sv-tag--after {
  position: absolute;
  z-index: 2;
  top: -0.875rem;
  left: 1rem;
  background: var(--yellow);
  transform: rotate(-2deg);
}
.sv-map__frame { position: relative; border: 4px solid var(--yellow); background: var(--white); }
.sv-map__frame img { display: block; width: 100%; height: auto; }

.sv-pin {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  margin: -0.9375rem 0 0 -0.9375rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  border: 3px solid var(--black);
  box-shadow: 0 0 0 3px var(--white);
  font-size: var(--text-sm);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: transform var(--duration) var(--ease), background-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
}
@media (min-width: 48rem) {
  .sv-pin { width: 2.5rem; height: 2.5rem; margin: -1.25rem 0 0 -1.25rem; font-size: var(--text-md); }
}
.sv-pin:hover,
.sv-pin.is-on { z-index: 2; background: var(--black); color: var(--yellow); transform: scale(1.2); }
.sv-pin:focus-visible { z-index: 2; }

/* The pin's name, shown beside it on hover and focus from a tablet up. */
.sv-pin__label { display: none; }
@media (min-width: 48rem) {
  .sv-pin__label {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    display: block;
    padding: 0.25rem 0.625rem;
    background: var(--white);
    color: var(--black);
    border: 2px solid var(--black);
    font-size: var(--text-xs);
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-50%) scale(0.8333);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity var(--duration) var(--ease);
  }
  .sv-pin--end .sv-pin__label { left: auto; right: -0.5rem; transform: scale(0.8333); transform-origin: top right; }
  .sv-pin:hover .sv-pin__label,
  .sv-pin:focus-visible .sv-pin__label,
  .sv-pin.is-on .sv-pin__label { opacity: 1; }
}
.sv-pin:focus-visible { background: var(--black); color: var(--yellow); outline: 3px solid var(--yellow); outline-offset: 3px; transform: scale(1.2); }

/* The pins drop onto the map one by one once it scrolls into view. Hidden
   only under .vx-ready, which the script sets — no script, no hiding. */
html.vx-ready .sv-map:not(.is-in) .sv-pin { transform: scale(0); }
html.vx-ready .sv-map.is-in .sv-pin {
  animation: sv-pop 0.5s calc(0.5s + var(--i, 0) * 0.12s) cubic-bezier(.3, 1.6, .5, 1) backwards;
}
@keyframes sv-pop { from { transform: scale(0); } }
@media (prefers-reduced-motion: reduce) {
  html.vx-ready .sv-map:not(.is-in) .sv-pin { transform: none; }
  html.vx-ready .sv-map.is-in .sv-pin { animation: none; }
}

/* ---------- the key ------------------------------------------------------ */
.sv-key { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); }
@media (min-width: 48rem) { .sv-key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .sv-key { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sv-key__item {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0 var(--space-xs);
  align-items: start;
  padding: var(--space-sm);
  border: 2px solid var(--dark-grey);
  transition: border-color var(--duration) var(--ease);
}
.sv-key__item.is-on,
.sv-key__item:target { border-color: var(--yellow); }
.sv-key__n {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  font-weight: 900;
}
.sv-key__title { font-size: var(--text-md); font-weight: 800; line-height: var(--leading-snug); }
.sv-key__from {
  margin-top: 0.375rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow);
  line-height: var(--leading-snug);
}
.sv-key__body { margin-top: 0.5rem; font-size: var(--text-sm); line-height: var(--leading-mid); color: var(--white); }
.sv-caption { color: var(--white); }
