:root {
    --yol-primary: #1d8496;       /* Teal color theme */
    --yol-primary-hover: #156270; /* Deeper shade for high-contrast hover */
    --yol-dark-blue: #002244;
    --yol-navy: #000040;
    --yol-pink: #d93a82;
}

body {
    font-family: 'Josefin Sans', sans-serif; /* Applied globally */
    color: #333;
}

/* Main Navbar Typography styling */
.main-navbar .nav-link {
    color: var(--yol-navy);
    font-weight: 600; /* Adjusted for Josefin Sans visibility weights */
    font-size: 1rem;
}
.main-navbar .nav-link:hover {
    color: var(--yol-primary);
}

/* Hero Wrapper Split Layout */
.hero-section {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    background-color: #222;
}

/* Right Side Background Image */

/* Left Sidebar Container - Angled Medium Smooth Wave */
.hero-left-menu {
    position: relative;
    /* Expanded the baseline canvas size to allow the rightward slant to grow smoothly */
    width: calc(33% + 140px);
    min-height: 520px;
    background-color: var(--yol-primary);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    clip-path: url(#waveClipPath);
    transform: translateZ(0);
}

/* Theme Menu Rows */
.menu-row {
    position: relative;
    width: 100%;
    flex-grow: 1;
    color: white;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.menu-row:hover {
    background-color: var(--yol-primary-hover);
}

.menu-row h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.5px;
}
.menu-row p {
    font-size: 0.95rem;
    margin-bottom: 0;
    font-weight: 300;
    opacity: 0.9;
}

/* Base Arrow Style */
.circle-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yol-primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 4;
}

/* Precise step coordinates inside the clipped mask */
.menu-row:nth-child(1) .circle-arrow {
    right: 125px;
}
.menu-row:nth-child(2) .circle-arrow {
    right: 90px;
}
.menu-row:nth-child(3) .circle-arrow {
    right: 55px;
}

.menu-row:hover .circle-arrow {
    transform: translateY(-50%) scale(1.08);
    background-color: #f8f9fa;
    color: var(--yol-primary-hover);
}

/* Hero Text content centered over image */
.hero-content-overlay {
    position: absolute;
    left: 46%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: white;
    max-width: 520px;
}
.hero-content-overlay h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    letter-spacing: -1px;
}
.hero-content-overlay p {
    font-size: 1.25rem;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.btn-navy {
    background-color: var(--yol-pink);
    color: white;
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    font-family: 'Josefin Sans', sans-serif;
    border-radius: 4px;
    border: none;
    letter-spacing: 0.5px;
}
.btn-navy:hover {
    background-color: #00152b;
    color: white;
}

/* Slider Controls */
.custom-carousel-controls {
    position: absolute;
    bottom: 25px;
    right: 40px;
    z-index: 2;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}
.control-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.6);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.control-btn:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}

/* Content Section */
.content-section {
    padding: 4.5rem 0;
}
.section-tagline {
    color: var(--yol-primary);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.section-title {
    color: var(--yol-navy);
    font-weight: 700;
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
}
.content-text {
    color: #444;
    line-height: 1.6;
    max-width: 850px;
    font-weight: 400;
}

/* Responsive Mobile Breakpoints */
@media (max-width: 992px) {
    .hero-left-menu {
        width: 100%;
        min-height: auto;
        clip-path: none;
    }
    .menu-row {
        padding: 2.5rem 2rem;
    }
    .hero-bg-img { position: relative; width: 100%; height: 320px; }
    .hero-content-overlay { position: relative; left: 0; top: 0; transform: none; padding: 2.5rem 1.5rem; max-width: 100%; background: #111; }
    .circle-arrow { right: 20px !important; }
    .custom-carousel-controls { display: none; }
}

#hoverTitle, #hoverText {
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

.fade-out {
    opacity: 0 !important;
}

/* Container holding all layered image variants */
.hero-bg-img {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    z-index: 1;
    background-color: #222;
    overflow: hidden; /* Keeps the moving image scaling contained */
}

/* Base properties for every layout graphic layer */
/* Base properties for every layout graphic layer */
.hero-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;

    /* FIX: Pushes the initial layout slightly downward on start */
    background-position: center 15%;

    background-size: cover;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    will-change: opacity, transform;
    transform: scale(1.1);
}

/* Layer 1: System Default Base Image (Visible when no item is hovered) */
.layer-default {
    background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.3)), url('Assets/Images/team.jpg');
    opacity: 1;
    z-index: 1;
}

/* Layer 2: Suchtberatung Variant */
.layer-sucht {
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.5)), url('Assets/Images/familie.jpg');
    z-index: 2;
}

/* Layer 3: Häusliche Gewalt Variant */
.layer-gewalt {
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.5)), url('Assets/Images/streit.jpg');
    z-index: 3;
}

/* Layer 4: Antiaggressivitäts Variant */
.layer-training {
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.5)), url('Assets/Images/weg.jpg');
    z-index: 4;
}

/* Native CSS State Triggers */
.hero-section.show-sucht .layer-sucht { opacity: 1; }
.hero-section.show-gewalt .layer-gewalt { opacity: 1; }
.hero-section.show-training .layer-training { opacity: 1; }

/* State Triggers running our revamped linear vertical downward motion */
.hero-section.show-sucht .layer-sucht {
    opacity: 1;
    animation: topToBottomPan 10s linear forwards; /* Extended to 10s for a premium, slower drop look */
}
.hero-section.show-gewalt .layer-gewalt {
    opacity: 1;
    animation: topToBottomPan 10s linear forwards;
}
.hero-section.show-training .layer-training {
    opacity: 1;
    animation: topToBottomPan 10s linear forwards;
}

/* FIX: New keyframe system panning strictly down the vertical Y-axis */
@keyframes topToBottomPan {
    0% {
        transform: scale(1.1) translateY(0%);
    }
    100% {
        transform: scale(1.1) translateY(-6%); /* Drags the image up slightly, making the camera look like it is panning down */
    }
}

/* Row-specific paddings and arrow positions to align perfectly with the downward slant */
.menu-row:nth-child(1) {
    padding: 2.5rem calc(120px) 2.5rem 2rem;
}
.menu-row:nth-child(1) .circle-arrow {
    right: 170px;
}

.menu-row:nth-child(2) {
    padding: 2.5rem calc(90px) 2.5rem 2rem;
}
.menu-row:nth-child(2) .circle-arrow {
    right: 200px;
}

.menu-row:nth-child(3) {
    padding: 2.5rem calc(50px) 2.5rem 2rem;
}
.menu-row:nth-child(3) .circle-arrow {
    right: 86px;
}

/* Custom Header Navbar Login Button styling */
.btn-login {
    color: var(--yol-navy);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1.2rem;
    border: 1.5px solid var(--yol-navy);
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.25s ease-in-out;
}

.btn-login:hover {
    color: white;
    background-color: var(--yol-pink);
    border-color: var(--yol-pink);
    box-shadow: 0 4px 10px rgba(217, 58, 130, 0.2); /* Soft subtle glow using pink theme token */
}

.btn-login i {
    font-size: 0.85rem;
}

/* Navigation Utility Links (Phone, Kontakt, Über uns) */
.nav-phone-link {
    color: var(--yol-primary);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-phone-link:hover {
    color: var(--yol-primary-hover);
}

.nav-extra-link {
    color: var(--yol-navy);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-extra-link:hover {
    color: var(--yol-primary);
}

/* Custom Header Navbar Login Button styling */
.btn-login {
    color: var(--yol-navy);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1.2rem;
    border: 1.5px solid var(--yol-navy);
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.25s ease-in-out;
}

.btn-login:hover {
    color: white;
    background-color: var(--yol-pink);
    border-color: var(--yol-pink);
    box-shadow: 0 4px 10px rgba(217, 58, 130, 0.2);
}

.btn-login i {
    font-size: 0.85rem;
}

/* ==========================================================================
   Full-Screen Sliding Popup Window Stylesheet
   ========================================================================== */
.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999; /* Higher than sticky header */
    display: flex;
    background-color: #ffffff;

    /* Hardware accelerated animation properties */
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Slide-in State Trigger Class called by Javascript */
.custom-popup.popup-active {
    transform: translateX(0);
}

/* --- Left Text Side Area Layout --- */
.popup-left-content {
    width: 55%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto; /* Allows scrolling inside if screen height is small */
    padding: 3.5rem 4rem;
}

/* Close Window Trigger Styling */
.popup-close-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--yol-navy);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2.5rem;
    transition: color 0.2s ease;
}

.popup-close-btn:hover {
    color: var(--yol-pink);
}

/* Typography elements formatted inside the panel */
.popup-inner-text {
    max-width: 680px;
}

.popup-tagline {
    color: var(--yol-primary);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.popup-main-title {
    color: var(--yol-navy);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.popup-sub-title {
    color: var(--yol-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.popup-lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #444;
    font-weight: 400;
}

.popup-divider {
    height: 2px;
    width: 60px;
    background-color: var(--yol-pink);
    margin: 2rem 0;
}

.popup-inner-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.25rem;
}

.popup-inner-text blockquote {
    border-left: 4px solid var(--yol-primary);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--yol-dark-blue);
    font-weight: 600;
}

.popup-inner-text .italic {
    font-style: italic;
}

/* --- Right Side Local Graphic Image Container --- */
.popup-right-visual {
    width: 45%;
    height: 100%;
    /* Reuses your local image asset */
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2)), url('Assets/Images/familie.jpg');
    background-size: cover;
    background-position: center 15%;
    background-repeat: no-repeat;
}

.layer-bg-training {
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2)), url('Assets/Images/weg.jpg') !important;
}

.layer-bg-gewalt {
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2)), url('Assets/Images/streit.jpg') !important;
}

/* Responsive updates for small screens */
@media (max-width: 992px) {
    .custom-popup {
        flex-direction: column;
    }
    .popup-left-content {
        width: 100%;
        height: 70%;
        padding: 2rem;
    }
    .popup-right-visual {
        width: 100%;
        height: 30%;
    }
}