/* Studio Stour: where David designs, the map shared by the contact page and the homepage (includes/where.php). */
/* ---------- where David designs: the map ---------- */
.where { overflow: clip; }
.where__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.where__copy .lede { margin-bottom: 26px; }
.where__lists { display: grid; gap: 20px; }
.where__gtitle { font-family: var(--body); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ochre-ink); margin: 0 0 4px; }
.where__list li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 9px 0 9px 14px; border-bottom: 1px solid var(--rule); position: relative; transition: background-color .35s var(--ease); }
.where__list li::before { content: ''; position: absolute; left: 0; top: 21px; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--stour); transform: scale(.8); transition: background .3s, transform .4s var(--ease); }
.where__list li.is-active { background-color: rgba(255, 255, 255, .55); }
.where__list li.is-active::before { background: var(--ochre); transform: scale(1.4); }
.where__name { font-family: var(--display); font-size: 1.14rem; font-weight: 560; color: var(--stour); line-height: 1.3; }
.where__what { color: var(--ink-2); font-size: .95rem; line-height: 1.4; }

.where__map { position: relative; width: min(100%, calc(min(76vh, 700px) * 1.0175)); aspect-ratio: 1017.5 / 1000; margin-left: auto; }
.where__stage { position: absolute; inset: 0; }
.where__land { position: absolute; inset: 0; width: 100%; height: 100%; }
.where__routes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.where__route { fill: none; stroke: var(--ochre-ink); stroke-width: 2.6; stroke-linecap: round; }
.where__flow { fill: none; stroke: var(--stour); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 0 11; opacity: 0; transition: opacity .8s; animation: route-flow 1.6s linear infinite; }
.where__map.is-live .where__stage .where__flow, .where__detail.is-drawn .where__flow { opacity: .75; }
@keyframes route-flow { to { stroke-dashoffset: -22; } }
.where__routes--detail .where__route { stroke-width: 7; }
.where__routes--detail .where__flow { stroke-width: 9; stroke-dasharray: 0 28; animation-name: route-flow-d; }
@keyframes route-flow-d { to { stroke-dashoffset: -56; } }
.where__leader { fill: none; stroke: var(--stour); stroke-width: 1.3; stroke-dasharray: 1; }
.where__callout { fill: none; stroke: var(--stour); stroke-width: 1.3; }
.where__home { fill: var(--ochre); stroke: var(--stour); stroke-width: 1.6; pointer-events: all; }
.where__callout { pointer-events: all; }
.where__home-ring { fill: none; stroke: var(--ochre); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: home-ring 2.6s var(--ease) infinite; }
@keyframes home-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }

/* the Suffolk and Essex inset sits over its circle on the map, larger than it, so the village pins have
   room between them (Hartest and Long Melford are close): 1.45 times its circle */
.where__detail { position: absolute; z-index: 3; width: calc(var(--cr) * 2.9); aspect-ratio: 1; left: calc(var(--cx) - var(--cr) * 1.45); top: calc(var(--cy) - var(--cr) * 1.45 * 1.0175); }
.where__disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px var(--stour), 0 26px 50px -24px rgba(19, 36, 31, .55); background: var(--meadow); }
.where__disc img, .where__disc svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.where__detail::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed rgba(31, 56, 51, .55); animation: disc-turn 40s linear infinite; pointer-events: none; }
@keyframes disc-turn { to { transform: rotate(360deg); } }
.where__county { position: absolute; font-weight: 700; font-size: .875rem; letter-spacing: .16em; text-transform: uppercase; color: #5E6E68; pointer-events: none; }
.where__county--s { left: 50%; top: 24%; }
.where__county--e { left: 16%; top: 76%; }

/* pins: real places, with a card on hover, focus or tap */
.pin { position: absolute; z-index: 4; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--stour); font: inherit; }
.pin__dot { position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--stour); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ochre); transition: transform .35s var(--ease), background .3s; }
.pin--home .pin__dot { width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; background: var(--ochre); box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4px var(--stour); }
.pin--home::after { content: ''; position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; border-radius: 50%; border: 1.5px solid var(--ochre); animation: pin-ring 2.6s var(--ease) infinite; pointer-events: none; }
@keyframes pin-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.pin__label { position: absolute; top: 50%; left: 34px; transform: translateY(-50%); white-space: nowrap; padding: 3px 8px; border-radius: var(--r);
  background: var(--paper); font-weight: 650; isolation: isolate; font-size: .875rem; line-height: 1.3; color: var(--stour); box-shadow: 0 1px 0 var(--rule); transition: background .3s, color .3s; }
.pin--l .pin__label { left: auto; right: 34px; }
.pin:hover .pin__dot, .pin:focus-visible .pin__dot, .pin.is-active .pin__dot { transform: scale(1.35); }
.pin.is-active .pin__label, .pin:hover .pin__label, .pin:focus-visible .pin__label { background: var(--ochre-soft); color: var(--stour); box-shadow: 0 0 0 1px var(--ochre); }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin__label { outline: 2px solid var(--ochre); outline-offset: 2px; }
.pin.is-active, .pin:hover, .pin:focus-visible { z-index: 6; }
/* one shared card for the map: it always shows a place while the map is live, and swaps its words (never empty) */
.where__card { position: absolute; left: 0; top: 0; z-index: 5; width: 300px; height: 128px; display: grid; grid-template-columns: 104px minmax(0, 1fr);
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 24px 44px -26px rgba(19, 36, 31, .5); overflow: hidden; }
.where__card-img { position: relative; display: block; background: var(--meadow); overflow: hidden; }
.where__card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s var(--ease); }
.where__card-ph { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper) url('../img/river-ink-faint.svg') 0 0 / 320px 96px; opacity: 0; transition: opacity .35s var(--ease); }
.where__card-ph span { font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--ochre-ink); text-align: center; line-height: 1.15; padding: 0 8px; }
.where__card.is-ph .where__card-ph { opacity: 1; }
.where__card.is-ph .where__card-img img { opacity: 0; }
.where__card-body { display: grid; align-content: start; gap: 2px; padding: 11px 14px 10px; transition: opacity .2s var(--ease); }
.where__card.is-swap .where__card-body { opacity: .35; }
.where__card-place { font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ochre-ink); }
.where__card-title { font-family: var(--display); font-size: 1.12rem; line-height: 1.2; font-weight: 560; color: var(--stour); }
.where__card-note { font-size: .875rem; line-height: 1.38; color: var(--ink-2); }
.js:not(.reduced):not(.no-anim) [data-map] .where__card { opacity: 0; }

.where__scale { position: absolute; left: 4%; bottom: 3%; width: var(--w); display: grid; gap: 4px; white-space: nowrap; font-weight: 650; font-size: .875rem; color: var(--stour); pointer-events: none; }
.where__scale .dim { margin: 0; color: var(--stour); }
.where__scale--detail { left: 50%; bottom: -46px; transform: translateX(-50%); justify-items: center; text-align: center; }
.where__scale--detail .dim { justify-self: stretch; }
.where__north { position: absolute; left: 4%; bottom: 12%; display: grid; justify-items: center; gap: 2px; font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--stour); pointer-events: none; }
.where__north svg { width: 16px; height: 24px; fill: var(--stour); }

.js:not(.reduced):not(.no-anim) [data-map] .pin { opacity: 0; }
.js:not(.reduced):not(.no-anim) [data-map] .where__route,
.js:not(.reduced):not(.no-anim) [data-map] .where__leader { stroke-dasharray: 1; stroke-dashoffset: 1; }
.reduced .where__flow, .reduced .where__home-ring, .reduced .pin--home::after, .reduced .where__detail::before { animation: none; }
.reduced .where__map .where__flow { opacity: 0; }

@media (max-width: 980px) {
  .where__grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .where__copy { display: contents; }
  .where__copy .h2 { order: 1; }
  .where__copy .lede { order: 2; }
  .where__map { order: 3; }
  .where__lists { order: 4; }
  .where__map { width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: auto; }
  .where__stage { position: relative; aspect-ratio: 1017.5 / 1000; }
  .where__leader, .where__callout { display: none; }
  .where__detail { position: relative; left: auto; top: auto; width: min(96%, 400px); margin: 28px auto 64px; }
  .where__card { position: relative; width: min(100%, 380px); margin: 0 auto 36px; }
  .where__list li { grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .where__stage .where__route { stroke-width: 4.4; }
  .where__stage .where__flow { stroke-width: 5.6; stroke-dasharray: 0 16; animation-name: route-flow-m; }
  .where__home { r: 7; }
}
@keyframes route-flow-m { to { stroke-dashoffset: -32; } }
@media (max-width: 520px) {
  .where__list li { grid-template-columns: 1fr; gap: 0; }
  .where__north { display: none; }
}
