/* =============================================================
   HEADER (extracted: 97px tall, padding 10px 15px, sticky w/ shadow)
   ============================================================= */
.site-header {
    position: sticky;
    inset-block-start: 0;
    background: var(--color-white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 100;
}

/* When the WP admin bar is visible (logged-in user), push the sticky
   header down so it sits BELOW the admin bar instead of being hidden
   behind it. Admin bar is 32px at ≥783px and 46px at ≤782px. */
body.admin-bar .site-header {
    inset-block-start: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        inset-block-start: 46px;
    }
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: none;                          /* override .container max-width — header is fluid */
    padding-block: 10px;
    padding-inline-start: 32px;               /* RTL: visual right = menu end */
    padding-inline-end: 16px;                 /* RTL: visual left = logo end */
    min-height: 97px;
}

/* Logo on the visual LEFT (= inline-end in RTL = order-end of flex row) */
.site-header__logo {
    flex-shrink: 0;
    order: 2;
    margin-inline-start: auto;
}

.site-header__logo img {
    height: 56px;
    width: auto;
}

/* source img inside an image-box, ~56px tall */

/* Two separate nav elements as top-level siblings of site-header__inner.
   RTL flex row with explicit order:
     primary nav (order 0) → visual RIGHT
     actions nav (order 1) → middle (between primary and logo)
     logo (order 2)        → far visual LEFT (margin-inline-start: auto absorbs slack)
*/
.site-header__nav {
    display: flex;
    align-items: center;
}

.site-header__nav--primary {
    order: 0;
}

.site-header__nav--actions {
    order: 1;
    margin-inline-end: 16px;
}

/* Generic menu list reset (applies to both menus) */
.site-header .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.site-header .menu.menu--actions {
    display: flex;
    flex-direction: row;
    gap: 0 12px;
}

.site-header .menu .menu-item {
    margin: 0;
}

.site-header .menu .menu-item a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    /*white-space: nowrap;*/
    font-family: inherit;
    transition: color 0.2s;
}

.site-header .menu .menu-item__icon {
    display: block;
    object-fit: contain;
}

/* ===== Primary menu (default header link style) ===== */
.menu--primary .menu-item a {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    padding: 13px 12px;
    margin-inline-end: 8px;
    letter-spacing: -0.3px;
    line-height: 20px;
    position: relative;
    gap: 8px;
}

.menu--primary .menu-item a:hover {
    color: var(--color-primary);
}

/* Active state — current page menu item + its ancestors render orange.
   WP's nav walker adds .current-menu-item to the active page's <li> and
   .current-menu-ancestor on parents in a hierarchical menu. */
.menu--primary .current-menu-item > a,
.menu--primary .current-menu-ancestor > a,
.menu--primary .current_page_item > a,
.menu--primary .current_page_ancestor > a {
    color: var(--color-primary) !important;
}

.menu--primary .menu-item__icon {
    width: 24px;
    height: 24px;
}

/* ===== Actions menu (icon-above-text, orange label) ===== */
.menu--actions {
    gap: 16px;
}

.menu--actions .menu-item a {
    flex-direction: column;
    align-items: center;
    gap: 13px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-primary);
    text-align: center;
    line-height: 1.2;
    min-width: 60px;
}

.menu--actions .menu-item__icon {
    width: 32px;
    height: 32px;
}

.menu--actions .menu-item a u {
    text-decoration: underline;
}

/* =============================================================
   Hamburger + slide-in panel base styles (visible only on mobile;
   desktop hides the burger and uses display:contents on the panel so
   its children participate in inner-flex). The actual mobile overrides
   that flip layout to a slide-in panel live in the @media (max-width:
   1024px) block at the bottom of this file.
   ============================================================= */
.site-header__burger {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.site-header__burger img {
    width: 100%;
    height: auto;
    display: block;
}

/* Panel + backdrop — display:contents on desktop so children participate
   in inner-flex layout. Decorative mobile-only pieces are hidden on desktop. */
.site-header__panel {
    display: contents;
}

.site-header__panel-close,
.site-header__panel-logo,
.site-header__panel-top,
.site-header__panel-divider,
.site-header__panel-follow,
.site-header__panel-langs,
.site-header__backdrop {
    display: none;
}

/* Panel copy of the actions menu — hidden on desktop. */
.site-header__nav--actions-panel {
    display: none;
}

/* ===== Submenu (dropdown under .menu-item-has-children) ===== */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a {
    gap: 4px;
}

.menu-item__chevron {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.2s;
}

.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Desktop dropdown: absolute panel revealed on hover/focus (≥1025px).
   Mobile uses .is-open (JS) only — no hover trigger. */
@media (min-width: 1025px) {
    .menu-item__chevron {
        transform: rotate(0deg);
    }

    .menu--primary .sub-menu {
        position: absolute;
        inset-block-start: 100%;
        inset-inline-start: 0;
        min-width: 220px;
        background: var(--color-white);
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
        padding: 8px 0;
        display: none;
        z-index: 110;
    }

    .menu--primary .menu-item-has-children:hover > .sub-menu,
    .menu--primary .menu-item-has-children:focus-within > .sub-menu,
    .menu--primary .menu-item-has-children.is-open > .sub-menu {
        display: block;
    }

    .menu--primary .sub-menu .menu-item a {
        display: block;
        padding: 10px 20px;
        font-size: 16px;
        color: var(--color-text-heading);
        white-space: nowrap;
        text-align: start;
        margin: 0;
    }

    .menu--primary .sub-menu .menu-item a:hover {
        color: var(--color-primary);
    }

    /* Active state inside the dropdown — needs to beat the navy color
       set on .menu--primary .sub-menu .menu-item a above. */
    .menu--primary .sub-menu .current-menu-item > a,
    .menu--primary .sub-menu .current_page_item > a {
        color: var(--color-primary);
    }

    /* Language dropdown — flex row, icon next to label, vertically centred. */
    .menu-item--lang-desktop .sub-menu {
        min-width: 250px;
        width: auto;
    }

    .menu-item--lang-desktop .sub-menu .menu-item a {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        white-space: normal;
        text-align: start;
    }

    .menu-item--lang-desktop .sub-menu .menu-item__icon {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        flex-shrink: 0;
    }
}

/* =============================================================
   TABLET / MID-DESKTOP (1025-1380px)
   Breakage starts ~1350px (logo gets pushed off-screen) because primary
   nav + actions + logo together need ~1380px. Scale nav padding/font
   down to stay within budget.
   ============================================================= */
@media (min-width: 1921px) {

    .menu--primary .menu-item > a {
        font-size: 20px;
    }
}

@media (min-width: 1200px) and (max-width: 1410px) {

    .menu--primary .menu-item > a {
        font-size: 16px;
    }
}

@media (min-width: 1025px) and (max-width: 1410px) {

    .site-header__inner {
        padding-inline-start: 16px;
        padding-inline-end: 12px;
        gap: 8px;
    }

    .site-header__logo img {
        height: 42px;
    }

    .menu--primary .menu-item > a {
        margin-inline-end: 0;
        letter-spacing: 0;
    }

    .menu--actions {
        gap: 10px;
    }

    .menu--actions .menu-item a {
        min-width: 0;
        gap: 6px;
    }

    .menu--actions .menu-item__icon {
        width: 26px;
        height: 26px;
    }
}

@media (min-width: 1025px) and (max-width: 1199px) {

    .menu--primary .menu-item > a {
        padding: 8px 6px;
        font-size: 14px;
    }

    .menu--actions .menu-item a {
        font-size: 12px;
    }
}

/* =============================================================
   MOBILE / TABLET (<=1024px) — primary header → burger + slide-in panel.
   ============================================================= */
@media (max-width: 1024px) {
    .site-header__inner {
        min-height: 64px;
        padding-block: 8px;
        padding-inline: 16px;
        gap: 12px;
        justify-content: space-between;
    }

    .site-header__logo img {
        height: 36px;
    }

    .site-header__logo {
        order: 1;
        margin-inline-start: 0;
    }

    .site-header__burger {
        display: flex;
        order: 0;
    }

    /* Bar-side actions hidden; the panel copy stays. */
    .site-header__inner > .site-header__nav--actions {
        display: none;
    }

    /* Panel becomes a slide-in overlay from visual right (RTL inline-start) */
    .site-header__panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: 85%;
        max-width: 360px;
        background: var(--color-white);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 200;
        overflow-y: auto;
        padding: 32px 24px 24px;
        gap: 0;
    }

    .site-header.is-open .site-header__panel {
        transform: translateX(0);
    }

    /* LTR (EN/RU): the panel is flush-left, so hide it off the LEFT edge.
       RTL hides off the right via translateX(100%) above. Width unchanged. */
    html:not([dir="rtl"]) .site-header__panel {
        transform: translateX(-100%);
    }

    .site-header__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 150;
    }

    .site-header.is-open .site-header__backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Top row inside the panel — actions on visual RIGHT, logo on visual LEFT. */
    .site-header__panel-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-block-end: 16px;
    }

    .site-header__panel-top .site-header__nav--actions-panel {
        order: 0;
    }

    .site-header__panel-top .site-header__panel-logo {
        order: 1;
        flex-shrink: 0;
    }

    .site-header__panel-logo {
        display: block;
    }

    .site-header__panel-logo img {
        height: 42px;
        width: auto;
        display: block;
    }

    /* Panel-side copy of the actions menu is visible on mobile */
    .site-header__nav--actions-panel {
        display: block;
    }

    /* × close button — absolute top-LEFT of the panel (RTL: inline-end = visual left). */
    .site-header__panel-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        inset-block-start: 10px;
        inset-inline-end: 10px;
        width: 16px;
        height: 16px;
        background: none;
        border: 0;
        padding: 0;
        color: var(--color-primary);
        cursor: pointer;
        z-index: 1;
    }

    .site-header__panel-close img {
        width: 100%;
        height: 100%;
        display: block;
    }

    .site-header__panel-divider {
        display: block;
        border: 0;
        border-block-start: 1px solid var(--color-primary);
        margin: 0 0 8px;
    }

    /* Primary nav vertical layout inside panel — menu items 100% wide */
    .site-header__nav--primary {
        width: 100%;
    }

    .menu--primary {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .menu--primary .menu-item {
        width: 100%;
        display: block;
    }

    .menu--primary .menu-item > a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        margin: 0;
        font-size: 18px;
        text-align: start;
    }

    .menu--primary .menu-item-has-children > a {
        display: none !important;
    }

    /* Push the chevron to the visual-left edge */
    .menu--primary .menu-item-has-children > a > .menu-item__chevron {
        margin-right: auto;
        font-size: 14px;
        transform: rotate(180deg);
        transition: transform 0.2s;
    }

    /* Sub-menus are open by default on mobile (pure CSS); the JS toggle adds
       .is-collapsed to fold them. */
    .menu--primary .menu-item-has-children.is-collapsed > a > .menu-item__chevron {
        transform: rotate(0deg);
    }

    /* Hide desktop-only inline lang dropdown on mobile — the full langs
       row below already serves as the language switcher in the panel. */
    .menu--primary .menu-item--lang-desktop {
        display: none;
    }

    /* Submenu on mobile: inline collapse, no indent, smaller font, full width. */
    .menu--primary .sub-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
        width: 100%;
        display: block;
    }

    .menu--primary .menu-item-has-children.is-collapsed > .sub-menu {
        display: none;
    }

    .menu--primary .sub-menu .menu-item {
        width: 100%;
    }

    .menu--primary .sub-menu .menu-item a {
        width: 100%;
        padding: 10px 0;
        font-size: 18px;
        justify-content: flex-start;
    }

    /* Compact actions in header bar (visible 769-1024px; hidden ≤768px) */
    .menu--actions {
        gap: 16px;
    }

    .menu--actions .menu-item a {
        gap: 8px;
        min-width: 0;
        font-size: 13px;
    }

    .menu--actions .menu-item__icon {
        width: 32px;
        height: 32px;
    }

    /* Language switcher row (mobile-only) */
    .site-header__panel-langs {
        display: block;
        padding-block: 16px 8px;
        border-block-start: 1px solid #eee;
        margin-block-start: 8px;
    }

    .menu--langs {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: space-around;
        gap: 8px;
    }

    .menu--langs .menu-item a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        font-size: 16px;
    }

    .menu--langs .menu-item__icon {
        width: 22px;
        height: 22px;
        border-radius: 50%;
    }

    /* Follow widget docked at the bottom of the panel */
    .site-header__panel-follow {
        display: block;
        margin-block-start: auto;
        padding-block-start: 24px;
        text-align: start;
    }

    .site-header__panel-follow-title {
        font-size: 18px;
        font-weight: 600;
        color: rgb(57, 70, 95);
        margin: 0 0 12px;
    }

    .site-header__panel-follow .menu--social {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 18px;
        align-items: center;
    }

    .site-header__panel-follow .menu-item a {
        padding: 0;
        display: inline-flex;
    }

    .site-header__panel-follow .menu-item__icon {
        width: 28px;
        height: 28px;
    }

    .site-header__panel-follow .menu-item__label {
        display: none;
    }
}

@media (max-width: 1024px) {
    .site-header__inner {
        padding-inline: 16px;
    }
}
