/* ================================================
   CHI BASEL - Mobile auf Handy und Tablet hoch/breit
   Breakpoint: max 1100px
   Version: 3.13
   ================================================ */

/* Scroll-Animation: visibility + opacity */
@media (max-width: 1100px) {
    .chi-mobile-header-section,
    .et_pb_section_1_tb_header {
        transition: opacity 0.35s ease, visibility 0.35s ease;
        will-change: opacity, visibility;
    }
    .chi-mobile-header-section.chi-header-hidden,
    .et_pb_section_1_tb_header.chi-header-hidden {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Desktop-Header ausblenden */
@media (max-width: 1100px) {
    #chi-scroll-header {
        display: none !important;
    }
}

/* Oberste Spalte mit Logos nebeneinander halten */
@media (max-width: 1100px) {
    #chi-mobile-header .et_pb_row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    #chi-mobile-header .et_pb_column {
        width: auto !important;
    }
}

/* Hamburger Button */
.chi-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto; /* schiebt ihn nach rechts */
}

.chi-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Erste Linie kuerzer */
.chi-hamburger span:first-child {
    width: 70%;
    margin-left: auto;
}

/* Hamburger → X Animation */
.chi-hamburger.is-active span:nth-child(1) {
    width: 100%;
    margin-left: 0;
    transform: translateY(10px) rotate(45deg);
}

.chi-hamburger.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.chi-hamburger.is-active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* ================================================
   CHI BASEL – Mobile Menu Panel
   ================================================ */

/* Panel grundstruktur – standardmässig geschlossen */
.chi-mobile-menu {
    position: fixed;
    top: 150px;
    left: 0;
    width: 100%;
    height: calc(100vh - 150px);
    background-color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9998;
    padding: 24px 20px;
    box-sizing: border-box;
    transform: translateY(-110%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    opacity: 0;
}

.chi-mobile-menu.is-open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
}

/* Suchfeld */
.chi-menu-search {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #002949;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.chi-menu-search input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #002949;
    background: transparent;
    letter-spacing: 0.05em;
}

.chi-menu-search input::placeholder {
    color: #002949;
    opacity: 0.5;
}

.chi-search-icon {
    font-size: 18px;
    color: #002949;
}

/* Navigation Liste */
.chi-menu-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chi-menu-nav .chi-menu-item {
    padding: 10px 0;
    cursor: pointer;
}

.chi-menu-nav .chi-menu-item span {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #002949;
    letter-spacing: 0.03em;
}

/* Globus Footer */
.chi-menu-footer {
    margin-top: 16px;
    padding-top: 12px;
}

.chi-globe {
    font-size: 24px;
    color: #002949;
    cursor: pointer;
}

/* Panel nur auf Mobile/Tablet öffnen */
.chi-mobile-menu {
    display: none;
}

@media (max-width: 1100px) {
    .chi-mobile-menu {
        display: block;
    }
}

/* ================================================
   Accordion Submenu
   ================================================ */

.chi-menu-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #002949;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chi-menu-item.is-active .chi-menu-label {
    color: #e6332a;
}

.chi-submenu {
    display: none;
    padding-top: 14px;
    padding-bottom: 10px;
}

.chi-menu-item.is-active .chi-submenu {
    display: block;
}

.chi-submenu-group {
    margin-bottom: 12px;
}

.chi-submenu-group h4 {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 900;
    color: #002949;
    margin: 0 0 4px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #002949;
    letter-spacing: 0.05em;
}

.chi-submenu-group a {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #002949;
    text-decoration: none;
    padding: 6px 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.chi-submenu-group a:hover {
    color: #e6332a;
}

/* ================================================
   Spätere Ergänzungen (v3.x)
   ================================================ */

/* Logo-Link Touch fix */
@media (max-width: 1100px) {
    #chi-mobile-header .et_pb_image_wrap {
        pointer-events: none;
    }
    #chi-mobile-header .et_pb_image_wrap a {
        pointer-events: auto;
    }
}

/* Deaktivierte Menüpunkte */
span.chi-menu-disabled {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 15px !important;
    font-weight: 400;
    color: #002949;
    opacity: 0.4;
    font-style: italic;
    padding: 6px 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: default;
}

.chi-submenu-group a {
    opacity: 1 !important;
    font-style: normal !important;
    cursor: pointer !important;
}

/* SearchWP Override */
.chi-menu-search input[data-swplive] {
    color: #002949 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    width: 100% !important;
    outline: none !important;
    letter-spacing: 0.05em !important;
}

.chi-menu-search input[data-swplive]::placeholder {
    color: #002949 !important;
    opacity: 0.5 !important;
}

/* margin-top fix */
@media (max-width: 1100px) {
    .et_pb_section_1_tb_header {
        margin-top: 0 !important;
    }
}

/* ================================================
   Scroll: Header ein-/ausblenden
   ================================================ */
@media (max-width: 1100px) {
    .chi-mobile-header-section,
    .et_pb_section_1_tb_header {
        transition: opacity 0.4s ease;
        will-change: opacity;
    }
    .chi-mobile-header-section.chi-header-hidden,
    .et_pb_section_1_tb_header.chi-header-hidden {
        opacity: 0 !important;
        pointer-events: none;
    }
}

/* Hamburger im Canvas – rechts ausrichten */
@media (max-width: 1100px) {
    .et_pb_column_9_tb_header .chi-hamburger {
        margin-left: auto;
        display: flex;
    }
    .et_pb_column_9_tb_header {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: flex-end !important;
    }
}

.chi-search-icon {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    color: #002949;
}
/* FEI News Button: Abstand via Wrapper-Padding auf Mobile */
@media (max-width: 767px) {
    /* Wrapper: 20px Padding links/rechts, volle Breite */
    .chi-fei-zeile .et_pb_button_0_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    /* Button: volle Breite innerhalb des Wrappers */
    .chi-fei-zeile .chi-fei-button.et_pb_button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }
}

/* FEI News Block: volle Breite auf Mobile */
@media (max-width: 767px) {
    /* Row selbst: Flex-Wrapping erzwingen, 20px Abstand links/rechts */
    .chi-fei-zeile.et_pb_row {
        display: flex !important;
        flex-wrap: wrap !important;
        overflow: hidden !important;
        width: calc(100% - 40px) !important;
        max-width: calc(100% - 40px) !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }
    /* Erste Spalte: Flex-Item auf volle Breite zwingen */
    .chi-fei-zeile .et_pb_column:first-child {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    /* Spalten 2 und 3 ausblenden */
    .chi-fei-zeile .et_pb_column:not(:first-child) {
        display: none !important;
    }
    /* Bild: volle Breite, kein Overflow */
    .chi-fei-zeile .et_pb_column:first-child img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    /* Alle Module in der Spalte: box-sizing */
    .chi-fei-zeile .et_pb_column:first-child .et_pb_module {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}