/* Stay In Tramore website: styles for the map pages. One file per area (kingnail/guidebook#11) so jobs that work side by side never edit the same lines of site.css. Loaded after site.css on every page; keep every rule scoped to this area. */

/* kingnail/guidebook#17: the map is drawn by MapLibre from this site's own files */
#map.maplibregl-map { font-family: var(--font-body); }
#map.nomap { display: grid; place-items: center; }
#map.nomap::after { content: 'The map could not be drawn in this browser. Every place is in the list.'; padding: 24px; text-align: center; color: var(--ink-2); }
#map .maplibregl-ctrl-group button { width: 44px; height: 44px; }
#map .maplibregl-ctrl-group button .maplibregl-ctrl-icon { background-size: 30px; }
#map .maplibregl-ctrl-attrib { font-size: .72rem; }
#map .maplibregl-ctrl-attrib a { color: var(--ink); }

/* pins, home tags and numbered groups: every one a button */
.mk { margin: 0; padding: 0; border: 0; cursor: pointer; font-family: var(--font-body); }
.mk:focus-visible { outline: 3px solid #1d1933; outline-offset: 3px; }
.mk.pin { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); background: var(--accent-fill) center / cover; color: #fff; font: 600 1.1rem var(--font-body); }
.mk.pin.on { box-shadow: 0 0 0 3px #1d1933, 0 0 0 5px #fff, 0 2px 12px rgba(0,0,0,.45); }
/* each place's ring in its category's colour, and the same colour as a dot on its chip (Dara, 25 Nov 2026,
   kingnail/guidebook#43): Things to do green, Bites and sips pink, Shops blue, Beaches yellow, Hikes brown */
.g-things { --gc: #2f9e5b; } .g-bites { --gc: #e5579b; } .g-shops { --gc: #2f78d6; } .g-beaches { --gc: #f2c12e; } .g-hikes { --gc: #8a5a2b; }
.mk.pin[class*="g-"] { border-color: var(--gc); border-width: 4px; }
.chips .gdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--gc); margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 1.5px #fff; }
/* a long name wraps inside its tag, never cut (kingnail/guidebook#10) */
.mk.stay { display: inline-block; min-height: 36px; width: max-content; max-width: 220px; padding: 8px 14px; border-radius: 18px; background: #1d1933; color: #fff; font: 600 .88rem/1.25 var(--font-body); text-align: center; overflow-wrap: anywhere; box-shadow: 0 3px 12px rgba(0,0,0,.35); }
.mk.grp { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; background: #1d1933; color: #fff; font: 700 1.05rem var(--font-body); box-shadow: 0 0 0 5px rgba(121,103,235,.35), 0 2px 10px rgba(0,0,0,.35); }

/* the card */
.mapcard.stay, .mapcard:has(.members) { display: block; padding: 14px 14px 12px; }
.mapcard .homes { display: grid; gap: 12px; max-height: min(44vh, 360px); overflow-y: auto; }
.mapcard .home { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; padding-right: 30px; }
.mapcard .home + .home { border-top: 1.5px solid var(--line); padding-top: 12px; }
.mapcard .home strong { color: var(--ink); }
.mapcard .row a { display: inline-flex; align-items: center; min-height: 44px; }
.mapcard .note { margin: 0; font-size: .8rem; color: var(--ink-2); }
.mapcard .dot { width: 84px; height: 84px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-fill); color: #fff; font: 600 2rem var(--font-display); }
.mapcard .members ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.mapcard .members button { width: 100%; min-height: 44px; text-align: left; border: 0; border-top: 1.5px solid var(--line); background: none; font: 500 1rem var(--font-body); color: var(--accent-text); cursor: pointer; }
.mapcard .x { width: 44px; height: 44px; right: 4px; top: 4px; }

/* the homes beside the map are buttons that zoom the map to them */
.staysrow button { width: 100%; display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; text-align: left; border: 0; cursor: pointer; color: var(--ink); background: var(--wave); border-radius: 16px; padding: 10px; font-family: var(--font-body); min-height: 44px; }
.staysrow button:hover b { text-decoration: underline; text-underline-offset: 4px; }
.staysrow button > span > span { display: block; }

/* the phone's "Show list" / "Show map" control: in the page above the map, held at the top while the map scrolls
   past, so it never sits under the price bar at the bottom or over the footer */
.maptoggle-row { display: none; }
@media (max-width: 860px) {
  .maptoggle-row { display: flex; justify-content: center; position: sticky; top: 8px; z-index: 6; margin: 0 0 10px; pointer-events: none; }
  .maptoggle-row .maptoggle { pointer-events: auto; min-height: 44px; box-shadow: 0 6px 20px rgba(20,16,60,.3); }
}

/* the walking-times switch is 44 px tall at every width, like the filters (kingnail/guidebook#17) */
.maphead .fromsel button { min-height: 44px; }

/* the phone's first screen holds the strand, the town and a home's area above the price bar (kingnail/guidebook#17):
   the walking-times switch orders the list, so on a phone it shows with the list, and the map fits the screen */
@media (max-width: 860px) {
  body[data-view="map"] .maphead .fromsel { display: none; }
  /* near the screen's height (Dara, 25 Nov: "twice as big vertically on a phone ... to fill the screen more"): from just
     under the Show list button to just above the price bar, with the menu bar showing too */
  body[data-view="map"] #map { height: max(340px, calc(100svh - 175px)); min-height: 0; }
}

/* the map in a frame (kingnail/guidebook#20): the map fills the frame; the chips stay; the page title, list and toggle go */
body.mapembed { margin: 0; background: var(--paper); }
body.mapembed .wrap { max-width: none; padding: 0; }
body.mapembed .maphead { padding: 10px 10px 0; }
body.mapembed .maphead h1, body.mapembed .maphead .lead, body.mapembed .maptoggle-row, body.mapembed .listbox { display: none; }
/* the frame never scrolls (Dara, 25 Nov: "It shouldn't have a scroll bar"): the page is exactly the frame's height, the
   chips take what they need at the top, and the map fills the rest */
html:has(body.mapembed), body.mapembed { height: 100%; overflow: hidden; }
body.mapembed { display: flex; flex-direction: column; }
body.mapembed .wrap.mapwrap { flex: 1 1 auto; min-height: 0; width: 100%; margin: 0; display: flex; flex-direction: column; }
body.mapembed .maphead { flex: 0 0 auto; }
body.mapembed .mapcols { display: block; flex: 1 1 auto; min-height: 0; padding-bottom: 0; }
body.mapembed .mapbox { position: relative; top: auto; height: 100%; min-height: 0; }
body.mapembed #map { height: 100% !important; min-height: 0; }

/* a home on the map: a glowing purple circle with a house in it, at the home's own position (kingnail/guidebook#20;
   Dara: "little purple house icons ... glowing ... to differentiate them from the other items") */
.mk.home { width: 40px; height: 40px; border-radius: 50%; background: #6b57e0; display: grid; place-items: center;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 16px 8px rgba(121, 103, 235, .75), 0 0 34px 14px rgba(121, 103, 235, .35); z-index: 3; }
.mk.home .ico { width: 22px; height: 22px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2 2.6 11.1a1 1 0 0 0 1.3 1.5l.9-.8V20a1 1 0 0 0 1 1h4.4v-5.6h3.6V21h4.4a1 1 0 0 0 1-1v-8.2l.9.8a1 1 0 0 0 1.3-1.5L12 3.2z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2 2.6 11.1a1 1 0 0 0 1.3 1.5l.9-.8V20a1 1 0 0 0 1 1h4.4v-5.6h3.6V21h4.4a1 1 0 0 0 1-1v-8.2l.9.8a1 1 0 0 0 1.3-1.5L12 3.2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.mk.home:focus-visible { outline: 3px solid #1d1933; outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .mk.home::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 22px 10px rgba(121, 103, 235, .55); animation: homeglow 2.4s ease-in-out infinite; pointer-events: none; }
  @keyframes homeglow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
}


/* computers: the map takes most of the width and nearly the window's height; the list narrows to a column on the
   right (Dara, 24 Nov: "displayed bigger. It can enlarge to the right and down") */
@media (min-width: 861px) {
  /* inside the site's usual page frame (Dara, 25 Nov: the frame itself must not grow): the map takes the room the list
     gives up, the list narrows to a column at the frame's right edge (his drawing: map to the green line, list in the
     yellow dots) */
  body:not(.mapembed) .mapcols { grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 300px); gap: 20px; }
  body:not(.mapembed) #map { height: max(560px, calc(100vh - 120px)); max-height: 980px; }
  body:not(.mapembed) .listbox .staysrow button img { width: 72px; height: 56px; }
}
/* full screen: the map and its card fill the screen */
.mapbox:fullscreen { background: var(--paper); }
.mapbox:fullscreen > #map { height: 100vh !important; max-height: none; }
