/* ============================================================
   Westway — GLOBAL styles (loaded on every page).
   Sticky responsive top nav + mobile hamburger + site footer.
   Uses fluid units (clamp/%) so paddings & type scale with the
   viewport rather than being fixed.
   ============================================================ */

:root {
    --ww-red: #E62D2B;
    --ww-dark: #2A3B45;
    --ww-nav-bg: #5a5a5a;
    --ww-gap: clamp(16px, 3vw, 30px);
}

* { box-sizing: border-box; }

/* ---------- Global sticky header / nav ---------- */
.westway-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: var(--ww-nav-bg);
    box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
/* 3-column bar: wordmark | nav (centre) | Canmoor logo */
.westway-header__inner {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 28px);
    width: 100%;
    padding: 4px clamp(16px, 3vw, 40px);
}
.westway-header__wordmark {
    flex: 0 0 auto;
    color: #fff;
    text-decoration: none;
    font-size: clamp(14px, 1.15vw, 20px);
    letter-spacing: .01em;
    white-space: nowrap;
    text-transform: lowercase;
    opacity: .92;
}
.westway-header__wordmark:hover { opacity: 1; }

/* nav takes the centre column and centres its items */
.westway-header > .westway-header__inner > .westway-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.westway-nav__list { justify-content: center; }

.westway-header__logo { flex: 0 0 auto; line-height: 0; }
.westway-header__logo img {
    height: clamp(26px, 2vw, 32px);   /* smaller */
    width: auto;
    display: block;
    /* no white background — render the logo as-is (dark outline + white
       wordmark reads fine on the grey bar). */
}
/* nav links carry the bar height; keep their vertical padding small */
.westway-nav__item > a { padding-top: clamp(6px, 0.5vw, 9px); padding-bottom: clamp(6px, 0.5vw, 9px); }

/* nav list */
.westway-nav__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(2px, 0.6vw, 10px);
    /* override the global `ul:not(.wp-block){margin:0 0 1.5em}` rule that
       was adding ~22px of empty space under the nav */
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}
.westway-nav__list, .westway-nav__sub { margin: 0 !important; }
.westway-nav__item > a {
    display: block;
    padding: clamp(8px, 0.7vw, 12px) clamp(7px, 0.8vw, 16px);
    color: #fff;
    text-decoration: none;
    font-size: clamp(12px, 0.95vw, 16px);
    white-space: nowrap;
    line-height: 1.2;
    transition: color .15s ease;
}
.westway-nav__item > a:hover,
.westway-nav__item--has-children:hover > a { color: var(--ww-red); }
.westway-nav__caret { font-size: .8em; }

/* dropdown */
.westway-nav__item--has-children { position: relative; }
.westway-nav__sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--ww-nav-bg);
    box-shadow: 0 12px 30px rgba(0,0,0,.2);
    visibility: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.westway-nav__item--has-children:hover > .westway-nav__sub,
.westway-nav__item--has-children:focus-within > .westway-nav__sub {
    visibility: visible; opacity: 1; transform: translateY(0);
}
.westway-nav__sub a {
    display: block;
    padding: 9px 20px;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
}
.westway-nav__sub a:hover { background: rgba(0,0,0,.25); color: var(--ww-red); }

/* hamburger toggle (hidden on desktop) */
.westway-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 1001;   /* stays above the fullscreen nav so it can close it */
}
.westway-header__toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    transition: transform .25s ease, opacity .25s ease;
}
.westway-header.is-open .westway-header__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.westway-header.is-open .westway-header__toggle span:nth-child(2) { opacity: 0; }
.westway-header.is-open .westway-header__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile nav: FULLSCREEN, centered, nav-bg colour ---------- */
@media (max-width: 1024px) {
    /* bar layout: wordmark (left) … hamburger (right). Logo hidden to
       save room; nav becomes the fullscreen overlay. */
    .westway-header__inner { gap: 12px; }
    .westway-header__wordmark { flex: 1 1 auto; font-size: clamp(13px, 3.6vw, 18px); }
    .westway-header__logo { display: none; }
    .westway-header__toggle { display: flex; flex: 0 0 auto; margin-left: auto; }

    .westway-nav {
        position: fixed;
        inset: 0;                       /* full screen */
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: var(--ww-nav-bg);   /* same as the nav bar bg */
        display: flex;
        align-items: center;            /* vertically centred */
        justify-content: center;        /* horizontally centred */
        padding: 72px 20px 32px;        /* clear of the top bar */
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease, visibility .28s ease;
        z-index: 999;
    }
    .westway-header.is-open .westway-nav { opacity: 1; visibility: visible; }

    .westway-nav__list {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;            /* links centred */
        gap: 0;
        width: 100%;
        max-width: 420px;
    }
    .westway-nav__item { width: 100%; text-align: center; }
    .westway-nav__item > a {
        display: block;
        padding: clamp(12px, 2.2vh, 18px) 16px;
        font-size: clamp(20px, 5.5vw, 28px);
        text-align: center;
    }
    .westway-nav__item--has-children > a { display: inline-flex; gap: 8px; align-items: center; justify-content: center; }

    /* submenu shown indented + centred when its parent is tapped open */
    .westway-nav__sub {
        position: static;
        visibility: visible; opacity: 1; transform: none;
        box-shadow: none; background: transparent;
        padding: 0; max-height: 0; overflow: hidden;
        transition: max-height .25s ease;
    }
    .westway-nav__item--has-children.is-open > .westway-nav__sub { max-height: 320px; }
    .westway-nav__sub a { text-align: center; padding: 10px; font-size: clamp(16px, 4.5vw, 20px); opacity: .85; }
    .westway-nav__caret { display: inline-block; transition: transform .2s ease; }
    .westway-nav__item--has-children.is-open .westway-nav__caret { transform: rotate(180deg); }
}

/* ---------- Global footer (matches the homepage Contacts block) ---------- */
.westway-footer {
    width: 100%;
    margin: 0;
    background: #6b6b6b;     /* grey panel, like the homepage footer */
    color: #fff;
}
.westway-footer__inner {
    width: 100%;
    margin: 0;
    padding: clamp(32px, 5vw, 60px) clamp(20px, 4vw, 60px);
}
.westway-footer__eyebrow {
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 8px;
    font-weight: 700;
}
.westway-footer__blurb { margin: 0 0 clamp(28px, 4vw, 48px); font-size: 15px; }
.westway-footer__group-title {
    font-size: clamp(20px, 2.2vw, 28px);
    margin: clamp(28px, 4vw, 48px) 0 24px;
    font-weight: 700;
}
.westway-footer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: clamp(24px, 3vw, 56px);
}
.westway-footer__agent {
    display: flex;
    align-items: flex-start;
    gap: clamp(20px, 2.5vw, 48px);
    flex: 0 1 auto;
}
.westway-footer__agent-logo {
    width: clamp(120px, 11vw, 150px);
    height: auto;
    flex: 0 0 auto;
}
.westway-footer__people { display: flex; flex-wrap: wrap; gap: clamp(20px, 2.5vw, 48px); }
.westway-footer__person { line-height: 1.55; font-size: 14px; }
.westway-footer__person strong { display: block; margin-bottom: 4px; }
.westway-footer__person a { display: block; color: #e8e8e8; text-decoration: none; }
.westway-footer__person a:hover { color: #fff; text-decoration: underline; }

/* disclaimer bar */
.westway-footer__bar {
    width: 100%;
    margin: 0;
    padding: 16px clamp(20px, 4vw, 60px);
    background: var(--ww-dark);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #c9c9c9;
}
.westway-footer__bar p { margin: 0; }
