/*
 * Kupplung vor Ort – Anpassungen zum Original-Stylesheet (legacy.css).
 * 1) WordPress-Eigenheiten neutralisieren  2) Ersatz für jQuery-Plugins  3) Gegen das Original kalibrierte Werte
 */

/* ---------- 1) WordPress neutralisieren ---------- */
.wp-site-blocks { padding: 0; }
.wp-block-template-part.kvo-header-part,
.wp-block-template-part.kvo-footer-part { margin: 0; }
:where(.wp-block-group.has-background) { padding: 0; }
.wp-block-image { margin: 0; }
.wp-block-image:not(.kvo-bare) img { height: auto; max-width: 100%; vertical-align: bottom; }
.wp-block-list { padding-left: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* Honeypot */
.kvo-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Inline-Icons statt Font Awesome */
.kvo-icon { display: inline-block; vertical-align: -2px; }
/* Font-Awesome-6-Glyphen (14px, Kasten 16×16) wie im Original */
.play-pause-btn .kvo-icon { width: 16px; height: 16px; }
.play-pause-btn.is-playing .kvo-icon path { d: path("M404.57 53.86H372.57Q352.57 54.86 338.57 67.86Q325.57 80.86 324.57 100.86V388.86Q325.57 409.86 338.57 422.86Q352.57 436.86 372.57 436.86L404.57 438.86Q424.57 437.86 438.57 424.86Q451.57 410.86 452.57 390.86V102.86Q451.57 82.86 438.57 68.86Q424.57 54.86 404.57 53.86ZM212.57 44.72H180.57Q160.57 45.72 146.57 58.72Q133.57 72.72 132.57 92.72V380.72Q133.57 401.72 146.57 415.72Q160.57 429.72 180.57 429.72H212.57Q232.57 428.72 246.57 415.72Q259.57 401.72 260.57 381.72V93.72Q259.57 73.72 246.57 59.72Q232.57 45.72 212.57 44.72Z"); }

/* Akkordeon: zu Beginn zu (wie jQuery UI) */
.ce_accordion .accordion { display: none; }

/* Mehrstufige Formulare */
.kvo-step[hidden] { display: none !important; }
.kvo-form-message { padding: 15px 20px; margin-bottom: 20px; border-radius: 5px; }
.kvo-form-message--ok { background: #e8f5e9; color: #1b5e20; }
.kvo-form-message--error { background: #ffebee; color: #b71c1c; }
.widget.error input, .widget.error select, .widget.error textarea { border-color: #FF0000 !important; }
.progress-bar-label a { cursor: pointer; }

/* Händler-Login */
.kvo-lostpw { margin-top: 10px; }

/* ---------- 2) Mobiles Menü (ersetzt mmenu) ---------- */
.kvo-offcanvas { position: fixed; inset: 0; z-index: 9999; }
.kvo-offcanvas[hidden] { display: none; }
.kvo-offcanvas__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .25s; }
.kvo-offcanvas__panel { position: absolute; top: 0; right: 0; bottom: 0; width: 80%; max-width: 440px; background: #000; color: #fff; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; font-family: 'Oswald', sans-serif; }
.kvo-offcanvas.is-open .kvo-offcanvas__backdrop { opacity: 1; }
.kvo-offcanvas.is-open .kvo-offcanvas__panel { transform: none; }
.kvo-offcanvas__head { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; height: 40px; border-bottom: 1px solid rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .6); text-transform: uppercase; font-size: 14px; }
.kvo-offcanvas__close { background: none; border: 0; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 0 0 10px; }
.kvo-offcanvas ul { list-style: none; margin: 0; padding: 0; }
.kvo-offcanvas li { border-bottom: 1px solid rgba(255, 255, 255, .15); }
.kvo-offcanvas li > a, .kvo-offcanvas li > strong { display: block; padding: 12px 20px; color: #fff; text-decoration: none; text-transform: uppercase; font-weight: normal; font-size: 16px; }
.kvo-offcanvas li.active > strong { background: #FF0000; }
.kvo-offcanvas li.submenu > a::after { content: '›'; float: right; transition: transform .2s; }
.kvo-offcanvas li.submenu.is-open > a::after { transform: rotate(90deg); }
.kvo-offcanvas ul.level_2 { display: none; background: rgba(255, 255, 255, .06); }
.kvo-offcanvas li.is-open > ul.level_2, .kvo-offcanvas li.trail > ul.level_2 { display: block; }
.kvo-offcanvas ul.level_2 li > a, .kvo-offcanvas ul.level_2 li > strong { padding-left: 35px; font-size: 15px; }
html.kvo-menu-open { overflow: hidden; }

/* ---------- 2) Lightbox (ersetzt swipebox) ---------- */
.kvo-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .92); display: none; align-items: center; justify-content: center; }
.kvo-lightbox.is-open { display: flex; }
.kvo-lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.kvo-lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 48px; line-height: 1; cursor: pointer; padding: 10px 18px; }
.kvo-lb-close { top: 10px; right: 10px; font-size: 40px !important; }
.kvo-lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.kvo-lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.kvo-lightbox.is-single .kvo-lb-prev, .kvo-lightbox.is-single .kvo-lb-next { display: none; }

/* YouTube nach Klick */
.js-video-replace-container.is-playing { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.js-video-replace-container.is-playing iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 3) Kalibrierung gegen das Original ---------- */

/* Referenzen-Liste: Bildzuschnitte wie die Contao-Bildgrößen (≥1200: 400×300 / 99×57, 768–991: 350×200, ≤767: 450×300, dazwischen Original) */
.news-gallery .image_container img { display: block; width: 100%; height: auto; object-fit: cover; object-position: center; }
@media only screen and (min-width: 1200px) {
	.news-gallery .element_big img { aspect-ratio: 4 / 3; }
	.news-gallery .element_small img { aspect-ratio: 99 / 57; }
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
	.news-gallery .image_container img { aspect-ratio: 350 / 200; }
}
@media only screen and (max-width: 767px) {
	.news-gallery .image_container img { aspect-ratio: 3 / 2; }
}

/* „// Unterzeile“: im Original steht ein Leerzeichen nach dem // */
.headline-before::before { margin-right: .25em; }

/* Leere Absätze mit &nbsp; aus Contao (Abstandhalter) */
.kvo-spacer::before { content: "\00a0"; }

/* Galerien und Tipps-Bilder: Zuschnitt wie die Contao-Bildgröße der jeweiligen Galerie (CSS-Variablen am Element) */
.ce_gallery ul li figure.image_container img, .news-image .image_container img { aspect-ratio: var(--kvo-r, auto); object-fit: cover; object-position: center; width: 100%; height: auto; }
@media only screen and (min-width: 768px) and (max-width: 991px) { .ce_gallery ul li figure.image_container img, .news-image .image_container img { aspect-ratio: var(--kvo-rt, var(--kvo-r, auto)); } }
@media only screen and (max-width: 767px) { .ce_gallery ul li figure.image_container img, .news-image .image_container img { aspect-ratio: var(--kvo-rm, var(--kvo-r, auto)); } }

/* Formularschritte: Felder nehmen wie in Contao direkt am Flex-Layout von .formbody teil */
.kvo-step { display: contents; }

/* Akkordeon-Titel ohne Überschrift: Zeilenhöhe wie im Original */
.ce_accordion > .toggler { line-height: normal; }

/* Bildunterschriften wie Contao (.caption) */
.ce_image .wp-element-caption, .ce_text .wp-element-caption, .ce_image p.caption { font-size: 0.85rem; opacity: 0.4; letter-spacing: 0.05rem; padding-top: 5px; margin: 0; }

/* Weiter/Zurück-Knöpfe (im Original type=submit, hier type=button): gleiche Grunddarstellung */
.kvo-multistep button[data-kvo-step] { -webkit-appearance: none; appearance: none; border: none; border-radius: 0; }
/* Links, die in Contao direkt im Container standen (hier in einem Absatz) */
p.kvo-link { display: contents !important; font: inherit !important; line-height: inherit !important; color: inherit !important; letter-spacing: inherit !important; text-transform: inherit !important; }
/* Bilder, die in Contao ohne <figure> standen */
figure.kvo-bare { display: contents; }
.wp-block-image.kvo-bare img { vertical-align: baseline; box-sizing: content-box; max-width: none; height: auto; }

/* Video-Player: Größe wie das Contao-Element (640 × 360) */
.ce_player .wp-block-video { margin: 0; }
.ce_player video { width: 640px; max-width: 100%; height: auto; display: block; }

/* YouTube im festen 16:9-Rahmen (ehem. rsce_youtube): Vorschau füllt den Rahmen */
.kvo-yt-169 > .js-video-replace-container { position: absolute; inset: 0; }
.kvo-yt-169 > .js-video-replace-container.is-playing { padding-bottom: 0; height: 100%; }
.kvo-yt-169 .video-accept-container { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; }
.kvo-yt-169 .video-accept-container > img { width: 100%; height: 100%; object-fit: cover; }

/* Zuschnitt je Breakpoint (Contao-Bildgrößen), siehe inc/media.php */
@media (min-width: 768px) and (max-width: 991px) {
	figure[class*="kvo-rt-"] img { aspect-ratio: var(--kvo-rt) !important; object-fit: cover !important; height: auto !important; }
}
@media (max-width: 767px) {
	figure[class*="kvo-rm-"] img { aspect-ratio: var(--kvo-rm) !important; object-fit: cover !important; height: auto !important; }
}
