/* ==========================================================================
   Troisa Custom Header — mobile-first, production-ready
   ========================================================================== */

/* Hide default theme / Elementor headers */
header.site-header,
.elementor-location-header,
header#masthead,
[data-elementor-type="header"],
.navbar {
    display: none !important;
}

/* Global overflow guard (front-end header scope) */
html {
    scroll-padding-top: var(--troisa-header-h, 68px);
    overflow-x: clip;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

/* Accessibility skip link */
.troisa-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10002;
    padding: 10px 16px;
    background: #000000;
    color: #ffffff;
    font-family: var(--troisa-font);
    font-size: 14px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
}

.troisa-skip-link:focus {
    top: 0;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

:root {
    --troisa-font: "Helvetica Neue", "Aktiv Grotesk", "Neue Haas Grotesk", Inter, sans-serif;
    --troisa-header-h: 56px;
    --troisa-header-h-desktop: 68px;
    --troisa-header-h-mobile: 56px;
    --troisa-header-pad-x: 16px;
    --troisa-header-pad-x-desktop: 40px;
    --troisa-header-pad-x-tablet: 24px;
    --troisa-ease: cubic-bezier(0.4, 0, 0.2, 1);
    /* 3A.svg cropped viewBox="248 528 632 340" */
    --troisa-logo-aspect: 632 / 340;
    --troisa-mobile-logo-width: min(140px, 58vw);
}

/* --------------------------------------------------------------------------
   Fixed / sticky header bar
   -------------------------------------------------------------------------- */
.troisa-custom-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1001;
    height: var(--troisa-header-h);
    box-sizing: border-box;
    background-color: transparent;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition:
        background-color 300ms var(--troisa-ease),
        backdrop-filter 300ms var(--troisa-ease),
        -webkit-backdrop-filter 300ms var(--troisa-ease),
        border-color 300ms var(--troisa-ease),
        box-shadow 300ms var(--troisa-ease);
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    contain: layout style;
}

.troisa-custom-header.is-scrolled,
.troisa-custom-header.is-menu-open {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
    height: 80px;
}

.troisa-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--troisa-header-pad-x);
    box-sizing: border-box;
    margin-top: 10px;

}

/* Logo */
.troisa-logo {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 52px);
    line-height: 0;
    transition: opacity 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.troisa-logo:hover {
    opacity: 0.7;
}

.troisa-logo img,
.troisa-logo svg {
    display: block;
    width: 45px;
        height: 60px;
    flex-shrink: 0;
}

.troisa-logo svg path {
    fill: #ffffff;
}

/* Desktop nav — hidden on mobile */
.troisa-nav {
    display: none;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.troisa-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(12px, 2vw, 32px);
}

.troisa-menu li {
    margin: 0;
    flex-shrink: 0;
}

.troisa-menu a {
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: var(--troisa-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 4px 0;
    white-space: nowrap;
    transition: color 220ms ease;
}

.troisa-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background-color: #ffffff;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 220ms ease;
}

.troisa-menu a:hover,
.troisa-menu a:focus-visible,
.troisa-menu a.is-active {
    color: #ffffff;
}

.troisa-menu a:hover::after,
.troisa-menu a:focus-visible::after,
.troisa-menu a.is-active::after {
    transform: scaleX(1);
}

/* Right zone — hamburger on mobile */
.troisa-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-shrink: 0;
}

/* Hamburger — mobile only (black & white) */
.troisa-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #000000;
    border-radius: 50%;
    background-color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
        background-color 220ms ease,
        border-color 220ms ease;
}

.troisa-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #000000;
    transition:
        transform 220ms ease,
        opacity 220ms ease,
        background-color 220ms ease;
    transform-origin: center;
}

.troisa-menu-toggle.is-active {
    background-color: #000000;
    border-color: #ffffff;
}

.troisa-menu-toggle.is-active span {
    background-color: #ffffff;
}

.troisa-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.troisa-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

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

.troisa-menu-toggle:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.troisa-menu-toggle.is-active:focus-visible {
    outline-color: #ffffff;
}

/* --------------------------------------------------------------------------
   Mobile full-screen menu
   -------------------------------------------------------------------------- */
.troisa-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding:
        max(var(--troisa-header-h), env(safe-area-inset-top, 0px))
        var(--troisa-header-pad-x)
        max(24px, env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 320ms var(--troisa-ease),
        visibility 0s linear 320ms;
}

.troisa-mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition:
        opacity 320ms var(--troisa-ease),
        visibility 0s linear 0s;
}

.troisa-mobile-menu-panel {
    width: 100%;
    max-width: 420px;
    overflow: visible;
    transform: translate3d(0, -24px, 0);
    opacity: 0;
    transition:
        transform 420ms var(--troisa-ease),
        opacity 420ms var(--troisa-ease);
}

.troisa-mobile-menu.is-open .troisa-mobile-menu-panel {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.troisa-mobile-menu-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 28px;
    padding: 0 8px;
    line-height: 0;
    overflow: visible;
    flex-shrink: 0;
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition: opacity 360ms ease, transform 360ms ease;
}

.troisa-mobile-menu.is-open .troisa-mobile-menu-logo {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: 40ms;
}

.troisa-mobile-menu.is-open .troisa-mobile-menu-logo:hover {
    opacity: 0.7;
}

.troisa-mobile-menu-logo img,
.troisa-mobile-menu-logo svg {
    display: block;
    width: var(--troisa-mobile-logo-width);
    height: auto;
    max-width: 100%;
    aspect-ratio: var(--troisa-logo-aspect);
    margin: 0 auto;
    flex-shrink: 0;
    overflow: visible;
}

.troisa-mobile-menu-logo svg {
    /* Inline width/height attributes must not crop the mark */
    max-height: none;
}

.troisa-mobile-menu-logo svg path {
    fill: #ffffff;
}

.troisa-mobile-menu-nav {
    width: 100%;
    margin-top: -4px;
}

.troisa-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.troisa-mobile-menu-list li {
    margin: 0;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 360ms ease, transform 360ms ease;
}

.troisa-mobile-menu.is-open .troisa-mobile-menu-list li {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(1) { transition-delay: 80ms; }
.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(2) { transition-delay: 160ms; }
.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(3) { transition-delay: 240ms; }
.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(4) { transition-delay: 320ms; }
.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(5) { transition-delay: 400ms; }
.troisa-mobile-menu.is-open .troisa-mobile-menu-list li:nth-child(6) { transition-delay: 480ms; }

.troisa-mobile-menu-list a {
    display: block;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    font-family: var(--troisa-font);
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.15;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 200ms ease;
}

.troisa-mobile-menu-list a:active {
    opacity: 0.7;
}

.troisa-mobile-menu-list a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 4px;
}

.troisa-mobile-menu-list a.is-active::after {
    content: "";
    display: block;
    width: 32px;
    height: 1px;
    background-color: #ffffff;
    margin: 6px auto 0;
}

/* Scroll lock — no horizontal shift */
html.troisa-menu-open {
    overflow: hidden;
}

html.troisa-menu-open body {
    position: fixed;
    top: var(--troisa-scroll-lock, 0);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    touch-action: none;
}

/* --------------------------------------------------------------------------
   Breakpoints: 480px, 768px, 1024px+
   -------------------------------------------------------------------------- */

/* Small phones (320px+) */
@media (max-width: 480px) {
    :root {
        --troisa-header-pad-x: 12px;
    }

    .troisa-logo img,
    .troisa-logo svg {
        width: 45px;
        height: 60px;
    }

    .troisa-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .troisa-mobile-menu-list a {
        padding: 6px 8px;
        font-size: clamp(18px, 5.8vw, 24px);
        letter-spacing: 0.04em;
    }

    .troisa-mobile-menu-logo {
        margin-bottom: 24px;
    }

    .troisa-mobile-menu-logo img,
    .troisa-mobile-menu-logo svg {
        --troisa-mobile-logo-width: min(120px, 52vw);
    }
}

/* Tablet + desktop nav */
@media (min-width: 769px) {
    :root {
        --troisa-header-h: var(--troisa-header-h-desktop);
        --troisa-header-pad-x: var(--troisa-header-pad-x-tablet);
    }

    .troisa-header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 16px;
    }

    .troisa-logo {
        justify-self: start;
        max-width: none;
    }

    .troisa-logo img,
    .troisa-logo svg {
        width: 45px;
        height: 60px;
    }

    .troisa-nav {
        display: flex;
        justify-self: center;
    }

    .troisa-header-right {
        justify-self: end;
    }

    .troisa-menu-toggle {
        display: none !important;
    }

    .troisa-mobile-menu {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    :root {
        --troisa-header-pad-x: var(--troisa-header-pad-x-desktop);
    }

    .troisa-header-inner {
        gap: 24px;
    }

    .troisa-menu {
        gap: clamp(20px, 2.5vw, 40px);
    }
}

/* Tight tablet nav */
@media (min-width: 769px) and (max-width: 1023px) {
    .troisa-menu a {
        font-size: 10px;
        letter-spacing: 0.12em;
    }

    .troisa-menu {
        gap: 14px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .troisa-custom-header,
    .troisa-mobile-menu,
    .troisa-mobile-menu-panel,
    .troisa-mobile-menu-list li,
    .troisa-menu-toggle span,
    .troisa-menu a::after {
        transition-duration: 0.01ms !important;
    }
}
