html {
  --palette-sky: #85cbfa;
  --palette-olive: #8b8345;
  --palette-rose: #f3c3d1;
}

html:has(body.orte-map-view) {
  overflow: hidden;
  height: 100%;
}

body.orte-map-view {
  overflow: hidden;
  height: 100vh;
  padding: 0;
}

body.orte-map-view main {
  position: fixed;
  inset: 0;
  display: block;
  min-height: 0;
  padding: 0;
  z-index: 1;
}

body.orte-map-view .orte-toolbar {
  position: fixed;
  top: 118px;
  right: 16px;
  z-index: 110;
  margin: 0;
}

body.orte-map-view #orteMapPanel {
  position: fixed;
  inset: 0;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.orte-map-view .orte-map-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
}

body.orte-map-view #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.orte-list-view {
  padding: 0 var(--chodo-page-gutter) 24px;
  padding-top: 118px;
  overflow: auto;
  height: auto;
}

body.orte-list-view main {
  position: static;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 118px + 24px);
}

body.orte-list-view .orte-toolbar {
  position: static;
  margin: 0 0 16px;
  margin-right: calc(16px - var(--chodo-page-gutter));
}

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 118px + 24px);
  flex: 1;
}

.orte-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  min-width: 0;
  flex-shrink: 0;
}

.view-segment {
  display: inline-flex;
  align-items: stretch;
  padding: 3px;
  background: #e8e8e8;
  border-radius: 999px;
  gap: 3px;
  flex-shrink: 0;
  min-height: 40px;
  box-sizing: border-box;
}

.view-btn {
  border: none;
  background: transparent;
  color: #000;
  padding: 0 14px;
  margin: 0;
  font-family: var(--chodo-font-sans);
  font-size: var(--chodo-text-ui-sm-size);
  line-height: var(--chodo-leading-ui-sm);
  letter-spacing: var(--chodo-tracking-none);
  font-weight: 400;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  box-sizing: border-box;
}

.view-btn.active {
  background: #fff;
  color: #000;
  font-weight: 500;
}

.view-btn:not(.active) {
  opacity: 0.92;
  font-weight: 400;
}

.view-btn:focus-visible {
  outline: none;
}

.orte-panel {
  display: none;
  width: 100%;
}

.orte-panel.is-active {
  display: block;
}

#orteMapPanel.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.orte-map-shell {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 360px;
  height: 100%;
  border: none;
  background: var(--palette-sky, #85cbfa);
}

.orte-map-tiles .leaflet-tile-pane img.leaflet-tile {
  filter: saturate(1.15) contrast(1.1) brightness(0.76) hue-rotate(-8deg);
}

.orte-map-tiles .leaflet-tile-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(243, 195, 209, 0.55) 0%, rgba(133, 203, 250, 0.22) 100%), rgba(0, 0, 0, 0.14);
  mix-blend-mode: multiply;
  opacity: 0.68;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.orte-map-view .leaflet-top.leaflet-left {
  top: 16px;
  left: 16px;
}

body.orte-map-view .leaflet-top.leaflet-left .leaflet-control {
  margin: 0 !important;
}

.leaflet-control-zoom a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff !important;
  color: #000 !important;
  border: none !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 0 !important;
  font-size: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.leaflet-control-zoom a img {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.leaflet-control-zoom a + a {
  margin-top: 8px !important;
}

.leaflet-control-zoom a:hover {
  background: #f3c3d1 !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #000 !important;
  font-size: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.map-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.75);
  transform: translate(-50%, -50%);
  transition: width 0.18s ease, height 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
  animation: map-pin-pulse 1.4s infinite;
}

.map-pin.is-active {
  width: 24px;
  height: 24px;
  background: #fff;
  border-color: #fff;
  animation: none;
  box-shadow: none;
}

@keyframes map-pin-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin {
    animation: none;
  }
}

.orte-map-float {
  position: fixed;
  z-index: 8000;
  width: 320px;
  max-width: min(320px, calc(100vw - 24px));
  margin: 0;
  pointer-events: none;
}

.orte-map-float-inner {
  position: relative;
  background: #fff;
  padding: 16px 16px 32px;
  color: #000;
  text-align: left;
  pointer-events: auto;
  box-shadow: none;
}

.orte-map-float-photo {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
  margin: 0 0 12px;
}

.orte-map-float-title {
  font-family: var(--chodo-font-sans);
  font-size: var(--chodo-text-ui-sm-size);
  line-height: var(--chodo-leading-ui-sm);
  letter-spacing: var(--chodo-tracking-none);
  font-weight: 700;
  text-align: left;
  margin: 0 0 12px;
}

.orte-map-float-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 3px;
  font-family: var(--chodo-font-sans);
  font-size: var(--chodo-text-ui-xs-size);
  line-height: var(--chodo-leading-ui-xs);
  letter-spacing: var(--chodo-tracking-ui);
}

.orte-map-float-web {
  display: block;
  margin: 0 0 12px;
}

.orte-map-float-web .inst-card-web-link {
  font-weight: 700;
}

.orte-map-float-web .inst-card-web-link:hover {
  text-decoration: none;
  color: #85cbfa;
}

.orte-map-float-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding-top: 20px;
}

.hotspot-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 0;
}

.hotspot-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #85cbfa;
  color: #000;
  padding: 10px 19px;
  font-family: var(--chodo-font-sans);
  font-size: var(--chodo-text-ui-sm-size);
  line-height: var(--chodo-leading-ui-sm);
  letter-spacing: var(--chodo-tracking-none);
  font-weight: 400;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.hotspot-link:hover {
  background: #000;
  color: #fff;
}

.hotspot-link:active {
  background: #000;
  color: #fff;
  border: none;
}

.institutions-list {
  width: 100%;
  max-width: none;
  padding-right: 0;
}

.inst-card {
  display: grid;
  grid-template-columns: minmax(160px, 288px) minmax(0, 1fr) minmax(160px, 288px);
  column-gap: 20px;
  align-items: start;
  border-top: 1px solid #000;
  padding: 16px 0;
  width: 100%;
}

.inst-card-photo-col {
  width: 100%;
  max-width: 288px;
  background: #f5f5f5;
  align-self: start;
  display: flex;
  flex-direction: column;
}

.inst-card-photo-img {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 160px;
  object-fit: cover;
  display: block;
}

.inst-card-photo-col.is-empty {
  min-height: 160px;
  background: linear-gradient(145deg, rgba(133, 203, 250, 0.2), rgba(139, 131, 69, 0.15));
}

.inst-card-side {
  max-width: 288px;
}

.inst-card-photo-col.is-empty .inst-card-photo-img {
  display: none;
}

.inst-card-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 100%;
  align-self: stretch;
  text-align: center;
}

.inst-card-name {
  font-family: var(--chodo-font-epicene-bold);
  font-size: var(--chodo-text-display-item-size);
  line-height: var(--chodo-leading-display-item);
  letter-spacing: var(--chodo-tracking-display);
  font-weight: 700;
  margin: 0;
  max-width: 100%;
  text-align: center;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 12 6 5;
  overflow-wrap: break-word;
  word-break: normal;
}

.inst-card-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  align-self: start;
  width: 100%;
  text-align: left;
}

.inst-card-side-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inst-card-web-link {
  font-family: var(--chodo-font-sans);
  font-weight: 700;
  font-size: var(--chodo-text-ui-sm-size);
  line-height: var(--chodo-leading-ui-sm);
  letter-spacing: var(--chodo-tracking-none);
  color: #000;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  align-self: flex-start;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-top: auto;
  padding-top: 14px;
}

.inst-card-web-link:hover {
  color: #85cbfa;
  text-decoration: none;
}

.inst-card-address,
.inst-card-hours {
  font-family: var(--chodo-font-sans);
  font-size: var(--chodo-text-ui-sm-size);
  line-height: var(--chodo-leading-ui-sm);
  letter-spacing: var(--chodo-tracking-none);
  white-space: pre-line;
  margin: 0;
}

body.orte-list-view .inst-card-address {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.25;
  white-space: normal;
}

body.orte-list-view .inst-card-address-line {
  display: block;
}

.inst-card-actions.hotspot-actions--orte {
  justify-content: center;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Mobiel overlay — alleen ≤640px; desktop gebruikt .orte-map-float */
.orte-map-overlay {
  display: none;
}

/* Tablet + mobiel: kaart-toolbar en lijst-padding */
@media (max-width: 1024px) {
  body.orte-map-view .orte-toolbar {
    top: 128px;
  }

  body.orte-list-view {
    padding-top: 128px;
  }

  body.orte-list-view main {
    min-height: calc(100vh - 128px + 24px);
  }

  main {
    min-height: calc(100vh - 128px + 24px);
  }

  body.orte-map-view #orteMapPanel.is-active {
    min-height: 0;
  }

  .orte-toolbar {
    justify-content: flex-end;
  }
}

/* Tablet 641–1024: 3 kolommen, compactere foto + kleinere titel */
@media (min-width: 641px) and (max-width: 1024px) {
  body.orte-list-view .inst-card {
    grid-template-columns: minmax(112px, 188px) minmax(0, 1fr) minmax(112px, 188px);
    column-gap: 12px;
    padding: 14px 0;
  }

  body.orte-list-view .inst-card-photo-col,
  body.orte-list-view .inst-card-side {
    max-width: 188px;
  }

  body.orte-list-view .inst-card-photo-img {
    max-height: 100px;
  }

  body.orte-list-view .inst-card-photo-col.is-empty {
    min-height: 100px;
  }

  body.orte-list-view .inst-card-center {
    gap: 12px;
  }

  body.orte-list-view .inst-card-name {
    font-family: var(--chodo-font-epicene-bold);
    font-size: var(--chodo-text-display-sub-size);
    line-height: var(--chodo-leading-display-sub);
    letter-spacing: var(--chodo-tracking-display);
    font-weight: 700;
  }

  body.orte-list-view .inst-card-address,
  body.orte-list-view .inst-card-hours,
  body.orte-list-view .inst-card-web-link {
    font-size: var(--chodo-text-ui-xs-size);
    line-height: var(--chodo-leading-ui-xs);
    letter-spacing: var(--chodo-tracking-ui);
  }
}

/* Mobiel: ≤640px */
@media (max-width: 640px) {
  body.orte-map-view,
  body.orte-list-view {
    --chodo-text-display-section-size: clamp(1.375rem, 1.375rem + 1.5vw, 2.625rem);
    --chodo-orte-mobile-toolbar-top: 106px;
    --chodo-orte-mobile-toolbar-height: 40px;
  }

  body.orte-map-view .orte-toolbar {
    position: fixed;
    top: var(--chodo-orte-mobile-toolbar-top);
    right: var(--chodo-page-gutter);
    left: auto;
    z-index: 110;
    margin: 0;
    justify-content: flex-end;
  }

  body.orte-map-view .leaflet-top.leaflet-left {
    top: var(--chodo-page-gutter);
    left: var(--chodo-page-gutter);
  }

  body.orte-list-view .orte-toolbar {
    position: static;
    z-index: auto;
    margin: 0 0 14px;
    margin-right: 0;
    justify-content: flex-end;
  }

  body.orte-map-overlay-open {
    overflow: hidden;
  }

  .orte-map-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: #fff;
    overflow: hidden;
  }

  .orte-map-overlay.is-open {
    display: block;
  }

  .orte-map-overlay-close {
    position: fixed;
    top: 8px;
    right: var(--chodo-page-gutter);
    z-index: 9600;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    line-height: 0;
    color: #000;
    box-sizing: border-box;
    transition: background 0.1s ease;
  }

  .orte-map-overlay.is-open .orte-map-overlay-close {
    display: flex;
  }

  .orte-map-overlay-close:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
  }

  .orte-map-overlay-close-img {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
  }

  .orte-map-overlay-body {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(8px + 44px + 20px) var(--chodo-page-gutter) 28px;
    box-sizing: border-box;
  }

  .orte-map-overlay .orte-map-float-inner {
    padding: 0;
    max-width: none;
  }

  .orte-map-overlay .orte-map-float-photo {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0 0 14px;
  }

  .orte-map-overlay .orte-map-float-title {
    font-family: var(--chodo-font-epicene-regular);
    font-size: var(--chodo-text-display-section-size);
    line-height: var(--chodo-leading-display-section);
    letter-spacing: var(--chodo-tracking-display-tight);
    font-weight: 400;
    margin: 0 0 14px;
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 12 6 5;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .orte-map-overlay .orte-map-float-meta {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
    font-size: var(--chodo-text-ui-md-size);
    line-height: var(--chodo-leading-ui-md);
    letter-spacing: var(--chodo-tracking-none);
  }

  .orte-map-overlay .orte-map-float-web {
    margin: 0 0 20px;
  }

  .orte-map-overlay .orte-map-float-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  body.orte-list-view {
    padding: var(--chodo-orte-mobile-toolbar-top) var(--chodo-page-gutter) 24px;
  }

  body.orte-list-view main {
    min-height: 0;
  }

  body.orte-list-view .inst-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 14px;
    padding: 14px 0 28px;
    border-top: 1px solid #000;
  }

  body.orte-list-view .inst-card:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  body.orte-list-view .inst-card-photo-col {
    order: 1;
    width: 100%;
    max-width: none;
    margin-bottom: 14px;
  }

  body.orte-list-view .inst-card-photo-img {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  body.orte-list-view .inst-card-photo-col.is-empty {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  body.orte-list-view .inst-card-center {
    display: contents;
  }

  body.orte-list-view .inst-card-name {
    order: 2;
    font-family: var(--chodo-font-epicene-regular);
    font-size: var(--chodo-text-display-section-size);
    line-height: var(--chodo-leading-display-section);
    letter-spacing: var(--chodo-tracking-display-tight);
    font-weight: 400;
    text-align: left;
    margin: 0 0 14px;
  }

  body.orte-list-view .inst-card-side {
    order: 3;
    max-width: none;
  }

  body.orte-list-view .inst-card-side-top {
    gap: 10px;
    margin-bottom: 10px;
  }

  body.orte-list-view .inst-card-web-link {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 20px;
  }

  body.orte-list-view .inst-card-actions.hotspot-actions--orte {
    order: 4;
    justify-content: flex-start;
  }

  body.orte-list-view .inst-card-name,
  body.orte-list-view .inst-card-address,
  body.orte-list-view .inst-card-hours {
    hyphens: auto;
    -webkit-hyphens: auto;
    hyphenate-limit-chars: 12 6 5;
    overflow-wrap: break-word;
    word-break: normal;
  }

  body.orte-list-view .inst-card-address,
  body.orte-list-view .inst-card-hours {
    font-size: var(--chodo-text-ui-md-size);
    line-height: var(--chodo-leading-ui-md);
  }

  body.orte-list-view .inst-card-web-link {
    font-size: var(--chodo-text-ui-md-size);
    line-height: var(--chodo-leading-ui-md);
  }
}
