/* =================================================================
   MAP - TRAVEL SECTION
   All Leaflet overrides and map-component styles live here.
================================================================= */

/* --- OUTER CONTAINER ------------------------------------------ */
#travel-map {
  max-width: 1100px;
  margin: 0 auto 60px;
}

/* --- FILTER BAR ----------------------------------------------- */
.map-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 14px;
}

.map-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-filter-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #999;
  margin-right: 4px;
  text-transform: uppercase;
}

.map-filter-btn {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 18px;
  border: 1px solid #ccc;
  color: #aaa;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.map-filter-btn--active {
  border-color: var(--gold);
  color: var(--gold);
}

.map-filter-btn:hover:not(.map-filter-btn--active) {
  border-color: #999;
  color: #777;
}

/* Legend */
.map-legend {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot--hotspot { background: #BD974E; }
.legend-dot--travel  { background: #4A7FC1; }

.legend-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #999;
}

/* --- MAP BODY (leaflet + panel side by side on desktop) ------- */
.map-body {
  display: flex;
  border: 1px solid rgba(189,151,78,0.25);
}

#leaflet-map {
  flex: 1;
  height: 500px;
  min-width: 0;
  z-index: 0;
}

/* --- INFO PANEL ----------------------------------------------- */
#map-info-panel {
  width: 36px;        /* collapsed by default */
  flex-shrink: 0;
  background: #F9F7F2;
  border-left: 1px solid rgba(189,151,78,0.2);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  transition: width 0.3s ease;
}

#map-info-panel.panel--open {
  width: 220px;
}

/* Toggle strip — always visible on the left edge of the panel */
#panel-toggle {
  width: 36px;
  min-width: 36px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(189,151,78,0.12);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

#panel-toggle:hover {
  background: rgba(189,151,78,0.06);
}

/* Label text inside the toggle — visible on mobile only */
.toggle-label {
  display: none;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.toggle-chevron {
  width: 15px;
  height: 15px;
  color: var(--gold);
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

#panel-toggle:hover .toggle-chevron { opacity: 1; }

/* Rotate chevron 180deg when open (> becomes <) */
#map-info-panel.panel--open .toggle-chevron {
  transform: rotate(180deg);
}

/* Panel content area — fades in once panel is open */
.panel-content {
  flex: 1;
  min-width: 184px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#map-info-panel.panel--open .panel-content {
  opacity: 1;
  transition: opacity 0.25s ease 0.18s;
}

.map-panel-icon {
  width: 28px;
  height: 28px;
  color: var(--gold);
  opacity: 0.55;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.map-panel-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.map-panel-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: #bbb;
  line-height: 1.75;
}

/* --- CUSTOM TEARDROP MARKERS ---------------------------------- */
.leaflet-div-icon { background: none !important; border: none !important; }

.marker-pin {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.marker-pin:hover {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.marker-pin::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
}

.marker-hotspot { background: #BD974E; }
.marker-travel  { background: #4A7FC1; }

/* --- CUSTOM POPUP --------------------------------------------- */
.map-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(189,151,78,0.3);
}

.map-popup .leaflet-popup-content {
  margin: 0;
  line-height: 1;
  width: 400px !important;
}

.map-popup .leaflet-popup-tip-container { display: none; }

.map-popup .leaflet-popup-close-button {
  color: #bbb !important;
  font-size: 20px !important;
  line-height: 20px !important;
  padding: 6px 9px !important;
  top: 2px !important;
  right: 2px !important;
  transition: color 0.2s;
}

.map-popup .leaflet-popup-close-button:hover { color: #555 !important; }

.popup-inner { padding: 10px 18px 12px; }

.popup-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 3px;
  line-height: 1.2;
  padding-right: 24px;
}

.popup-type {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.popup-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: #888;
  line-height: 1.7;
  border-top: 1px solid rgba(189,151,78,0.15);
  padding-top: 8px;
}

.leaflet-control-attribution { font-size: 10px; }

/* --- RESPONSIVE ----------------------------------------------- */
@media (max-width: 768px) {
  .map-body { flex-direction: column; }

  /* flex: none prevents flex-basis:0 from collapsing the height to 0
     in a column-direction flex container with auto parent height. */
  #leaflet-map {
    flex: none;
    height: 380px;
  }

  /* Pad the filter bar so text doesn't clip at screen edges */
  .map-filter-bar {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Panel stacks below map and collapses vertically */
  #map-info-panel {
    width: 100%;
    flex-direction: column;
    border-left: none;
    border-top: 1px solid rgba(189,151,78,0.2);
    overflow: hidden;
    transition: none;
  }

  /* Toggle is a full-width horizontal bar with label + chevron */
  #panel-toggle {
    width: 100%;
    height: 44px;
    border-right: none;
    border-bottom: 1px solid rgba(189,151,78,0.12);
    justify-content: space-between;
    padding: 0 18px;
  }

  .toggle-label { display: block; }

  /* Chevron down when collapsed, up when open */
  .toggle-chevron               { transform: rotate(90deg); }
  #map-info-panel.panel--open .toggle-chevron { transform: rotate(-90deg); }

  /* Content hidden when collapsed, horizontal row when open */
  .panel-content {
    display: none;
    min-width: 0;
    opacity: 1;
    transition: none;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 18px 20px;
    gap: 16px;
    text-align: left;
  }

  #map-info-panel.panel--open .panel-content {
    display: flex;
    opacity: 1;
    transition: none;
  }

  .map-panel-icon { margin-bottom: 0; }
  .map-panel-text { font-size: 13px; }
  .map-filter-bar { gap: 10px; }
  .map-legend     { gap: 14px; }
}
