/* ==========================================================================
   SAPOR Redesign – Ebene über dem Theme Manon
   Alles gilt nur mit body.sapor-rd (setzt das Plugin). Ohne Klasse: alter Stand.
   Grundsatz: Manon bleibt erkennbar (Slider, Seitenleiste, Oswald-Versalien,
   Kontur-Laufband, Pastellkacheln, Halbkreis-Fußzeile). Verbessert werden
   Lesbarkeit, Zeilenabstände (keine Überschneidungen), Raster und Mobil.
   ========================================================================== */

body.sapor-rd {
    --rd-text: #161616;
    --rd-grau: #5f5f5f;
    --rd-linie: #e2ddd5;
    --rd-flaeche: #f3efe9;
    --rd-kopf: "Oswald", sans-serif;
    --rd-lauf: "Open Sans", sans-serif;
    --rd-rand: clamp(20px, 4vw, 56px);
}

/* --------------------------------------------------------------------------
   1. Überschriften: Oswald bleibt, Zeilenabstand so, dass sich Umlaute,
      Kommas und Ober-/Unterlängen benachbarter Zeilen nie berühren
   -------------------------------------------------------------------------- */
body.sapor-rd .edgtf-content :is(h1, h2, h3, h4, h5, h6):not(rs-module-wrap *),
body.sapor-rd .edgtf-page-footer :is(h1, h2, h3, h4, h5, h6) {
    line-height: 1.22;
    overflow-wrap: break-word;
    text-wrap: balance;
}

body.sapor-rd .edgtf-content h2:not(rs-module-wrap *) { font-size: clamp(40px, 5.4vw, 80px); }
body.sapor-rd .edgtf-content h3:not(rs-module-wrap *) { font-size: clamp(30px, 3.7vw, 54px); line-height: 1.28; }
body.sapor-rd .edgtf-content h4:not(rs-module-wrap *) { font-size: clamp(21px, 1.9vw, 27px); line-height: 1.28; }
body.sapor-rd .edgtf-content h5:not(rs-module-wrap *) { line-height: 1.28; }
body.sapor-rd .edgtf-content h6:not(rs-module-wrap *) { line-height: 1.3; }

/* Blogbeiträge: ein Zusatz-CSS (inline im Kopf) erzwingt dort 1,12 mit !important – daher hier spezifischer */
body.sapor-rd .edgtf-post-text-main :is(h1, h2, h3, h4, h5, h6),
body.sapor-rd.single-post .edgtf-blog-single .edgtf-post-text-main :is(h1, h2, h3, h4, h5, h6) { line-height: 1.26 !important; }

/* Eingefärbte/fett gesetzte Teile in Überschriften (oft mit eigener Zeilenhöhe aus dem Editor) übernehmen die der Überschrift */
body.sapor-rd .edgtf-content :is(h1, h2, h3, h4, h5, h6):not(rs-module-wrap *) :is(span, strong, b, em, a) { line-height: inherit !important; }

/* Kleinschreibung in Oswald (z. B. Zitate) braucht mehr Luft für g, p, y */
body.sapor-rd .edgtf-content [style*="text-transform: none"],
body.sapor-rd .edgtf-content .edgtf-testimonial-title { line-height: 1.38; }

/* Seitentitel der Blog-/Rechtsseiten */
body.sapor-rd .edgtf-title-holder .edgtf-page-title,
body.sapor-rd .edgtf-post-title,
body.sapor-rd .edgtf-post-heading .entry-title { line-height: 1.22 !important; }

/* --------------------------------------------------------------------------
   2. Fließtext: Open Sans bleibt, etwas mehr Zeilenabstand, ruhige Breite
   -------------------------------------------------------------------------- */
/* Ausnahme: Waterless-Block (.sapor-wl) behält seine eigene Gestaltung – cs, 02.12.2026 */
body.sapor-rd .edgtf-content :is(p, li):not(.sapor-wl *),
body.sapor-rd .edgtf-content .wpb_text_column {
    color: var(--rd-text);
}

body.sapor-rd .edgtf-content p:not(rs-module-wrap *, .sapor-wl *),
body.sapor-rd .edgtf-content .wpb_text_column li,
body.sapor-rd .edgtf-post-text-main li {
    line-height: 1.62;
}


body.sapor-rd .edgtf-content p a:not(.edgtf-btn, .sapor-wl *),
body.sapor-rd .edgtf-content li a:not(.edgtf-btn, .sapor-wl *) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Lange Texte (Blog, Rechtstexte, Produktbeschreibung) nicht zu breit */
body.sapor-rd .edgtf-post-text-main > :is(p, ul, ol, h2, h3, h4),
body.sapor-rd.page-template-full-width .edgtf-grid-col-12 > .wpb-content-wrapper > .wpb_text_column {
    max-width: 76ch;
}

/* --------------------------------------------------------------------------
   3. Kopf: Beschriftung „Menü“ neben dem Raster-Symbol
   -------------------------------------------------------------------------- */
body.sapor-rd .edgtf-page-header .edgtf-side-menu-button-opener,
body.sapor-rd .edgtf-sticky-header .edgtf-side-menu-button-opener {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
}

body.sapor-rd .edgtf-page-header .edgtf-side-menu-button-opener::before {
    content: "Menü";
    font: 700 13px/1 var(--rd-kopf);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: currentColor;
}
html[lang^="en"] body.sapor-rd .edgtf-page-header .edgtf-side-menu-button-opener::before { content: "Menu"; }
html[lang^="fr"] body.sapor-rd .edgtf-page-header .edgtf-side-menu-button-opener::before { content: "Menu"; }

/* --------------------------------------------------------------------------
   4. Seitenleiste: Schriftgröße und Abstände wie bei Manon (85 px, Luis 01.12.).
      Behoben wird nur: VERANTWORTUNG (610 px breit) war abgeschnitten → Leiste
      etwas breiter (633 → 720 px); BLOG/KONTAKT lagen unter dem Bildschirmrand,
      ohne dass man scrollen konnte → Leiste scrollt.
   -------------------------------------------------------------------------- */
body.sapor-rd .edgtf-side-menu {
    width: min(720px, 100vw);
    right: calc(-1 * min(720px, 100vw));
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #444 #000;
}

/* --------------------------------------------------------------------------
   6. Produktraster (Startseite + Produkte): gleichmäßiges Raster,
      ruhige Flächen, Namen immer sichtbar statt erst beim Überfahren
   -------------------------------------------------------------------------- */
body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-inner {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 28px);
    height: auto !important;
    margin: 0 !important;
}

body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-inner::before,
body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-inner::after,
body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-grid-sizer,
body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-grid-gutter {
    display: none !important;
}

body.sapor-rd .edgtf-portfolio-list-holder article.edgtf-pl-item {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    width: auto !important;
    height: auto !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.sapor-rd .edgtf-pl-item .edgtf-pl-item-inner {
    position: relative;
    height: auto !important;
}

body.sapor-rd .edgtf-pl-item .edgtf-pli-image {
    background: var(--rd-flaeche);
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

body.sapor-rd .edgtf-pl-item .edgtf-pli-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    mix-blend-mode: multiply;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1);
}

body.sapor-rd .edgtf-pl-item:hover .edgtf-pli-image img { transform: scale(1.035); }

body.sapor-rd .edgtf-pl-item .edgtf-pli-text-holder {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: none !important;
    transform: none !important;
    height: auto !important;
    padding: 14px 0 4px !important;
    text-align: left !important;
}

body.sapor-rd .edgtf-pl-item .edgtf-pli-text-wrapper,
body.sapor-rd .edgtf-pl-item .edgtf-pli-text {
    display: block !important;
    height: auto !important;
    padding: 0 !important;
    transform: none !important;
    opacity: 1 !important;
}

body.sapor-rd .edgtf-pl-item .edgtf-pli-title,
body.sapor-rd .edgtf-pl-item .edgtf-pli-title a {
    margin: 0 !important;
    color: #000 !important;
    font: 700 18px/1.3 var(--rd-kopf) !important;
    text-transform: uppercase;
    opacity: 1 !important;
    transform: none !important;
}

/* Schriftgröße setzt das Skript notfalls am h6 herab (lange Wörter) – der Link erbt sie */
body.sapor-rd .edgtf-pl-item .edgtf-pli-title a { font: inherit !important; }

body.sapor-rd .edgtf-pl-item .edgtf-pli-category-holder { display: none !important; }

body.sapor-rd .edgtf-pl-item .edgtf-pli-link {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3;
}

/* Abstand des Produktrasters zum Rand auf schmalen Schirmen */
@media (max-width: 1024px) {
    body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   7. Zitate: normale Schreibung statt langer Versalblöcke
   -------------------------------------------------------------------------- */
body.sapor-rd .edgtf-testimonials-holder .edgtf-testimonial-title {
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: clamp(21px, 2vw, 28px) !important;
    letter-spacing: 0 !important;
    max-width: 30em;
}

body.sapor-rd .edgtf-testimonials-holder .edgtf-testimonials-author-name {
    font-family: var(--rd-kopf);
    font-weight: 700;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   8. Fußzeile: Halbkreis bleibt, dazu Adresse (fügt redesign.js ein)
   -------------------------------------------------------------------------- */
body.sapor-rd .sapor-rd-adresse {
    margin: 10px 0 0 !important;
    font: 400 15px/1.6 var(--rd-lauf) !important;
    color: var(--rd-grau) !important;
}

body.sapor-rd .sapor-rd-adresse a { color: inherit !important; }

/* --------------------------------------------------------------------------
   9. Mobil
   -------------------------------------------------------------------------- */
/* Mobiles Menü: statt kleiner Klappliste dieselbe große schwarze Liste wie die Seitenleiste am Desktop */
@media (max-width: 1024px) {
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav {
        background: #000 !important;
        height: auto !important;
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
        overflow-y: auto !important;
        overscroll-behavior: contain;
        padding: 18px 0 30px !important;
    }

    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav .edgtf-grid { width: auto !important; padding: 0 var(--rd-rand); }

    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav ul li a,
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav ul li h6 {
        display: block;
        padding: 3px 0 !important;
        border: 0 !important;
        color: #fff !important;
        font: 700 clamp(28px, 8.6vw, 40px)/1.22 var(--rd-kopf) !important;
        text-transform: uppercase;
        text-decoration: none !important;
    }

    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav ul li.current-menu-item > a,
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav ul li.edgtf-active-item > a {
        color: transparent !important;
        -webkit-text-stroke: 1px #fff;
    }
}

@media (max-width: 767px) {
    body.sapor-rd .edgtf-content h2:not(rs-module-wrap *) { font-size: clamp(32px, 9.6vw, 44px); }
    body.sapor-rd .edgtf-content h3:not(rs-module-wrap *) { font-size: clamp(27px, 8vw, 36px); }
    body.sapor-rd .edgtf-content h4:not(rs-module-wrap *) { font-size: clamp(20px, 5.6vw, 24px); }
    body.sapor-rd .edgtf-content p:not(rs-module-wrap *, .sapor-wl *),
    body.sapor-rd .edgtf-content li:not(.sapor-wl *) { font-size: 16px; }

    body.sapor-rd .edgtf-portfolio-list-holder .edgtf-pl-inner { gap: 16px 12px; }
    body.sapor-rd .edgtf-pl-item .edgtf-pli-title { font-size: 15px !important; }
}

@media (prefers-reduced-motion: reduce) {
    body.sapor-rd .edgtf-pl-item .edgtf-pli-image img { transition: none; }
}

/* Kreis-Knöpfe (z. B. „Toute l’équipe“): zweizeilige Beschriftung mit Akzenten braucht Luft */
body.sapor-rd .edgtf-btn-circle-inner span { line-height: 1.25 !important; }

/* --------------------------------------------------------------------------
   10. Handy oben (02.12.2026): zwei Fehler, die schon im alten Manon-Stand stecken
   - Kopfzeile brach um (Logo oben, SHOP/Sprachen/Menü darunter, 140 statt 70 px):
     Manon setzt den Rahmen der mobilen Kopfzeile auf 80 % der Breite (300 px bei 375 px),
     Logo 173 px + rechte Gruppe 142 px passen nicht nebeneinander.
   - Slider: zwei der fünf Punkte lagen rechts außerhalb des Bildschirms.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    body.sapor-rd .edgtf-mobile-header .edgtf-grid {
        width: auto !important;
        margin: 0 16px !important;
    }
}

@media (max-width: 400px) {
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-logo-wrapper img {
        height: 32px !important;
        width: auto !important;
    }
}

@media (max-width: 767px) {
    body.sapor-rd rs-module-wrap rs-bullets {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }
}

/* --------------------------------------------------------------------------
   11. Handy: Menü-Animationen (02.12.2026, Luis: „mobil keine schönen Animationen“)
   - Menü (☰): Manon klappt per jQuery slideDown/slideUp(450) auf. Abschnitt 9 setzt die
     Höhe fest (height:auto !important) → die Animation lief ins Leere: Menü sprang auf,
     beim Schließen stand es 0,45 s still und verschwand schlagartig.
     Jetzt: Fläche öffnet sich von oben (clip-path), Menüpunkte gleiten nacheinander herein;
     beim Schließen blendet sie aus (Klasse .sapor-rd-zu aus redesign.js).
   - Seitenleiste: Manon schiebt sie über „right“ mit easeInOutQuart (0,6 s) → wirkte die
     ersten 0,3 s wie eingefroren und ruckelt (Layout je Bild). Jetzt transform mit
     weichem Auslauf, sofortiger Start, Einträge folgen versetzt.
   Nur bis 1024 px und nur ohne „Bewegung reduzieren“.
   -------------------------------------------------------------------------- */
@keyframes sapor-rd-flaeche-auf {
    from { clip-path: inset(0 0 100% 0); }
    to   { clip-path: inset(0 0 0 0); }
}
@keyframes sapor-rd-flaeche-zu {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateY(-8px); }
}
@keyframes sapor-rd-punkt-auf {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
@keyframes sapor-rd-leiste-punkt {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 1024px) and (prefers-reduced-motion: no-preference) {
    /* Menü (☰) */
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav {
        animation: sapor-rd-flaeche-auf .42s cubic-bezier(.22, 1, .36, 1) both;
    }
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav .edgtf-grid > ul > li {
        animation: sapor-rd-punkt-auf .5s cubic-bezier(.22, 1, .36, 1) both;
        animation-delay: calc(80ms + var(--sapor-rd-i, 0) * 45ms);
    }
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav.sapor-rd-zu {
        animation: sapor-rd-flaeche-zu .26s cubic-bezier(.4, 0, 1, 1) both;
    }
    body.sapor-rd .edgtf-mobile-header .edgtf-mobile-nav.sapor-rd-zu .edgtf-grid > ul > li { animation: none; }

    /* Seitenleiste */
    body.sapor-rd.edgtf-side-menu-slide-from-right .edgtf-side-menu {
        right: 0;
        transform: translateX(100%);
        transition: transform .38s cubic-bezier(.4, 0, 1, 1), visibility 0s linear .38s;
        will-change: transform;
    }
    body.sapor-rd.edgtf-side-menu-slide-from-right.edgtf-right-side-menu-opened .edgtf-side-menu {
        transform: none;
        transition: transform .5s cubic-bezier(.22, 1, .36, 1), visibility 0s;
    }
    body.sapor-rd.edgtf-right-side-menu-opened .edgtf-side-menu nav.edgtf-sidearea-menu > ul > li,
    body.sapor-rd.edgtf-right-side-menu-opened .edgtf-side-menu .edgtf-sidearea-widgets {
        animation: sapor-rd-leiste-punkt .55s cubic-bezier(.22, 1, .36, 1) both;
        animation-delay: calc(120ms + var(--sapor-rd-i, 0) * 45ms);
    }
}

/* Reihenfolge für das Versetzen */
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(2),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(2) { --sapor-rd-i: 1; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(3),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(3) { --sapor-rd-i: 2; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(4),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(4) { --sapor-rd-i: 3; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(5),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(5) { --sapor-rd-i: 4; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(6),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(6) { --sapor-rd-i: 5; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(7),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(7) { --sapor-rd-i: 6; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(8),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(8) { --sapor-rd-i: 7; }
body.sapor-rd .edgtf-mobile-nav .edgtf-grid > ul > li:nth-child(n+9),
body.sapor-rd nav.edgtf-sidearea-menu > ul > li:nth-child(n+9),
body.sapor-rd .edgtf-side-menu .edgtf-sidearea-widgets { --sapor-rd-i: 8; }

/* Seitenleiste am Handy: 85 px (Abschnitt 4, Desktop) schnitt PRODUKTE, GESCHICHTE,
   VERANTWORTUNG ab → bis 767 px 11vw (41 px bei 375 px, längster Eintrag endet bei 331 px). */
@media (max-width: 767px) {
    body.sapor-rd .edgtf-side-menu nav.edgtf-sidearea-menu > ul > li { padding-left: var(--rd-rand) !important; }
    body.sapor-rd .edgtf-side-menu nav.edgtf-sidearea-menu > ul > li > a {
        font-size: clamp(34px, 11vw, 85px) !important;
        margin-bottom: 14px !important;
    }
    body.sapor-rd .edgtf-side-menu .edgtf-sidearea-widgets { padding: 20px var(--rd-rand); }
}
