/* =========================================================
   Punkfish Embed / Minimal Mode
   Aktiv bei ?minimal=true
   Marker:
   - neu:  html.pf-embed-minimal  (gesetzt von embed-minimal.js)
   - legacy: body.iframe-version  (zusätzlich gesetzt für alte Tools)
   ========================================================= */

/* ---------- 0) Body-Grundlayout im Embed ---------- */
html.pf-embed-minimal body,
body.iframe-version {
  margin: 0 !important;
  padding: 14px 0 18px !important;     /* oben/unten Luft im iframe */
  background: transparent !important;
  overflow: visible !important;         /* kein internes Scrollen */
  min-height: auto !important;
}

/* ---------- 1) Kopf-/Fuß-/Nav-Bereiche ausblenden ---------- */
html.pf-embed-minimal #header,
html.pf-embed-minimal #footer,
html.pf-embed-minimal .site-header,
html.pf-embed-minimal .site-footer,
html.pf-embed-minimal .global-nav,
html.pf-embed-minimal #intro-text,
html.pf-embed-minimal #info-text,
body.iframe-version #header,
body.iframe-version #footer,
body.iframe-version .site-header,
body.iframe-version .site-footer,
body.iframe-version .global-nav,
body.iframe-version #intro-text,
body.iframe-version #info-text {
  display: none !important;
}

/* ---------- 2) Sticky neutralisieren (gezielt) ---------- */
html.pf-embed-minimal [style*="position:sticky"],
html.pf-embed-minimal .is-sticky,
html.pf-embed-minimal .sticky,
body.iframe-version [style*="position:sticky"],
body.iframe-version .is-sticky,
body.iframe-version .sticky {
  position: static !important;
  top: auto !important;
}

/* ---------- 3) 100vh/Viewport-Höhen auflösen ---------- */
html.pf-embed-minimal [style*="height:100vh"],
html.pf-embed-minimal [style*="min-height:100vh"],
html.pf-embed-minimal .vh-100,
html.pf-embed-minimal .min-vh-100,
html.pf-embed-minimal .full-height,
html.pf-embed-minimal .et_fullwidth_section,
body.iframe-version [style*="height:100vh"],
body.iframe-version [style*="min-height:100vh"],
body.iframe-version .vh-100,
body.iframe-version .min-vh-100,
body.iframe-version .full-height,
body.iframe-version .et_fullwidth_section {
  height: auto !important;
  min-height: 0 !important;
}

/* ---------- 4) Main kompakt & sauber ---------- */
html.pf-embed-minimal main,
body.iframe-version main {
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  width: 100%;
}

/* Erstes sichtbares Element nicht nach unten schieben */
html.pf-embed-minimal main > :first-child,
body.iframe-version main > :first-child {
  margin-top: 0 !important;
}

/* ---------- 5) Container enger setzen ---------- */
html.pf-embed-minimal .container,
html.pf-embed-minimal .wrap,
html.pf-embed-minimal .content-area,
body.iframe-version .container,
body.iframe-version .wrap,
body.iframe-version .content-area {
  margin: 0 auto !important;
  padding: 0 12px !important;          /* mobile-freundlicher Rand */
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ---------- 6) Medien responsiv ---------- */
html.pf-embed-minimal img,
html.pf-embed-minimal video,
html.pf-embed-minimal svg,
html.pf-embed-minimal canvas,
body.iframe-version img,
body.iframe-version video,
body.iframe-version svg,
body.iframe-version canvas {
  max-width: 100%;
  height: auto;
}

/* ---------- 7) Divi/Section-Paddings bändigen (optional) ---------- */
html.pf-embed-minimal .section,
html.pf-embed-minimal .et_pb_section,
html.pf-embed-minimal .et_pb_row,
body.iframe-version .section,
body.iframe-version .et_pb_section,
body.iframe-version .et_pb_row {
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---------- 8) Schatten reduzieren (optional) ---------- */
html.pf-embed-minimal .card,
html.pf-embed-minimal .box,
html.pf-embed-minimal .et_pb_module,
body.iframe-version .card,
body.iframe-version .box,
body.iframe-version .et_pb_module {
  box-shadow: none !important;
}

/* ---------- 9) Doppelte Scrollbars verhindern ---------- */
html.pf-embed-minimal [style*="overflow:auto"],
html.pf-embed-minimal [style*="overflow: auto"],
html.pf-embed-minimal [style*="overflow:scroll"],
html.pf-embed-minimal [style*="overflow: scroll"],
html.pf-embed-minimal [style*="overflow-y"],
html.pf-embed-minimal [style*="overflow-x"],
body.iframe-version [style*="overflow:auto"],
body.iframe-version [style*="overflow: auto"],
body.iframe-version [style*="overflow:scroll"],
body.iframe-version [style*="overflow: scroll"],
body.iframe-version [style*="overflow-y"],
body.iframe-version [style*="overflow-x"] {
  overflow: visible !important;
  overflow-y: visible !important;
  overflow-x: visible !important;
}

/* ---------- 10) Punkfish Tool-Frame: volle Breite im Embed ---------- */
html.pf-embed-minimal .pf-tool-frame,
body.iframe-version .pf-tool-frame {
  max-width: none !important;
  margin: 0 !important;
}
