/* =========================================================================
   W Training — site header
   -------------------------------------------------------------------------
   Every selector is prefixed with .wt- and scoped to the header so nothing
   here can reach existing page components. Brand colours are injected as
   CSS custom properties by inc/nav.php from the site_settings row, so the
   admin colour pickers keep working.

   Layout note: the previous header was position:absolute and overlaid the
   page, so pages already reserve their own top padding. This header stays
   out of the document flow (position:fixed) for exactly the same reason —
   that is what keeps existing pages from shifting.
   ========================================================================= */

.wt-header-wrap {
    --wt-topbar-h: 38px;
    --wt-nav-h: 74px;
    --wt-nav-h-scrolled: 62px;
    --wt-radius: 6px;
    --wt-speed: 200ms;
    --wt-ease: cubic-bezier(0.4, 0, 0.2, 1);

    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 1030;
    background: #fff;
    border-block-end: 1px solid var(--wt-line);
    transition: box-shadow var(--wt-speed) var(--wt-ease);
}

.wt-header-wrap.wt-is-scrolled {
    box-shadow: 0 1px 3px rgba(20, 33, 40, 0.06), 0 6px 20px rgba(20, 33, 40, 0.06);
}

/* Anchor targets must not hide behind the fixed header. */
html {
    scroll-padding-block-start: 124px;
}

/* --- Skip link ---------------------------------------------------------- */

.wt-skip-link {
    position: absolute;
    inset-inline-start: 12px;
    inset-block-start: -100px;
    z-index: 10;
    padding: 10px 16px;
    border-radius: var(--wt-radius);
    background: var(--wt-ink);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: inset-block-start var(--wt-speed) var(--wt-ease);
}

.wt-skip-link:focus {
    inset-block-start: 8px;
    color: #fff;
}

/* --- Shared container --------------------------------------------------- */

.wt-shell {
    max-inline-size: 1320px;
    margin-inline: auto;
    padding-inline: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- Top bar ------------------------------------------------------------ */

.wt-topbar {
    background: var(--wt-ink);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.2;
    block-size: var(--wt-topbar-h);
    overflow: hidden;
    transition: block-size var(--wt-speed) var(--wt-ease),
                opacity var(--wt-speed) var(--wt-ease);
}

.wt-header-wrap.wt-is-scrolled .wt-topbar {
    block-size: 0;
    opacity: 0;
}

.wt-topbar .wt-shell {
    block-size: var(--wt-topbar-h);
    justify-content: space-between;
    gap: 16px;
}

.wt-topbar-group {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--wt-speed) var(--wt-ease);
}

.wt-topbar-link:hover,
.wt-topbar-link:focus-visible {
    color: var(--wt-accent-on-dark);
}

.wt-topbar-link i {
    font-size: 14px;
    line-height: 1;
}

/* Icon-only links (phone / WhatsApp) lose their text label, so they get an
   explicit hit area instead. Sized to stay inside the 38px bar, so neither
   the top-bar nor the header height changes. */
.wt-topbar-link-icon {
    justify-content: center;
    gap: 0;
    min-inline-size: 32px;
    min-block-size: 30px;
    border-radius: 6px;
}

/* --- Language switcher -------------------------------------------------- */

.wt-lang {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--wt-radius);
}

.wt-lang-option {
    padding: 3px 10px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color var(--wt-speed) var(--wt-ease),
                color var(--wt-speed) var(--wt-ease);
}

.wt-lang-option:hover,
.wt-lang-option:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.wt-lang-option[aria-current="true"] {
    background: #fff;
    color: var(--wt-ink);
}

/* --- Main navigation bar ------------------------------------------------ */

.wt-nav {
    block-size: var(--wt-nav-h);
    transition: block-size var(--wt-speed) var(--wt-ease);
}

.wt-header-wrap.wt-is-scrolled .wt-nav {
    block-size: var(--wt-nav-h-scrolled);
}

.wt-nav .wt-shell {
    block-size: 100%;
    justify-content: space-between;
}

/* The logo is a stacked lockup (mark over wordmark) with a 0.956 aspect
   ratio, served from a whitespace-trimmed copy of the uploaded file. Width is
   the controlling dimension and the height follows it, so the artwork can
   never be stretched. The box reserves its height via aspect-ratio, which
   keeps the bar from shifting while the image loads. */
.wt-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.wt-brand img {
    inline-size: 53px;
    block-size: auto;
    aspect-ratio: 458 / 479;
    object-fit: contain;
    object-position: center;
    transition: inline-size var(--wt-speed) var(--wt-ease);
}

.wt-header-wrap.wt-is-scrolled .wt-brand img {
    inline-size: 45px;
}

.wt-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-menu-link {
    position: relative;
    display: block;
    padding: 10px 12px;
    color: var(--wt-ink);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--wt-radius);
    transition: color var(--wt-speed) var(--wt-ease),
                background-color var(--wt-speed) var(--wt-ease);
}

.wt-menu-link::after {
    content: "";
    position: absolute;
    inset-inline: 12px;
    inset-block-end: 2px;
    block-size: 2px;
    border-radius: 2px;
    background: var(--wt-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--wt-speed) var(--wt-ease);
}

.wt-menu-link:hover,
.wt-menu-link:focus-visible {
    color: var(--wt-ink-strong);
    background: var(--wt-tint);
}

.wt-menu-link:hover::after,
.wt-menu-link:focus-visible::after {
    transform: scaleX(1);
}

/* Active page: weight + persistent underline, never colour alone. */
.wt-menu-link[aria-current="page"] {
    color: var(--wt-ink-strong);
    font-weight: 700;
}

.wt-menu-link[aria-current="page"]::after {
    transform: scaleX(1);
    block-size: 3px;
}

/* --- Right-hand actions ------------------------------------------------- */

.wt-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.wt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 40px;
    block-size: 40px;
    padding: 0;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius);
    background: #fff;
    color: var(--wt-ink);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: color var(--wt-speed) var(--wt-ease),
                border-color var(--wt-speed) var(--wt-ease),
                background-color var(--wt-speed) var(--wt-ease);
}

.wt-icon-btn:hover,
.wt-icon-btn:focus-visible {
    color: var(--wt-ink-strong);
    border-color: var(--wt-accent);
    background: var(--wt-tint);
}

.wt-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    padding: 11px 22px;
    border: 1px solid var(--wt-accent);
    border-radius: var(--wt-radius);
    background: var(--wt-accent);
    color: var(--wt-accent-ink);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: filter var(--wt-speed) var(--wt-ease),
                box-shadow var(--wt-speed) var(--wt-ease);
}

.wt-cta:hover,
.wt-cta:focus-visible {
    color: var(--wt-accent-ink);
    filter: brightness(0.92);
    box-shadow: 0 4px 12px rgba(20, 33, 40, 0.14);
}

/* --- Visible keyboard focus, everywhere in the header ------------------- */

.wt-header-wrap a:focus-visible,
.wt-header-wrap button:focus-visible {
    outline: 2px solid var(--wt-accent);
    outline-offset: 2px;
}

.wt-topbar a:focus-visible {
    outline-color: #fff;
}

/* --- Hamburger ---------------------------------------------------------- */

.wt-burger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius);
    background: #fff;
    cursor: pointer;
}

.wt-burger span {
    display: block;
    inline-size: 20px;
    block-size: 2px;
    border-radius: 2px;
    background: var(--wt-ink);
    transition: transform var(--wt-speed) var(--wt-ease),
                opacity var(--wt-speed) var(--wt-ease);
}

.wt-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.wt-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.wt-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile panel ------------------------------------------------------- */

.wt-panel {
    position: fixed;
    inset-inline: 0;
    /* Sits directly under whatever the header currently measures. */
    inset-block-start: calc(var(--wt-topbar-h) + var(--wt-nav-h));
    inset-block-end: 0;
    z-index: 1029;
    padding: 8px 20px 32px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--wt-speed) var(--wt-ease),
                transform var(--wt-speed) var(--wt-ease),
                visibility var(--wt-speed) var(--wt-ease);
}

.wt-header-wrap.wt-is-scrolled .wt-panel {
    inset-block-start: var(--wt-nav-h-scrolled);
}

.wt-panel.wt-is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Local copy so the header never depends on a Bootstrap utility being present. */
.wt-header-wrap .visually-hidden {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.wt-panel-menu {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.wt-panel-menu li + li {
    border-block-start: 1px solid var(--wt-line);
}

.wt-panel-link {
    display: flex;
    align-items: center;
    min-block-size: 52px;
    padding-block: 12px;
    color: var(--wt-ink);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.wt-panel-link[aria-current="page"] {
    color: var(--wt-ink-strong);
    font-weight: 700;
    border-inline-start: 3px solid var(--wt-accent);
    padding-inline-start: 12px;
}

.wt-panel .wt-cta {
    inline-size: 100%;
    min-block-size: 52px;
    font-size: 16px;
}

.wt-panel-section {
    margin-block-start: 22px;
    padding-block-start: 18px;
    border-block-start: 1px solid var(--wt-line);
}

.wt-panel-contact {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-panel-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-block-size: 44px;
    color: var(--wt-ink);
    font-size: 15px;
    text-decoration: none;
}

.wt-panel-lang {
    display: inline-flex;
    gap: 2px;
    margin-block-start: 14px;
    padding: 3px;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius);
}

.wt-panel-lang .wt-lang-option {
    min-block-size: 38px;
    display: inline-flex;
    align-items: center;
    padding-inline: 18px;
    color: var(--wt-ink);
    font-size: 14px;
}

.wt-panel-lang .wt-lang-option:hover,
.wt-panel-lang .wt-lang-option:focus-visible {
    background: var(--wt-tint);
    color: var(--wt-ink-strong);
}

.wt-panel-lang .wt-lang-option[aria-current="true"] {
    background: var(--wt-ink);
    color: #fff;
}

/* Locks the page only while the panel is open. */
body.wt-nav-open {
    overflow: hidden;
}

/* --- Breakpoints -------------------------------------------------------- */

/* Eight top-level items need room; below this the panel takes over. */
@media (max-width: 1199.98px) {
    .wt-menu,
    .wt-nav .wt-actions .wt-cta {
        display: none;
    }

    .wt-burger {
        display: flex;
    }
}

@media (min-width: 1200px) {
    .wt-panel {
        display: none;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199.98px) {
    /* Labels are still visible here, so the contact text steps down one notch. */
    .wt-topbar {
        font-size: 12px;
    }

    .wt-lang-option {
        font-size: 12px;
    }

    .wt-brand img {
        inline-size: 50px;
    }

    .wt-header-wrap.wt-is-scrolled .wt-brand img {
        inline-size: 43px;
    }
}

@media (max-width: 767.98px) {
    .wt-header-wrap {
        --wt-topbar-h: 36px;
        --wt-nav-h: 62px;
        --wt-nav-h-scrolled: 56px;
    }

    html {
        scroll-padding-block-start: 104px;
    }

    /* Labels collapse to icons below, but keep the size in range if shown. */
    .wt-topbar {
        font-size: 12px;
    }

    .wt-lang-option {
        font-size: 12px;
    }

    .wt-shell {
        padding-inline: 14px;
        gap: 12px;
    }

    .wt-topbar-group {
        gap: 12px;
    }

    /* Keep the bar readable at 320px: labels collapse to icons. */
    .wt-topbar-link .wt-label {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .wt-topbar-link {
        min-inline-size: 28px;
        justify-content: center;
    }

    .wt-topbar-link i {
        font-size: 15px;
    }

    /* Email lives in the panel on small screens. */
    .wt-topbar-item-email {
        display: none;
    }

    .wt-brand img {
        inline-size: 45px;
    }

    .wt-header-wrap.wt-is-scrolled .wt-brand img {
        inline-size: 40px;
    }
}

@media (max-width: 359.98px) {
    .wt-lang-option {
        padding-inline: 7px;
    }
}

/* --- Motion preferences ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .wt-header-wrap,
    .wt-header-wrap *,
    .wt-panel {
        transition-duration: 1ms !important;
    }
}
