/* ==========================================================================
   Bild mit Fokuspunkten (EXT:ec_hotspots)
   Ab 992px Desktop-Bild mit Punkten und Pop-ups, darunter Reiter + Slider.
   Anpassung im Sitepackage über die CSS-Variablen unten (Spezifität 0 durch :where,
   jede Angabe auf .ec-hotspots im Sitepackage gewinnt).
   ========================================================================== */

:where(.ec-hotspots) {
  --ec-hotspots-accent: #c8102e;
  --ec-hotspots-accent-background: var(--ec-hotspots-accent);
  --ec-hotspots-text: #333;
  --ec-hotspots-muted: #d9d9d9;
  --ec-hotspots-backdrop: rgb(60 64 66 / 55%);
  --ec-hotspots-dark-background: rgb(40 44 46 / 55%);
  --ec-hotspots-surface: #fff;
  --ec-hotspots-card-background: #eef2f4;
  --ec-hotspots-card-shadow: 0 9px 30px 0 rgb(217 217 217 / 50%);
  --ec-hotspots-image-radius: 24px;
  --ec-hotspots-dialog-radius: 16px;
  --ec-hotspots-card-radius: 16px;
  --ec-hotspots-title-size: 31px;
  --ec-hotspots-tab-size: 20px;
  --ec-hotspots-pill-size: 16px;
}

.ec-hotspots {
  color: var(--ec-hotspots-text);
}

.ec-hotspots__intro > :last-child {
  margin-bottom: 0;
}

.ec-hotspots__intro ~ :is(.ec-hotspots__desktop, .ec-hotspots__mobile) {
  margin-top: 40px;
}

/* --------------------------------------------------------------------------
   Desktop: Bild mit Punkten
   -------------------------------------------------------------------------- */

.ec-hotspots__stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--ec-hotspots-image-radius);
  container-type: inline-size;
}

.ec-hotspots__image {
  display: block;
  width: 100%;
  height: auto;
}

/* Pille: Mittelpunkt des Plus-Icons liegt auf dem gesetzten Punkt */
.ec-hotspots__pill {
  --icon: 22px;
  --pad: 7px;
  --border: 1px;
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 5px 16px 5px var(--pad);
  border: var(--border) solid rgb(255 255 255 / 85%);
  border-radius: 100px;
  background: var(--ec-hotspots-accent-background);
  color: #fff;
  font: inherit;
  font-size: var(--ec-hotspots-pill-size);
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
  transform: translate(calc(-1 * (var(--border) + var(--pad) + var(--icon) / 2)), -50%);
  transition: box-shadow .2s ease, filter .2s ease;
}

.ec-hotspots__pill.is-flipped {
  flex-direction: row-reverse;
  padding: 5px var(--pad) 5px 16px;
  transform: translate(calc(-100% + var(--border) + var(--pad) + var(--icon) / 2), -50%);
}

.ec-hotspots__pill:hover {
  z-index: 2;
  box-shadow: 0 6px 20px rgb(0 0 0 / 30%);
  filter: brightness(1.08);
}

.ec-hotspots__pill:focus-visible {
  z-index: 2;
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Plus im Kreis */
.ec-hotspots__pill-icon {
  position: relative;
  flex: 0 0 var(--icon);
  width: var(--icon);
  height: var(--icon);
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.ec-hotspots__pill-icon::before,
.ec-hotspots__pill-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.ec-hotspots__pill-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Stil "Dunkel, transparent": weißes Icon mit Plus in Akzentfarbe */
.ec-hotspots--dark .ec-hotspots__pill {
  background: var(--ec-hotspots-dark-background);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ec-hotspots--dark .ec-hotspots__pill-icon {
  border-color: #fff;
  background: #fff;
}

.ec-hotspots--dark .ec-hotspots__pill-icon::before,
.ec-hotspots--dark .ec-hotspots__pill-icon::after {
  height: 2px;
  background: var(--ec-hotspots-accent);
}

/* Stil "Weiß mit Akzentfarbe" */
.ec-hotspots--light .ec-hotspots__pill {
  border-color: var(--ec-hotspots-accent);
  background: #fff;
  color: var(--ec-hotspots-accent);
}

.ec-hotspots--light .ec-hotspots__pill:focus-visible {
  outline-color: var(--ec-hotspots-accent);
}

/* --------------------------------------------------------------------------
   Pop-up
   -------------------------------------------------------------------------- */

.ec-hotspots__dialog {
  /* margin: auto zentriert das modale <dialog> wieder, falls ein globaler Reset margin: 0 setzt */
  margin: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--ec-hotspots-dialog-radius);
  background: var(--ec-hotspots-surface);
  color: var(--ec-hotspots-text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 20%);
}

.ec-hotspots__dialog--wide {
  width: min(880px, calc(100vw - 32px));
}

.ec-hotspots__dialog::backdrop {
  background: var(--ec-hotspots-backdrop);
}

/* Seite hinter dem offenen Pop-up nicht scrollbar; scrollbar-gutter verhindert, dass der Inhalt seitlich springt */
html:has(.ec-hotspots__dialog[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.ec-hotspots__dialog-inner {
  position: relative;
  padding: 24px 22px 22px;
}

.ec-hotspots__title {
  margin: 0 48px 8px 0;
  color: inherit;
  font-size: var(--ec-hotspots-title-size);
  font-weight: 700;
  line-height: 1.3;
}

.ec-hotspots__close {
  position: absolute;
  top: 22px;
  right: 18px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.ec-hotspots__close::before,
.ec-hotspots__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ec-hotspots__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ec-hotspots__close:focus-visible {
  outline: 2px solid var(--ec-hotspots-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Inhalt (Pop-up und Slide): Text, Kacheln, Button
   -------------------------------------------------------------------------- */

.ec-hotspots__text > :last-child {
  margin-bottom: 0;
}

.ec-hotspots__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

/* 4 Kacheln im Pop-up: 2 × 2 statt 3 + 1 (vier nebeneinander wären im 880px-Pop-up zu schmal);
   nur im Dialog, die mobile Slide bleibt einspaltig */
.ec-hotspots__dialog .ec-hotspots__cards:has(> .ec-hotspots__card:nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ec-hotspots__card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--ec-hotspots-card-radius);
  background: var(--ec-hotspots-card-background);
  box-shadow: var(--ec-hotspots-card-shadow);
}

.ec-hotspots__card-title {
  margin: 0 0 8px;
  color: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.ec-hotspots__card-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* Kachel-Text aus dem RTE: Absätze/Listen eng, letzter Block ohne Abstand */
.ec-hotspots__card-text :is(p, ul, ol) {
  margin: 0 0 8px;
}

/* Schrift der Kachel (14px) auch für Absätze/Listen, sonst greift die globale Absatzgröße */
.ec-hotspots__card .ec-hotspots__card-text :is(p, ul, ol, li) {
  font-size: inherit;
  line-height: inherit;
}

.ec-hotspots__card-text > :last-child {
  margin-bottom: 0;
}

.ec-hotspots__card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: auto;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--ec-hotspots-accent);
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.ec-hotspots__card-link::after {
  content: "→";
  font-weight: 400;
}

.ec-hotspots__card-link:hover,
.ec-hotspots__card-link:focus-visible {
  color: var(--ec-hotspots-accent);
}

.ec-hotspots__actions {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Mobil: Reiter + Slider
   -------------------------------------------------------------------------- */

.ec-hotspots__tabs {
  display: flex;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -4px 0 var(--ec-hotspots-muted);
}

.ec-hotspots__tabs::-webkit-scrollbar {
  display: none;
}

.ec-hotspots__tab {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 20px 16px;
  border: 0;
  background: none;
  color: var(--ec-hotspots-text);
  font: inherit;
  font-size: var(--ec-hotspots-tab-size);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.ec-hotspots__tab.is-active {
  color: var(--ec-hotspots-accent);
}

.ec-hotspots__tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--ec-hotspots-accent);
}

.ec-hotspots__tab:focus-visible {
  outline: 2px solid var(--ec-hotspots-accent);
  outline-offset: -2px;
}

.ec-hotspots__track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  transition: height .3s ease;
}

.ec-hotspots__track::-webkit-scrollbar {
  display: none;
}

.ec-hotspots__slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ec-hotspots__slide-image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 16px;
  border-radius: var(--ec-hotspots-image-radius);
}

.ec-hotspots__slide .ec-hotspots__cards {
  grid-template-columns: minmax(0, 1fr);
}

.ec-hotspots__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.ec-hotspots__arrow {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ec-hotspots-accent);
  border-radius: 50%;
  background: #fff;
  color: var(--ec-hotspots-accent);
  cursor: pointer;
  transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}

/* Pfeil aus Linie + Spitze */
.ec-hotspots__arrow::before,
.ec-hotspots__arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
}

.ec-hotspots__arrow::before {
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.ec-hotspots__arrow::after {
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.ec-hotspots__arrow--next::after {
  transform: translate(calc(-50% + 4px), -50%) rotate(45deg);
}

.ec-hotspots__arrow--prev::after {
  transform: translate(calc(-50% - 4px), -50%) rotate(-135deg);
}

.ec-hotspots__arrow:hover:not(:disabled),
.ec-hotspots__arrow:focus-visible {
  background: var(--ec-hotspots-accent);
  color: #fff;
}

.ec-hotspots__arrow:disabled {
  opacity: .4;
  cursor: default;
}

.ec-hotspots__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ec-hotspots__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: var(--ec-hotspots-muted);
  cursor: pointer;
  transition: width .25s ease, background-color .25s ease;
}

.ec-hotspots__dot.is-active {
  width: 24px;
  background: var(--ec-hotspots-accent);
}

/* --------------------------------------------------------------------------
   Umschaltung bei 992px
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .ec-hotspots__desktop {
    display: none;
  }
}

@media (min-width: 992px) {
  .ec-hotspots__mobile {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-hotspots__track,
  .ec-hotspots__dot,
  .ec-hotspots__pill {
    transition: none;
  }
}
