.block-apa-canal-harta .map-section {
  --map-navy: var(--navy-blue, #0b2b5c);
  --map-blue: var(--primary-blue, #0077c0);
  --map-border: var(--gray-medium, #e8edf2);
  /* Less bottom padding: the next section brings its own top spacing. */
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(1rem, 2.5vw, 1.75rem);
  background: transparent;
}

.block-apa-canal-harta .map-section > .container {
  width: min(100% - 2rem, 1200px);
  max-width: 1200px;
  padding-inline: 0;
}

.map-section__header {
  max-width: 760px;
  margin: 0 auto clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
}

.map-section__eyebrow,
.map-legend__eyebrow {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--map-blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.map-section__header .section-title {
  margin: 0;
  color: var(--map-navy);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  text-wrap: balance;
}

.map-section__intro {
  max-width: 650px;
  margin: 0.85rem auto 0;
  color: #526276;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  line-height: 1.65;
}

.block-apa-canal-harta .map-experience,
.block-apa-canal-harta .map-container {
  position: relative;
}

.block-apa-canal-harta .map-experience {
  width: min(94%, 1100px);
  margin-inline: auto;
  margin-block: clamp(1.25rem, 3vw, 2rem) 0;
}

.block-apa-canal-harta .map-container {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(11, 43, 92, 0.14);
  border-radius: 20px;
  background: #eef4f7;
  box-shadow: 0 18px 50px rgba(11, 43, 92, 0.12);
  z-index: 0;
  isolation: isolate;
}

.block-apa-canal-harta .interactive-map {
  width: 100%;
  height: clamp(500px, 57vw, 650px);
  min-height: 500px;
  border-radius: 0;
  background: #eef4f7;
  z-index: 1;
}

.block-apa-canal-harta .interactive-map:focus-visible {
  outline: 3px solid var(--map-blue);
  outline-offset: -3px;
}

.block-apa-canal-harta .leaflet-control-zoom {
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(11, 43, 92, 0.16);
}

.block-apa-canal-harta .leaflet-control-zoom a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-color: var(--map-border);
  background: #fff;
  color: var(--map-navy);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-indent: 0;
}

.block-apa-canal-harta .leaflet-control-zoom a span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  /* Optical vertical centering for + / − glyphs */
  transform: translateY(-0.04em);
}

.block-apa-canal-harta .leaflet-control-zoom a:hover,
.block-apa-canal-harta .leaflet-control-zoom a:focus-visible {
  background: #f2f8fc;
  color: var(--map-blue);
}

.block-apa-canal-harta .custom-marker {
  border: 0;
  background: transparent;
}

.map-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 48px;
  min-height: 48px;
  padding: 4px;
}

.map-marker__dot {
  display: block;
  box-sizing: content-box;
  width: var(--marker-size);
  height: var(--marker-size);
  flex-shrink: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow:
    0 2px 7px rgba(11, 43, 92, 0.35),
    0 0 0 2px color-mix(in srgb, var(--marker-color) 32%, transparent);
}

.map-marker--labelled {
  justify-content: flex-start;
  padding-top: 2px;
}

.map-marker--labelled .map-marker__dot {
  position: relative;
  z-index: 2;
}

.map-marker__label {
  position: relative;
  z-index: 1;
  max-width: 150px;
  margin-top: 4px;
  padding: 0.35rem 0.55rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: var(--marker-color);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(11, 43, 92, 0.24);
  pointer-events: none;
}

.custom-marker:focus-visible .map-marker__dot {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.block-apa-canal-harta .map-legend {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 5;
  width: min(350px, calc(100% - 6.5rem));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 36px rgba(11, 43, 92, 0.18);
  backdrop-filter: blur(14px);
}

.map-legend__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--map-border);
}

.block-apa-canal-harta .legend-title {
  margin: 0;
  color: var(--map-navy);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.map-legend__toggle {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--map-border);
  border-radius: 10px;
  background: #f7fafc;
  color: var(--map-navy);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.map-legend__toggle span {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.map-legend__toggle[aria-expanded="false"] span {
  transform: translateY(2px) rotate(225deg);
}

.map-legend__toggle:hover,
.map-legend__toggle:focus-visible {
  border-color: var(--map-blue);
  background: #eaf5fc;
  outline: 0;
}

.block-apa-canal-harta .legend-items {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.65rem;
}

.block-apa-canal-harta .legend-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #34455a;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.block-apa-canal-harta .legend-item:hover,
.block-apa-canal-harta .legend-item:focus-visible {
  border-color: #d5e6f0;
  background: #f2f8fc;
  outline: 0;
}

/* Deselected category: grey out the swatch and strike the label. */
.block-apa-canal-harta .legend-item[aria-pressed="false"] {
  opacity: 0.55;
}

.block-apa-canal-harta .legend-item[aria-pressed="false"] .legend-color {
  background: #c3cfda;
  box-shadow: 0 0 0 1px #b3c2cf;
}

.block-apa-canal-harta .legend-item[aria-pressed="false"] .legend-item__text {
  color: #6b7a8c;
  text-decoration: line-through;
  text-decoration-color: #93a3b3;
  text-decoration-thickness: 1.5px;
}

.block-apa-canal-harta .legend-item[aria-pressed="false"] .legend-item__count {
  background: #e6ebf0;
  color: #6b7a8c;
}

.block-apa-canal-harta .legend-color {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--marker-color) 45%, #c7d3dc);
}

.legend-item__text {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.legend-item__count {
  display: grid;
  min-width: 26px;
  height: 26px;
  padding-inline: 0.35rem;
  place-items: center;
  border-radius: 999px;
  background: #edf3f7;
  color: var(--map-navy);
  font-size: 0.75rem;
  font-weight: 700;
}

.map-legend__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--map-border);
  background: #f8fafc;
}

.map-legend__total {
  color: #66768a;
  font-size: 0.76rem;
  line-height: 1.3;
}

.map-legend__total strong {
  color: var(--map-navy);
}

.map-legend__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.25rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--map-blue);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.map-legend__reset:hover,
.map-legend__reset:focus-visible {
  text-decoration: underline;
  outline: 0;
}

.map-legend.is-collapsed .legend-items,
.map-legend.is-collapsed .map-legend__footer {
  display: none;
}

.map-help {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 2rem);
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(11, 43, 92, 0.84);
  color: #fff;
  font-size: 0.65rem;
  box-shadow: 0 4px 12px rgba(11, 43, 92, 0.16);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.map-help__icon {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11V6a2 2 0 1 1 4 0v4-2a2 2 0 1 1 4 0v4-1a2 2 0 1 1 4 0v4c0 4-3 7-7 7h-1c-3 0-5-1-7-4l-3-5a2 2 0 0 1 3-2l3 3v-3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11V6a2 2 0 1 1 4 0v4-2a2 2 0 1 1 4 0v4-1a2 2 0 1 1 4 0v4c0 4-3 7-7 7h-1c-3 0-5-1-7-4l-3-5a2 2 0 0 1 3-2l3 3v-3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.map-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 450;
  width: min(420px, calc(100% - 2rem));
  padding: 1rem 1.25rem;
  border: 1px solid #cfe2ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--map-navy);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(11, 43, 92, 0.12);
  transform: translate(-50%, -50%);
}

.block-apa-canal-harta .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(11, 43, 92, 0.2);
}

.block-apa-canal-harta .leaflet-popup-close-button {
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: 0;
  border: 1px solid var(--map-border);
  border-radius: 999px;
  background: #f3f7fa;
  color: var(--map-navy);
  font: inherit;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(11, 43, 92, 0.1);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.block-apa-canal-harta .leaflet-popup-close-button span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-0.04em);
}

.block-apa-canal-harta .leaflet-popup-close-button:hover,
.block-apa-canal-harta .leaflet-popup-close-button:focus-visible {
  border-color: var(--map-blue);
  background: #eaf5fc;
  color: var(--map-blue);
  outline: 0;
}

.block-apa-canal-harta .leaflet-popup-content {
  min-width: 180px;
  margin: 1rem 1.1rem;
}

.map-popup {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.map-popup__category {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #617185;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
}

.map-popup__category::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--marker-color);
}

.map-popup__title {
  color: var(--map-navy);
  font-size: 1rem;
  line-height: 1.3;
}

.map-popup__description {
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  color: #526276;
  font-size: 0.82rem;
  line-height: 1.5;
}

.map-popup__description > :first-child {
  margin-top: 0;
}

.map-popup__description > :last-child {
  margin-bottom: 0;
}

.map-popup__description p {
  margin: 0 0 0.5rem;
  font-size: inherit;
  line-height: inherit;
}

.map-popup__description a {
  color: var(--map-blue);
  font-weight: 600;
  text-decoration: underline;
}

.map-popup__description ul,
.map-popup__description ol {
  margin: 0 0 0.5rem;
  padding-left: 1.15rem;
}

.map-popup__description li {
  margin-bottom: 0.2rem;
}

@media (max-width: 47.99rem) {
  .block-apa-canal-harta .map-section {
    padding: 2.75rem 0;
  }

  .block-apa-canal-harta .map-section > .container {
    width: min(100% - 1rem, 1200px);
  }

  .map-section__intro {
    padding-inline: 0.5rem;
  }

  .block-apa-canal-harta .map-container {
    border-radius: 14px;
  }

  .block-apa-canal-harta .interactive-map {
    height: 520px;
    min-height: 520px;
  }

  .block-apa-canal-harta .map-legend {
    top: auto;
    right: 0.65rem;
    bottom: 2.65rem;
    left: 0.65rem;
    width: auto;
    max-height: calc(100% - 5rem);
    overflow-y: auto;
    border-radius: 13px;
  }

  .map-legend__header {
    padding: 0.75rem 0.8rem;
  }

  .block-apa-canal-harta .legend-items {
    padding: 0.45rem;
  }

  .block-apa-canal-harta .legend-item {
    min-height: 48px;
    padding-block: 0.5rem;
  }

  .map-help {
    display: none;
  }
}

@media (max-width: 22rem) {
  .map-legend__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
