/**
 * R4Y header + menu (page type global_header) – port of Elementor header 4253 and
 * menu popups 5025 (desktop, ≥1025) / 4312 (mobile + tablet), with new motion.
 *
 * Renders on Elementor pages too, so it is scoped on its own roots (.r4y-header,
 * .r4y-menu) and sets color/font/size explicitly to beat the Kit and Hello reset.
 * Values mirror post-4253/5025/4312.css (2026-11-07). Breakpoints: laptop ≤1366,
 * tablet ≤1024, mobile ≤767.
 *
 * Motion (assets/js/global/header.js toggles .is-open / .is-closing on the dialog):
 * the whole menu slides down from the top as one sheet (0.6s expo-out) and slides
 * back up when it closes (0.45s expo-in); the backdrop fades. No per-item animation.
 * prefers-reduced-motion: a short fade only.
 */

/* ── Header bar ─────────────────────────────────────────────────────── */
.r4y-header {
    --r4y-header-alpha: 0;
    --r4y-header-blur: 0px;
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0;
    z-index: 10;
    width: 100%;
    padding: 0 10px; /* Elementor's default container padding */
    background: rgba(255, 255, 255, var(--r4y-header-alpha));
    -webkit-backdrop-filter: blur(var(--r4y-header-blur));
    backdrop-filter: blur(var(--r4y-header-blur));
    font-family: var(--r4y-font-body);
    line-height: var(--r4y-lh-body);
}
.r4y-header *,
.r4y-menu *,
.r4y-menu *::before,
.r4y-menu *::after {
    box-sizing: border-box;
}
.r4y-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--r4y-container);
    min-height: 90px;
    margin-inline: auto;
}
.r4y-header ul,
.r4y-menu ul,
.r4y-menu p {
    margin: 0;
    padding: 0;
    list-style: none;
}
.r4y-header img,
.r4y-menu img {
    display: block;
    max-width: 100%;
    height: auto;
}
.r4y-header .r4y-icon,
.r4y-menu .r4y-icon {
    width: 1em;
    height: 1em;
    flex: none;
}

/* Elementor: a 350px logo next to a 100% container; both shrink, weighted by their basis
   (≈279px logo at 1440, ≈269px at 1300). */
.r4y-header__logo {
    display: block;
    flex: 0 1 350px;
    min-width: 0;
}
.r4y-header__logo-full  { width: 100%; }
.r4y-header__logo-small { display: none !important; width: 50px; }

.r4y-header__right {
    display: flex;
    flex: 0 1 100%;
    justify-content: flex-end;
    align-items: center;
    padding: 10px; /* Elementor's default container padding */
}
.r4y-header__nav {
    display: flex;
    justify-content: flex-end;
}
.r4y-header__links {
    display: flex;
    align-items: center;
}
.r4y-header .r4y-header__links a {
    display: block;
    margin-right: 60px;
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-base);
    font-weight: var(--r4y-fw-medium);
    line-height: 1;
    color: var(--r4y-kit-primary);
    text-decoration: none;
}
.r4y-header .r4y-header__links a:hover,
.r4y-header .r4y-header__links a:focus {
    color: var(--r4y-kit-primary);
}
.r4y-header__notice {
    margin: 0 30px 0 0;
    font-size: var(--r4y-fs-xs);
    color: var(--r4y-kit-secondary);
}

.r4y-header__actions {
    display: flex;
    flex: none;
}
.r4y-header .r4y-header__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 15px;
    border: 2px solid var(--r4y-kit-primary);
    border-radius: 0;
    background-color: var(--r4y-kit-primary);
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-base);
    font-weight: var(--r4y-fw-light);
    line-height: 1;
    color: var(--r4y-kit-white);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--r4y-transition), color var(--r4y-transition), border-color var(--r4y-transition);
}
.r4y-header .r4y-header__button:hover,
.r4y-header .r4y-header__button:focus {
    background-color: transparent;
    color: var(--r4y-kit-primary);
}
.r4y-header .r4y-header__button--advice {
    border-color: var(--r4y-kit-secondary);
    background-color: var(--r4y-kit-secondary);
}
.r4y-header .r4y-header__button--advice:hover,
.r4y-header .r4y-header__button--advice:focus {
    background-color: transparent;
    color: var(--r4y-kit-secondary);
}
.r4y-header a:focus-visible,
.r4y-header button:focus-visible,
.r4y-menu a:focus-visible,
.r4y-menu button:focus-visible {
    outline: 2px solid var(--r4y-kit-secondary);
    outline-offset: 3px;
}

@media (max-width: 1366px) {
    .r4y-header { padding: 0 60px; }
}
/* Tablet: Elementor hid every header element here (no navigation at all). Fix: logo + Menu. */
@media (max-width: 1024px) {
    .r4y-header__logo { flex: 0 0 200px; }
    .r4y-header__nav,
    .r4y-header .r4y-header__button--advice { display: none; }
}
@media (max-width: 767px) {
    .r4y-header { padding: 0 15px; }
    /* Elementor: min-height 60 + 15px padding, but the inline logo image makes the row 84px. */
    .r4y-header__inner { min-height: 84px; }
    .r4y-header__logo { flex: 0 0 50px; } /* Elementor uses a grid here: no shrinking */
    .r4y-header__logo-full  { display: none !important; }
    .r4y-header__logo-small { display: block !important; }
    .r4y-header .r4y-header__button {
        gap: 5px;
        padding: 8px 15px;
        font-size: var(--r4y-fs-sm);
    }
}

/* ── Menu dialog: shared ────────────────────────────────────────────── */
.r4y-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--r4y-kit-white);
    font-family: var(--r4y-font-body);
    line-height: var(--r4y-lh-body);
    overflow: hidden;
    overscroll-behavior: contain;
}
.r4y-menu[open] {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.r4y-menu::backdrop {
    background: var(--r4y-color-backdrop);
    opacity: 0;
    transition: opacity 0.45s ease-out;
}
.r4y-menu.is-open::backdrop {
    opacity: 1;
}
html.r4y-menu-open {
    overflow: hidden;
}

/* Motion: the whole menu slides down from above the viewport as one sheet, and back up. */
.r4y-menu {
    transform: translateY(-100%);
    transition: transform 0.6s var(--r4y-ease-out);
}
.r4y-menu.is-open {
    transform: none;
}
.r4y-menu.is-closing {
    transform: translateY(-100%);
    transition: transform 0.45s var(--r4y-ease-in);
}
.r4y-menu.is-closing::backdrop {
    opacity: 0;
    transition-duration: 0.35s;
}

.r4y-menu__panel {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 90px;
    overflow-y: auto;
}
.r4y-menu__panel--nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--r4y-kit-primary);
}
.r4y-menu__panel--aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--r4y-kit-white);
}

/* Specificity (0,2,0) beats the Kit rule .elementor-kit-3906 button (green fill, padding 15). */
.r4y-menu .r4y-menu__close {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 2;
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--r4y-kit-primary);
    cursor: pointer;
    transition: color var(--r4y-transition);
}
.r4y-menu .r4y-menu__close::after {
    content: "";
    position: absolute;
    inset: -12px; /* 48px touch target */
}
.r4y-menu .r4y-menu__close:hover,
.r4y-menu .r4y-menu__close:focus {
    background: transparent;
    color: var(--r4y-kit-secondary);
}

/* ── Menu: nav panel (desktop = popup 5025) ─────────────────────────── */
.r4y-menu .r4y-menu__label {
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-xs);
    font-weight: var(--r4y-fw-bold);
    line-height: 1;
    color: var(--r4y-kit-white);
}
.r4y-menu__links--mobile { display: none; }
.r4y-menu .r4y-menu__list a {
    display: block;
    padding: 15px 0;
    font-family: var(--r4y-font-heading);
    font-size: 28px;
    font-weight: var(--r4y-fw-light);
    line-height: 20px;
    letter-spacing: 1px;
    color: var(--r4y-kit-white);
    text-decoration: none;
    transition: color var(--r4y-transition), transform 0.4s var(--r4y-ease-out);
}
.r4y-menu .r4y-menu__list a:hover,
.r4y-menu .r4y-menu__list a:focus,
.r4y-menu .r4y-menu__list .current-menu-item > a {
    color: var(--r4y-kit-secondary);
}
.r4y-menu .r4y-menu__list a:hover {
    transform: translateX(6px);
}

.r4y-menu__contact {
    display: flex;
    align-items: flex-end;
}
/* Elementor: a 167px image next to a 100% container; both shrink, weighted by basis (≈124px). */
.r4y-menu .r4y-menu__contact-photo {
    flex: 0 1 167px;
    min-width: 0;
    width: 167px;
    height: 120px;
    object-fit: cover;
    object-position: top center;
}
.r4y-menu__contact-text {
    flex: 0 1 100%;
    min-width: 0;
    margin-left: 15px;
}
.r4y-menu .r4y-menu__contact-title {
    margin-bottom: 8px;
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-base);
    font-weight: var(--r4y-fw-bold);
    line-height: 1;
    text-transform: uppercase;
    color: var(--r4y-kit-secondary);
}
.r4y-menu .r4y-menu__contact-text a {
    display: block;
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-base);
    font-weight: var(--r4y-fw-regular);
    line-height: 24px;
    color: var(--r4y-kit-white);
    text-decoration: none;
    transition: color var(--r4y-transition);
}
.r4y-menu .r4y-menu__contact-text a:hover,
.r4y-menu .r4y-menu__contact-text a:focus {
    color: var(--r4y-kit-secondary);
}

/* ── Menu: aside panel (logo, brochure, HR tools) ───────────────────── */
.r4y-menu__aside {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 540px;
    margin-inline: auto;
}
.r4y-menu__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
}
.r4y-menu__logo img {
    width: 50%;
    height: 150px;
    object-fit: contain;
}
.r4y-menu__cards {
    display: flex;
    gap: 20px;
}
.r4y-menu .r4y-menu__card--wide {
    flex: none;
    margin-bottom: 20px;
}
.r4y-menu .r4y-menu__card {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 250px;
    padding: 15px;
    overflow: hidden;
    color: var(--r4y-kit-white);
    text-decoration: none;
    isolation: isolate;
}
.r4y-menu .r4y-menu__card-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 0.8s var(--r4y-ease-out);
}
.r4y-menu .r4y-menu__card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(180deg, transparent 0%, var(--r4y-kit-primary) 100%);
    opacity: 0.5;
}
.r4y-menu .r4y-menu__card--wide::after {
    background-image: linear-gradient(180deg, transparent 52%, var(--r4y-kit-primary) 100%);
}
/* Elementor scaled the whole card on hover (instantly); now the photo zooms smoothly. */
.r4y-menu .r4y-menu__card:hover .r4y-menu__card-image,
.r4y-menu .r4y-menu__card:focus-visible .r4y-menu__card-image {
    transform: scale(1.05);
}
.r4y-menu .r4y-menu__card-kicker {
    font-family: var(--r4y-font-body);
    font-size: var(--r4y-fs-xs);
    font-weight: var(--r4y-fw-bold);
    line-height: 1;
    text-transform: uppercase;
}
.r4y-menu .r4y-menu__card-title {
    font-family: var(--r4y-font-heading);
    font-size: var(--r4y-fs-xl);
    font-weight: var(--r4y-fw-light);
    line-height: 1;
}

/* ── Mobile + tablet (= popup 4312: full-screen, links only) ────────── */
@media (max-width: 1024px) {
    .r4y-menu[open] { display: block; }
    .r4y-menu::backdrop { background: transparent; }
    .r4y-menu__panel--aside,
    .r4y-menu__contact,
    .r4y-menu__label,
    .r4y-menu__links--desktop { display: none; }
    .r4y-menu__links--mobile  { display: block; }

    .r4y-menu__panel {
        min-height: 0;
        height: 100%;
        padding: 130px 30px 120px; /* Elementor: 120 margin + 10 default padding */
    }
    .r4y-menu .r4y-menu__list li + li {
        margin-top: 15px;
    }
    .r4y-menu .r4y-menu__list a {
        padding: 13px 0;
        font-size: 32px;
        letter-spacing: 0;
    }
    .r4y-menu .r4y-menu__close {
        font-size: 20px;
        color: var(--r4y-kit-white);
    }
}

/* ── Reduced motion: fades only ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .r4y-menu,
    .r4y-menu.is-closing {
        transform: none;
        opacity: 0;
        transition: opacity 0.15s linear;
    }
    .r4y-menu.is-open { opacity: 1; }
    .r4y-menu .r4y-menu__list a:hover { transform: none; }
}
