/*
Theme Name: Cody Child
Theme URI: https://example.com/cody
Template: cody
Author: Henning
Author URI: https://example.com
Description: Child-Theme von Cody. Eigene Anpassungen hier vornehmen, ohne das Parent-Theme zu verändern.
Version: 1.4.26
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cody-child
*/

/* =========================================================
   Eigene Anpassungen (überschreiben das Parent-Theme)
   =========================================================
   Die Design-Tokens des Parent-Themes lassen sich hier
   bequem überschreiben, z. B.:

   :root {
       --cody-color-accent: #db2777;
   }
   ========================================================= */

:root {
    --cody-color-text: #1a1a1a;
    --cody-color-bg: #ffffff;
    --cody-color-primary: rgb(27,171,119);
    --cody-color-accent: rgb(27,171,119);
    --cody-color-muted: #6b7280;
    --cody-color-border: #e5e7eb;
    --cody-color-bg2: rgb(233,233,233);
    --cody-color-bg-light: rgb(244,244,244);


    --cody-font-base: "Montserrat";
    --cody-font-weight: 600;
    --cody-font-size: 16px;
    --cody-line-height: 24px;

    --cody-content-width: 1600px;
    --cody-space: 32px;

    /* Höhe der (sticky) Kopfleiste – an einer Stelle gepflegt, damit Hero
       und scroll-padding-top automatisch mitwachsen. */
    --cody-header-height: 56px;
}



/* Sanftes Scrollen zu Menü-Ankern (#section). scroll-padding-top gibt dem
   Ziel etwas Luft nach oben. prefers-reduced-motion: ohne Animation, für
   Nutzer, die reduzierte Bewegung bevorzugen (Barrierefreiheit). */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Sticky-Header berücksichtigen: Anker-Ziele dürfen nicht unter der
   Kopfleiste landen → deren Höhe plus etwas Luft als Offset. */
html {
    scroll-padding-top: calc(var(--cody-header-height) + var(--cody-space));
}

/* Kein horizontaler Scrollbalken durch full-bleed-Elemente (.cody-hero,
   .cody-video) und überstehende Pfeile. clip auf html UND body: auf iOS ist
   html der horizontale Scroll-Container, daher reicht body allein nicht.
   clip statt hidden → erzeugt keinen Scroll-Container (sticky bleibt heil). */
html,
body {
    overflow-x: clip;
    font-size: 16px;
}

body {
    background: var(--cody-color-bg-light);
}

/* =========================================================
   Hero (.cody-hero) – genutzt vom Block-Pattern und in PHP.
   Mobile-first: Bild oben, Content darunter.
   Ab 850px: Content als Overlay über dem Bild.
   ========================================================= */
.cody-hero {
    display: grid;
    gap: var(--cody-space);
    /* Full-Bleed: über die Container-Breite hinaus bis an die Fensterkanten. */
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
}


/* Hero bündig unter den Header, wenn er das erste Element ist –
   gleicht das obere Padding von .site-content (#content) aus. */
.entry-content > .cody-hero:first-child {
    margin-top: calc(var(--cody-space) * -2);
}

/* Manche WordPress-Versionen rendern im Group-Block einen zusätzlichen
   Wrapper. Per display:contents wird er aus dem Layout entfernt, sodass
   Bild und Content direkte Grid-Kinder von .cody-hero werden. */
.cody-hero > .wp-block-group__inner-container {
    display: contents;
}

.cody-hero__media {
    margin: 0;
}

.cody-hero__media img {
    display: block;
    width: 100%;
    height: auto;
}

.cody-hero__content {
    display: flex;
    flex-direction: column;
    gap: var(--cody-space);
    /* Innenabstand, da der Hero randlos ist. */
    padding: calc(var(--cody-space) * 1.5);
}

/* Doppelte Abstände der Core-Blöcke vermeiden – Abstand kommt aus gap. */
.cody-hero__content > * {
    margin-block: 0;
}


@media (min-width: 53.125em) { /* 850px */
    .cody-hero {
        gap: 0;
        /* Fix: immer Fullscreen abzüglich der (sticky) Navbar. */
        height: calc(100vh - var(--cody-header-height));
        grid-template-rows: 1fr;
        /* minmax(0,1fr): Spalte fix auf Containerbreite – das überbreite Bild
           bläht die Grid-Zelle NICHT auf (sonst stimmt die Content-Zentrierung nicht). */
        grid-template-columns: minmax(0, 1fr);
        overflow: hidden;
    }

    /* Bild und Content in dieselbe Rasterzelle → Overlay. */
    .cody-hero__media,
    .cody-hero__content {
        grid-area: 1 / 1;
    }

    /* Bild: volle Höhe, korrektes Seitenverhältnis, 300px von links eingerückt. */
    .cody-hero__media {
        height: 100%;
        justify-self: start;
        margin-inline-start: 300px;
    }

    .cody-hero__media img {
        height: 100vh;
        width: auto;
        max-width: none;
    }


    /* Content auf Container-Breite zentriert – linke Innenkante fluchtet jetzt
       mit dem Logo (gleiche max-width + Gutter wie .site-header__inner). */
    .cody-hero__content {
        position: relative;
        z-index: 1;
        align-self: end;
        justify-self: center;
        width: 100%;
        max-width: var(--cody-content-width);
        padding-inline: var(--cody-space);
        padding-block: clamp(var(--cody-space), 5vw, calc(var(--cody-space) * 4));
        /* Helle Lese-Ebene hinter dem Text für ausreichenden Kontrast
           (WCAG). Verlauf links deckend → rechts transparent. Bei Bedarf
           anpassen oder entfernen. */
        /*background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.6) 70%,
            rgba(255, 255, 255, 0)
        );*/
    }

    .cody-hero__content .wp-block-group__inner-container {
        max-width: 530px;
    }

    /* Nur Überschrift und Fließtext schmal halten – Buttons unangetastet. */
    .cody-hero__content :is(h1, h2, p) {
        max-width: 40rem;
    }
}

@media (min-width: 1600px) {
    .cody-hero__media {
        height: 100%;
        justify-self: start;
        margin-inline-start: 25vw;
    }
}

/* =========================================================
   Features (.cody-features) – Pattern: Icon + Titel + Lead + Hover-Text.
   3 weiße Kacheln mit Gutter; der zweite Absatz blendet beim Hover ein.
   ========================================================= */
.cody-features {
    display: grid;
    grid-template-columns: 1fr;        /* mobil: 1 Spalte */
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 53.125em) {
    .cody-features {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Group-Wrapper mancher WP-Versionen flach machen, damit Raster + Kacheln
   sauber greifen (gleicher Trick wie beim Hero). */
.cody-features .wp-block-group__inner-container {
    display: contents;
}

.cody-feature {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Feste Höhe – bleibt beim Hover unverändert. Bei längeren Texten erhöhen. */
    height: 360px;
    overflow: hidden;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cody-feature__icon {
    margin: 0 0 24px;                  /* mehr Luft unter dem Icon */
}

.cody-feature__icon img {
    display: block;
    width: 54px;
    height: auto;
}

.cody-scroller .cody-feature__icon img {
    width: 96px;
}

/* Feature-Titel: nicht das globale uppercase-H3, sondern Title-Case in Grün.
   margin-top: auto schiebt den gesamten Textblock an den unteren Rand. */
.cody-feature__title {
    margin: auto 0 0;
    font-size: 18px;
    line-height: 1.3;
    text-transform: none;
    color: var(--cody-color-primary);
}

/* Immer sichtbarer Lead-Text (fett). */
.cody-feature__lead {
    margin: 0;
    font-weight: 700;
    color: var(--cody-color-text);
}

/* Zweiter Absatz: standardmäßig eingeklappt, blendet bei Hover/Fokus ein. */
.cody-feature__more {
    margin: 0;
    color: var(--cody-color-text);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.cody-feature:hover .cody-feature__more,
.cody-feature:focus-within .cody-feature__more {
    max-height: 22rem;
    opacity: 1;
}

/* =========================================================
   Partner-Raster (.partnerbox) – Core-Columns-Block statt Scroller.
   Befüllte Spalten sehen aus wie die .cody-feature-Karten aus dem
   Scroller; leere Spalten (Platzhalter im Editor) werden ausgeblendet.
   ========================================================= */
.wp-block-columns.partnerbox {
    display: grid;                     /* überschreibt das Flex-Layout des Columns-Blocks */
    grid-template-columns: 1fr;        /* mobil: 1 Spalte */
    gap: 24px;
}

/* Zwischenschritt Tablet: 2 Spalten, sonst werden die Karten zwischen
   850px und ~1100px extrem schmal. */
@media (min-width: 53.125em) {
    .wp-block-columns.partnerbox {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 68.75em) { /* 1100px */
    .wp-block-columns.partnerbox {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Befüllte Spalte = Karte im Scroller-Look (wie .cody-feature). */
.partnerbox > .wp-block-column:has(*) {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 360px;
    overflow: hidden;
    padding: 24px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    min-width: 0;                      /* verhindert Grid-Blowout durch Logos */
}

/* Leere Platzhalter-Spalten aus dem Raster nehmen (Karten rücken nach). */
.partnerbox > .wp-block-column:not(:has(*)) {
    display: none;
}

/* Logos in Kartengröße wie im Scroller (Basis wäre 54px). */
.partnerbox .cody-feature__icon img {
    width: 96px;
}

/* =========================================================
   Karten-Scroller (.cody-scroller) – horizontale Reihe aus Feature-Karten,
   je ~25% breit, beliebig viele, horizontal scrollbar mit Snap.
   ========================================================= */
.cody-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;          /* Luft für die Scrollbar */
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

/* Group-Wrapper flach machen (wie bei den anderen Patterns). */
.cody-scroller .wp-block-group__inner-container {
    display: contents;
}

/* Karten behalten ihre feste Breite (nicht schrumpfen) und rasten beim Scrollen. */
.cody-scroller .cody-feature {
    flex: 0 0 78%;                 /* mobil: eine Karte, die nächste lugt hervor */
    scroll-snap-align: start;
}

/* Zwischenschritt Tablet: 2 Karten sichtbar — 4 Karten wären zwischen
   850px und ~1100px extrem schmal. (100% − 1 × gap) / 2 = 50% − 6px. */
@media (min-width: 53.125em) {
    .cody-scroller .cody-feature {
        flex-basis: calc(50% - 6px);
    }
}

@media (min-width: 68.75em) { /* 1100px */
    .cody-scroller .cody-feature {
        /* Desktop: genau 4 sichtbar. Die 3 Gaps aus der Breite
           herausrechnen, sonst sprengen 4 Karten den Container:
           (100% − 3 × gap) / 4 = 25% − 18px. */
        flex-basis: calc(25% - 18px);
    }
}

/* Mit JS (scroller.js): Scrollbar ausblenden, Pfeile einblenden.
   Ohne JS bleibt die native Scrollbar sichtbar und nutzbar. */
.cody-scroller-wrap {
    position: relative;
}

.cody-scroller-wrap.is-ready .cody-scroller {
    scrollbar-width: none;         /* Firefox */
    padding-bottom: 0;
}

.cody-scroller-wrap.is-ready .cody-scroller::-webkit-scrollbar {
    display: none;                 /* WebKit/Blink */
}

/* Positionierungs-Container für die Pfeile (kommt aus scroller.js).
   Standard: deckungsgleich mit dem Wrap – die Pfeile sitzen wie bisher an
   dessen Kanten. pointer-events:none, damit die unsichtbare Ebene Klicks/
   Scrollen auf dem Slider nicht blockiert (die Pfeile selbst wieder auto). */
.cody-scroller__nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cody-scroller__arrow {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--cody-color-primary);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s ease;
}

.cody-scroller__arrow--prev {
    left: -24px;
}


.cody-scroller__arrow--next {
    right: -24px;
}


.cody-scroller__arrow[disabled] {
    opacity: 0.25;
    cursor: default;
}

/* Passt alles ohne Scrollen rein, sind BEIDE Pfeile gleichzeitig disabled
   (bei einer scrollbaren Liste ist stets mindestens einer aktiv). Dann die
   Pfeile komplett ausblenden. */
.cody-scroller-wrap:has(.cody-scroller__arrow--prev[disabled]):has(.cody-scroller__arrow--next[disabled]) .cody-scroller__arrow {
    display: none;
}

/* Chevron aus zwei Rahmenkanten. */
.cody-scroller__arrow span {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.cody-scroller__arrow--prev span {
    transform: rotate(135deg);
    margin-left: 4px;
}

.cody-scroller__arrow--next span {
    transform: rotate(-45deg);
    margin-right: 4px;
}

/* =========================================================
   Video-Sektion (.cody-video) – Cover mit Hintergrundbild + Padding,
   in der Mitte ein zentriertes, eingebettetes YouTube-Video.
   ========================================================= */
.cody-video {
    /* Full-Bleed bis an die Fensterkanten (wie der Hero). */
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-block: calc(var(--cody-space) * 3);
    padding-inline: var(--cody-space);
}


/* Video mittig und auf angenehme Breite begrenzt. Selektoren greifen auf alles
   in .cody-video – auch falls die Klasse cody-video__embed beim Einfügen der
   URL verloren ging (passiert beim Embed-Block häufig). */
.cody-video__embed,
.cody-video .wp-block-embed {
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
}

.cody-video .wp-block-embed__wrapper {
    width: 100%;
}

/* Iframe füllt die volle Breite und behält 16:9 – unabhängig von Cores
   responsive Embed-CSS (sonst bleibt das Video bei ~560px „klein"). */
.cody-video iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}

/* Lokales Video (Core-Video-Block): auf Hauptinhalts-Breite begrenzen und
   zentrieren – sonst füllt es die ganze Full-Bleed-Breite der Sektion. */
.cody-video .wp-block-video {
    width: 100%;
    max-width: var(--cody-content-width);
    margin-inline: auto;
}

.cody-video video {
    display: block;
    width: 100%;
    height: auto;
}

/* Klick-zum-Abspielen: Play-Overlay (von js/video.js erzeugt). */
.cody-video__player {
    position: relative;
    cursor: pointer;
}

.cody-video__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* Grüner Kreis */
.cody-video__play span {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--cody-color-primary);
}

/* Play-Dreieck */
.cody-video__play span::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;                 /* optischer Ausgleich des Dreiecks */
}

/* Beim Abspielen Overlay ausblenden – native Steuerelemente werden nutzbar. */
.cody-video__player.is-playing .cody-video__play {
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   Rezensionen-Slider (.cody-reviews) – links Grafik, rechts Zitate.
   JS (reviews.js) blendet eine Rezension ein und baut die Punkte. Ohne JS /
   im Editor bleiben alle Rezensionen sichtbar (editierbar); Stapeln/Ausblenden
   greift erst über die Klasse .is-ready.
   ========================================================= */
.cody-reviews {
    display: grid;
    grid-template-columns: 1fr;
    background: #ffffff;
}

@media (min-width: 53.125em) {
    .cody-reviews {
        grid-template-columns: 5fr 7fr;
    }
}

/* Group-Wrapper flach machen (wie bei den anderen Patterns). */
.cody-reviews .wp-block-group__inner-container {
    display: contents;
}

.cody-reviews__media {
    margin: 0;
    padding: 24px;                 /* 24px rundum */
    display: none;                 /* Bild nur auf dem Desktop zeigen */
}

@media (min-width: 53.125em) {
    .cody-reviews__media {
        display: block;
    }
}

.cody-reviews__media img {
    display: block;                /* linksbündig (kein auto-margin) */
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 700px;             /* max. 600px hoch, Seitenverhältnis bleibt */
}

.cody-reviews__slider {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 120px;                    /* Abstand Rezension → Slider-Punkte (Figma mobil) */
    padding: 96px 24px;
}

@media (min-width: 53.125em) {
    .cody-reviews__slider {
        gap: var(--cody-space);
        padding: calc(var(--cody-space) * 2);
    }
}

.cody-review {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 53.125em) {
    .cody-review {
        gap: 12px;
    }
}

/* Erst mit JS: alle Slides in eine Zelle stapeln, nur die aktive zeigen. */
.cody-reviews.is-ready .cody-reviews__stage {
    display: grid;
}

.cody-reviews.is-ready .cody-review {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.cody-reviews.is-ready .cody-review.is-active {
    opacity: 1;
    visibility: visible;
}

.cody-review__stars {
    margin: 0;
    color: var(--cody-color-primary);
    letter-spacing: 3px;
}

.cody-review__quote {
    margin: 0;
    font-size: 36px;
    line-height: 48px;
    font-weight: 600;
}

@media (max-width: 450px) {
    .cody-review__quote {
        margin: 0;
        font-size: 16px;
        line-height: 22px;
        font-weight: 600;
    }
}


.cody-review__author {
    margin: 0;
    font-weight: 700;
}

.cody-review__location {
    margin: 0;
    color: var(--cody-color-primary);
}

.cody-reviews__dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cody-reviews__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    background: var(--cody-color-border);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}

.cody-reviews__dot.is-active {
    width: 24px;
    background: var(--cody-color-primary);
}

/* =========================================================
   Footer – oben block-bearbeitbarer Bereich, darunter Copyright + Menü.
   ========================================================= */
.site-footer {
    display: flex;
    flex-direction: column;
    gap: var(--cody-space);
}

/* Block-Editor-Bereich (Widget-Area). */
.site-footer__widgets {
    display: flow-root;
}

/* Untere Leiste: Copyright links, Menü rechts. */
.site-footer__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--cody-space);
}

.site-footer__copyright {
    margin: 0;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cody-space);
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-menu a {
    color: inherit;
    text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus {
    text-decoration: underline;
}

/* montserrat-300 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 300;
    src: url('fonts/montserrat-v31-latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* montserrat-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/montserrat-v31-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* montserrat-500 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/montserrat-v31-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* montserrat-600 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/montserrat-v31-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

h1, h2 {
    font-size: 36px;
    line-height: 44px;
}

/* under 450px width */
@media (max-width: 450px) {
    h1, h2 {
        font-size: 28px;
        line-height: 36px;
    }
}

h2 {
    margin: 24px 0;
}

h3 {
    font-size: 16px;
    line-height: 24px;
    text-transform: uppercase;
    color: var(--cody-color-primary);
}

.wp-block-button .wp-element-button{
    border: 2px solid var(--cody-color-primary);
    color: #ffffff;
    background-color: var(--cody-color-primary);
    border-radius: 0;
    /* Gleiches Padding wie der Outline-Button (ohne Cores "+ 2px"),
       da der Fill-Button jetzt ebenfalls eine 2px-Border hat → gleiche Größe. */
    padding: 12px 20px;
    line-height: 32px;
    min-width:240px;
}

.wp-block-button .wp-element-button:hover{
    box-shadow: 7px 10px 15px -2px rgba(0, 0, 0, 0.13);
    -webkit-box-shadow: 7px 10px 15px -2px rgba(0, 0, 0, 0.13);
}
.wp-block-button.is-style-outline .wp-element-button{
    border: 2px solid var(--cody-color-primary);
    color: var(--cody-color-primary);
    background-color: var(--cody-color-bg-light);
    border-radius: 0;
}


.is-layout-flex {
    gap: 24px;
}

.portrait {
    /* Höhe des Abstandshalters über dem Bild – Figma: 71px bei 354px
       Kachelbreite ≈ 20%. Wird auch von .cto-text genutzt, damit die
       Overlay-Box den Abstandshalter exakt mit abdeckt. */
    --portrait-spacer: 20%;
    /* Verlauf von oben: 0–50% unverändert Grau, 50–75% Übergang nach Weiß,
       ab 75% komplett Weiß. */
    background: linear-gradient(
        to bottom,
        rgb(227,227,227) 0%,
        rgb(227,227,227) 50%,
        #ffffff 75%,
        #ffffff 100%
    );
    /* Rand über dem Bild, proportional zur Breite (Prozent-Padding bezieht sich
       auf die Containerbreite) – skaliert also mit der Bildgröße mit. */
    padding-top: var(--portrait-spacer);
    position:relative;
}

/* Desktop (600px+): schmaler Abstandshalter wie ursprünglich – die 20% aus
   der mobilen Figma-Vorlage gelten nur für kleine Viewports. Die Overlay-Box
   (.cto-text) folgt automatisch über dieselbe Custom Property. */
@media (min-width: 37.5em) { /* 600px */
    .portrait {
        --portrait-spacer: 4%;
    }
}

.portrait p {
    background: #ffffff;
    margin-block-end: 0;
    padding: 12px;
}


.portrait figure {
    margin-block-end: 0;
}

.whiteback {
    background-color: #ffffff;
    padding:24px;
}

/* Nur auf Desktop sichtbar (mobile-first: standardmäßig ausgeblendet) */
.outfall {
    display: none;
}

.outfall img {
    position:absolute;
}

@media (min-width: 53.125em) {
    .outfall {
        display: block;

    }
}


/* =========================================================
   Kontaktformular (Contact Form 7) – an das Theme angepasst.
   Markup-Wrapper .cody-form kommt aus dem CF7-Formular-Template.
   ========================================================= */
.cody-form__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--cody-space);
}

@media (min-width: 600px) {
    .cody-form__row {
        grid-template-columns: 1fr 1fr;
    }
}

.wpcf7-form p {
    margin: 0 0 20px;
}

/* Feld-Labels grün (Name, E-Mail, Nachricht, „Was suchen Sie?"). */
.cody-form__field > label,
.cody-form__legend {
    display: block;
    margin-bottom: 8px;
    color: var(--cody-color-primary);
    font-weight: 700;
}

/* Text-, E-Mail-, Telefon- und Textarea-Eingaben. */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--cody-color-border);
    border-radius: 0;
    background: #ffffff;
    font: inherit;
    color: var(--cody-color-text);
}

.wpcf7-form textarea {
    min-height: 160px;
    resize: vertical;
}

.wpcf7-form ::placeholder {
    color: var(--cody-color-muted);
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
    outline: 2px solid var(--cody-color-primary);
    outline-offset: 2px;
}

/* Radio-Optionen untereinander. */
.wpcf7-radio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpcf7-radio .wpcf7-list-item {
    margin: 0;
}

.wpcf7-radio label,
.wpcf7-acceptance label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 400;
    color: var(--cody-color-text);
    cursor: pointer;
}


/* Grüne Auswahl für Radios und Checkbox. */
.wpcf7-form input[type="radio"],
.wpcf7-form input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: var(--cody-color-primary);
}

/* CF7-Fehlertipps an das Theme angleichen. Gilt auch für den per js/cf7-errors.js
   nachgerüsteten Tipp am Datenschutz-Häkchen (CF7 6.x rendert dort sonst keinen). */
.wpcf7-not-valid-tip {
    display: block;
    margin-top: 6px;
    color: #b00020;
    font-size: 0.875rem;
}

/* Absenden-Button im Look der Theme-Buttons. */
.wpcf7-submit {
    border: 2px solid var(--cody-color-primary);
    background-color: var(--cody-color-primary);
    color: #ffffff;
    padding: 12px 20px;
    line-height: 32px;
    min-width: 240px;
    border-radius: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wpcf7-submit:hover,
.wpcf7-submit:focus {
    background-color: #ffffff;
    color: var(--cody-color-primary);
}

.entry-content > .wp-block-group {
    margin-bottom: 96px;
}

.entry-content > .wp-block-group:last-child {
    margin-bottom: 0;
}


article {
    padding-bottom: 0;
    margin-bottom:0;
}


.cto-container {
    position: relative;
}

.cto {
    position: absolute;
    left: 24px;
    bottom: 24px;
    cursor: pointer;
}

.cto-text  {
    position: absolute;
    left: 0;
    /* Nach oben über den Bild-Container hinaus, um den Abstandshalter von
       .portrait mit abzudecken. Wichtig: Prozent-margin bezieht sich auf die
       Container-BREITE (wie das padding-top des Abstandshalters), Prozent-top
       dagegen auf die Höhe – deshalb top:0 + negatives margin-top. */
    top: 0;
    margin-top: calc(-1 * var(--portrait-spacer, 20%));
    bottom: 0;
    right:0;
    background:rgba(255,255,255,0.8) !important;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Klick auf .cto blendet den Text ein (Klasse setzt js/cto.js). */
.cto-text.is-revealed {
    opacity: 1;
}

@media (max-width: 599px) {
    main {
        padding:24px !important;
    }
    .wpcf7-submit, .wp-block-button {
        width:100%;
    }
    .cody-form__row {
        gap:0;
    }

    .cody-form__field {
        margin-bottom: 0px !important;
    }

    /* Mobil: schmalerer Innenabstand im Hero-Content (Desktop behält das
       clamp()-Padding aus dem 850px-Block). */
    .cody-hero__content {
        padding: 24px;
    }
}

.cody-accordion__item summary {
    font-size: 16px;
    align-items: start;
}

.whitebox {
    background: white;
    padding: 24px;
}eine objgekn