/* ==========================================================================
   Hangar 3 – Custom Header  |  assets/header.css
   All selectors prefixed h3- so child theme overrides are unambiguous.
   ========================================================================== */

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    /* Typography */
    --h3-font:               'Outfit', Helvetica, Arial, Lucida, sans-serif;
    --h3-nav-size:           16px;
    --h3-lang-size:          14px;

    /* Colours – default (transparent / hero) */
    --h3-text-default:       #ffffff;

    /* Colours – scrolled */
    --h3-text-scroll:        #333333;
    --h3-bg-scroll:          rgba(236, 238, 240, 0.85);

    /* CTA button */
    --h3-btn-bg:             #61652F;
    --h3-btn-border:         #61652F;
    --h3-btn-bg-hover:       #3A5127;
    --h3-btn-border-hover:   #3A5127;
    --h3-btn-color:          #ffffff;
    --h3-btn-radius:         5px;
    --h3-btn-ease:           0.3s;

    /* Language switcher */
    --h3-lang-bg:            #ffffff;
    --h3-lang-radius:        5px;
    --h3-lang-divider:       #e5e7eb;

    /* Layout */
    --h3-height-default:     107px;
    --h3-height-scroll:      88px;
    --h3-inner-width:        90%;
    --h3-inner-max-width:    2000px;
    --h3-logo-width:         170px;

    /* Transitions */
    --h3-ease:               0.35s ease;

    /* Mobile breakpoint */
    --h3-bp-mobile:          980px;
}

/* ── Blanket reset for all header children ──────────────────────────────── */
#h3-header,
#h3-header * {
    box-sizing: border-box;
    margin:     0;
    padding:    0;
}

/* ── Base header ────────────────────────────────────────────────────────── */
#h3-header {
    position:         fixed;
    top:              0;
    left:             0;
    width:            100%;
    z-index:          9999;
    font-family:      var(--h3-font);
    transition:
        background-color  var(--h3-ease),
        height            var(--h3-ease),
        box-shadow        var(--h3-ease),
        backdrop-filter   var(--h3-ease);
}

/* Default – transparent */
#h3-header.h3-header--default {
    background-color: transparent;
    height:           var(--h3-height-default);
    box-shadow:       none;
}

/* Scrolled – frosted glass */
#h3-header.h3-header--scrolled {
    background-color:    var(--h3-bg-scroll);
    backdrop-filter:     blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height:              var(--h3-height-scroll);
    box-shadow:          0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ── Inner flex container ───────────────────────────────────────────────── */
.h3-header__inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    width:           var(--h3-inner-width);
    max-width:       var(--h3-inner-max-width);
    margin:          0 auto;
    height:          100%;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */
.h3-logo {
    display:     flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    text-decoration: none;
}

.h3-logo__img {
    width:      var(--h3-logo-width);
    height:     auto;
    display:    block;
    transition: opacity var(--h3-ease);
}

/* ── Desktop nav wrapper ────────────────────────────────────────────────── */
.h3-nav--desktop {
    display:     flex;
    align-items: center;
    gap:         32px;
}

/* ── Nav list ───────────────────────────────────────────────────────────── */
.h3-nav__list {
    display:     flex;
    align-items: center;
    gap:         36px;
    list-style:  none;
}

.h3-nav__item {
    position: relative; /* anchor for lang dropdown */
}

/* ── Nav links ──────────────────────────────────────────────────────────── */
.h3-nav__link {
    font-family:     var(--h3-font);
    font-size:       var(--h3-nav-size);
    font-weight:     400;
    color:           var(--h3-text-default);
    text-decoration: none;
    white-space:     nowrap;
    letter-spacing:  0.01em;
    transition:      color var(--h3-ease), opacity var(--h3-ease);
}

.h3-nav__link:hover {
    opacity: 0.72;
}

#h3-header.h3-header--scrolled .h3-nav__link {
    color: var(--h3-text-scroll);
}

/* ── CTA Button ─────────────────────────────────────────────────────────── */
.h3-btn-kontakt {
    display:          inline-flex;
    align-items:      center;
    justify-content:  center;
    font-family:      var(--h3-font);
    font-size:        var(--h3-nav-size);
    font-weight:      500;
    color:            var(--h3-btn-color) !important;
    background-color: var(--h3-btn-bg);
    border:           1px solid var(--h3-btn-border);
    border-radius:    var(--h3-btn-radius);
    padding:          10px 25px;
    text-decoration:  none;
    white-space:      nowrap;
    cursor:           pointer;
    flex-shrink:      0;
    transition:
        background-color var(--h3-btn-ease),
        border-color     var(--h3-btn-ease);
}

.h3-btn-kontakt:hover,
.h3-btn-kontakt:focus-visible {
    background-color: var(--h3-btn-bg-hover);
    border-color:     var(--h3-btn-border-hover);
    outline:          none;
}

/* ══════════════════════════════════════════════════════════════════════════
   Language Switcher
   The trigger and the dropdown share the same border-radius so that when
   the dropdown opens it looks like the trigger simply grew downward.
   ══════════════════════════════════════════════════════════════════════════ */

/* Wrapper */
.h3-lang {
    position: relative;
}

/* Trigger button */
.h3-lang__trigger {
    font-family:      var(--h3-font);
    font-size:        var(--h3-lang-size);
    font-weight:      500;
    line-height:      1;
    background-color: transparent;
    border:           1px solid rgba(255, 255, 255, 0.7);
    border-radius:    var(--h3-lang-radius);
    padding:          7px 11px;
    color:            var(--h3-text-default);
    cursor:           pointer;
    white-space:      nowrap;
    min-width:        46px;
    text-align:       center;
    transition:
        color            var(--h3-ease),
        background-color var(--h3-ease),
        border-color     var(--h3-ease),
        border-radius    0.15s ease;
}

/* Scrolled – trigger adapts to dark header */
#h3-header.h3-header--scrolled .h3-lang__trigger {
    color:        var(--h3-text-scroll);
    border-color: rgba(51, 51, 51, 0.30);
}

/* Open state – trigger top half only, flush bottom so dropdown attaches */
.h3-lang.is-open .h3-lang__trigger {
    background-color:           var(--h3-lang-bg);
    color:                      var(--h3-text-scroll);
    border-color:               var(--h3-lang-divider);
    border-bottom-color:        var(--h3-lang-bg);   /* hides seam */
    border-bottom-left-radius:  0;
    border-bottom-right-radius: 0;
    /* keep top radius from shifting */
    border-top-left-radius:     var(--h3-lang-radius);
    border-top-right-radius:    var(--h3-lang-radius);
}

/* Dropdown list */
.h3-lang__dropdown {
    position:         absolute;
    top:              calc(100% + 1px); /* +1px closes the 1px seam */
    left:             -1px;            /* align with trigger border */
    min-width:        calc(100% + 2px);/* same visual width as trigger */
    background-color: var(--h3-lang-bg);
    border:           1px solid var(--h3-lang-divider);
    border-top:       none;            /* seamless join with trigger */
    border-radius:    0 0 var(--h3-lang-radius) var(--h3-lang-radius);
    list-style:       none;
    overflow:         hidden;
    z-index:          200;
    /* Hidden */
    visibility:       hidden;
    opacity:          0;
    transform:        translateY(-6px);
    transition:
        opacity    0.18s ease,
        transform  0.18s ease,
        visibility 0s linear 0.18s;
}

/* Open */
.h3-lang.is-open .h3-lang__dropdown {
    visibility:        visible;
    opacity:           1;
    transform:         translateY(0);
    transition-delay:  0s;
}

/* Individual option */
.h3-lang__option {
    display:         block;
    font-family:     var(--h3-font);
    font-size:       var(--h3-lang-size);
    font-weight:     400;
    color:           var(--h3-text-scroll);
    text-decoration: none;
    padding:         8px 11px;
    text-align:      center;
    transition:      background-color 0.15s ease;
}

.h3-lang__option:hover {
    background-color: #f3f4f6;
}

.h3-lang__option--active {
    font-weight:      600;
    background-color: #f3f4f6;
}

/* ══════════════════════════════════════════════════════════════════════════
   Mobile controls (lang + hamburger, shown only below breakpoint)
   ══════════════════════════════════════════════════════════════════════════ */

.h3-mobile-controls {
    display:     none; /* overridden in media query */
    align-items: center;
    gap:         10px;
}

/* ── Hamburger ──────────────────────────────────────────────────────────── */
.h3-hamburger {
    display:          flex;
    align-items:      center;
    justify-content:  center;
    width:            44px;
    height:           44px;
    background-color: var(--h3-btn-bg);
    border:           none;
    border-radius:    var(--h3-btn-radius);
    cursor:           pointer;
    flex-shrink:      0;
    transition:       background-color 0.25s ease;
}

.h3-hamburger:hover {
    background-color: var(--h3-btn-bg-hover);
}

.h3-hamburger__icon {
    display:        flex;
    flex-direction: column;
    justify-content: center;
    gap:            5px;
    width:          20px;
}

.h3-hamburger__icon span {
    display:          block;
    width:            100%;
    height:           2px;
    background-color: #ffffff;
    border-radius:    2px;
    transition:
        transform  0.3s ease,
        opacity    0.3s ease,
        width      0.3s ease;
    transform-origin: center;
}

/* Hamburger → × */
.h3-hamburger[aria-expanded="true"] .h3-hamburger__icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.h3-hamburger[aria-expanded="true"] .h3-hamburger__icon span:nth-child(2) {
    opacity:   0;
    transform: scaleX(0);
}
.h3-hamburger[aria-expanded="true"] .h3-hamburger__icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════════════════════
   Mobile full-screen menu overlay
   ══════════════════════════════════════════════════════════════════════════ */

.h3-mobile-menu {
    position:         fixed;
    inset:            0;
    background-color: #ffffff;
    z-index:          9998; /* behind header (9999), above everything else */
    display:          flex !important; /* override [hidden] display:none for transition */
    flex-direction:   column;
    padding:          120px 7% 48px;
    /* Animation */
    opacity:          0;
    transform:        translateX(100%);
    transition:
        opacity   0.32s ease,
        transform 0.32s ease,
        visibility 0s linear 0.32s;
    visibility:       hidden;
    pointer-events:   none;
}

.h3-mobile-menu:not([hidden]) {
    opacity:        1;
    transform:      translateX(0);
    visibility:     visible;
    pointer-events: auto;
    transition-delay: 0s;
}

/* List */
.h3-mobile-menu__list {
    list-style: none;
}

.h3-mobile-menu__item {
    border-bottom: 1px solid #f0f2f4;
}

.h3-mobile-menu__item--cta {
    border-bottom: none;
    margin-top: 8px;
}

.h3-mobile-menu__link {
    display:         block;
    font-family:     var(--h3-font);
    font-size:       22px;
    font-weight:     400;
    color:           #333333;
    text-decoration: none;
    padding:         18px 0;
    transition:      color 0.2s ease;
}

.h3-mobile-menu__link:hover {
    color: var(--h3-btn-bg);
}

.h3-mobile-menu__link--cta {
    color:       var(--h3-btn-bg);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════════════
   Responsive breakpoint
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 980px) {

    /* Hide desktop nav, show mobile controls */
    .h3-nav--desktop {
        display: none;
    }
    .h3-mobile-controls {
        display: flex;
    }

    /* No height change on mobile – only colours change */
    #h3-header.h3-header--default,
    #h3-header.h3-header--scrolled {
        height: var(--h3-height-default);
    }

    /* Mobile lang trigger – scrolled colour */
    #h3-header.h3-header--scrolled .h3-lang--mobile .h3-lang__trigger {
        color:        var(--h3-text-scroll);
        border-color: rgba(51, 51, 51, 0.30);
    }

    /* Mobile lang dropdown opens leftward so it doesn't clip off-screen */
    .h3-lang--mobile .h3-lang__dropdown {
        left:  auto;
        right: -1px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   Divi Theme Builder – compatibility
   The shortcode is placed inside a Divi Code module inside the Global Header.
   These rules ensure the Divi header wrapper doesn't interfere.
   ══════════════════════════════════════════════════════════════════════════ */

/* Remove Divi's default top padding on the first section when our
   fixed header is present. Adjust the value to match --h3-height-default. */
.et_fixed_nav #page-container > .et_pb_section:first-child {
    padding-top: var(--h3-height-default) !important;
}

/* Prevent Divi from showing its own fixed header on scroll */
#main-header.et-fixed-header {
    display: none !important;
}

/* ── Accessibility ──────────────────────────────────────────────────────── */
#h3-header a:focus-visible,
#h3-header button:focus-visible {
    outline:        2px solid var(--h3-btn-bg);
    outline-offset: 3px;
    border-radius:  3px;
}
