:root {
    /* --- Typography Variables --- */
    
    /* Mobile font sizes */
    --hero-title-size-mobile: 2.5rem;
    --hero-title-small-scale: 0.6;
    --hero-title-small-weight-scale: 0.8;
    --hero-date-size-mobile: 1rem;
    --hero-slogan-size-mobile: 2rem;
    --hero-desc-size-mobile: 1rem;

    --title-font-weight: 600; /*Forum Branzy Kosmetycznej*/
    --date-font-weight: 600; /*Data*/
    --slogans-font-weight: 600; /*Konsument.Emocje.Technologie.*/
    --desc-font-weight: 400; /*text under slogans*/
    
    /* Desktop font sizes */
    --hero-title-size-desktop: 3rem;
    --hero-date-size-desktop: 1.25rem;
    --hero-slogan-size-desktop: 4.5rem;
    --hero-desc-size-desktop: 1.25rem;

    /* --- Layout & Spacing Variables --- */
    --hero-gap-mobile: 2rem;
    --hero-gap-desktop: 4rem;
    --hero-content-padding-mobile: 0px 1.5rem;
    --hero-content-padding-desktop: 5rem 0;
    
    /* Desktop layout breakpoint */
    --hero-breakpoint-desktop: 1024px;

    /* --- Z-index Mapping --- */
    --hero-z-bg: -1;
    --hero-z-content: 10;
    --hero-z-highlight: 20;

    /* --- Highlighted Image Variables (Desktop) --- */
    --hero-highlight-width-desktop: 55%; 
    --hero-highlight-offset-bottom: 0px; 
    --hero-highlight-offset-right: 15vw;  
    /* --- Spacing Variables (Światło w pionie) --- */
    --hero-margin-title: 1rem;         /* Wcześniej: 0.5rem */
    --hero-margin-date: 3rem;          /* Wcześniej: 2rem */
    --hero-margin-desc-top: 2.5rem;    /* Wcześniej: 1.5rem */
    --hero-margin-desc-bottom: 3.5rem; /* Wcześniej: 2.5rem */

    /* --- Button Overrides --- */
    --hero-btn-font-size: 1.125rem;
    --hero-btn-font-weight: 700;
    --hero-btn-padding: 1.5rem 2.5rem; /* Zmieniono padding pionowy z 1rem na 1.5rem */
    --hero-btn-line-height: 1.2;       /* Zabezpieczenie przed ucinaniem tekstu */
}

/* ==========================================================================
   Base & Mobile First Styling
   ========================================================================== */

/* 1. Reset & Core Structure */
.hero-bg {
    background: transparent !important;
    position: relative;
    /* FIX: Zmiana z clip na hidden gwarantuje twarde odcięcie wylewających się kontenerów */
    overflow-x: hidden; 
    overflow-y: hidden;
    background-image: linear-gradient(#ff0086, #ff85c5) !important;
    
    /* FIX: Ochrona Box Model na głównym wrapperze */
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 20px !important;
}
.hero-slogans {
    /* Przestrzeń w pionie */
    padding-top: 30px; 
    padding-bottom: 30px; 
    
    /* Reset paddingu WordPressa */
    padding-left: 0 !important;
    padding-right: 0 !important;

    /* FIX: Twarde wymuszenie ujemnych marginesów i blokada wp-block-constrained */
    width: calc(100% + 400px) !important; 
    max-width: none !important; /* Neutralizuje blokadę maksymalnej szerokości z WP */
    margin-left: -200px !important; 
    margin-right: -200px !important; 
    word-break: keep-all !important; 
    
    box-sizing: border-box;
}

.hero-sekcja,
.hero-sekcja * {
    font-family: var(--font-primary) !important;
    box-sizing: border-box;
}
.hero-sekcja {
    padding: var(--hero-content-padding-mobile);
    text-align: center;
    position: relative;
    z-index: var(--hero-z-content);
    /* FIX: Zablokowanie rozszerzania poza viewport */
    width: 100%;
    max-width: 100vw;
}

/* Reversing layout for mobile: Image on top, text below */
.hero-sekcja > .wp-block-group.is-nowrap {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: var(--hero-gap-mobile);
    
    /* FIX: Definiujemy ramy dla szerokości */
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}
.hero-left-side > .wp-block-image {
    width: 80%;
    height: auto;
    max-height: 100%;
}

/* 2. Typography */
.hero-left-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* FIX: Zamknięcie wymiarów w 100% szerokości rodzica bez wylewania się z prawej strony */
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow-wrap: break-word; /* Prewencja przed wylewaniem długich ciągów znaków */
}
.hero-title-small {
        font-family: var(--font-primary) !important;
    font-size: calc(1em * var(--hero-title-small-scale));
    font-weight: calc(var(--title-font-weight) * var(--hero-title-small-weight-scale));
    display: inline-block; /* Ensures consistent cross-browser rendering for inline elements */
    line-height: inherit;  /* Inherits safe line-height from parent */
}
.hero-title {
        font-family: var(--font-primary) !important;
    font-size: var(--hero-title-size-mobile);
    margin-bottom: var(--hero-margin-title);
    line-height: 0.8;
    font-weight: var(--title-font-weight);
}

.hero-date {
        font-family: var(--font-primary) !important;
    font-size: var(--hero-date-size-mobile);
    margin-bottom: var(--hero-margin-date);
    font-weight: var(--date-font-weight);
}

.hero-slogan-line {
        font-family: var(--font-primary) !important;
    font-size: var(--hero-slogan-size-mobile);
    line-height: 0.9;
    margin: 0;
    font-weight: var(--slogans-font-weight);
}

.hero-desc {
        font-family: var(--font-primary) !important;
    font-size: var(--hero-desc-size-mobile);
    margin: var(--hero-margin-desc-top) 0 var(--hero-margin-desc-bottom) 0;
    font-weight: var(--desc-font-weight);
}

/* 3. Button constraints (Modifying ONLY size and alignment) */
.hero-action-button {
    display: flex;
    justify-content: center;
    width: 100%;
    
}

.hero-action-button .wp-element-button {
    padding: var(--hero-btn-padding) !important;
    margin-top: 40px;
    line-height: var(--hero-btn-line-height) !important;
    /*font-weight: var(--hero-btn-font-weight) !important;*/
    min-height: 56px; /* A11y standard dla obszarów dotykowych, jako bezpieczny fallback */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 4. Images Structure (Mobile) */
.hero-sekcja > .wp-block-group.is-nowrap > .wp-block-group:last-child {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px; /* Safe mobile fallback */
}

/* Highlighted Image (Lotus) - Scaled and centered on mobile */
.hero-highlighted-image {
    position: relative;
    z-index: var(--hero-z-highlight);
    width: 65%;
    max-width: 300px;
    margin: 0 auto;
}

.hero-highlighted-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Background Image (Leaves) - Behind EVERYTHING on mobile */
.hero-img-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw; /* Stretch across entire viewport width */
    height: 100vh; /* Cover vertical space securely */
    z-index: var(--hero-z-bg);
    pointer-events: none;
    margin: 0;
}

.hero-img-bg img {
    width: 120%;
    height: 120%;
    object-fit: cover;
    overflow: hidden;
    opacity: 0.6; /* Slight transparency for readability on mobile, optional */
}
/* Highlighted Slogan */
.hero-slogans .hero-slogan-line .hero-highlighted-slogan {
    color: var(--button-bg-color) !important; 
}

/* ==========================================================================
   Desktop Styling (min-width breakpoint)
   ========================================================================== */

@media (min-width: 1024px) {
    
    .hero-sekcja {
        padding: var(--hero-content-padding-desktop);
        text-align: left;
    }

    /* Standard Row Layout */
    .hero-sekcja > .wp-block-group.is-nowrap {
        flex-direction: row;
        justify-content: flex-start;
        align-items: stretch; /* Align to full height for right image container */
        position: relative;
    }

    .hero-left-side {
        align-items: flex-start;
        max-width: 50%; /* Maintains standard WP left-side constraint */
        padding-right: var(--hero-gap-desktop);
    }

    /* Scaling Typography for Desktop */
    .hero-title { font-size: var(--hero-title-size-desktop); }
    .hero-date { font-size: var(--hero-date-size-desktop); }
    .hero-slogan-line { font-size: var(--hero-slogan-size-desktop); }
    .hero-desc { font-size: var(--hero-desc-size-desktop); }

    .hero-action-button {
        justify-content: flex-start;
    }

/* Right Column Bleed to Screen Edge */
    .hero-sekcja > .wp-block-group.is-nowrap > .wp-block-group:last-child {
        position: absolute;
        top: 0;
        bottom: 0;
        right: calc(50% - 50vw); 
        width: 50vw;
        display: block; /* Zmiana z flex na block, pozycjonujemy dzieci absolutnie */
    }

    /* Highlighted Image (Lotus) over the Leaves - Bottom Right Anchored */
    .hero-highlighted-image {
        position: absolute;
        bottom: var(--hero-highlight-offset-bottom);
        right: var(--hero-highlight-offset-right);
        width: var(--hero-highlight-width-desktop);
        max-width: none;
        margin: 0;
        transform: none; /* Usunięcie poprzedniego przesunięcia */
        z-index: var(--hero-z-highlight);
    }

    /* Background Image (Leaves) bounds to right container on desktop */
    .hero-img-bg {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        transform: none; /* Remove mobile transform */
    }

    .hero-img-bg img {
        object-fit: cover;
        object-position: left center; /* Keeps the pattern structurally correct */
        opacity: 1; /* Restore full opacity on desktop */
    }
    .hero-slogans {
        width: 100% !important; 
        max-width: 100% !important;
        margin-left: 0 !important; 
        margin-right: 0 !important; 
        padding-top: 20px !important; /* Zgodnie z wytycznymi przywracamy 20px */
        padding-bottom: 20px !important;
        word-break: normal !important; /* Wyłączamy wymuszanie nierozrywania na desktopie */
    }
}