/* =========================================================
   InteractiveBoxes
   Gemeinsame Basen
========================================================= */

/* Gemeinsame Basisklasse für Plugin-Elemente */
.ibx,
.interactive-box {
  box-sizing: border-box;
}

.ibx *,
.interactive-box * {
  box-sizing: inherit;
}

/* Medien im Plugin grundsätzlich responsiv halten */
.ibx img,
.ibx video,
.ibx iframe,
.interactive-box img,
.interactive-box video,
.interactive-box iframe {
  max-width: 100%;
  height: auto;
}

/* Fehlerausgabe */
.interactiveboxes-errors {
  margin: 1rem 0;
}

.interactiveboxes-error {
  padding: 0.75rem 1rem;
  border: 1px solid #c33;
  background: #fff3f3;
  color: #7a1111;
  line-height: 1.4;
}


/* =========================================================
   1) Hover
========================================================= */

/* Basis:
   - verlinkter Inhalt mit eingeblendetem Overlaytext
   - funktioniert ohne Modifikatorklassen sinnvoll
*/
.hover-box {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  vertical-align: top;
  touch-action: manipulation;
  border-radius: 0.25rem;
}

/* Link als Block + Bezugspunkt für Overlay */
.hover-box > a {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
}

/* Bilder und andere direkte Medien sauber darstellen */
.hover-box img {
  display: block;
  width: 100%;
  height: auto;
}

/* Overlaytext */
.hover-box .ovl,
.hover-box > a > .ovl {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;

  padding: 1rem;
  margin: 0;

  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;

  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  border-radius: inherit;
}

/* Zustände */
.hover-box:hover .ovl,
.hover-box.touched .ovl,
.hover-box > a:focus-visible .ovl {
  opacity: 1;
}

.hover-box:active .ovl {
  opacity: 0;
}

/* Klarer Fokus-Ring */
.hover-box > a:focus-visible {
  outline: none;
}

.hover-box > a:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

/*  =============================
Modifikatoren Hover 
================================== */

/* Größerer Overlaytext */
.hover-box.hover-big .ovl {
  font-size: 1.35rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

/* Text links oben ausrichten */
.hover-box.hover-left .ovl {
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  padding: 1.15rem 1.35rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Helles Overlay mit blauem Text */
.hover-box.hover-soft-blue .ovl {
  background: rgba(255, 255, 255, 0.88);
  color: #0b4f6c;
  box-shadow: inset 0 0 0 1px rgba(11, 79, 108, 0.22);
}


/* =========================================================
   2) Link
========================================================= */

/* Basis:
   - ein Linkelement wird auf die gesamte Box erweitert
   - zusätzliche Inhalte bleiben lesbar und gut strukturiert
*/
.linked-box {
  position: relative;
  display: block;
  width: 100%;
  padding: 1rem;
  border: 1px solid #cfcfcf;
  border-radius: 0.4rem;
  background: #fff;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Links in der Box */
.linked-box a {
  color: #a34714;
  text-decoration: none;
}

/* Hover/Fokus */
.linked-box a:hover,
.linked-box a:focus {
  color: inherit;
  background: rgba(200, 110, 45, 0.12);
  outline: none;
}

/* Linkelement bleibt normal sichtbar */
.linked-box > a {
  display: inline-block;
}

/* Klickfläche über gesamte Box legen */
.linked-box > a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

/* Zusätzlicher Boxinhalt */
.linked-box .linked-box-content {
  position: relative;
  z-index: 0;
  margin-top: 0.75rem;
  line-height: 1.5;
  color: #000;
}

/* Falls Inhalt direkt Blockelemente enthält */
.linked-box .linked-box-content > :first-child {
  margin-top: 0;
}

.linked-box .linked-box-content > :last-child {
  margin-bottom: 0;
}

/* Medien im Link und Inhalt */
.linked-box img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Dezente Gesamtreaktion */
.linked-box:hover {
  transform: scale(1.02);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.08);
}

/* Fokuszustand über sichtbaren Link */
.linked-box > a:focus-visible {
  outline: 2px solid #0b4f6c;
  outline-offset: 0.2rem;
}

/* =====================================
Modifikatoren Link 
================================  */

/* Etwas stärkerer Teaser-Charakter */
.linked-box.teaser {
  padding: 1.15rem;
}

/* Schattiger */
.linked-box.shadow {
  box-shadow: 0 0.3rem 0.9rem rgba(0, 0, 0, 0.08);
}

.linked-box.link-narrow {
  max-width: 30rem;
}

/* =========================================================
   3) Overlay
========================================================= */

/* Trigger:
   Basisoptik, falls Textlink/Schaltfläche ohne weitere Klassen genutzt wird
*/
a.mz-overlay-open {
  display: inline-block;
  color: #a34714;
  text-decoration: none;
  cursor: pointer;
}

a.mz-overlay-open:hover,
a.mz-overlay-open:focus {
  text-decoration: none;
}

a.mz-overlay-open:focus-visible {
  outline: 2px solid #0b4f6c;
  outline-offset: 0.2rem;
}

/* Backdrop */
#mz-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.62);
}

#mz-overlay-backdrop.mz-overlay-hidden,
.mz-overlay-hidden {
  display: none;
}

/* Fenster */
.mz-overlay-window {
  position: relative;
  width: min(92vw, 56rem);
  max-height: 90vh;
  overflow: auto;

  padding: 2rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #222;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

/* Close-Button */
.mz-overlay-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  margin: 0;

  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #222;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.mz-overlay-close:hover,
.mz-overlay-close:focus {
  background: rgba(0, 0, 0, 0.07);
  outline: none;
}

.mz-overlay-close:focus-visible {
  outline: 2px solid #0b4f6c;
  outline-offset: 0.12rem;
}

/* Inhaltsbereich */
#mz-overlay-content {
  overflow-x: hidden;
  line-height: 1.5;
}

#mz-overlay-content img,
#mz-overlay-content video,
#mz-overlay-content iframe {
  max-width: 100%;
  height: auto;
}

#mz-overlay-content * {
  max-width: 100%;
  box-sizing: border-box;
}

#mz-overlay-content table {
  width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
}

.mz-overlay-loading {
  padding: 1rem 0;
  font-weight: 600;
}

/* Dezente Basisanimation */
#mz-overlay-backdrop {
  animation: mzOverlayFadeIn 160ms ease-out;
}

.mz-overlay-window {
  animation: mzOverlayLiftIn 180ms ease-out;
}

@keyframes mzOverlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mzOverlayLiftIn {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bewegungsreduktion respektieren */
@media (prefers-reduced-motion: reduce) {
  #mz-overlay-backdrop,
  .mz-overlay-window {
    animation: none !important;
  }

  .hover-box .ovl,
  .linked-box {
    transition: none !important;
  }
}

/* =============================
Modifikatoren Overlay 
===============================*/

/* Größeres Overlayfenster */
.mz-overlay-window.overlay-wide {
  width: min(96vw, 72rem);
}

/* Kompakter */
.mz-overlay-window.overlay-compact {
  width: min(92vw, 40rem);
}