/* components/site-header/site-header.css — Header / Navigation (markup: header.php) */

/* Transparent so only the white card visually sticks. The navy at the top
   comes from the hero (pulled up behind the header via a negative margin in
   hero.css); on scroll the card floats over whatever is beneath it. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    padding: 20px 0;
}

.header-card {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* logo + nav cluster left; CTA pushed right */
    gap: 48px;
    max-width: var(--content-max); /* align card edges with the site content width */
    margin-inline: auto;
    min-height: 106px;
    padding: 0 30px;
    background: var(--color-off-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}

/* Push the CTA to the right edge, leaving the logo + nav grouped on the left. */
.header-cta { margin-left: auto; }

.site-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Custom logo: fix the display height so it renders crisply regardless of the
   uploaded file's pixel size; width scales to keep aspect ratio. */
.site-branding .custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}
/* Width is driven by the Customizer "Logo Width" slider (--logo-width,
   injected as inline CSS in functions.php); height auto keeps aspect ratio.
   max-height guards against SVGs that lack intrinsic dimensions. */
.site-branding .custom-logo {
    width: var(--logo-width, 160px);
    height: auto;
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.site-title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: var(--weight-bold);
    line-height: 1.1;
}
.site-title a { color: var(--color-navy-mid); text-decoration: none; }

.site-description {
    width: 100%;
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: var(--weight-regular);
    color: var(--color-text-muted);
}

/* Top-level menu only — the > prevents this flex from hitting .sub-menu. */
.main-navigation > ul {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.main-navigation li {
    position: relative;
}
.main-navigation a {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: var(--weight-regular);
    color: var(--color-navy-deep);
    text-decoration: none;
}
.main-navigation a:hover {
    color: var(--color-gold);
    text-decoration: none;
}

/* Caret on parent items that have a dropdown. */
.main-navigation .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    margin-left: 7px;
    vertical-align: middle;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transform: translateY(2px);
}

/* ---------- Dropdown submenus ---------- */
.main-navigation .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 210px;
    margin: 0;
    padding: 0;
    overflow: hidden; /* keeps rounded corners while hover fills edge-to-edge */
    list-style: none;
    background: var(--color-off-white);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition);
}
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.main-navigation .sub-menu li {
    display: block;
}
.main-navigation .sub-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 16px;
    white-space: nowrap;
}
.main-navigation .sub-menu a:hover {
    color: var(--color-gold);
    text-decoration: none;
    background: rgba(16, 42, 67, 0.05);
}

/* Header CTA — Roboto SemiBold 20px, off-white text on the gold gradient.
   Scoped so the global link-color rule can't override it. */
.site-header .header-cta .btn--primary,
.site-header .header-cta .btn--primary:hover,
.site-header .header-cta .btn--primary:focus-visible {
    font-family: var(--font-cta);
    font-weight: var(--weight-semibold);
    font-size: 20px;
    color: var(--color-off-white);
    text-decoration: none;
    /* Fixed 220 × 55 per Figma; side padding trimmed so the label fits. */
    width: 220px;
    min-width: 0;
    padding-inline: 20px;
    gap: 10px;
    /* No hover animation on this button (per Figma). */
    transition: none;
}
/* Default = gold gradient (C6A15B → E2C986). Hover = solid light gold
   (#E2C986), with no lift/glow — overrides the base .btn--primary:hover. */
.site-header .header-cta .btn--primary:hover {
    background: var(--color-gold-light);
    box-shadow: none;
    transform: none;
}

/* Mobile nav toggle (shown < 1024px) */
.menu-toggle {
    display: none;
    margin-left: auto; /* sits at the right on mobile (CTA is hidden there) */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-navy-mid);
}

@media (max-width: 1024px) {
    .menu-toggle { display: inline-flex; }
    .header-card { padding: 0 20px; }
    .main-navigation {
        position: absolute;
        inset: 100% 16px auto 16px;
        background: var(--color-off-white);
        border-radius: 12px;
        box-shadow: var(--shadow-card);
        padding: 16px;
        display: none;
    }
    .main-navigation.is-open { display: block; }
    .main-navigation > ul { flex-direction: column; align-items: flex-start; gap: 16px; }
    .header-cta { display: none; }

    /* On mobile there is no hover — show submenus inline, indented. */
    .main-navigation .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 8px 0 0 16px;
        min-width: 0;
    }
    .main-navigation .sub-menu a { padding: 6px 0; }
}
