/* Hide Alpine elements until initialized */
[x-cloak] { display: none !important; }

/* HTMX transitions */
.htmx-added {
  animation: fadeIn 200ms ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.htmx-request #content {
  opacity: 0.6;
  transition: opacity 200ms;
}

/* HTMX indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

/* Hide page content behind fullscreen map.
   Uses display:none (not visibility:hidden) so canvas/Chart.js elements
   don't bleed through the fullscreen overlay. */
body.mh-fullscreen > *:not(:has(.leaflet-fullscreen-on)) {
  display: none !important;
}

/* Map container — responsive height */
.mh-map {
  height: 350px;
  border-radius: 0.5rem;
  z-index: 0;
}

/* Tall map for dedicated map pages */
.mh-map.mh-map-tall {
  height: 60vh;
  min-height: 400px;
  max-height: 800px;
}

/* Small dot markers for access sites and shops */
.mh-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}

/* Cluster markers */
.mh-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0.85;
  cursor: pointer;
}

/* Map marker labels — shared base */
.map-label {
  background: rgba(255,255,255,0.92);
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  padding: 1px 6px;
  font-size: 11px;
  color: #44403c;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.map-label::before {
  display: none;
}
/* Color-coded left border per layer type */
.label-gauge  { border-left: 3px solid #1a4d6e; }
.label-access { border-left: 3px solid #2d8659; }
.label-shop   { border-left: 3px solid #d97706; }

/* Home/reset-view button */
.leaflet-bar a.mh-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.leaflet-bar a.mh-home-btn:hover {
  background: #f4f4f4;
}

/* Location dot — "you are here" marker */
.mh-loc-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4285F4;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.mh-loc-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(66,133,244,0.2);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: mh-pulse 2s ease-out infinite;
}
@keyframes mh-pulse {
  0% { transform: translate(-50%,-50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(2); opacity: 0; }
}

/* Locate/geolocation button */
.leaflet-bar a.mh-locate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.leaflet-bar a.mh-locate-btn:hover {
  background: #f4f4f4;
}

/* Leaflet popups above controls on mobile */
.leaflet-popup {
  z-index: 1001 !important;
}

/* Internal navigation links in map popups */
.popup-link {
  color: #1a4d6e;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}
.popup-link:hover {
  text-decoration: underline;
}


/* Gauge dot marker */
.mh-gauge-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a4d6e;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}

/* Stretched link: makes entire card clickable via ::after overlay */
.stretched-link::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
}

/* Card hover lift effect */
.card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card-hover:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Card chevron — nudges right on hover */
.card-chevron {
  transition: transform 200ms ease, color 200ms ease;
}
.card-hover:hover .card-chevron {
  color: #1a4d6e;
  transform: translateX(3px);
}

/* Focus-visible rings for keyboard navigation */
a:focus-visible, button:focus-visible {
  outline: 2px solid #1a4d6e;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Active nav link */
.nav-link-active {
  color: #d4a574;
}

/* ═══ Logo ═══ */
.logo {
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo .mtn-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  z-index: 1;
  line-height: 0;
}
.logo .trout-wrap {
  position: relative;
  z-index: 2;
  line-height: 0;
}
.logo .word-montana {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 5px;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  margin-top: -3px;
}
.logo .word-hatch {
  font-family: 'Yellowtail', cursive;
  font-size: 44px;
  line-height: 0.85;
  position: relative;
  z-index: 2;
  margin-top: -4px;
}

/* Full size defaults */
.logo .mtn-bg svg { width: 180px; height: 60px; }
.logo .trout-wrap svg { width: 88px; height: 88px; }

/* Cream page background */
.logo.on-cream .mtn-bg svg { fill: rgba(26,77,110,0.05); }
.logo.on-cream .trout-wrap svg { fill: #1a4d6e; opacity: 0.35; }
.logo.on-cream .word-montana { color: rgba(26,77,110,0.45); }
.logo.on-cream .word-hatch { color: #1a4d6e; }

/* Dark footer background */
.logo.on-dark .mtn-bg svg { fill: rgba(255,255,255,0.05); }
.logo.on-dark .trout-wrap svg { fill: #d4a574; opacity: 0.5; }
.logo.on-dark .word-montana { color: rgba(255,255,255,0.45); }
.logo.on-dark .word-hatch { color: #f5f0e8; }

/* Footer medium size — left-aligned, fish+text centered on mountains */
.logo.medium-size { align-items: center; text-align: center; width: 130px; }
.logo.medium-size .mtn-bg { left: 50%; transform: translate(-50%, -46%); }
.logo.medium-size .mtn-bg svg { width: 130px; height: 44px; }
.logo.medium-size .trout-wrap svg { width: 60px; height: 60px; }
.logo.medium-size .word-montana { font-size: 10px; letter-spacing: 4px; }
.logo.medium-size .word-hatch { font-size: 32px; }

/* External link indicator */
.ext-link::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2em;
  vertical-align: baseline;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5l-2-2-3 3-2-2 3-3zm0 2v3h-4v5h5v-4h3v6H3V5z'/%3E%3C/svg%3E") no-repeat center/contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5l-2-2-3 3-2-2 3-3zm0 2v3h-4v5h5v-4h3v6H3V5z'/%3E%3C/svg%3E") no-repeat center/contain;
}
