/* Where to stay and Things to do: the map beside the list, numbered and color-coded cards (places.js) */

.page-stay, .page-things-to-do { --cream: #fffaf0; --stripe-sm: 14px; }
/* a color for each kind of thing to do, on its card, its pin and the key */
[data-cat="outdoors"], [data-k="outdoors"] { --cat: #3f6b4c; --cat-ink: #fffaf0; }
[data-cat="water"], [data-k="water"] { --cat: #2b7471; --cat-ink: #fffaf0; }
[data-cat="eat"], [data-k="eat"] { --cat: #c23a2b; --cat-ink: #fffaf0; }
[data-cat="fun"], [data-k="fun"] { --cat: #d6a032; --cat-ink: #1f3b2c; }

/* ---------- Layout: map on top on phones, beside the list on computers ---------- */

.places { display: grid; gap: 28px; margin-top: 40px; }
.places .cards { margin-top: 0; }
.places-map {
  position: relative; margin: 0; height: min(62svh, 500px); min-height: 340px;
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 45%, #fbf5e6 0%, #e7efe6 45%, #cfe0d6 100%);
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -40px color-mix(in srgb, var(--ink) 60%, transparent);
}
.places-map::before { content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(90deg, var(--primary) 0 var(--stripe-sm), #fbf2df var(--stripe-sm) calc(var(--stripe-sm) * 2)); pointer-events: none; }
.places-map::after { content: "Loading the map"; position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 11px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); white-space: nowrap; pointer-events: none; }
.places-map.is-ready::after { display: none; }
.places-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.places-canvas canvas { opacity: 0; transition: opacity 0.7s var(--ease); }
.places-map.is-ready .places-canvas canvas { opacity: 1; }
.places-map:not(.is-ready) .maplibregl-marker { visibility: hidden; }
.places-canvas .maplibregl-canvas:focus-visible { outline: 3px solid var(--glow); outline-offset: -3px; }
.places-map .maplibregl-ctrl-attrib { font-size: 10.5px; }
.places-map .maplibregl-ctrl-group { border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 10px 20px -12px color-mix(in srgb, var(--ink) 50%, transparent); }
.places-map .maplibregl-cooperative-gesture-screen { font: 500 15px/1.4 var(--sans); background: color-mix(in srgb, var(--ink) 55%, transparent); }

@media (min-width: 1020px) {
  .places { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .places-list { grid-column: 1; grid-row: 1; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
  .places-map { grid-column: 2; grid-row: 1; position: sticky; top: 92px; height: calc(100svh - 120px); max-height: 820px; min-height: 480px; }
}

/* the key on the Things to do map */
.places-key { position: absolute; z-index: 2; left: 12px; top: 24px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); pointer-events: none; }
.places-key span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 0 0 1px var(--line); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.places-key span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cat); }

/* ---------- Cards ---------- */

.place { padding-top: 30px; }
.card-link { color: inherit; text-decoration: none; }
/* the whole card opens the website; the "On the map" button sits above that */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.place h3 { position: static; }
.place:hover { transform: translateY(-3px); }
.place:has(.card-link:focus-visible) { outline: 3px solid var(--primary); outline-offset: 3px; }
.card-link:focus-visible { outline: none; }
:root .places .place.is-lit, :root .places .place.is-flash { box-shadow: inset 0 0 0 3px var(--ink), 0 24px 40px -30px color-mix(in srgb, var(--ink) 45%, transparent); }
.place.is-flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--glow) 45%, var(--surface)); } }

/* hotels: a number that matches the pin */
.place-num { position: absolute; z-index: 2; top: -13px; left: 24px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--cream); font: 600 13.5px/1 var(--sans); box-shadow: 0 0 0 3px var(--bg), 0 6px 12px -6px rgba(0, 0, 0, 0.4); }
.place-badge { align-self: flex-start; margin: -6px 0 14px !important; padding: 6px 11px; border-radius: 999px; background: var(--glow); color: var(--ink) !important; font-size: 10.5px !important; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }

/* drive times */
.drive { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 20px !important; }
.drive span { padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--sea) 70%, var(--surface)); font-size: 13px; line-height: 1.2; color: var(--ink-soft); }
.drive b { font-weight: 600; color: var(--ink); }

.place-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.place-foot .text-link { white-space: nowrap; }
.place-show { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px 0 11px; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 999px; background: var(--surface); font: 500 11px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); cursor: pointer; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.place-show::before { content: ""; width: 9px; height: 9px; border-radius: 50% 50% 50% 0; background: var(--cat, var(--primary)); transform: rotate(-45deg); }
.place-show:hover { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.place-show:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* things to do: each kind gets its own color, an awning stripe and an outline */
:root .place[data-cat] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cat) 80%, transparent); }
.place[data-cat]::before { content: ""; position: absolute; left: 2px; right: 2px; top: 2px; height: 10px; border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; background: repeating-linear-gradient(90deg, var(--cat) 0 14px, transparent 14px 28px); opacity: 0.85; }
.cat-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--cat); vertical-align: 1px; }

/* the two that matter most for the wedding weekend */
.place--featured { grid-column: 1 / -1; background: color-mix(in srgb, var(--alt) 70%, var(--surface)); }
.place--featured h3 { font-size: clamp(26px, 2.6vw, 32px); }
.place-ribbon { align-self: flex-start; margin: 0 0 14px !important; padding: 6px 12px; border-radius: 999px; background: var(--primary); color: var(--on-primary) !important; font-size: 10.5px !important; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- Pins ---------- */

.mpin { cursor: pointer; }
.mpin.is-off { display: none; }
.mpin-dot { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border: 2.5px solid var(--cream); border-radius: 50%; background: var(--cat, var(--primary)); color: var(--cat-ink, var(--cream)); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.5); transition: transform 0.25s var(--ease); }
.mpin-dot b { font: 600 13px/1 var(--sans); }
.mpin-dot svg { width: 15px; height: 15px; fill: currentColor; }
.mpin-count { position: absolute; top: -7px; right: -8px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--ink); color: var(--cream); font: 600 10px/1 var(--sans); font-style: normal; box-shadow: 0 0 0 2px var(--cream); }
.mpin-label { position: absolute; left: 50%; bottom: 38px; padding: 5px 10px 6px; border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 14px/1.1 var(--display); white-space: nowrap; transform: translateX(-50%); box-shadow: 0 0 0 1px var(--line), 0 8px 18px -10px rgba(0, 0, 0, 0.45); opacity: 0; visibility: hidden; transition: opacity 0.2s; pointer-events: none; }
.mpin:hover .mpin-dot, .mpin.is-on .mpin-dot { transform: scale(1.22); }
.mpin:hover .mpin-label, .mpin.is-on .mpin-label { opacity: 1; visibility: visible; }
.mpin:hover { z-index: 5; }

/* the ceremony and the reception */
.spot { position: relative; z-index: 3; width: 18px; height: 18px; pointer-events: none; }
.spot.is-clickable { pointer-events: auto; cursor: pointer; }
.spot i { position: absolute; inset: 0; border: 3px solid var(--cream); border-radius: 50%; background: var(--ink); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); }
.spot i::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 22%, transparent); animation: ping 2.4s var(--ease) infinite; }
.spot span { position: absolute; left: 50%; bottom: 24px; padding: 5px 10px 6px; border-radius: 10px; background: var(--ink); color: var(--cream); font: 400 14px/1 var(--display); white-space: nowrap; transform: translateX(-50%); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.5); }
.spot--ceremony span { bottom: auto; top: 24px; }
.spot.is-on i { background: var(--primary); }
@keyframes ping { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

/* ---------- The card that opens on the map ---------- */

.pl-pop { z-index: 6; }
.pl-pop .maplibregl-popup-content { padding: 14px 34px 14px 16px; border-radius: 14px; background: var(--surface); font-family: var(--sans); box-shadow: 0 0 0 1px var(--line), 0 20px 40px -20px rgba(0, 0, 0, 0.5); }
.pl-pop .maplibregl-popup-tip { border-top-color: var(--surface); border-bottom-color: var(--surface); }
.pl-pop .maplibregl-popup-close-button { top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; font-size: 20px; color: var(--muted); }
.pl-pop .maplibregl-popup-close-button:hover { background: var(--bg); color: var(--ink); }
.pop-item + .pop-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pop-item p { margin: 0; }
.pop-meta { display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.pop-meta b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--primary); color: var(--cream); font-size: 11px; letter-spacing: 0; }
.pop-name { margin-top: 4px !important; font-family: var(--display); font-size: 20px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.pop-drive { margin-top: 6px !important; font-size: 13px; color: var(--ink-soft); }
.pop-link { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.pop-link::after { content: " ↗"; color: var(--primary); }
.pop-link:hover { color: var(--primary); }

@media (max-width: 760px) {
  .spot span { font-size: 13px; padding: 4px 9px 5px; }
  .places-key span { padding: 4px 9px 4px 7px; font-size: 9.5px; letter-spacing: 0.12em; }
}

.still .spot i::before, .still .place.is-flash { animation: none; }
