/* ═══════════════════════════════════════════════════════════════════
   Homestead Hollow — Park Map page (loaded only on /park-map/)
   Pins are positioned by % of the map image so they track the artwork.
   ═══════════════════════════════════════════════════════════════════ */

.pmap-page { padding: 150px 0 110px; background: var(--linen); overflow: hidden; }
.pmap-page .hero-rule { display: flex; align-items: center; gap: 18px; margin-bottom: 30px; }
.pmap-page .hero-rule .line { flex: 1; height: 1px; background: var(--ink-30); position: relative; }
.pmap-page .hero-rule .line::after { content: "❖"; position: absolute; right: 0; top: 50%; transform: translateY(-52%); font-size: 9px; color: var(--brass); background: var(--linen); padding-left: 8px; }
.pmap-page .hero-rule .label { color: var(--clay); white-space: nowrap; }
.pmap-page h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.025em;
  font-size: clamp(42px, 6.6vw, 88px); line-height: 1; color: var(--ink);
}
.pmap-page h1 .ital { font-style: italic; font-weight: 300; color: var(--clay); }
.pmap-page .pmap-sub { margin-top: 22px; font-size: 18.5px; color: var(--ink-70); max-width: 640px; }

/* ── the map ──────────────────────────────────────────────────────── */
.pmap { --pin: clamp(30px, 2.9vw, 42px); margin-top: 46px; }
.pmap-hint {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-50);
}
.pmap-hint i { color: var(--clay); font-size: 18px; }
.pmap-hint-touch { display: none; }
@media (hover: none) {
  .pmap-hint-fine { display: none; }
  .pmap-hint-touch { display: inline; }
}

.pmap-scroll { position: relative; }
.pmap-stage { position: relative; max-width: 1180px; margin: 0 auto; padding-top: 6px; }
.pmap-stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

/* ── pins ─────────────────────────────────────────────────────────── */
/* the button is a zero-size anchor sitting exactly on the pin's TIP;
   the bubble is drawn upward from it and grows from that same point */
.pmap-pin {
  position: absolute; width: 0; height: 0; padding: 0; border: 0; background: none;
  cursor: pointer; z-index: 2; font: inherit; color: inherit;
}
.pmap-bubble {
  position: absolute; left: calc(var(--pin) / -2); bottom: 0;
  width: var(--pin); height: calc(var(--pin) * 1.25);
  transform-origin: 50% 100%;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), filter .22s;
  filter: drop-shadow(0 2px 2px rgba(22,40,31,.35));
}
.pmap-bubble svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pmap-bubble path { fill: #c4161c; stroke: #7e0d11; stroke-width: 1; stroke-linejoin: round; transition: fill .2s; }
.pmap-bubble b {
  position: absolute; left: 0; right: 0; top: 0; height: 80%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: calc(var(--pin) * .42); color: #fff; line-height: 1;
}
/* grow on hover / focus / when its list item is active */
.pmap-pin:hover, .pmap-pin:focus-visible, .pmap-pin.is-active { z-index: 6; }
.pmap-pin:hover .pmap-bubble, .pmap-pin:focus-visible .pmap-bubble, .pmap-pin.is-active .pmap-bubble {
  transform: scale(1.5); filter: drop-shadow(0 5px 5px rgba(22,40,31,.4));
}
.pmap-pin:focus-visible { outline: none; }
.pmap-pin:focus-visible .pmap-bubble path { stroke: var(--brass-lt); stroke-width: 2; }

/* name label */
.pmap-tip {
  position: absolute; left: 0; bottom: calc(var(--pin) * 1.25 * 1.5 + 10px);
  transform: translate(-50%, 6px) scale(.92); transform-origin: 50% 100%;
  display: block; width: max-content; max-width: 220px;
  background: var(--pine); color: var(--magnolia);
  font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: -.005em; line-height: 1.2;
  padding: 9px 16px 10px; border-radius: 10px; border: 1.5px solid var(--brass);
  box-shadow: 3px 3px 0 rgba(22,40,31,.3);
  opacity: 0; visibility: hidden; pointer-events: none; text-align: center;
  transition: opacity .18s, transform .22s cubic-bezier(.34,1.56,.64,1), visibility .18s;
}
.pmap-tip small { display: block; margin-top: 3px; font-family: var(--serif-2); font-style: italic; font-weight: 400; font-size: 14px; color: var(--cream-70); }
.pmap-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px;
  background: var(--pine); border-right: 1.5px solid var(--brass); border-bottom: 1.5px solid var(--brass);
  transform: translateX(-50%) rotate(45deg);
}
.pmap-pin:hover .pmap-tip, .pmap-pin:focus-visible .pmap-tip, .pmap-pin.is-active .pmap-tip {
  opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1);
}
/* pins near the top edge: label drops below the tip instead */
.pmap-pin.is-below .pmap-tip { bottom: auto; top: 12px; transform: translate(-50%, -6px) scale(.92); transform-origin: 50% 0; }
.pmap-pin.is-below:hover .pmap-tip, .pmap-pin.is-below:focus-visible .pmap-tip, .pmap-pin.is-below.is-active .pmap-tip { transform: translate(-50%, 0) scale(1); }
.pmap-pin.is-below .pmap-tip::after { bottom: auto; top: -7px; border: 0; border-left: 1.5px solid var(--brass); border-top: 1.5px solid var(--brass); }

/* ── key (list) ───────────────────────────────────────────────────── */
.pmap-list {
  list-style: none; margin: 56px auto 0; max-width: 1180px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px;
  border-top: 1.5px solid var(--ink);
}
.pmap-item {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 15px 8px; background: none; border: 0; border-bottom: 1px solid var(--ink-14);
  font-family: var(--serif-2); font-size: 18px; color: var(--ink); cursor: pointer; min-height: 52px;
  transition: background .2s, padding .2s;
}
.pmap-item:hover, .pmap-item.is-active { background: var(--magnolia); padding-left: 14px; }
.pmap-num {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #c4161c; color: #fff; border: 1.5px solid #7e0d11;
  font-family: var(--sans); font-weight: 700; font-size: 13px; transition: transform .2s;
}
.pmap-item:hover .pmap-num, .pmap-item.is-active .pmap-num { transform: scale(1.18); }
.pmap-name small { display: block; font-style: italic; font-size: 14.5px; color: var(--ink-50); }

/* ── tablet / phone ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .pmap-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .pmap-page { padding: 108px 0 80px; }
  .pmap-page .hero-rule { gap: 12px; margin-bottom: 20px; }
  .pmap-page .hero-rule .line { display: none; }
  .pmap-page .hero-rule .label { white-space: normal; letter-spacing: .2em; font-size: 10.5px; line-height: 1.5; }
  .pmap-page h1 { font-size: clamp(40px, 12vw, 52px); }
  .pmap-page .pmap-sub { font-size: 17px; }
  .pmap { --pin: 30px; margin-top: 32px; }
  .pmap-hint { font-size: 11px; letter-spacing: .1em; line-height: 1.5; align-items: flex-start; }

  /* the map is drawn wider than the screen and swipes sideways, so the
     pins stay big enough to tap; room above/below keeps labels uncut */
  .pmap-scroll {
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    margin: 0 -20px; padding: 50px 20px 56px; scroll-snap-type: x proximity;
    background: linear-gradient(var(--linen-2), var(--linen-2)) center / 100% calc(100% - 20px) no-repeat;
  }
  .pmap-stage { width: 820px; max-width: none; margin: 0; }
  .pmap-tip { font-size: 16px; max-width: 190px; }
  .pmap-list { grid-template-columns: 1fr; margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .pmap-bubble, .pmap-tip, .pmap-item, .pmap-num { transition: none; }
}

/* pin 2 sits at the very top edge beside pin 1 — its label opens to the right */
.pmap-pin.is-right .pmap-tip {
  bottom: calc(var(--pin) * 1.25 * .5); left: calc(var(--pin) * .75 + 16px); top: auto;
  transform: translate(-8px, 0) scale(.92); transform-origin: 0 50%;
}
.pmap-pin.is-right:hover .pmap-tip, .pmap-pin.is-right:focus-visible .pmap-tip, .pmap-pin.is-right.is-active .pmap-tip { transform: translate(0, 0) scale(1); }
.pmap-pin.is-right .pmap-tip::after {
  left: -7px; bottom: auto; top: 50%; border: 0;
  border-left: 1.5px solid var(--brass); border-bottom: 1.5px solid var(--brass);
  transform: translateY(-50%) rotate(45deg);
}

/* ── tilt: the stage leans toward the mouse (see hh-map.js) ───────── */
@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .pmap-stage { will-change: transform; transform-style: flat; }
  .pmap-stage img { filter: drop-shadow(0 18px 22px rgba(22,40,31,.14)); }
}

/* ── sheen: a soft glint that chases the pointer while the map moves ──
   Clipped to the map's own outline (its alpha) so it never spills onto the
   page. Brightness is driven by hh-map.js from how fast the pointer moves. */
.pmap-sheen { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .pmap-sheen {
    display: block; position: absolute; inset: 6px 0 0 0; z-index: 1;
    pointer-events: none; opacity: 0; --sx: 50%; --sy: 40%;
    background: linear-gradient(112deg, rgba(255,255,255,0) calc(var(--sx) - 16%), rgba(255,255,255,.34) var(--sx), rgba(255,255,255,0) calc(var(--sx) + 16%));
    mix-blend-mode: overlay;
    -webkit-mask: url("park-map.webp") center / 100% 100% no-repeat;
            mask: url("park-map.webp") center / 100% 100% no-repeat;
  }
}
@media (prefers-reduced-motion: reduce) { .pmap-sheen { display: none !important; } }

/* ═══ 3D depth (v1.3) ═══════════════════════════════════════════════════
   The map is the ground plane. Each pin stands UP off it: its tip stays on
   the spot, but the body counter-rotates against the map's tilt (--rx/--ry,
   set by hh-map.js) so it keeps facing you, with a soft shadow on the ground
   and the name label floating higher still. Because everything shares one
   perspective, pins and labels slide against the map as it leans. */
.pmap-shadow {
  position: absolute; left: -15px; top: -5px; width: 30px; height: 10px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(22,32,18,.55), rgba(22,32,18,0) 70%);
  pointer-events: none; transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .22s;
}
.pmap-up {
  position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0;
  transform: rotateY(calc(var(--ry, 0deg) * -1)) rotateX(calc(var(--rx, 0deg) * -1));
}
/* a lifted pin throws a wider, fainter shadow */
.pmap-pin:hover .pmap-shadow, .pmap-pin:focus-visible .pmap-shadow, .pmap-pin.is-active .pmap-shadow { transform: scale(1.7, 1.5); opacity: .55; }

@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .pmap-stage { transform-style: preserve-3d; }
  .pmap-pin { transform-style: preserve-3d; }
  .pmap-up {
    transform-style: preserve-3d;
    transform: translateZ(var(--lift, 0px)) rotateY(calc(var(--ry, 0deg) * -1)) rotateX(calc(var(--rx, 0deg) * -1));
    transition: transform .2s ease-out;
  }
  /* the hovered pin rises above its neighbours (z-index is ignored in 3D) */
  .pmap-pin:hover .pmap-up, .pmap-pin:focus-visible .pmap-up, .pmap-pin.is-active .pmap-up { --lift: 22px; }
  /* labels float well above the surface; the extra Z is what you see slide */
  .pmap-tip { --tz: 46px; }
  .pmap-tip { transform: translate3d(-50%, 6px, var(--tz)) scale(.92); }
  .pmap-pin:hover .pmap-tip, .pmap-pin:focus-visible .pmap-tip, .pmap-pin.is-active .pmap-tip { transform: translate3d(-50%, 0, var(--tz)) scale(1); }
  .pmap-pin.is-below .pmap-tip { transform: translate3d(-50%, -6px, var(--tz)) scale(.92); }
  .pmap-pin.is-below:hover .pmap-tip, .pmap-pin.is-below:focus-visible .pmap-tip, .pmap-pin.is-below.is-active .pmap-tip { transform: translate3d(-50%, 0, var(--tz)) scale(1); }
  .pmap-pin.is-right .pmap-tip { transform: translate3d(-8px, 0, var(--tz)) scale(.92); }
  .pmap-pin.is-right:hover .pmap-tip, .pmap-pin.is-right:focus-visible .pmap-tip, .pmap-pin.is-right.is-active .pmap-tip { transform: translate3d(0, 0, var(--tz)) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .pmap-up { transition: none; } }

/* v1.3.1 — float pins clear of the surface. A flat pin standing against a
   tilted map pokes below the plane (and gets hidden by it) unless its whole
   body sits above it; lift must exceed pin height × sin(max tilt). */
@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .pmap-up { --lift: 20px; }
  .pmap-pin:hover .pmap-up, .pmap-pin:focus-visible .pmap-up, .pmap-pin.is-active .pmap-up { --lift: 40px; }
  .pmap-tip { --tz: 58px; }
}

/* ── Download Map button (sits level with the hover hint) ──────────── */
.pmap-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px 24px; margin: 0 auto 18px; max-width: 1180px; }
.pmap-bar .pmap-hint { margin-bottom: 0; }
.pmap-dl { flex: 0 0 auto; padding: 12px 22px; font-size: 12.5px; gap: 9px; min-height: 46px; white-space: nowrap; }
.pmap-dl i { font-size: 18px; }
.pmap-dl small {
  margin-left: 4px; padding-left: 12px; border-left: 1px solid rgba(253,251,245,.4);
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; opacity: .85;
}
@media (max-width: 700px) {
  .pmap-bar { flex-direction: column-reverse; align-items: stretch; gap: 14px; margin-bottom: 14px; }
  .pmap-dl { justify-content: center; min-height: 50px; }
}

/* ── Bigger map (v1.5.2): break out of the 1240px text column ─────────
   The map block grows to nearly the full window (cap 1560px) and stays
   centred on the page; the heading above keeps its normal column.        */
@media (min-width: 701px) {
  /* widen this page's container (no 100vw maths — that counts the scrollbar and
     pushes the map off-centre); the intro text keeps its own max-widths */
  .pmap-page .container { max-width: 1364px; }
  .pmap-bar, .pmap-stage { max-width: 1300px; }
  .pmap-list { max-width: 1240px; }
  /* heading text stays on the nav's 1176px column so the logo and title line up */
  .pmap-page .hero-rule { max-width: 1176px; margin-left: auto; margin-right: auto; }
  .pmap-page h1, .pmap-page .pmap-sub { margin-left: max(0px, calc((100% - 1176px) / 2)); }
}

/* ── Map key heading + note (v1.6) ──────────────────────────────────── */
.pmap-key-title {
  max-width: 1240px; margin: 64px auto 0; padding: 0;
  font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; color: var(--ink);
}
.pmap-key-note { max-width: 1240px; margin: 12px auto 0; font-size: 17px; color: var(--ink-70); }
.pmap-key-title + .pmap-key-note + .pmap-list { margin-top: 26px; }
@media (max-width: 700px) { .pmap-key-title { margin-top: 44px; } .pmap-key-note { font-size: 16px; } }
