/**
 * header_style_mobile.css
 * Mobile navigation: off-canvas slide-in panel, hamburger toggle,
 * accordion-style dropdowns, and background overlay.
 * Active below 1300 px.
 *
 * Two tiers:
 *   ≤ 1299px  – tablet + narrow desktop
 *   ≤  600px  – phone-specific refinements
 */

/* =========================
   TIER 1 – TABLET  (≤ 1299px)
========================= */

@media (max-width: 1299px) {

    /* Tighter header padding on tablet */
    .site-header {
        padding: 0 20px;
    }

    /* =========================
       OFF-CANVAS NAV PANEL
    ========================= */

    .navigation {
        position: fixed;
        top: var(--header-height, 70px);
        right: 0;
        width: 300px;
        height: calc(100vh - var(--header-height, 70px));

        background: var(--color-bg-white);
        box-shadow: -4px 0 20px rgba(0,0,0,0.10);

        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;  /* smooth scroll on iOS */

        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    .navigation.active {
        transform: translateX(0);
    }

    /* =========================
       NAV LIST
    ========================= */

    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        list-style: none;
    }

    .nav-links li {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links a {
        display: block;
        padding: 16px 24px;
        font-size: 17px;
        font-weight: 500;
        color: #333;
        text-decoration: none;
        transition: color 0.2s;
        /* Large touch target */
        min-height: 52px;
        display: flex;
        align-items: center;
    }

    .nav-links a:hover,
    .nav-links a:active {
        color: var(--color-primary-mid);
    }

    /* =========================
       HAMBURGER BUTTON
    ========================= */

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        z-index: 1100;
        /* Large touch target */
        padding: 10px;
        margin-right: -10px;
        transition: transform 0.3s ease;
        background: none;
        border: none;
    }

    .hamburger span {
        width: 24px;
        height: 2px;
        background: #333;
        transform-origin: center;
        transition: transform 0.3s ease, opacity 0.3s ease;
        display: block;
    }

    /* Animate to X when open */
    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* =========================
       BACKGROUND OVERLAY
    ========================= */

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 900;
        /* Prevent scroll bleed-through on iOS */
        -webkit-tap-highlight-color: transparent;
    }

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* =========================
       ACCORDION DROPDOWN
    ========================= */

    .dropdown-menu {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-4px);
        transition:
            max-height 0.35s ease,
            opacity 0.25s ease,
            transform 0.25s ease;
        display: block;
    }

    .dropdown.active .dropdown-menu {
        max-height: 600px;
        opacity: 1;
        transform: translateY(0);
    }

    /* Chevron arrow on dropdown trigger */
    .dropdown > a {
        position: relative;
    }

    .dropdown > a::after {
        content: "›";
        position: absolute;
        right: 20px;
        font-size: 20px;
        line-height: 1;
        color: var(--color-muted);
        transition: transform 0.3s ease;
    }

    .dropdown.active > a::after {
        transform: rotate(90deg);
    }

    /* =========================
       DROPDOWN CONTENT (mobile)
    ========================= */

    .dropdown-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 4px 0 8px;
    }

    .dropdown-column h4,
    .dropdown-feature h4 {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--color-muted);
        margin: 12px 24px 4px;
    }

    .dropdown-column a {
        display: flex;
        align-items: center;
        padding: 11px 32px;
        font-size: 15px;
        color: #444;
        text-decoration: none;
        border-bottom: 1px solid #f5f5f5;
        transition: color 0.2s, background 0.2s;
        /* Large touch target */
        min-height: 46px;
    }

    .dropdown-column a:last-child {
        border-bottom: none;
    }

    .dropdown-column a:hover,
    .dropdown-column a:active {
        color: var(--color-primary-mid);
        background: var(--color-primary-light);
    }

    /* Feature box hidden on mobile */
    .dropdown-feature {
        display: none;
    }
}

/* =========================
   TIER 2 – PHONE  (≤ 600px)
========================= */

@media (max-width: 600px) {

    /* Even tighter padding on phones */
    .site-header {
        padding: 0 16px;
    }

    /* Narrower nav panel on very small screens */
    .navigation {
        width: 280px;
    }

    .nav-links a {
        font-size: 16px;
        padding: 14px 20px;
    }

    .dropdown-column a {
        padding: 11px 28px;
        font-size: 14px;
    }

    .dropdown-column h4,
    .dropdown-feature h4 {
        margin: 12px 20px 4px;
    }
}


/* =========================
   LANGUAGE SWITCHER – MOBILE (≤ 1299px)
   Merged from lang_switcher.css
========================= */

@media (max-width: 1299px) {

    /* Hide desktop li */
    li.lang-dropdown { display: none !important; }

    /* Mobile bar: inline after last nav link */
    .mobile-lang-bar {
        border-top: 1px solid var(--color-border, #e5e7eb);
        position: relative;
        overflow: visible;
    }

    .mobile-lang-trigger {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 16px 24px;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        font-size: 17px;
        font-weight: 500;
        color: #333;
        text-align: left;
        transition: color 0.2s;
        min-height: 52px;
        position: relative;
    }
    .mobile-lang-trigger:hover { color: var(--color-primary-mid, #2a6db5); }
    .mobile-lang-trigger svg   { color: #333; flex-shrink: 0; }
    .mobile-lang-trigger:hover svg { color: var(--color-primary-mid, #2a6db5); }

    /* › chevron – matches .dropdown > a::after pattern */
    .mobile-lang-trigger::after {
        content: "›";
        position: absolute;
        right: 20px;
        font-size: 20px;
        line-height: 1;
        color: var(--color-muted, #888);
        transition: transform 0.3s ease;
    }
    .mobile-lang-bar.open .mobile-lang-trigger::after {
        transform: rotate(90deg);
    }

    .mobile-lang-current {
        flex: 1;
        color: #333;
        font-size: 14px;
        letter-spacing: 0.5px;
    }
    .mobile-lang-trigger:hover .mobile-lang-current { color: var(--color-primary-mid, #2a6db5); }

    /* Downward dropdown */
    .mobile-lang-dropdown {
        width: 100%;
        background: var(--color-bg-white, #fff);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.25s ease, opacity 0.2s ease;
    }
    .mobile-lang-bar.open .mobile-lang-dropdown {
        max-height: 200px;
        opacity: 1;
    }

    .mobile-lang-option {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 11px 32px;
        background: none;
        border: none;
        border-top: 1px solid var(--color-border, #e5e7eb);
        cursor: pointer;
        font-family: inherit;
        font-size: 15px;
        color: #444;
        text-align: left;
        transition: color 0.2s, background 0.2s;
        min-height: 46px;
    }
    .mobile-lang-option:hover {
        background: var(--color-primary-light, #eef4fb);
        color: var(--color-primary-mid, #2a6db5);
    }
    .mobile-lang-option.lang-option-active {
        color: var(--color-primary-mid, #2a6db5);
        font-weight: 700;
    }
    .mobile-lang-code {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.5px;
        color: var(--color-muted, #888);
    }
    .mobile-lang-option.lang-option-active .mobile-lang-code {
        color: var(--color-primary-mid, #2a6db5);
    }
}

/* Language switcher – Phone refinements (≤ 600px) */
@media (max-width: 600px) {
    .mobile-lang-trigger {
        font-size: 16px;
        padding: 14px 20px;
    }
    .mobile-lang-option {
        padding: 11px 28px;
        font-size: 14px;
    }
}
