/* =====================================================================
   Map of the sights (Figma "Χάρτης Αξιοθέατων" + "Filter Panel")
   The map fills the band; the filters float on it, top left, in the page gutter.
   ===================================================================== */

#map {
  position: relative;
  margin-bottom: 0 !important;
}

#map-container {
  height: clamp(440px, 3.5vw + 413px, 480px);
}

/* ----- Filter panel ----- */
#map .map-filters-wrapper {
  position: absolute;
  top: 32px;
  left: var(--sf-gutter);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 320px;
  max-width: calc(100% - 2 * var(--sf-gutter));
  max-height: calc(100% - 64px);
  overflow-y: auto;
  padding: 20px 24px 24px;
  color: var(--sf-text);
  background-color: var(--sf-surface);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow-panel);
}

#map .map-filters-wrapper:not(.open) {
  padding-bottom: 20px;
}

/* The title folds the list away */
#map .filters-toggler {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  color: var(--sf-text);
  background: none;
  border: none;
  font-size: var(--sf-fs-h3);
  font-weight: 700;
  line-height: var(--sf-lh-card);
  text-align: left;
}

#map .filters-toggler i {
  color: var(--sf-brand);
  font-size: 14px;
  transition: transform var(--sf-transition);
}

#map .map-filters-wrapper:not(.open) .filters-toggler i {
  transform: rotate(180deg);
}

#map .filters-toggler:focus-visible {
  outline: var(--sf-focus-ring);
  outline-offset: 4px;
  border-radius: var(--sf-radius-xs);
}

#map .map-filters {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#map .map-filters-wrapper.open > .map-filters {
  display: flex;
  animation: filters 0.4s forwards;
  opacity: 0;
}

@keyframes filters {
  to {
    opacity: 1;
  }
}

#map .map-filters li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--sf-text);
  font-size: var(--sf-fs-md);
  line-height: var(--sf-lh-body);
}

#map .map-filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

#map .map-filters input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--sf-brand);
  cursor: pointer;
}

#map .filter-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Map pin in the category colour (pin colour from the category settings): in the filters and on the map */
#map .map-pin {
  flex-shrink: 0;
  fill: currentColor;
}

#map .map-filters .map-pin {
  width: 16px;
  height: 16px;
}

/* On the map: white outline so the pin stands out on any tile */
#map .custom-marker {
  background: none;
  border: 0;
}

#map .custom-marker .map-pin {
  display: block;
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.leaflet-marker-icon {
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  #map .filters-toggler i {
    transition: none;
  }

  #map .map-filters-wrapper.open > .map-filters {
    animation: none;
    opacity: 1;
  }
}
