/* Tasmania Wine & Booze — Explore Map styles */

/* Force the /explore/ page out of the normal content-width container so
   the map fills the full viewport width. Targets common WP wrappers. */
/* Only target containers inside the CONTENT area — never #masthead/header,
   which has its own .container for logo + nav layout. */
body.tasdir-explore-active #primary.listdomer-primary,
body.tasdir-explore-active #primary.listdomer-primary > #content,
body.tasdir-explore-active #content.site-content,
body.tasdir-explore-active #content.container-fluid,
body.tasdir-explore-active .site-main,
body.tasdir-explore-active .entry-content,
body.tasdir-explore-active #content .container,
body.tasdir-explore-active .site-main .container,
body.tasdir-explore-active .entry-content .container {
  max-width: none !important;
  width: 100vw !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
}

/* Hide the sidebar on the /explore/ page so the map uses full width */
body.page aside#secondary:has(~ * #tasdir-explore-wrap),
body.tasdir-explore-active aside#secondary {
  display: none !important;
}

/* Hide page title / breadcrumb / entry header on /explore/ — map is the hero.
   Scoped to content area only so the SITE header (#masthead) stays visible. */
body.tasdir-explore-active #primary > .listdomer-header,
body.tasdir-explore-active #primary.listdomer-primary > .listdomer-header,
body.tasdir-explore-active #content .listdomer-header,
body.tasdir-explore-active article .entry-header,
body.tasdir-explore-active main .entry-header,
body.tasdir-explore-active #content .entry-header,
body.tasdir-explore-active #primary .page-header,
body.tasdir-explore-active .post-header,
body.tasdir-explore-active article h1.entry-title,
body.tasdir-explore-active #primary h1.page-title,
body.tasdir-explore-active .wp-block-post-title,
body.tasdir-explore-active .listdomer-page-title,
body.tasdir-explore-active #primary .listdomer-breadcrumbs,
body.tasdir-explore-active #primary .breadcrumbs,
body.tasdir-explore-active #primary .lsd-breadcrumbs,
body.tasdir-explore-active .tasdir-style-label {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Translucent SITE header (masthead) overlays the map. Extra-specific
   selectors (html > body) so they beat any theme-level style. */
html body.tasdir-explore-active #masthead,
html body.tasdir-explore-active header.site-header,
html body.tasdir-explore-active header#masthead,
html body.tasdir-explore-active .site-header {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important;
  width: 100% !important;
  height: auto !important;
  z-index: 9999 !important;
  background-color: rgba(251, 247, 238, 0.55) !important;
  backdrop-filter: blur(18px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.3) !important;
  box-shadow: none !important;
  overflow: visible !important;
  border: 0 !important;
  transform: none !important;
  pointer-events: auto !important;
  isolation: isolate !important;
  padding-top: 22px !important;
  padding-bottom: 26px !important;      /* room for brush-stroke decoration */
  min-height: 92px !important;          /* consistent shell for vertical centring */
  border-bottom: 0 !important;
}

/* Amber brush-stroke behind each top-level menu item (Regions, Makers,
   Explore, My Favourites, Blog, About Us, Contact Us). Matches the
   widget-title brush used elsewhere on the site. */
html body.tasdir-explore-active #primary-menu > li > a,
html body.tasdir-explore-active #site-navigation > ul > li > a,
html body.tasdir-explore-active .lsdr-site-header-type6 #primary-menu > li > a {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60' preserveAspectRatio='none'><path d='M4,34 C40,14 88,50 140,26 C190,6 230,48 296,22 L296,50 C240,58 190,44 140,56 C90,66 40,50 4,58 Z' fill='%23C8872D' opacity='0.28'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: center 72% !important;
  background-size: 92% 55% !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* Kill any box-shadow on every nested header wrapper — theme adds
   drop shadows on .site-header-inner, .header-main etc. */
html body.tasdir-explore-active #masthead,
html body.tasdir-explore-active #masthead *,
html body.tasdir-explore-active header.site-header,
html body.tasdir-explore-active header.site-header * {
  box-shadow: none !important;
  filter: none !important;
}

/* Menu vertical alignment — DO NOT touch inner wrappers; let Listdomer's
   own layout handle menu dropdowns. Only adjust the top-level row. */
body.tasdir-explore-active #masthead > .header-main,
body.tasdir-explore-active #masthead > .header-row,
body.tasdir-explore-active #masthead > .listdomer-header-wrapper {
  align-items: center !important;
}

/* Type-6 header: centre nav vertically within the header shell */
html body.tasdir-explore-active .lsdr-site-header-type6 {
  display: flex !important;
  align-items: center !important;
}
html body.tasdir-explore-active .lsdr-site-header-type6 #site-navigation,
html body.tasdir-explore-active .lsdr-site-header-type6 .main-navigation {
  align-self: center !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Keep header below logged-in admin bar */
body.tasdir-explore-active.admin-bar #masthead { top: 32px !important; }
@media (max-width: 782px) {
  body.tasdir-explore-active.admin-bar #masthead { top: 46px !important; }
}
/* Clear backgrounds on every nested wrapper inside masthead so the
   translucent outer bg is what the user actually sees. */
body.tasdir-explore-active #masthead > *,
body.tasdir-explore-active #masthead .site-header-inner,
body.tasdir-explore-active #masthead .site-branding,
body.tasdir-explore-active #masthead .site-header-wrapper,
body.tasdir-explore-active #masthead .header-wrapper,
body.tasdir-explore-active #masthead .header-main,
body.tasdir-explore-active #masthead .header-row,
body.tasdir-explore-active #masthead .header-top,
body.tasdir-explore-active #masthead .header-bottom,
body.tasdir-explore-active #masthead .listdomer-header-inner,
body.tasdir-explore-active #masthead .listdomer-header-wrapper,
body.tasdir-explore-active #masthead .navigation-container,
body.tasdir-explore-active #masthead .main-navigation,
body.tasdir-explore-active #masthead nav {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
/* Map wrap now gets full viewport height, no gap under header */
body.tasdir-explore-active #tasdir-explore-wrap {
  height: 100vh !important;
  margin-top: 0 !important;
}

#tasdir-explore-wrap {
  position: relative;
  width: 100vw;
  height: calc(100vh - 80px); /* allow header to show above */
  min-height: 600px;
  background: #0b1924;
  overflow: hidden;
  /* Break out of any remaining padded parents using negative margins */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

#tasdir-explore-cesium {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tasdir-explore-error {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #FBF7EE; text-align: center;
  font-family: "DM Sans", sans-serif;
  padding: 32px;
}
.tasdir-explore-error h2 {
  font-family: "DM Serif Display", Georgia, serif; font-weight: 400;
  font-size: 32px; margin: 0 0 12px;
}

/* Control panel — top-right filter chips */
.tasdir-explore-controls {
  position: absolute; top: 110px; right: 20px; z-index: 25;
  display: flex; flex-wrap: wrap; gap: 8px;
  background: rgba(251, 247, 238, 0.92);
  padding: 12px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.tasdir-explore-controls .tasdir-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: 500 13px "DM Sans", sans-serif; color: #2A1E16;
  background: #FBF7EE; border: 1px solid #D4CDBF;
  transition: all 0.15s;
  user-select: none;
}
.tasdir-explore-controls .tasdir-chip:hover { background: #F3EADB; }
.tasdir-explore-controls .tasdir-chip.is-off {
  opacity: 0.4; text-decoration: line-through;
}
.tasdir-explore-controls .tasdir-dot {
  width: 22px; height: 22px; border-radius: 0;
  background: transparent !important;       /* override inline background colour */
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
/* Replace colour-dot with Lordicon-based glyph per category */
[data-tasdir-filter="winery"]     .tasdir-dot { background-image: url('icons/chips/winery.svg?v=1.9.6') !important; }
[data-tasdir-filter="distillery"] .tasdir-dot { background-image: url('icons/chips/distillery.svg?v=1.9.6') !important; }
[data-tasdir-filter="brewery"]    .tasdir-dot { background-image: url('icons/chips/brewery.svg?v=1.9.6') !important; }
[data-tasdir-filter="cidery"]     .tasdir-dot { background-image: url('icons/chips/cidery.svg?v=1.9.6') !important; }
.tasdir-explore-controls .tasdir-count {
  font-size: 11px; opacity: 0.7; margin-left: 2px;
}

.tasdir-explore-reset {
  position: absolute; top: 110px; left: 20px; z-index: 25;  /* below header (h ~80px) */
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  background: rgba(251, 247, 238, 0.92); color: #2A1E16;
  border: 1px solid #D4CDBF;
  font: 500 13px "DM Sans", sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.tasdir-explore-reset:hover { background: #F3EADB; }

/* Leaflet's built-in zoom controls — pushed below header */
body.tasdir-explore-active .leaflet-top.leaflet-left {
  top: 100px !important;
}

/* Zoom + tilt control strip — sits below Reset View */
.tasdir-explore-zoom-controls {
  position: absolute; top: 162px; left: 20px; z-index: 25;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(251, 247, 238, 0.92);
  border: 1px solid #D4CDBF;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.tasdir-zoom-btn {
  width: 36px; height: 36px; padding: 0;
  background: #FBF7EE; color: #2A1E16;
  border: 1px solid #D4CDBF;
  border-radius: 6px; cursor: pointer;
  font: 600 18px "DM Sans", sans-serif;
  line-height: 1;
  transition: background 0.15s;
  user-select: none;
}
.tasdir-zoom-btn:hover { background: #F3EADB; }
.tasdir-zoom-btn:active { background: #C89F4C; color: #FBF7EE; }

/* Leaflet popup — restyled with brand palette; attached to pin so it
   auto-positions above the marker and auto-pans the map if needed. */
.leaflet-popup.tasdir-popup .leaflet-popup-content-wrapper {
  background: #FBF7EE !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3) !important;
  padding: 0 !important;
  font-family: "DM Sans", sans-serif;
  overflow: hidden;
}
.leaflet-popup.tasdir-popup .leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
}
.leaflet-popup.tasdir-popup .leaflet-popup-tip {
  background: #FBF7EE !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12) !important;
}
.leaflet-popup.tasdir-popup .leaflet-popup-close-button {
  top: 6px !important; right: 6px !important;
  width: 28px !important; height: 28px !important;
  border-radius: 50% !important;
  background: rgba(42,30,22,0.8) !important;
  color: #FBF7EE !important;
  font: 700 16px/28px sans-serif !important;
  text-align: center !important;
  z-index: 2 !important;
}
.leaflet-popup.tasdir-popup .leaflet-popup-close-button:hover {
  background: #6D1F2C !important;
}

/* Info card (fallback — legacy, kept for backwards compat) */
#tasdir-explore-card {
  position: absolute; bottom: 80px; left: 90px; z-index: 30;    /* above header */
  width: 340px; max-width: calc(100% - 40px);
  background: #FBF7EE; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  overflow: hidden;
  opacity: 0; pointer-events: none; visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
  font-family: "DM Sans", sans-serif;
}
#tasdir-explore-card.is-visible {
  opacity: 1; pointer-events: auto; visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s, visibility 0s;
}
.tasdir-card-close {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(42,30,22,0.8); color: #FBF7EE;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.tasdir-card-thumb {
  width: 100%; height: 160px; object-fit: cover; display: block;
}
.tasdir-card-thumb-fallback {
  display: flex !important; align-items: center; justify-content: center;
  width: 100%; height: 160px;
}
/* Hard-coded per-category fallback backgrounds so a listing with no photo
   always shows the matching brand colour. Wins over any theme override. */
.tasdir-popup .tasdir-cat-winery,
.leaflet-popup.tasdir-popup .tasdir-cat-winery { background-color: #6D1F2C !important; }
.tasdir-popup .tasdir-cat-distillery,
.leaflet-popup.tasdir-popup .tasdir-cat-distillery { background-color: #2A1E16 !important; }
.tasdir-popup .tasdir-cat-brewery,
.leaflet-popup.tasdir-popup .tasdir-cat-brewery { background-color: #C89F4C !important; }
.tasdir-popup .tasdir-cat-cidery,
.leaflet-popup.tasdir-popup .tasdir-cat-cidery { background-color: #2F5132 !important; }
/* Cream glyph centred inside the coloured block */
.tasdir-fallback-glyph {
  width: 72px; height: 72px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.tasdir-card-region-icon {
  display: inline-block; margin-right: 4px; font-size: 11px;
  transform: translateY(-1px); opacity: 0.8;
}
.tasdir-card-body { padding: 16px 20px 20px; }
.tasdir-card-cat {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #FBF7EE;
  margin-bottom: 8px;
}
.tasdir-card-name {
  font-family: "DM Serif Display", Georgia, serif; font-weight: 400;
  font-size: 24px; color: #2A1E16; margin: 0 0 4px;
  line-height: 1.1;
}
.tasdir-card-region {
  font-size: 13px; color: #6B4B32; margin: 0 0 14px;
}
.tasdir-card-cta {
  display: inline-block; padding: 9px 18px; border-radius: 6px;
  background: #6D1F2C; color: #FBF7EE !important;
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.tasdir-card-cta:hover { background: #8C2D3E; }

/* Loading overlay — shown while 3D Tiles stream */
.tasdir-explore-loading {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
  color: #FBF7EE;
  font-family: "DM Sans", sans-serif;
  transition: opacity 0.4s ease;
}
.tasdir-explore-loading.is-hidden { opacity: 0; pointer-events: none; }
.tasdir-loading-card {
  text-align: center;
  padding: 32px 40px;
  background: rgba(251, 247, 238, 0.08);
  border: 1px solid rgba(251, 247, 238, 0.15);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
.tasdir-loading-spinner {
  width: 40px; height: 40px; margin: 0 auto 16px;
  border: 3px solid rgba(251, 247, 238, 0.2);
  border-top-color: #C89F4C;
  border-radius: 50%;
  animation: tasdir-spin 0.9s linear infinite;
}
.tasdir-loading-card p {
  margin: 0; font-size: 14px; letter-spacing: 0.04em;
  opacity: 0.9;
}
@keyframes tasdir-spin {
  to { transform: rotate(360deg); }
}

/* =======================================================================
   Ocean styling variants — activated via the tasdir-style-XXXX class
   added to #tasdir-explore-wrap by JS. Overlays sit above the Cesium
   canvas but below the UI controls.
   ======================================================================= */

.tasdir-style-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;  /* above Cesium canvas (z 0), below controls (z 5+) */
}

/* --- Option 2 — Flat navy ocean — REMOVED (reverted per review).
   /explore-flat-ocean/ now renders identical to baseline. The page
   can be deleted later if not needed. --- */

/* --- Option 3 — Deep gradient vignette --- */
.tasdir-style-overlay-deep-gradient {
  background:
    radial-gradient(
      ellipse at 50% 55%,
      rgba(10, 20, 34, 0) 32%,
      rgba(10, 20, 34, 0.55) 65%,
      rgba(6, 12, 24, 0.95) 100%
    );
}

/* --- Option 4 — Sepia chart / vintage tourism-map --- */
#tasdir-explore-wrap.tasdir-style-sepia,
#tasdir-explore-wrap.tasdir-style-sepia #tasdir-explore-cesium,
#tasdir-explore-wrap.tasdir-style-sepia canvas {
  filter: sepia(0.9) saturate(0.7) contrast(1.1) brightness(0.96) hue-rotate(-12deg);
}
.tasdir-style-overlay-sepia {
  background: rgba(200, 159, 76, 0.18);  /* tw-amber cast */
  mix-blend-mode: multiply;
}

/* --- Option 5 — Cropped island (ocean fades to cream) --- */
.tasdir-style-overlay-island-only {
  background: radial-gradient(
    ellipse 28% 42% at 55% 62%,
    rgba(251, 247, 238, 0) 48%,
    rgba(251, 247, 238, 0.7) 72%,
    rgba(251, 247, 238, 1) 90%
  );
}
#tasdir-explore-wrap.tasdir-style-island-only {
  background: #FBF7EE;
}

/* ---- Unified 2D style toggle (bottom-centre) ---- */
.tasdir-explore-style-toggle {
  position: absolute;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 4px;
  background: rgba(251, 247, 238, 0.94);
  border: 1px solid #D4CDBF;
  border-radius: 999px;
  padding: 5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.tasdir-style-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 999px;
  background: transparent; color: #2A1E16;
  border: 0; cursor: pointer;
  font: 500 13px "DM Sans", sans-serif;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tasdir-style-btn:hover { background: #F3EADB; color: #2A1E16; }
.tasdir-style-btn.is-active {
  background: #6D1F2C;
  color: #FBF7EE;
}
.tasdir-style-btn.is-active:hover { background: #6D1F2C; color: #FBF7EE; }
.tasdir-style-btn-icon { font-size: 15px; line-height: 1; }
.tasdir-style-btn-link {
  border-left: 1px solid #D4CDBF;
  margin-left: 4px; padding-left: 18px;
  color: #6B4B32;
}
.tasdir-style-btn-link:hover { color: #2F5132; background: transparent; }

/* ---- Leaflet 2D variants (watercolor, mapbox-outdoors) ---- */
#tasdir-explore-wrap.tasdir-is-2d #tasdir-explore-cesium {
  width: 100%; height: 100%;
}
#tasdir-explore-wrap.tasdir-is-2d .leaflet-container {
  background: #FBF7EE;  /* oat while tiles load */
}
/* Watercolour style: tone down the random vivid greens (national-park
   renderings in Stamen) so they blend with the painted wash instead of
   looking like random patches. Slight saturation drop + hue nudge. */
#tasdir-explore-wrap.tasdir-style-watercolor .leaflet-tile,
#tasdir-explore-wrap.tasdir-style-unified-2d .leaflet-tile {
  filter: saturate(0.75) hue-rotate(-5deg);
}

.tasdir-cluster-wrap { background: transparent; border: 0; }
.tasdir-cluster-wrap svg { display: block; }

/* Style Leaflet's native zoom controls to match brand */
#tasdir-explore-wrap .leaflet-control-zoom {
  border: 1px solid #D4CDBF !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin: 20px !important;
}
#tasdir-explore-wrap .leaflet-control-zoom a {
  background: rgba(251, 247, 238, 0.96) !important;
  color: #2A1E16 !important;
  border-bottom: 1px solid #D4CDBF !important;
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font: 700 18px "DM Sans", sans-serif !important;
}
#tasdir-explore-wrap .leaflet-control-zoom a:last-child { border-bottom: 0 !important; }
#tasdir-explore-wrap .leaflet-control-zoom a:hover {
  background: #F3EADB !important;
  color: #2A1E16 !important;
}
.tasdir-leaflet-pin { filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }

/* Leaflet attribution control — subtle, small */
#tasdir-explore-wrap.tasdir-is-2d .leaflet-control-attribution {
  font: 400 10px "DM Sans", sans-serif;
  background: rgba(251,247,238,0.85);
  color: #2A1E16;
  border-radius: 4px;
  padding: 2px 8px;
}
#tasdir-explore-wrap.tasdir-is-2d .leaflet-control-attribution a { color: #2F5132; }

/* --- Option 6 — Hatched / stippled ocean (nautical chart) --- */
.tasdir-style-overlay-textured {
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(42, 30, 22, 0) 0,
      rgba(42, 30, 22, 0) 6px,
      rgba(42, 30, 22, 0.25) 6px,
      rgba(42, 30, 22, 0.25) 8px
    );
  mix-blend-mode: multiply;
}

/* Variant labels — small pill top-centre showing which style is active */
.tasdir-style-label {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 6;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(251, 247, 238, 0.92);
  border: 1px solid #D4CDBF;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  backdrop-filter: blur(6px);
  font: 500 12px "DM Sans", sans-serif;
  color: #2A1E16;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Mobile */
@media (max-width: 767px) {
  #tasdir-explore-wrap { height: calc(100vh - 60px); min-height: 500px; }
  .tasdir-explore-controls { top: 12px; right: 12px; padding: 8px; }
  .tasdir-explore-controls .tasdir-chip { padding: 5px 10px; font-size: 12px; }
  .tasdir-explore-reset { top: 12px; left: 12px; padding: 8px 12px; font-size: 12px; }
  #tasdir-explore-card { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .tasdir-card-thumb { height: 120px; }
}
