﻿/**** BURGER MENU (max 1200px) ****/
@media all and (max-width: 1200px) {
    header {
        top: 0.75rem;
    }

    .bottommenu nav {
        visibility: hidden;
        position: absolute;
        padding: 1rem 0;
        top: 100%;
        right: 0;
        left: 0;
        width: 100%;
        opacity: 1;
        z-index: 200;
        border-radius: 0 0 10px 10px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .bottommenu nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    .menuitem {
        flex-direction: column;
        align-items: center;
    }

    #burgermenu {
        display: block;
    }

    #header-cta-btn {
        display: none;
    }

    .dropdown {
        position: relative;
        padding: 0 1rem;
        margin: 0;
        top: 0;
    }

    nav li {
        height: fit-content;
        padding: 0.5rem 0;
    }

    .bottommenu nav.visible {
        visibility: visible;
    }
}

/**** LAPTOP (max 1300px) ****/
@media all and (max-width: 1300px) {
    #hero h1 {
        font-size: clamp(1.6rem, 3vw, 2.5rem);
    }

    #teaserbox .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #topfooter .inner.grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/**** TABLET (max 1000px) ****/
@media all and (max-width: 1000px) {
    #about .inner {
        flex-direction: column;
        gap: 2rem;
    }

    .right img {
        display: none;
    }

    .select {
        flex-direction: row;
    }

    #popup .select {
        flex-direction: row;
    }

    .teaser {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .teaser i {
        margin: auto;
    }

    .content {
        padding: calc(1.5rem + 3vw) 0;
    }

    #popup {
        left: 1.5rem;
        right: 1.5rem;
        width: auto;
        transform: translateY(-50%);
        max-width: none;
    }

    #hero {
        min-height: 75vh;
    }

    #hero .inner {
        min-height: 75vh;
    }
}

/**** SMARTPHONE (max 600px) ****/
@media all and (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    #teaserbox .grid {
        grid-template-columns: 1fr;
    }

    #topfooter .inner.grid {
        grid-template-columns: 1fr;
    }

    .teaser {
        grid-template-columns: 1fr;
    }

    #popup {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 1.5rem;
        width: 100%;
        transform: none;
        border-radius: 0;
    }

    #hero {
        min-height: 70vh;
    }

    #hero .inner {
        min-height: 70vh;
    }

    #hero h1 {
        font-size: 1.8rem;
    }

    .buttons.flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    #topfooter nav ul li {
        padding: 2px 0 !important;
    }

    /* Weitere Links: column layout below text */
    #about .inner {
        flex-direction: column !important;
    }

    .select {
        flex-direction: column !important;
    }

    #linkblock {
        width: 100% !important;
    }
}

/**** MOBILE (max 450px) ****/
@media all and (max-width: 450px) {
    header {
        top: 0.5rem;
    }

    .select.flex {
        flex-direction: column;
    }

    #popup .select {
        flex-direction: column;
    }

    #popup button {
        width: 100%;
    }

    #hero {
        min-height: 60vh;
    }

    #hero .inner {
        min-height: 60vh;
    }

    #hero h1 {
        font-size: 1.5rem;
    }

    #hero .hero-sub {
        font-size: 0.85rem;
    }
}

/**** MOBILE HEADER FIX (max 900px) ****/
@media all and (max-width: 900px) {

    .align-start {
        flex-direction: column !important;
    }

    header {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 200 !important;
    }

    .bottommenu {
        padding: 12px 15px !important;
    }

    .bottommenu .inner {
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 28px rgba(0, 0, 0, 0.13) !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 64px !important;
        margin-top: 0 !important;
        padding: 0 18px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative !important;
    }

    .logo {
        width: auto !important;
        position: static !important;
        left: 0 !important;
        margin: 0 !important;
        margin-right: auto !important;
    }

    .logo img {
        width: 150px !important;
    }

    #burgermenu {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: static !important;
        background-color: transparent !important;
        width: 44px !important;
        height: 44px !important;
        border: none !important;
        box-shadow: none !important;
        flex-shrink: 0 !important;
        align-self: center !important;
    }

    #burgermenu .burger {
        display: block !important;
        width: 20px !important;
        height: 14px !important;
        position: relative !important;
        margin-top: 43px;
    }

    #burgermenu .burger .line {
        background-color: #007CD8 !important;
    }

    #burgermenu[data-open='true'] {
        position: fixed !important;
        top: 110px !important;
        left: calc(min(85vw, 320px) - 70px) !important;
        right: auto !important;
        transform: none !important;
        z-index: 300 !important;
        background-color: #007CD8 !important;
        border-radius: 10px !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #burgermenu[data-open='true'] .burger .line {
        opacity: 0 !important;
    }

    #burgermenu[data-open='true'] .burger {
        position: relative !important;
        width: 20px !important;
        height: 20px !important;
        display: block !important;
        margin-top: 3px;
    }

    #burgermenu[data-open='true'] .burger::before,
    #burgermenu[data-open='true'] .burger::after {
        content: '' !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: 18px !important;
        height: 2px !important;
        background: #ffffff !important;
        border-radius: 1px !important;
    }

    #burgermenu[data-open='true'] .burger::before {
        transform: translate(-50%, -50%) rotate(45deg) !important;
    }

    #burgermenu[data-open='true'] .burger::after {
        transform: translate(-50%, -50%) rotate(-45deg) !important;
    }

    #nav {
        position: fixed !important;
        top: 80px !important;
        left: -120% !important;
        width: 85vw !important;
        max-width: 320px !important;
        height: calc(100vh - 80px) !important;
        background: #ffffff !important;
        z-index: 250 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 90px 30px 20px !important;
        transition: left 0.3s ease !important;
        pointer-events: none !important;
        box-shadow: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #nav.visible {
        left: 0 !important;
        pointer-events: auto !important;
        box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5) !important;
    }

    #nav.visible .nav-list {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    #nav .nav-list li {
        font-size: 1.1rem !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
    }

    #nav .nav-list li a {
        font-size: 1.1rem !important;
        color: #111 !important;
        font-weight: 500 !important;
    }

    #hero .inner {
        padding-top: 100px !important;
    }
}

/* Fix overlapping text on mobile */
@media all and (max-width: 600px) {
    .section-tagline {
        margin-bottom: 0 !important;
    }
}

/* Fix hero text on mobile */
@media all and (max-width: 600px) {
    #hero .inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #hero .tagline {
        font-family: 'Roboto', sans-serif !important;
        font-size: 24px !important;
        margin-left: 0 !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }

    #hero h1 {
        margin-left: 0 !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
        line-height: 1.3 !important;
    }

    #hero .hero-sub {
        margin-left: 0 !important;
        text-align: center !important;
    }
}

@media (max-width: 900px) {

    /* Fix Hero Alignment */
    #hero {
        justify-content: center !important;
    }

    /* Fix Contact Phone Option */
    .option.flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .phone-link {
        white-space: nowrap;
    }

    /* Fix Article / Sidebar layout */
    .article .inner.flex {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    #hero .content {
        margin-left: 0 !important;
        margin-top: 0 !important;
    }

    #hero .tagline,
    #hero h1,
    #hero .hero-sub,
    #hero .buttons {
        margin-left: 0 !important;
    }
}

@media (max-width: 900px) {
    .inner.flex {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .inner.flex .left,
    .inner.flex .right {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

@media (max-width: 900px) {
    #hero {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #hero .inner {
        padding-top: 100px !important;
        padding-bottom: 4rem !important;
    }
}