/* ============================================================
   m36 - Image Video
   ============================================================ */
section.m36_image_video {
  position: relative;
  z-index: 2;
  padding: var(--mM_section_padding, 80px 0);
  margin: 0 20px;
  max-width: calc(100vw - 40px);
  background-color: #fff;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
section.m36_image_video .m36_header {
  text-align: center;
  margin-bottom: 48px;
}

/* ============================================================
   Grid & Karte
   ============================================================ */
section.m36_image_video .m36_karten_wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Standard: 3 Spalten */
  gap: 40px;
}
/* 1 Karte: zentriert, max 500px */
section.m36_image_video .m36_karten_wrapper:has(.m36_karte:only-child) {
  grid-template-columns: min(100%, 500px);
  justify-content: center;
}
/* 2 Karten */
section.m36_image_video .m36_karten_wrapper:not(:has(.m36_karte:nth-child(3))) {
  grid-template-columns: repeat(2, 1fr);
}
section.m36_image_video .m36_karte {
  position: relative;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.10);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
@media (min-width: 992px) {
  section.m36_image_video .m36_karte:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 42px rgba(0,0,0,0.18);
  }
}

/* ============================================================
   Media / Bild
   ============================================================ */
section.m36_image_video .m36_media_wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f0f0f0;
  border-radius: 16px 16px 16px 16px;
  overflow: visible;
}
section.m36_image_video .m36_media_wrapper .m36_bild {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  border-radius: 16px 16px 16px 16px;
  clip-path: inset(0 round 16px 16px 0 0);
}

/* ============================================================
   Video / Overlay
   ============================================================ */
section.m36_image_video .m36_video_container {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
section.m36_image_video .m36_overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 16px 16px 0 58px;
}
section.m36_image_video .m36_overlay_content {
  width: 100%;
  height: 100%;
  display: block;
}
section.m36_image_video .m36_play_button_container {
  position: absolute;
  bottom: -16px;
  left: 58px;
  z-index: 11;
}
section.m36_image_video .m36_play_no_image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  z-index: 4;
}
section.m36_image_video .m36_video_btn svg {
  fill: #fff;
}
section.m36_image_video .m36_video_btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 30, 30, 0.80);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 15px 23px 15px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  backdrop-filter: blur(4px);
}
@media (min-width: 992px) {
  section.m36_image_video .m36_video_btn:hover {
    background: rgba(30, 30, 30, 0.95);
  }
}
section.m36_image_video .m36_video_btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
}

/* ============================================================
   Icon Badge
   ============================================================ */
section.m36_image_video .m36_icon_badge {
  position: absolute;
  right: 24px;
  bottom: -38px;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dadbd7;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  color: var(--color_primary, #86a942);
}
/* Full-Karte: Icon mittig am rechten Bildrand (nur Desktop, wo Bild links ist) */
@media (min-width: 1200px) {
  section.m36_image_video .m36_karte--full .m36_icon_badge {
    right: -38px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
  }
}
section.m36_image_video .m36_icon_svg {
  width: 42px;
  height: 42px;
  display: block;
}
section.m36_image_video .m36_icon_svg svg {
  width: 100%;
  height: 100%;
  display: block;
}
section.m36_image_video .m36_icon_svg svg path,
section.m36_image_video .m36_icon_svg svg rect,
section.m36_image_video .m36_icon_svg svg circle,
section.m36_image_video .m36_icon_svg svg polygon {
  fill: var(--color_primary, #86a942);
}
section.m36_image_video .m36_icon_svg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ============================================================
   Text / Liste / Buttons (allgemeine Verlinkung, nicht per Karte)
   ============================================================ */
section.m36_image_video .m36_text {
  padding: 20px 56px 24px 56px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
section.m36_image_video .m36_untertitel,
section.m36_image_video .m36_text h3,
section.m36_image_video .m36_text h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color_text, #1a1a1a);
  line-height: 1.3;
}
section.m36_image_video .m36_text p {
  margin: 0 0 14px;
}
section.m36_image_video .m36_text p:last-of-type {
  margin-bottom: 0;
}
section.m36_image_video .m36_text ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
section.m36_image_video .m36_text ul li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  color: var(--color_text, #444);
  line-height: 1.5;
  list-style: none;
}
section.m36_image_video .m36_text ul li .m36_list_icon {
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 13px;
  height: 13px;
  display: inline-block;
  flex-shrink: 0;
  fill: var(--color_primary, #86a942);
}
section.m36_image_video .m36_text .m36_links_container,
section.m36_image_video .m36_text .m36_link_container {
  margin-top: auto;
  padding-top: 28px;
}
section.m36_image_video .m36_text .m36_link_container {
  display: flex;
  justify-content: center;
}
section.m36_image_video .m36_text .m36_link_container .button.primary.rounded_corners {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #86a942 0%, #6e8f35 100%);
  box-shadow: 0 18px 28px rgba(134, 169, 66, 0.26);
  color: #fff;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
@media (min-width: 992px) {
  section.m36_image_video .m36_text .m36_link_container .button.primary.rounded_corners:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 34px rgba(134, 169, 66, 0.32);
    background: linear-gradient(135deg, #9dc54a 0%, #7a9f32 100%);
  }
}
section.m36_image_video .m36_text a.button.secondary.rounded_corners,
section.m36_image_video .m36_text a.button.secondary.rounded_corners span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(134, 169, 66, 0.12) !important;
  color: var(--color_primary, #86a942) !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  width: auto;
  max-width: 100%;
}
section.m36_image_video .m36_text .mM_links_container {
  padding-top: 50px;
}
@media (min-width: 992px) {
  section.m36_image_video .m36_text a.button.secondary.rounded_corners:hover,
  section.m36_image_video .m36_text a.button.secondary.rounded_corners:hover span {
    background: rgba(134, 169, 66, 0.22) !important;
    color: var(--color_primary, #86a942) !important;
    transform: translateY(3px);
  }
}
section.m36_image_video .m36_link_container {
  text-align: center;
  margin-top: 48px;
}
section.m36_image_video .m36_link_container .button.primary.rounded_corners {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #86a942 0%, #6e8f35 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 18px 28px rgba(134, 169, 66, 0.26);
}
@media (min-width: 992px) {
  section.m36_image_video .m36_link_container .button.primary.rounded_corners:hover {
    background: linear-gradient(135deg, #9dc54a 0%, #7a9f32 100%);
    transform: translateY(-2px);
    box-shadow: 0 22px 34px rgba(134, 169, 66, 0.32);
  }
}

/* ============================================================
   Lightbox
   ============================================================ */
.m36_lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.m36_lightbox[aria-hidden="false"] {
  pointer-events: all;
  opacity: 1;
}
.m36_lightbox_overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}
.m36_lightbox_inner {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: visible;
}
.m36_lightbox_media {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}
.m36_lightbox_close {
  position: absolute;
  top: -21px;
  right: -21px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}
.m36_lightbox_close:hover {
  background: rgba(255,255,255,0.3);
}
.m36_lightbox_close svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* ============================================================
   Buttons: per-Karte Verlinkung
   ============================================================ */
section.m36_image_video .m36_karte .m36_links_container {
  padding: 0 0 24px;
  margin-top: auto;
  box-sizing: border-box;
}
section.m36_image_video .m36_karte .m36_link_container {
  display: block;
  width: 100%;
}
section.m36_image_video .m36_karte .m36_links_container a.button.primary.rounded_corners {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #86a942 0%, #6e8f35 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 18px 28px rgba(134, 169, 66, 0.26);
}
section.m36_image_video .m36_karte .m36_links_container a.button.secondary.rounded_corners {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  background: rgba(134, 169, 66, 0.12) !important;
  color: var(--color_primary, #86a942) !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* ============================================================
   4. Karte – Full-Width Box
   ============================================================ */
section.m36_image_video .m36_karte--full {
  grid-column: 1 / -1; /* spannt alle Spalten → automatisch so breit wie die Karten darüber */
  flex-direction: row;
  align-items: stretch;
}
section.m36_image_video .m36_karte--full .m36_media_wrapper {
  width: 40%;
  flex-shrink: 0;
  aspect-ratio: unset;
  min-height: 280px;
  border-radius: 16px;
  position: relative; /* Bild absolut positionieren, damit es nicht mehr die Card-Höhe treibt */
}
section.m36_image_video .m36_karte--full .m36_media_wrapper .m36_bild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  clip-path: inset(0 round 16px);
}
section.m36_image_video .m36_karte--full .m36_text {
  padding: 20px 56px 24px 56px;
}

/* Child-Grid innerhalb der Full-Karte */
section.m36_image_video .m36_child_grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 40px 32px;
}
section.m36_image_video .m36_child_item {
  flex: 1 1 calc(33.333% - 14px);
  min-width: 180px;
  background: #f8f8f8;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
section.m36_image_video .m36_child_bild_wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
section.m36_image_video .m36_child_bild {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
section.m36_image_video .m36_child_titel {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color_text, #1a1a1a);
  margin: 0;
}
section.m36_image_video .m36_child_text {
  font-size: 0.875rem;
  color: var(--color_text, #444);
  line-height: 1.5;
}

/* Responsive – Full-Karte stackt untereinander auf kleineren Screens */
@media (max-width: 1199px) {
  section.m36_image_video .m36_karte--full {
    flex-direction: column;
  }
  section.m36_image_video .m36_karte--full .m36_media_wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: unset;
    border-radius: 16px 16px 0 0;
  }
  section.m36_image_video .m36_karte--full .m36_media_wrapper .m36_bild {
    border-radius: 16px 16px 0 0;
    clip-path: inset(0 round 16px 16px 0 0);
  }
  section.m36_image_video .m36_child_grid {
    padding: 0 24px 24px;
  }
  section.m36_image_video .m36_child_item {
    flex: 1 1 calc(50% - 10px);
  }
}
@media (max-width: 576px) {
  section.m36_image_video .m36_karte--full .m36_text {
    padding: 16px 16px 20px;
  }
  section.m36_image_video .m36_child_grid {
    padding: 0 16px 20px;
    gap: 14px;
  }
  section.m36_image_video .m36_child_item {
    flex: 1 1 100%;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

/* ─── ≤1199px: 3 Spalten bleiben, Gap & Padding kleiner ─── */
@media (max-width: 1199px) {
  section.m36_image_video .m36_karten_wrapper {
    gap: 24px;
  }
  section.m36_image_video .m36_text {
    padding: 20px 32px 24px;
  }
  section.m36_image_video .m36_karte .m36_links_container {
    padding: 0 0 24px;
  }
  section.m36_image_video .m36_play_button_container {
    left: 32px;
  }
  section.m36_image_video .m36_icon_badge {
    right: 18px;
  }
  section.m36_image_video .m36_karte .m36_links_container a.button.primary.rounded_corners,
  section.m36_image_video .m36_karte .m36_links_container a.button.secondary.rounded_corners {
    padding: 12px 20px;
    font-size: 0.9rem;
    line-height: 1.25;
    text-align: center;
  }
}

/* ─── ≤1023px: 2 Spalten, Orphan-Fix für 3. Karte ──────── */
@media (max-width: 1023px) {
  section.m36_image_video .m36_karten_wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  /* Orphan-Fix: 3. reguläre Karte spannt beide Spalten,
     wird aber auf halbe Breite limitiert und zentriert –
     optisch gleich breit wie die Karten in der Reihe darüber */
  section.m36_image_video .m36_karten_wrapper .m36_karte:nth-child(3):not(.m36_karte--full) {
    grid-column: 1 / -1;
    width: calc(50% - 10px);
    justify-self: center;
  }
  section.m36_image_video .m36_text {
    padding: 20px 22px 24px;
  }
  section.m36_image_video .m36_karte .m36_links_container {
    padding: 0 0 20px;
  }
  section.m36_image_video .m36_header {
    margin-bottom: 36px;
  }
  section.m36_image_video .m36_karte .m36_links_container a.button.primary.rounded_corners,
  section.m36_image_video .m36_karte .m36_links_container a.button.secondary.rounded_corners {
    padding: 11px 18px;
    font-size: 0.875rem;
    line-height: 1.25;
    text-align: center;
  }
}

/* ─── ≤679px: 1 Spalte – früh, bevor Karten zu schmal ──── */
@media (max-width: 679px) {
  section.m36_image_video .m36_karten_wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* Orphan-Fix zurücksetzen */
  section.m36_image_video .m36_karten_wrapper .m36_karte:nth-child(3):not(.m36_karte--full) {
    grid-column: auto;
    width: auto;
    justify-self: stretch;
  }
  section.m36_image_video .m36_text {
    padding: 18px 20px 22px;
  }
}

/* ─── ≤576px: Section-Form ──────────────────────────────── */
@media (max-width: 576px) {
  section.m36_image_video {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
    border-radius: 16px;
    padding: 60px 0;
  }
  section.m36_image_video .m36_karten_wrapper {
    gap: 20px;
  }
  section.m36_image_video .m36_text {
    padding: 16px 16px 20px;
  }
  section.m36_image_video .m36_karte .m36_links_container {
    padding: 0 0 20px;
  }
  section.m36_image_video .m36_text a.button.secondary.rounded_corners,
  section.m36_image_video .m36_text a.button.secondary.rounded_corners span,
  section.m36_image_video .m36_link_container .button.primary.rounded_corners {
    width: 100%;
    box-sizing: border-box;
  }
  .m36_lightbox_close {
    top: 8px;
    right: 8px;
  }
}

/* ─── ≤400px ──────────────────────────────────────────── */
@media (max-width: 400px) {
  section.m36_image_video {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
    padding: 40px 0;
  }
  section.m36_image_video .m36_header {
    margin-bottom: 32px;
  }
  section.m36_image_video .m36_karten_wrapper {
    gap: 16px;
  }
  section.m36_image_video .m36_text {
    padding: 14px 14px 18px;
  }
  section.m36_image_video .m36_karte .m36_links_container {
    padding: 0 0 18px;
  }
  section.m36_image_video .m36_untertitel,
  section.m36_image_video .m36_text h3,
  section.m36_image_video .m36_text h4 {
    font-size: 1rem;
  }
  section.m36_image_video .m36_icon_badge {
    width: 60px; height: 60px; bottom: -30px; right: 16px;
  }
  section.m36_image_video .m36_icon_svg {
    width: 32px; height: 32px;
  }
}

/* ─── ≤300px ──────────────────────────────────────────── */
@media (max-width: 300px) {
  section.m36_image_video {
    width: calc(100vw - 8px);
    max-width: calc(100vw - 8px);
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    padding: 32px 0;
  }
  section.m36_image_video .m36_karten_wrapper { gap: 12px; }
  section.m36_image_video .m36_text { padding: 12px 12px 16px; }
  section.m36_image_video .m36_karte .m36_links_container { padding: 0 0 16px; }
  section.m36_image_video .m36_video_btn { font-size: 0.8rem; }
  section.m36_image_video .m36_text a.button.secondary.rounded_corners,
  section.m36_image_video .m36_text a.button.secondary.rounded_corners span {
    padding: 10px 20px; font-size: 0.85rem;
  }
  section.m36_image_video .m36_icon_badge {
    width: 50px; height: 50px; bottom: -25px; right: 12px;
  }
  section.m36_image_video .m36_icon_svg { width: 26px; height: 26px; }
}

/* ─── ≤280px ──────────────────────────────────────────── */
@media (max-width: 280px) {
  section.m36_image_video .m36_text {
    padding-top: 32px;
  }
  section.m36_image_video .m36_icon_badge {
    width: 44px;
    height: 44px;
    bottom: -22px;
    right: 10px;
  }
  section.m36_image_video .m36_icon_svg {
    width: 22px;
    height: 22px;
  }
  section.m36_image_video .m36_play_button_container {
    left: 36px;
  }
}
