/* Updated new.css with responsive header wrapping and preserved image aspect ratio */

:root {
    --theme-blue: #045184;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: "Avenir", Helvetica, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fff;
}

h1 {
    font-size: clamp(2.0736rem, 2.0736vw, 2.4883rem);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(1.728rem, 1.728vw, 2.0736rem);
}

h3 {
    font-size: clamp(1.44rem, 1.44vw, 1.728rem);
}

h4 {
    font-size: clamp(1.2rem, 1.2vw, 1.44rem);
    font-weight: 500;
}

p {
    font-size: clamp(1rem, 1vw, 1.2rem);
}

/* Welcome Section */
.welcome-section {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin: none;

    /* Heading and text share remaining space */
    .heading {
        flex: 3 3 0;
        background-color: var(--theme-blue);
        color: #fff;
        padding: 40px 20px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Image container: keep proportional, no distortion */
    .top-image {
        flex: 5 5 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;

        img {
            display: block;
            width: 100%;

            height: 100%;
            object-fit: cover;
            margin: -0.5% 0;
        }
    }

    /* On narrow screens, stack text under image */
    @media (max-width: 700px) {

        .heading,
        .top-image {
            flex: 1 1 100%;
            flex-direction: column;
            /* Stack hero-text and hero-image vertically */
        }
    }
}

.carousel-section {
    width: 100%;
    padding: clamp(10px, 1vw, 20px) clamp(20px, 5vw, 60px);

    .text-block {
        display: flex;
        align-items: stretch;
        flex-wrap: wrap;
        margin-bottom: 1rem;

        .german-text,
        .english-text {
            flex: 1 1 0;
            padding: 20px 0;
        }

        .vertical-line {
            width: 1px;
            margin: 15px 15px 15px 10px;
            background-color: #000;
            color: #000;
        }
    }

    /* On narrow screens, stack text under image */
    @media (max-width: 700px) {

        .german-text,
        .vertical-line,
        .english-text {
            flex: 1 1 100%;
            flex-direction: column;
            /* Stack hero-text and hero-image vertically */
        }

        .vertical-line {
            height: 1px;
            width: 100%;
        }
    }

    .carousel {
        position: relative;
        width: 100%;
        overflow: hidden;
        padding: 0;
        touch-action: pan-y;
        margin-bottom: 2rem;

        .carousel-track {
            display: flex;
            transition: transform 0.5s ease-in-out;
            will-change: transform;
            gap: 10px;
            align-items: stretch;
            margin-top: 1rem;

            img {
                flex: 1 0 0;
                min-width: 0;
                width: 100%;
                object-fit: cover;
            }
        }

        .carousel-arrows {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            transform: translateY(-50%);
            display: flex;
            justify-content: space-between;
            padding: 0 1vw;
            pointer-events: none;

            .arrow {
                font-size: 3rem;
                color: #fff;
                cursor: pointer;
                opacity: 1;
                pointer-events: auto;
                transition: color 0.3s ease, opacity 0.2s ease-in-out;

                &:hover {
                    color: #045184;
                }
            }
        }

        .carousel-lines {
            display: none !important;
        }
    }

    @media (max-width: 700px) {

        h2 {
            line-height: 1.1;
        }
    }
}

@media (min-width: 1400px) {
    .carousel-arrows {
        display: none !important;
    }
}


/* top-menu stuff */

/* Desktop Logo Section */
.logo-container {
    text-align: center;
}

.logo {
    width: 25vw;
    max-width: 333px;
}

/* Hide mobile header by default (desktop view) */
.mobile-header {
    display: none;
}

/* Sticky Top Menu: remains at the top when scrolling */
.top-menu {
    width: 100%;
    text-align: center;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* padding-left: 2vw; */
    /* padding-right: 2vw; */
    padding-top: 2px;
}

/* Use flex layout to keep menu items in one line */
.top-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    margin: 0 2vw;
}

/* Each menu item */
.top-menu li {
    display: inline-block;
    margin: 0 15px;
}

/* Menu links */
.top-menu a {
    text-decoration: none;
    color: #000;
    font-weight: 400;
    font-size: clamp(1rem, 1vw, 1.2rem);
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Hover effect for normal links */
.top-menu a:hover {
    color: #367eff;
}

/* Highlight for the rightmost menu item as a rectangular button */
.top-menu .highlight a {
    display: inline-flex;
    background-color: #045184;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    border: 1px solid #045184;
}

/* Ensure full background for highlighted link */
.top-menu .highlight a {
    display: block;
}

/* Hover effect for the highlighted (rightmost) link */
.top-menu .highlight a:hover {
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
}

/* Horizontal separator below the menu (desktop) */
.menu-separator {
    width: 100%;
    align-content: center;
    height: 2px;
    background-color: #000;
    margin-top: 8px;
}

/* Desktop Content */
.content {
    padding: 20px;
    margin-top: 20px;
}

/* ---------------------------------------------- */
/* Mobile Styles (width below 888px) */
@media screen and (max-width: 888px) {

    /* Hide the desktop header/logo container */
    .logo-container {
        display: none;
    }

    /* Enable the mobile header */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        /* padding-left: 15px; */
        padding-bottom: 0px;
        /* padding-right: 15px; */
        background: #fff;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
        flex-wrap: wrap;
    }

    /* Mobile separator below header */
    .mobile-separator {
        flex-basis: 100%;
        height: 2px;
        background-color: #000;
    }

    /* Push logo to left, use mobile size */
    .mobile-header .logo {
        margin-left: 15px;
        width: 50vw;
        max-width: 200px;
    }

    /* Hamburger toggle button on the right */
    .mobile-menu-toggle {
        margin-right: 10px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1002;
    }

    /* Hamburger icon lines */
    .mobile-menu-toggle .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 4px 0;
        background-color: #000;
        transition: all 0.3s ease;
    }

    /* Hide the original nav menu by default (we’ll slide it in) */
    .top-menu {
        position: fixed;
        top: 0;
        /* behind the mobile header */
        right: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    /* When mobile menu is active, slide in */
    .top-menu.active {
        transform: translateX(0);
    }

    /* In mobile, hide the menu separator inside the nav */
    .top-menu .menu-separator {
        display: none;
    }

    /* In mobile, show the menu items in block layout when visible */
    .top-menu ul {
        display: block;
        padding: 80px 20px 20px;
        /* give space for header and some padding */
        text-align: center;
    }

    .top-menu li {
        display: block;
        margin: 15px 0;
    }

    .top-menu a {
        display: inline-block;
        text-align: center;
        width: 100%;
    }

    /* Adjust page content so it doesn't hide behind the fixed mobile header */
    .welcome-section {
        margin-top: 60px;
    }

    /* Transform hamburger to cross when active */
    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}

/* footer stuff */

/* Footer line */
.footer-line {
    border: none;
    border-top: 2px solid #000;
    margin-bottom: 15px;
    /* margin-left: 2vw;
            margin-right: 2vw; */
}

/* Footer overall container */
footer {
    color: #000;
    background-color: #fff;
    /* padding: 1em 0; */
}

/* Grid layout for screens above 630px */
.footer-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left and right take equal space; center auto */
    align-items: center;
    padding: 0 1em;
    /* Prevent text from touching the edges */
    margin-left: 10px;
    margin-right: 10px;
}

/* Left section flush left */
.footer-left {
    justify-self: start;
    text-align: left;
}

/* Right section flush right */
.footer-right {
    justify-self: end;
    text-align: right;
    display: flex;
    flex-flow: row;
    justify-content: flex-end;
    gap: 20px;
}

/* Center section: Buttons */
.footer-center {
    justify-self: center;
    display: flex;
    gap: 1em;
}

/* Make the buttons equal in size with centered text */
.footer-center a {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11pt;
    font-weight: bold;
}

.footer-button {
    background-color: #045184;
    color: #fff;
    text-decoration: none;
    padding: 0.7em 1em;
    font-size: 0.9rem;
    border: 1px solid #045184;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-button:hover {
    background-color: #fff;
    border-color: #000;
    color: #000;
}

/* Bottom link (Impressum / Imprint) always centered */
.footer-bottom {
    text-align: center;
    margin-top: 1em;
}

.footer-bottom a {
    color: #045184;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Responsive rules */

/* Wider than 1200px */

@media (min-width: 1200px) {
    .footer-container {
        margin-left: 8vw;
        margin-right: 8vw;
    }
}

/* Between 930px and 730px:
       - Only the buttons in the center stack vertically,
       - Left/right sections remain in their grid cells. */
@media (max-width: 930px) and (min-width: 731px) {
    .footer-center {
        flex-direction: column;
        gap: 0.5em;
    }
}

/* Under 730px: Stack all elements vertically */
@media (max-width: 730px) {
    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1em;
        padding: 0 1em;
    }

    /* Adjust left/right texts for vertical layout if needed */
    .footer-left {
        text-align: center;
    }

    .description {
        text-align: right;
    }

    .answers {
        text-align: left;
    }
}