/* Experiences hub — dropdown filters + MapLibre / Leaflet map (editorial) */

.experiences-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-5);
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--line);
}

.experiences-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(100%, 11.5rem);
  flex: 0 1 14rem;
}

.experiences-filter-label {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}

.experiences-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 16rem;
  margin: 0;
  padding: 0.55rem 2.1rem 0.55rem 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  line-height: 1.3;
  color: var(--ink);
  background-color: var(--bone);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath stroke='%235c5a55' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1.5 1.5L6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(17, 17, 15, 0.03);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.experiences-select:hover {
  border-color: color-mix(in srgb, var(--clay) 55%, var(--line-strong));
}

.experiences-select:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

.experiences-count {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
  margin: 0 0 var(--space-3);
}

.experiences-empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  background: var(--bone);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
}

.experiences-empty p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-lede);
}

.experiences-empty .meta {
  margin-top: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
}

/* Hub layout: map + list */
.experiences-hub {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.35fr);
  gap: var(--space-5);
  align-items: start;
}

.experiences-map-panel {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 1;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 40vh;
}

.experiences-map {
  width: 100%;
  height: max(40vh, 320px);
  background: color-mix(in srgb, var(--cream) 70%, #d4cfc4);
  position: relative;
}

.experiences-map-fallback-msg {
  margin: 0;
  padding: var(--space-6);
  text-align: center;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
}

.experiences-map-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.45rem 0.75rem;
  background: color-mix(in srgb, var(--cream) 88%, var(--bone));
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
}

.experiences-map-chrome strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.experiences-list-panel {
  min-width: 0;
}

/* Active card ↔ pin sync */
.place-card.is-map-active {
  border-color: var(--clay);
  box-shadow: var(--shadow-card-hover), 0 0 0 2px color-mix(in srgb, var(--clay) 45%, transparent);
}

.place-card.is-map-active .place-card-body {
  border-top-color: var(--clay);
}

/* ——— MapLibre chrome ——— */
.maplibregl-map {
  font-family: var(--font-sans);
  font: inherit;
}

.maplibregl-ctrl-group {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
  background: var(--bone) !important;
}

.maplibregl-ctrl-group button {
  width: 28px !important;
  height: 28px !important;
  background-color: var(--bone) !important;
}

.maplibregl-ctrl-group button:hover {
  background-color: var(--cream) !important;
}

.maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--cream) 82%, transparent) !important;
  color: var(--ink-muted) !important;
  font-size: 9px !important;
  line-height: 1.25 !important;
  padding: 2px 6px !important;
  border-radius: var(--radius-sm) 0 0 0;
  max-width: min(70%, 16rem);
  opacity: 0.72;
}

.maplibregl-ctrl-attrib a {
  color: var(--ink-muted) !important;
}

.maplibregl-ctrl-attrib:hover,
.maplibregl-ctrl-attrib:focus-within {
  opacity: 1;
}

.maplibregl-popup.dt-map-popup .maplibregl-popup-content,
.dt-map-popup .maplibregl-popup-content {
  border-radius: var(--radius-sm);
  background: var(--bone);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  padding: 0.65rem 0.85rem;
  font-size: var(--fs-caption);
  line-height: 1.35;
}

.maplibregl-popup.dt-map-popup .maplibregl-popup-content strong,
.dt-map-popup .maplibregl-popup-content strong {
  font-family: var(--font-serif);
  font-size: 1rem;
}

.maplibregl-popup.dt-map-popup .maplibregl-popup-tip,
.dt-map-popup .maplibregl-popup-tip {
  border-top-color: var(--bone);
}

.map-popup-meta {
  color: var(--ink-muted);
}

/* Cream / clay / ink markers (MapLibre button + Leaflet DivIcon) */
.dt-map-pin {
  background: transparent !important;
  border: none !important;
  padding: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.dt-map-pin:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 50%;
}

.dt-map-pin-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--clay);
  border: 2px solid var(--ink);
  box-shadow: 0 1px 3px rgba(17, 17, 15, 0.28);
  box-sizing: border-box;
}

.dt-map-pin.is-active-pin .dt-map-pin-dot {
  width: 18px;
  height: 18px;
  background: var(--clay);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 35%, transparent),
    0 2px 8px rgba(168, 84, 47, 0.4);
}

/* Leaflet fallback chrome (loaded only if OpenFreeMap fails) */
.leaflet-container {
  font-family: var(--font-sans);
  background: color-mix(in srgb, var(--cream) 80%, #ccc);
  color: var(--ink);
}

.leaflet-bar {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
}

.leaflet-bar a {
  background: var(--bone) !important;
  color: var(--ink-soft) !important;
  border-bottom-color: var(--line) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
}

.leaflet-bar a:hover {
  background: var(--cream) !important;
  color: var(--clay) !important;
}

.leaflet-control-attribution {
  background: color-mix(in srgb, var(--cream) 82%, transparent) !important;
  color: var(--ink-muted) !important;
  font-size: 9px !important;
  opacity: 0.72;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
  background: var(--bone);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}

.leaflet-popup-tip {
  background: var(--bone);
}

.leaflet-popup-content {
  margin: 0.65rem 0.85rem;
  font-size: var(--fs-caption);
  line-height: 1.35;
}

.leaflet-popup-content strong {
  font-family: var(--font-serif);
  font-size: 1rem;
}

@media (max-width: 900px) {
  .experiences-hub {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .experiences-map-panel {
    position: relative;
    top: auto;
    min-height: 0;
  }

  .experiences-map {
    height: 240px;
  }

  .experiences-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .experiences-filter-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .experiences-select {
    max-width: none;
  }
}

/* WFT guide chrome */
.experiences-filter-guide {
  flex: 1 1 18rem;
  min-width: min(100%, 14rem);
}

.experiences-filter-guide .experiences-select {
  max-width: 28rem;
}

.wft-guide-lede {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bone);
  border-left: 3px solid var(--clay);
  border-radius: var(--radius-sm);
}

.wft-guide-lede-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--ink-soft);
}

.wft-rank {
  font-family: var(--font-sans);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--clay);
  margin-right: 0.15rem;
}

.place-card-address {
  margin: 0 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  color: var(--ink-muted);
}

.place-card-media-empty {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--bone), var(--cream, #f7f1e7));
}


/* Name → website; address → Google Maps */
.place-card-name a {
  color: inherit;
  text-decoration: none;
}
.place-card-name a:hover,
.place-card-name a:focus-visible {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.place-card-address a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-color: color-mix(in srgb, var(--ink-muted) 55%, transparent);
}
.place-card-address a:hover,
.place-card-address a:focus-visible {
  color: var(--clay);
  text-decoration-color: var(--clay);
}


/* ——— Map expand / collapse ——— */
.experiences-map-chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.experiences-map-expand {
  appearance: none;
  margin: 0;
  padding: 0.28rem 0.65rem;
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.experiences-map-expand:hover {
  border-color: color-mix(in srgb, var(--clay) 55%, var(--line-strong));
  color: var(--clay);
}

.experiences-map-expand:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

.experiences-map-expand[aria-pressed="true"] {
  background: color-mix(in srgb, var(--clay) 14%, var(--cream));
  border-color: var(--clay);
  color: var(--ink);
}

.experiences-hub.is-map-expanded {
  grid-template-columns: 1fr;
}

.experiences-hub.is-map-expanded .experiences-map-panel {
  position: relative;
  top: auto;
  z-index: 2;
}

.experiences-hub.is-map-expanded .experiences-map {
  height: min(78vh, 720px);
}

.experiences-hub.is-map-expanded .experiences-list-panel {
  margin-top: var(--space-2);
}

@media (max-width: 900px) {
  .experiences-hub.is-map-expanded .experiences-map {
    height: min(70vh, 560px);
  }
}

/* ——— Editorial color grade (cream / ink / clay — muted cinematic) ———
   Filter basemap canvas / tile pane only — pins + popups stay unfiltered. */
.experiences-map .maplibregl-canvas,
.experiences-map .leaflet-tile-pane {
  filter: sepia(0.28) saturate(0.72) contrast(1.06) brightness(0.98)
    hue-rotate(-8deg);
}

/* Keep marker / popup / control UI crisp above the graded basemap */
.experiences-map .maplibregl-marker,
.experiences-map .leaflet-marker-pane,
.experiences-map .leaflet-shadow-pane,
.experiences-map .leaflet-overlay-pane,
.experiences-map .leaflet-tooltip-pane,
.experiences-map .leaflet-popup-pane,
.experiences-map .maplibregl-popup,
.experiences-map .maplibregl-ctrl-top-right,
.experiences-map .maplibregl-ctrl-bottom-right,
.experiences-map .leaflet-control-container {
  filter: none;
}

/* MapLibre close (X) affordance — editorial */
.maplibregl-popup.dt-map-popup .maplibregl-popup-close-button,
.dt-map-popup .maplibregl-popup-close-button {
  font-size: 16px;
  color: var(--ink-muted);
  padding: 2px 6px;
  right: 2px;
  top: 0;
}
.maplibregl-popup.dt-map-popup .maplibregl-popup-close-button:hover,
.dt-map-popup .maplibregl-popup-close-button:hover {
  color: var(--clay);
  background: transparent;
}
