/* Tour sights map — Leaflet + Yandex tiles, premium navy/gold style */

/* Hide Leaflet library credit from attribution — Яндекс requirement is only tile-source */
.leaflet-container .leaflet-control-attribution a[href*="leafletjs"],
.leaflet-container .leaflet-control-attribution a[href*="leaflet"]:not([href*="yandex"]),
.leaflet-attribution-flag{
  display: none !important;
}
.leaflet-control-attribution{ font-size: 10px; }

/* Section heading */
.tour-sights-map__title{
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  color: var(--color-primary-800, #0A2540);
  margin: 0 0 var(--space-2, 8px);
  text-align: center;
}
.tour-sights-map__subtitle{
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 15px;
  color: var(--color-text-light, #4A5968);
  text-align: center;
  margin: 0 auto var(--space-6, 24px);
  max-width: 560px;
}

/* Map container */
.tour-sights-map{
  width: 100%;
  height: clamp(380px, 55vh, 560px);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  isolation: isolate; /* contain Leaflet's z-index stack below sticky nav (--z-header: 300) */
  box-shadow: 0 4px 16px rgba(10, 37, 64, 0.08), 0 0 0 1px rgba(201, 169, 97, 0.18);
  background: #E8EEF2;
}

/* Keep Leaflet panes + controls below the sticky nav (which is at --z-header: 300).
   Leaflet defaults: pane 400, popup 700, tooltip 650, top/bottom 1000.  */
.tour-sights-map .leaflet-pane,
.tour-sights-map .leaflet-top,
.tour-sights-map .leaflet-bottom,
.tour-sights-map .leaflet-control{
  z-index: 1 !important;
}
.tour-sights-map .leaflet-popup-pane{ z-index: 2 !important; }
.tour-sights-map .leaflet-tooltip-pane{ z-index: 2 !important; }

/* Popup — premium navy/gold look */
.tsm-popup{ font-family: 'Inter', system-ui, sans-serif; min-width: 180px; max-width: 340px; }
.tsm-popup__label{
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A961;
  font-weight: 700;
  margin-bottom: 2px;
}
.tsm-popup__day{
  font-weight: 700;
  letter-spacing: 0.14em;
}
.tsm-popup__title{
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  font-size: 17px;
  line-height: 1.2;
  color: #0A2540;
  margin: 4px 0 6px;
  font-weight: 600;
}
.tsm-popup__desc{
  font-size: 13px;
  color: #4A5968;
  line-height: 1.45;
  margin: 0 0 8px;
}
.tsm-popup__link{
  display: inline-block;
  font-size: 13px;
  color: #C9A961;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 169, 97, 0.35);
  padding-bottom: 1px;
}
.tsm-popup__link:hover{ color: #D4B56F; border-bottom-color: #D4B56F; }

/* Leaflet popup shell — override Leaflet defaults for premium feel */
.leaflet-popup-content-wrapper{
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.2), 0 0 0 1px rgba(10, 37, 64, 0.1);
  padding: 14px 16px;
}
.leaflet-popup-content{ margin: 0; line-height: 1.4; }
.leaflet-popup-tip{ box-shadow: 0 4px 8px rgba(10, 37, 64, 0.1); }

/* Tile switcher control (top-right) */
.tsm-tile-switcher{
  display: flex;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tsm-tile-switcher button{
  border: 0;
  background: transparent;
  padding: 7px 12px;
  cursor: pointer;
  color: #0A2540;
  transition: background 0.15s, color 0.15s;
}
.tsm-tile-switcher button:hover{ background: #F5EFE0; }
.tsm-tile-switcher button.is-active{ background: #0A2540; color: #fff; }

/* Empty state */
.tsm-empty{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #4A5968;
  font-style: italic;
  padding: var(--space-6, 24px);
  text-align: center;
}

/* Mobile */
@media (max-width: 640px){
  .tour-sights-map{ height: 360px; }
  .tsm-tile-switcher{ font-size: 11px; }
  .tsm-tile-switcher button{ padding: 6px 10px; }
}

/* Expand button (bottom-right of small map) */
.tsm-expand{
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 500;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #0A2540;
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.tsm-expand:hover{ background: #C9A961; color: #fff; }
.tsm-expand svg{ display: block; }

/* Fullscreen backdrop + shell */
.tsm-fullscreen-backdrop{
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tsm-fullscreen-backdrop--open{
  opacity: 1;
  pointer-events: auto;
}

.tsm-fullscreen-shell{
  width: 92vw;
  height: 88vh;
  max-width: 1400px;
  background: #FAFAF5;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(6, 24, 41, 0.45), 0 0 0 1px rgba(10, 37, 64, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tsm-fullscreen-backdrop--open .tsm-fullscreen-shell{
  transform: translateY(0) scale(1);
}

.tsm-fullscreen-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(180deg, #0C2A4A 0%, #0A2540 100%);
  border-bottom: 1px solid rgba(201, 169, 97, 0.25);
  color: #F5EFE0;
  flex-shrink: 0;
}
.tsm-fullscreen-title{
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.01em;
}
.tsm-fullscreen-close{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #F5EFE0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.tsm-fullscreen-close:hover{ background: rgba(255, 255, 255, 0.14); }

.tsm-fullscreen-map{ flex: 1; width: 100%; }

@media (max-width: 640px){
  .tsm-fullscreen-backdrop{ padding: 0; }
  /* 100dvh = dynamic viewport height; excludes Safari/Chrome address bars.
     Fallback 100vh for older browsers. */
  .tsm-fullscreen-shell{ width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; max-width: none; }
  .tsm-fullscreen-head{ padding: 12px 16px; }
  .tsm-fullscreen-title{ font-size: 18px; }
  .tsm-expand{ width: 32px; height: 32px; bottom: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce){
  .tsm-fullscreen-backdrop,
  .tsm-fullscreen-shell{ transition: none; }
}
