/* ==========================================
   Full-bleed: strip Elementor's wrapper spacing
========================================== */

.elementor-widget-header {
    margin: 0 !important;
}

.elementor-widget-header > .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================
   Header bar
========================================== */

/* every control in the bar is a bare button — neutralise any theme styling
   (borders, outlines, backgrounds) so nothing prints a coloured box */
.cew-header button {
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    color: inherit;
    font: inherit;
}

.cew-header button:focus,
.cew-header button:focus-visible {
    outline: none;
    box-shadow: none;
}

.cew-header {
    --cew-accent: #0f5238;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;

    background-color: rgba(249, 249, 248, 0.80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

    transition: height 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.cew-header-container {
    max-width: 1200px;
    height: 80px;
    margin: 0 auto;
    padding: 0 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    /* guarantees clear space between logo, nav and actions so they never collide */
    gap: 40px;

    transition: height 0.3s ease;
}

/* shrinks once the page is scrolled — matches the index.html behaviour */
.cew-header.cew-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: rgba(249, 249, 248, 0.95);
}

.cew-header.cew-scrolled .cew-header-container {
    height: 64px;
}

/* ==========================================
   Logo
========================================== */

.cew-logo {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    text-decoration: none;
}

.cew-logo-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #2D6A4F;

    /* keep the brand on a single line instead of stacking three words tall */
    white-space: nowrap;
}

.cew-logo-subtitle {
    margin-top: 1px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #404943;
    opacity: 0.8;
    white-space: nowrap;
}

/* ==========================================
   Desktop navigation
========================================== */

.cew-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.cew-nav-item {
    position: relative;
}

.cew-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #404943;

    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;

    transition: color 0.3s ease;
}

.cew-nav-link:hover,
.cew-has-dropdown:hover .cew-nav-link {
    color: var(--cew-accent);
}

.cew-caret {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.cew-has-dropdown:hover .cew-caret {
    transform: rotate(180deg);
}

/* ==========================================
   Dropdown
========================================== */

.cew-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    min-width: 224px;

    background-color: #ffffff;
    border: 1px solid rgba(191, 201, 193, 0.30);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10);

    padding: 8px 0;

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;

    z-index: 50;
}

/* the gap-free hover bridge keeps the menu open while the cursor travels down */
.cew-has-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.cew-has-dropdown:hover .cew-dropdown,
.cew-has-dropdown:focus-within .cew-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cew-dropdown-link {
    display: block;
    padding: 8px 16px;

    font-size: 16px;
    color: #404943;
    text-decoration: none;

    transition: background-color 0.2s ease, color 0.2s ease;
}

.cew-dropdown-link:hover {
    background-color: rgba(45, 106, 79, 0.05);
    color: var(--cew-accent);
}

/* the active theme colours link hovers pink; force the nav + dropdown links to
   the brand accent instead, with enough weight to beat the theme rule.
   The CTA/mobile-cta pills are deliberately excluded so they keep their colour. */
.cew-header .cew-nav-link:hover,
.cew-header .cew-dropdown-toggle:hover,
.cew-header .cew-dropdown-link:hover,
.cew-header .cew-mobile-link:hover,
.cew-header .cew-mobile-sublink:hover,
.cew-header .cew-wp-menu a:hover,
.cew-header .cew-wp-menu > li:hover > a {
    color: var(--cew-accent) !important;
}

/* ==========================================
   Actions
========================================== */

.cew-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cew-contact-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;

    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;

    background-color: #2D6A4F;
    color: #ffffff;
    text-decoration: none;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;

    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    cursor: pointer;

    transition: filter 0.3s ease, transform 0.1s ease;
}

.cew-contact-btn:hover {
    filter: brightness(1.1);
}

.cew-contact-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   Mobile toggle + drawer
========================================== */

/* scoped under .cew-header so the hide always outranks the generic button reset */
.cew-header .cew-nav-toggle {
    display: none;

    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #404943;
}

.cew-nav-toggle .material-symbols-outlined {
    font-size: 28px;
    line-height: 1;
}

.cew-nav-toggle-close {
    display: none;
}

.cew-header.cew-open .cew-nav-toggle-open {
    display: none;
}

.cew-header.cew-open .cew-nav-toggle-close {
    display: inline-block;
}

.cew-mobile {
    display: none;
    flex-direction: column;

    padding: 8px 16px 24px;
    border-top: 1px solid rgba(191, 201, 193, 0.30);

    background-color: rgba(249, 249, 248, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.cew-header.cew-open .cew-mobile {
    display: flex;
}

.cew-mobile-link,
.cew-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    padding: 14px 8px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #1a1c1c;
    text-align: left;

    background: none;
    border: none;
    border-bottom: 1px solid rgba(191, 201, 193, 0.20);
    cursor: pointer;
    text-decoration: none;
}

.cew-mobile-toggle[aria-expanded="true"] .cew-caret {
    transform: rotate(180deg);
}

.cew-mobile-sub {
    display: flex;
    flex-direction: column;
    padding: 4px 0 8px 16px;
}

.cew-mobile-sublink {
    padding: 10px 8px;

    font-size: 15px;
    color: #404943;
    text-decoration: none;
}

.cew-mobile-sublink:hover {
    color: var(--cew-accent);
}

.cew-mobile-cta {
    margin-top: 16px;
    padding: 14px;

    text-align: center;
    border-radius: 999px;

    background-color: #2D6A4F;
    color: #ffffff;
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ==========================================
   Responsive
========================================== */

@media (max-width: 1024px) {

    .cew-header .cew-nav {
        display: none;
    }

    .cew-header .cew-nav-toggle {
        display: inline-flex;
    }

    /* the CTA lives inside the drawer on small screens to save bar space */
    .cew-header-actions .cew-contact-btn {
        display: none;
    }

}

@media (max-width: 768px) {

    .cew-header-container {
        height: 64px;
        padding: 0 16px;
    }

    .cew-header.cew-scrolled .cew-header-container {
        height: 56px;
    }

    .cew-logo-title {
        font-size: 16px;
    }

    .cew-logo-subtitle {
        font-size: 8px;
        letter-spacing: 0.14em;
    }

    .cew-mobile {
        max-height: calc(100vh - 56px);
    }

}

/* ==========================================
   WordPress menu (wp_nav_menu output)
   Styled to match the custom menu above.
========================================== */

/* --- Desktop --- */

.cew-nav--wp .cew-wp-menu {
    display: flex;
    align-items: center;
    gap: 32px;

    list-style: none;
    margin: 0;
    padding: 0;
}

.cew-nav--wp .cew-wp-menu > li {
    position: relative;
}

.cew-nav--wp .cew-wp-menu a {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #404943;
    text-decoration: none;

    transition: color 0.3s ease;
}

.cew-nav--wp .cew-wp-menu > li > a {
    padding: 8px 0;
}

/* caret on parents, using the Material Symbols font */
.cew-nav--wp .cew-wp-menu .menu-item-has-children > a::after {
    content: "expand_more";
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.cew-nav--wp .cew-wp-menu .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* keep the menu open while the cursor crosses the gap to the sub-menu */
.cew-nav--wp .cew-wp-menu .menu-item-has-children::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.cew-nav--wp .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    min-width: 224px;

    list-style: none;
    padding: 8px 0;

    background-color: #ffffff;
    border: 1px solid rgba(191, 201, 193, 0.30);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10);

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;

    z-index: 50;
}

.cew-nav--wp .menu-item-has-children:hover > .sub-menu,
.cew-nav--wp .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cew-nav--wp .sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 16px;
    letter-spacing: normal;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cew-nav--wp .sub-menu a:hover {
    background-color: rgba(45, 106, 79, 0.05);
}

/* the caret must not print on sub-menu items */
.cew-nav--wp .sub-menu .menu-item-has-children > a::after {
    display: none;
}

/* --- Mobile drawer --- */

.cew-mobile--wp .cew-wp-menu {
    display: flex;
    flex-direction: column;

    list-style: none;
    margin: 0;
    padding: 0;
}

.cew-mobile--wp .cew-wp-menu a {
    display: block;
    padding: 14px 8px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #1a1c1c;
    text-decoration: none;

    border-bottom: 1px solid rgba(191, 201, 193, 0.20);
}

.cew-mobile--wp .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 16px;
    display: none;
}

/* JS adds cew-open to the parent li to reveal its sub-menu */
.cew-mobile--wp .menu-item-has-children.cew-open > .sub-menu {
    display: block;
}

.cew-mobile--wp .sub-menu a {
    font-size: 15px;
    font-weight: 400;
    color: #404943;
    padding: 10px 8px;
    border-bottom: none;
}
