/* ════════════════════════════════════════════════════════════════
   Beyond Madeira — Explore map page
   Pixel-faithful replica of australia.com/en/explore.html
   Styles ONLY the classes/ids that explore.js actually emits.
═════════════════════════════════════════════════════════════════ */

:root {
  /* 6 category tile colours (exact australia.com) — also set inline by JS */
  --ex-attractions: #00783E;
  --ex-trips:       #A62A5E;
  --ex-events:      #00783E;
  --ex-hotels:      #EA2321;
  --ex-food:        #00A0AF;
  --ex-experiences: #FB9C07;

  /* brand / ui — teal aligned to the site token (--primary #0e5259) */
  --ex-teal:    #0e5259;
  --ex-ink:     #1a1d1f;
  --ex-ink-2:   #4b4f54;
  --ex-muted:   #767b80;
  --ex-faint:   #9aa0a6;
  --ex-line:    #e7e7e7;
  --ex-line-2:  #ededed;
  --ex-page:    #f4f8f9;
  --ex-hover:   #f2f2f2;
  --ex-gold:    #f5a623;

  --ex-nav-h:   64px;
  --ex-side-w:  375px;
  --ex-radius:  12px;
  --ex-shadow:  0 2px 14px rgba(20,28,34,.10);
  --ex-shadow-lg: 0 12px 38px rgba(20,28,34,.20);

  --ex-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--ex-font);
  color: var(--ex-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow: hidden; } /* page never scrolls; only .ex-side / map do */

button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ───────────────────────── TOP NAV ───────────────────────── */
.ex-nav {
  position: relative;
  z-index: 40;
  height: var(--ex-nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}

.ex-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ex-ink);
  white-space: nowrap;
}
.ex-logo svg { width: 24px; height: 24px; flex: none; }

.ex-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0 auto;
}
.ex-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ex-ink);
  padding: 6px 2px;
  position: relative;
  transition: color .15s;
}
.ex-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--ex-teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
.ex-links a:hover { color: var(--ex-teal); }
.ex-links a:hover::after { transform: scaleX(1); }

.ex-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.ex-ic {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ex-ink);
  transition: background .15s;
}
.ex-ic:hover { background: var(--ex-hover); }
.ex-ic svg { width: 22px; height: 22px; }

.ex-burger { display: none; }

/* ───────────────────────── SHELL / LAYOUT ───────────────────────── */
.ex-shell {
  position: relative;
  display: flex;
  height: calc(100vh - var(--ex-nav-h));
  height: calc(100dvh - var(--ex-nav-h));
  overflow: hidden;
}

.ex-side {
  width: var(--ex-side-w);
  flex: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ex-page);
  padding: 18px 18px 40px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd3d6 transparent;
  position: relative;
  z-index: 20;
}
.ex-side::-webkit-scrollbar { width: 8px; }
.ex-side::-webkit-scrollbar-thumb { background: #cbd3d6; border-radius: 8px; }
.ex-side::-webkit-scrollbar-track { background: transparent; }

/* drag handle — hidden on desktop */
.ex-handle { display: none; }

.ex-map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
#exMap { position: absolute; inset: 0; }

/* ───────────────────────── SEARCH ───────────────────────── */
.ex-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 62px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--ex-line);
  border-radius: 6px;
  transition: box-shadow .15s, border-color .15s;
}
.ex-search:focus-within {
  border-color: var(--ex-teal);
  box-shadow: 0 0 0 3px rgba(10,138,141,.12);
}
.ex-search svg {
  width: 20px; height: 20px;
  flex: none;
  color: var(--ex-faint);
}
.ex-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ex-ink);
}
.ex-search input::placeholder { color: var(--ex-faint); }

/* search dropdown — rows are <button.ex-sr> with .ex-sr-dot + .ex-sr-txt */
.ex-search-results {
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--ex-line);
  border-radius: 10px;
  box-shadow: var(--ex-shadow);
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
}
.ex-search-results[hidden] { display: none; }
.ex-sr {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid var(--ex-line-2);
}
.ex-sr:last-child { border-bottom: 0; }
.ex-sr:hover,
.ex-sr.active { background: var(--ex-page); }
.ex-sr-dot {
  width: 11px; height: 11px;
  flex: none;
  border-radius: 50%;
  background: var(--ex-muted); /* JS overrides via inline tile colour */
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.ex-sr-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.ex-sr-txt strong {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ex-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-sr-txt small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ex-muted);
  margin-top: 1px;
}

/* ───────────────────────── RESULTS LIST (active category) ───────────────────────── */
.ex-results {
  margin-top: 14px;
  background: #fff;
  border-radius: var(--ex-radius);
  box-shadow: var(--ex-shadow);
  overflow: hidden;
}
.ex-results[hidden] { display: none; }
.ex-res-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--ex-line-2);
}
.ex-res-head strong { font-size: 14.5px; font-weight: 700; color: var(--ex-ink); }
.ex-res-clear {
  border: 0;
  background: var(--ex-page);
  color: var(--ex-ink-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .15s;
}
.ex-res-clear:hover { background: var(--ex-hover); }
.ex-res {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;          /* comfortable touch row, not an admin table line */
  text-align: left;
  padding: 12px;
  border: 0;
  background: transparent;
  border-bottom: 1px solid var(--ex-line-2);
  cursor: pointer;
  transition: background .12s;
}
.ex-res:last-child { border-bottom: 0; }
.ex-res:hover { background: var(--ex-page); }
/* selected row mirrors the open map pin, so list and map never disagree */
.ex-res.selected { background: var(--ex-page); box-shadow: inset 3px 0 0 var(--ex-teal); }
.ex-res-img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ex-line-2);
}
.ex-res-img img { width: 100%; height: 100%; object-fit: cover; }
.ex-res-noimg { display: block; width: 100%; height: 100%; }
.ex-res-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
/* two lines beat an ellipsis: "Miradouro da Eira do Serrado" is a real name
   here, and truncating it to "Miradouro da Eira do..." helps nobody */
.ex-res-txt strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ex-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ex-res-txt small {
  font-size: 12px;
  color: var(--ex-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-res-rate { font-size: 12.5px; font-weight: 600; color: var(--ex-ink-2); margin-top: 3px; }
.ex-res-rate em { font-style: normal; font-weight: 500; color: var(--ex-muted); }
.ex-res-go { width: 18px; height: 18px; flex: 0 0 auto; color: #c2c8cc; }
.ex-res.selected .ex-res-go { color: var(--ex-teal); }

/* empty state — a way out, not a dead end */
.ex-res-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}
.ex-res-empty svg { width: 26px; height: 26px; color: var(--ex-muted); }
.ex-res-empty strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ex-ink-2);
  line-height: 1.45;
  max-width: 30ch;
}
.ex-res-reset {
  margin-top: 2px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ex-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ex-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ex-res-reset:hover { background: var(--ex-page); }

/* ── keyboard focus: visible on every interactive control on this page ── */
.ex-res:focus-visible,
.ex-cat:focus-visible,
.ex-fb-toggle:focus-visible,
.ex-fb-clear:focus-visible,
.ex-res-more:focus-visible,
.ex-res-reset:focus-visible,
.ex-handle:focus-visible {
  outline: 2px solid var(--ex-teal);
  outline-offset: 2px;
  border-radius: 10px;
}
.ex-res-more {
  display: block;
  width: 100%;
  padding: 13px;
  border: 0;
  background: var(--ex-page);
  color: var(--ex-teal);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .15s;
}
.ex-res-more:hover { background: var(--ex-hover); }

/* ───────────────────────── CATEGORY TILES ───────────────────────── */
/* JS emits: <button.ex-cat data-key><span.ex-cat-ic style=bg><svg/></span><span.ex-cat-lbl/></button> */
/* category chooser — opened by the Filters button. A vertical list, not a
   3x2 circle grid: the grid cost ~215px of sheet before a single result. */
.ex-cats {
  margin-top: 10px;
  background: #fff;
  border-radius: var(--ex-radius);
  box-shadow: var(--ex-shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ex-cats[hidden] { display: none; }
.ex-cat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.ex-cat:hover { background: #f4f7f8; }
.ex-cat.active { background: #eef4f5; }
.ex-cat-ic {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.ex-cat-ic svg {
  width: 18px; height: 18px;
  display: block;
}
.ex-cat-lbl {
  font-size: 15px;
  font-weight: 500;
  color: var(--ex-ink);
  text-align: left;
  line-height: 1.3;
}

.ex-cat.active .ex-cat-lbl { color: var(--ex-ink); font-weight: 600; }

/* ───────────────────────── SECTIONS / HEADINGS ───────────────────────── */
.ex-sec { margin-top: 26px; }
.ex-sec-h {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ex-ink);
  margin: 0 0 12px;
}

/* ───────────────────────── CAROUSELS / RAILS ───────────────────────── */
.ex-rail-wrap { position: relative; }
.ex-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.ex-rail::-webkit-scrollbar { display: none; height: 0; }

/* card = <button.ex-card> > <span.ex-card-img>(img|.ex-card-noimg) + <span.ex-card-name> */
.ex-card {
  position: relative;
  flex: 0 0 auto;
  width: 145px;
  height: 180px;
  border: 0;
  padding: 0;
  border-radius: var(--ex-radius);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  background: var(--ex-line-2);
  box-shadow: 0 2px 8px rgba(20,28,34,.10);
  display: block;
  text-align: left;
}
.ex-card-img {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--ex-line-2);
}
.ex-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.ex-card:hover .ex-card-img img { transform: scale(1.07); }
.ex-card-noimg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #d6e3e6, #c2d4d8);
}
/* dark bottom gradient for label legibility */
.ex-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64%;
  background: linear-gradient(to top, rgba(0,0,0,.74) 0%, rgba(0,0,0,.32) 46%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 1;
}
.ex-card-name {
  position: absolute;
  left: 12px; right: 12px;
  bottom: 11px;
  z-index: 2;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* itinerary cards: wider + meta line + colour bar */
.ex-card-itin { width: 200px; height: 188px; }
.ex-card-itin .ex-card-name { bottom: 28px; }
.ex-card-meta {
  position: absolute;
  left: 12px; right: 12px;
  bottom: 11px;
  z-index: 2;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  opacity: .94;
  text-shadow: 0 1px 3px rgba(0,0,0,.45);
}
/* colour bar pinned to the top of itinerary card image */
.ex-card-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  z-index: 2;
  background: var(--ex-teal);
}

/* article cards: anchor, slightly taller */
.ex-card-article { width: 210px; height: 200px; }

/* rail prev/next floating buttons */
.ex-rail-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ex-line);
  background: #fff;
  color: var(--ex-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(20,28,34,.18);
  opacity: 0;
  transition: opacity .15s, background .15s, box-shadow .15s;
  z-index: 5;
}
.ex-rail-btn svg { width: 20px; height: 20px; }
.ex-rail-btn.prev { left: -10px; }
.ex-rail-btn.next { right: -10px; }
.ex-rail-btn:hover { background: var(--ex-hover); box-shadow: 0 4px 12px rgba(20,28,34,.24); }
.ex-rail-wrap:hover .ex-rail-btn { opacity: 1; }
.ex-rail-btn[disabled] { opacity: 0 !important; pointer-events: none; }

/* ───────────────────────── FILTER BAR (active category + Filters) ─────────────────────────
   Replaces the category balloons that used to float over the map: they covered
   the thing the user came to look at, and duplicated the tile grid below. */
.ex-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;   /* the 320px sidebar can't fit chip + Filters side by side;
                        wrapping beats truncating the category to "Food &..." */
  gap: 10px;
  margin-top: 14px;
}
/* active category reads as the subject of the list; it takes the room */
.ex-fb-active {
  flex: 1 1 190px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 50px;                /* fits the 44px clear target with 3px breathing */
  padding: 0 3px 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ex-line);
  box-shadow: 0 2px 8px rgba(20,28,34,.08);
}
.ex-fb-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c, var(--ex-teal));
  flex: none;
}
.ex-fb-lbl {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ex-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-fb-clear {
  flex: none;
  width: 44px; height: 44px;   /* WCAG 2.2 target size — it was 36px */
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ex-ink-soft, #5b686f);
  cursor: pointer;
}
.ex-fb-clear:hover { background: rgba(20,28,34,.06); }
.ex-fb-clear svg { width: 17px; height: 17px; }
.ex-fb-toggle {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--ex-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ex-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20,28,34,.08);
  transition: background .15s, border-color .15s;
}
.ex-fb-toggle svg { width: 18px; height: 18px; }
.ex-fb-toggle:hover { background: #f6f8f9; }
.ex-filterbar.open .ex-fb-toggle {
  background: var(--ex-ink);
  border-color: var(--ex-ink);
  color: #fff;
}

/* ───────────────────────── BURGER DRAWER ───────────────────────── */
.ex-drawer-bd {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10,14,16,.4);
  opacity: 0;
  transition: opacity .25s ease;
}
.ex-drawer-bd.open { opacity: 1; }
.ex-drawer-bd[hidden] { display: none; }
.ex-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(320px, 86vw);
  background: #fff;
  box-shadow: -8px 0 30px rgba(20,28,34,.22);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  padding: 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.ex-drawer.open { transform: translateX(0); }
.ex-drawer[hidden] { display: none; }
.ex-drawer a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ex-ink);
  transition: background .12s;
}
.ex-drawer a:hover { background: var(--ex-page); }

/* ───────────────────────── MAP MARKERS ───────────────────────── */
/* JS emits: <div.mk[.mk-featured]> <span.pin style="--c"><img></span> <span.tag/> </div> */
.mk {
  position: relative;
  width: 38px;
  height: 38px;
  cursor: pointer;
  transition: transform .15s ease;
  will-change: transform;
}
/* invisible 44x44 halo so every pin is a comfortable touch target */
.mk::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.mk .pin {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  background: var(--c, var(--ex-line-2));
  box-shadow: 0 3px 10px rgba(0,0,0,.32);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mk .pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mk .tag {
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ex-ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  /* white text-halo so labels read over the map */
  text-shadow:
     1px  1px 0 #fff, -1px  1px 0 #fff,
     1px -1px 0 #fff, -1px -1px 0 #fff,
     0 2px 4px rgba(255,255,255,.9);
}
.mk:hover { z-index: 999; }
.mk:hover .pin { transform: scale(1.2); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.mk:hover .tag { opacity: 1; }

/* featured markers ride a touch larger */
.mk-featured .pin { width: 42px; height: 42px; }
.mk-featured { width: 42px; height: 42px; }

/* ───────────────────────── MAPLIBRE OVERRIDES ───────────────────────── */
.maplibregl-popup-content {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--ex-shadow-lg);
  font-family: var(--ex-font);
}
.maplibregl-popup-close-button {
  font-size: 20px;
  color: #fff;
  padding: 2px 8px;
  z-index: 2;
}
.maplibregl-popup-tip { display: none; }

.maplibregl-ctrl-top-right { top: 12px; right: 12px; }
.maplibregl-ctrl-bottom-right { bottom: 16px; right: 12px; }
.maplibregl-ctrl-bottom-left { bottom: 16px; left: 12px; }
.maplibregl-ctrl-group {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(20,28,34,.18);
}
.maplibregl-ctrl button { border-radius: 8px; }

/* ───────────────────────── DETAIL PANEL ───────────────────────── */
/* Visibility is driven by the [hidden] attribute only (JS toggles it). */
.ex-detail {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 30;
  width: 330px;
  max-height: calc(100% - 36px);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--ex-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: exDetailIn .24s ease both;
}
.ex-detail[hidden] { display: none; }
@keyframes exDetailIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ex-detail-img {
  position: relative;
  height: 160px;
  flex: none;
  background: linear-gradient(135deg, #d6e3e6, #c2d4d8);
}
.ex-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ex-detail-x {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  transition: background .15s;
}
.ex-detail-x:hover { background: rgba(0,0,0,.62); }
.ex-detail-x svg { width: 18px; height: 18px; }

.ex-detail-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ex-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ex-muted); /* JS overrides via inline tile colour */
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 9px;
}

.ex-detail-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--ex-ink);
  margin: 0 0 8px;
}

/* rating row — stars are ★/☆ text glyphs */
.ex-detail-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ex-ink-2);
  margin-bottom: 8px;
}
.ex-stars {
  color: var(--ex-gold);
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 1;
}
.ex-rating-num { font-weight: 600; color: var(--ex-ink); }
.ex-rating-count { color: var(--ex-muted); }

.ex-detail-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--ex-ink);
  margin-bottom: 8px;
}
.ex-detail-sub {
  font-size: 13.5px;
  color: var(--ex-muted);
  margin-bottom: 8px;
}

/* address / hours rows — JS gives plain text; we add an icon via ::before */
.ex-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ex-ink-2);
  margin-bottom: 7px;
}
.ex-detail-row::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  background: var(--ex-faint);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
.ex-detail-addr {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7-5.5-7-11a7 7 0 0114 0c0 5.5-7 11-7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.6' fill='black' stroke='none'/%3E%3C/svg%3E");
}
.ex-detail-hours {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E");
}
/* full weekly hours are a wall of text — keep the card scannable */
.ex-detail-hours {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ex-detail-hours::before { display: none; }
.ex-detail-hours {
  padding-left: 25px;
  position: relative;
}
.ex-detail-hours::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--ex-faint);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}

.ex-detail-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ex-ink-2);
  margin: 10px 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ex-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.ex-detail-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--ex-teal);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: background .15s, transform .08s;
}
.ex-detail-cta:hover { background: #0a3f45; }
.ex-detail-cta:active { transform: scale(.99); }
.ex-detail-dir {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--ex-teal);
  border-radius: 10px;
  background: #fff;
  color: var(--ex-teal);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .15s;
}
.ex-detail-dir:hover { background: rgba(10,138,141,.07); }
.ex-detail-dir svg { width: 18px; height: 18px; }
/* if there is no full page, Directions stretches to fill the row */
.ex-detail-dir:only-child { flex: 1 1 auto; }

/* pull-down grab bar — visible on mobile only */
.ex-detail-grab { display: none; }

/* ───────────────────────── ACTIVE-ITINERARY HEADER ───────────────────────── */
/* JS injects <div.ex-itin-hdr> when an itinerary is selected */
.ex-itin-hdr {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--ex-shadow);
}
.ex-itin-bar {
  width: 5px;
  align-self: stretch;
  min-height: 34px;
  border-radius: 3px;
  background: var(--ex-teal);
  flex: none;
}
.ex-itin-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}
.ex-itin-txt strong {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ex-ink);
}
.ex-itin-txt small {
  font-size: 12px;
  color: var(--ex-muted);
  margin-top: 2px;
}
.ex-itin-x {
  width: 30px; height: 30px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--ex-page);
  color: var(--ex-ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.ex-itin-x:hover { background: var(--ex-hover); }
.ex-itin-x svg { width: 16px; height: 16px; }

/* itinerary stop markers on the map */
.ex-stop {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--ex-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  cursor: pointer;
}

/* ───────────────────────── RESPONSIVE: TABLET ───────────────────────── */
@media (max-width: 1024px) {
  :root { --ex-side-w: 320px; }
  .ex-links { display: none; }
}

/* ───────────────────────── RESPONSIVE: MOBILE ───────────────────────── */
@media (max-width: 767px) {
  /* --ex-navbar: the app's bottom nav is fixed at z-index 1400 — far above the
     sheet (z 50). The sheet must stop above it, or the nav silently eats 60px:
     before this, a 200px peek showed 140px and cut the Filters button in half. */
  :root { --ex-nav-h: 56px; --ex-peek: 200px; --ex-navbar: 60px; }

  .ex-nav { gap: 12px; padding: 0 14px; }
  .ex-logo { font-size: 17px; }
  .ex-logo svg { width: 22px; height: 22px; }

  /* only the burger shows on the right */
  .ex-nav-right .ex-ic { display: none; }
  .ex-burger { display: inline-flex; }

  /* shell = full-screen map; side = bottom sheet */
  .ex-shell { display: block; position: relative; }
  .ex-map-wrap { position: absolute; inset: 0; height: 100%; }

  /* category chips float over the map */

  /* bottom sheet — frosted glass over the map, JS drives translateY.
     Two snap points only (peek/full), mirroring australia.com/en/explore.html:
     at full the radius squares off so the sheet reads as the screen, not a card. */
  .ex-side {
    position: absolute;
    left: 0; right: 0;
    bottom: var(--ex-navbar);   /* stop above the app nav, never under it */
    width: 100%;
    z-index: 50;
    height: calc(100vh - var(--ex-nav-h) - 10px - var(--ex-navbar));
    height: calc(100dvh - var(--ex-nav-h) - 10px - var(--ex-navbar));
    max-height: none;
    transform: translateY(calc(100% - var(--ex-peek))); /* peek fallback before JS runs */
    transition: transform .3s cubic-bezier(.32,.72,0,1), border-radius .2s linear;
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 28px rgba(20,28,34,.14);
    /* the sheet already ends above the nav, so this is just breathing room
       under the last row rather than a clearance hack */
    padding: 0 16px 24px;
    overflow-y: hidden; /* JS enables scroll only at full */
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .ex-side.dragging { transition: none; }
  /* full screen = no card edges, and the shadow has nothing left to sit against */
  .ex-side.at-full { border-radius: 0; box-shadow: none; }

  /* handle + search stay pinned so the sheet never scrolls its own chrome away */
  .ex-handle {
    display: block;
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    height: 32px;          /* 44px touch target once the search gap is counted */
    margin: 0;
    cursor: grab;
    /* Same tint as the sheet, not a whiter one: a denser white here read as a
       seam — a flat white band sitting on tinted glass, which is the exact
       "barra branca" complaint. Matching .72 + its own blur means the list
       softens away underneath instead of butting against a stripe. */
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .ex-handle::after {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(20,28,34,.22);
    margin: 12px auto 0;
  }

  .ex-side .ex-search {
    height: 56px;
    position: sticky;
    top: 32px;             /* directly under the handle */
    z-index: 5;
    margin-bottom: 4px;
    /* the input is opaque; this covers the 16px gutters either side of it so
       rows don't slide through the gap between sheet edge and input edge */
    background: rgba(255,255,255,.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  /* the sheet's 16px gutters stay empty (content shares the same padding box),
     so the pinned chrome must NOT bleed into them — it just looks broken */
  .ex-cats { margin-top: 14px; }
  .ex-results { margin-top: 12px; }

  /* map controls sit just above the peeking sheet */
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--ex-navbar) + var(--ex-peek) + 16px); }
  .maplibregl-ctrl-bottom-left { bottom: calc(var(--ex-navbar) + var(--ex-peek) + 16px); }
  /* pinch does the zooming — keep only geolocate */
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-in,
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-out { display: none; }
  .maplibregl-ctrl-scale { display: none; }

  /* detail = card sheet above the side sheet */
  .ex-detail {
    top: auto;
    left: 0; right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78vh;
    border-radius: 22px 22px 0 0;
    z-index: 60;
    animation: exDetailUp .26s ease both;
    transition: transform .25s cubic-bezier(.32,.72,0,1);
    touch-action: pan-y;
  }
  @keyframes exDetailUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .ex-detail-img { height: 190px; }
  .ex-detail-grab {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 26px;
    z-index: 3;
    pointer-events: none; /* visual only — the whole card is draggable; never block the X */
  }
  .ex-detail-grab::after {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.85);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    margin: 10px auto 0;
  }
  .ex-detail-body { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

  .ex-rail-btn { display: none; }
}

/* ───────────────────────── ACCESSIBILITY ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--ex-teal);
  outline-offset: 2px;
}

/* ── no-photo markers → small coloured dot ── */
.mk-dot .pin { width: 20px; height: 20px; background: var(--c); border-width: 2.5px; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.mk-dot .pin img { display: none; }
.mk-dot:hover .pin, .mk-dot.on .pin { transform: scale(1.35); }

/* ── section heading inline link (e.g. @beyondmadeira) ── */
.ex-sec-link { font-size: 13px; font-weight: 600; color: var(--ex-teal); margin-left: 6px; }

/* ── Reels rail (Instagram embeds) ── */
.ex-rail-reels { align-items: flex-start; }
.ex-reel { flex: 0 0 280px; max-width: 280px; }
.ex-reel .instagram-media {
  min-width: 0 !important; width: 280px !important; max-width: 280px !important;
  margin: 0 !important; border-radius: 12px !important; box-shadow: 0 2px 10px rgba(20,40,60,.10) !important;
}

/* ── map ALWAYS shows: bege base + loader ── */
#exMap { background: #ECE6D8; }
.ex-map-loader {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; background: #ECE6D8;
  color: var(--ex-muted, #767b80); font-size: 14px; pointer-events: none;
}
.ex-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(10,138,141,.25);
  border-top-color: var(--ex-teal, #0e5259); animation: exspin .8s linear infinite; }
@keyframes exspin { to { transform: rotate(360deg); } }

/* ── card rating chip (category rails) ── */
.ex-card-img { position: relative; }
.ex-card-rate {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(0,0,0,.62); color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px; backdrop-filter: blur(2px);
}

/* ── itinerary "app view" panel (overlays the sidebar) ── */
.ex-itin-panel {
  position: absolute; inset: 0; z-index: 40; background: #fff; overflow-y: auto;
  -webkit-overflow-scrolling: touch; animation: exItinIn .26s ease both;
}
@keyframes exItinIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.ex-itin-head { position: sticky; top: 0; background: #fff; padding: 18px 20px 14px; border-bottom: 1px solid var(--ex-line, #ececec); box-shadow: 0 4px 12px -8px rgba(0,0,0,.25); }
.ex-itin-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, #0e5259); }
.ex-itin-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ex-muted, #767b80); margin-bottom: 10px; }
.ex-itin-back svg { width: 16px; height: 16px; }
.ex-itin-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.ex-itin-meta { margin-top: 4px; font-size: 13px; color: var(--ex-muted, #767b80); font-weight: 500; }
.ex-itin-days { padding: 8px 16px 40px; }
.ex-itin-day { padding: 14px 0 6px; }
.ex-itin-dhead { font-size: 15px; font-weight: 700; margin: 6px 4px 10px; display: flex; align-items: center; gap: 8px; }
.ex-itin-dnum { background: var(--c, #0e5259); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: .02em; text-transform: uppercase; }
.ex-itin-stops { list-style: none; margin: 0; padding: 0; position: relative; }
.ex-itin-stops::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--ex-line, #ececec); }
.ex-itin-stop { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-radius: 12px; cursor: pointer; position: relative; }
.ex-itin-stop:hover { background: #f4f8f9; }
.ex-itin-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--c, #0e5259); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; z-index: 1; }
.ex-itin-thumb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #e6edef; }
.ex-itin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-itin-stxt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ex-itin-stxt strong { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.ex-itin-stxt small { font-size: 12px; color: var(--ex-muted, #767b80); }
.ex-itin-go { width: 18px; height: 18px; color: #c2c8cc; flex: 0 0 auto; }

/* ════════════════════════════════════════════════════════════════
   SHARED HEADER INTEGRATION (migrated off bespoke .ex-nav)
   The site header (#site-header, /js/header.js) is position:fixed and
   floats over the top of the page. This page never scrolls (body is
   overflow:hidden) and has no hero, so:
     1. It is forced into its solid state via `header-solid` on <body>
        (see explore.html) — otherwise the desktop bar / mobile glass
        capsule stays transparent with a white logo, illegible over the
        map. That class reuses header.css's existing solid rules; no
        colour overrides needed here.
     2. Reserve the header's real height at the top of the map shell so
        the map canvas + sidebar + MapLibre controls start below it.
   --ex-nav-h is that reserved offset, matched to header.css:
     ≥1024px  → #site-header height 72px
     <1024px  → floating capsule ≈ 60px (10px top pad + 50px inner)
═════════════════════════════════════════════════════════════════ */
.explore-page { --ex-nav-h: 60px; }

@media (min-width: 1024px) {
  .explore-page { --ex-nav-h: 72px; }
}

/* Push the whole map shell below the fixed header. The base .ex-shell
   height rule (100dvh - --ex-nav-h) then leaves exactly the right space,
   on both desktop (flex split) and mobile (absolute map + bottom sheet). */
.explore-page .ex-shell { margin-top: var(--ex-nav-h); }
