/**
 * Static header + footer + off-canvas for the ave_event single template.
 *
 * Design goals on this page (per user direction):
 *   - The header, hero, and footer all sit on ONE continuous navy background
 *     (no visual seam between them — no separate header bar bg, no separate
 *     footer bar bg).
 *   - Page bg: navy (#094E9B, kit "BRAND - Main - Dark") with a subtle radial
 *     vignette for depth.
 *   - Nav buttons: white outline pills; on HOVER they fill with the brand
 *     orange (#FF5A3C — same color used on the CTA submit button).
 *   - The hamburger off-canvas mobile menu works with zero JavaScript (pure
 *     CSS :checked toggle).
 *   - No sticky / fixed / scroll-effect behavior — the header sits at the top
 *     of the page in normal flow and scrolls away naturally.
 *
 * Loaded only on is_singular('ave_event') by AVE_Template_Loader.
 * Scoped under body.single-ave_event / .ave-header / .ave-footer to avoid
 * collisions with the rest of the site.
 *
 * @package CUSTOM_AV_Events
 */

/* ====================================================================
   Body bg — navy with subtle radial vignette. Scoped to the
   single-ave_event body class so other pages are untouched.
   ==================================================================== */
body.single-ave_event {
    margin: 0;
    background-color: #094E9B;
    background-image: radial-gradient(ellipse at top center, #0a5ab2 0%, #094E9B 55%, #06366d 100%);
    background-attachment: fixed;
    color: #ffffff;
}

/* ====================================================================
   Header bar — TRANSPARENT (no bg, no border) so the body navy
   shows through and the header reads as part of the page, not a
   separate chrome bar.
   ==================================================================== */
.ave-header {
    --avh-text:       #ffffff;
    --avh-accent:     #cc4830;   /* exact match to OLD page accent (puppeteer-measured) */
    --avh-accent-h:   #b13e29;
    --avh-icon-size:  44px;
    --avh-pad-x:      32px;
    --avh-pad-y:      18px;

    position: relative;
    background: transparent;
    border: 0;
    color: var(--avh-text);
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.2;
    z-index: 10;
}

.ave-header *,
.ave-header *::before,
.ave-header *::after,
.ave-offcanvas *,
.ave-offcanvas *::before,
.ave-offcanvas *::after,
.ave-footer *,
.ave-footer *::before,
.ave-footer *::after {
    box-sizing: border-box;
}

.ave-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--avh-pad-y) var(--avh-pad-x);
    display: flex;
    align-items: center;
    gap: 18px;
}

/* ====================================================================
   Logo
   ==================================================================== */
.ave-header-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--avh-text);
    flex-shrink: 0;
}

.ave-header-logo img {
    display: block;
    height: 48px;
    width: auto;
    max-width: 200px;
}

.ave-header-logo-text {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--avh-text);
}

/* ====================================================================
   Nav pill buttons (desktop) — white outline; HOVER fills with brand orange.
   ==================================================================== */
.ave-header-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ave-nav-btn {
    display: inline-block;
    padding: 12px 24px;          /* matches OLD page exactly */
    color: var(--avh-text);
    font-family: inherit;
    font-size: clamp(0.7rem, 0.88vw, 0.95rem);  /* OLD page ≈ 12.64px @ 1440 */
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
    text-align: center;
    border: 1px solid #ffffff;   /* OLD page uses solid white border */
    border-radius: 999px;
    background: transparent;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.ave-nav-btn:hover,
.ave-nav-btn:focus {
    background: var(--avh-accent);
    border-color: var(--avh-accent);
    color: #ffffff;
    text-decoration: none;
}

/* ====================================================================
   Phone icon — same hover treatment as nav buttons
   ==================================================================== */
.ave-header-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--avh-icon-size);
    height: var(--avh-icon-size);
    color: var(--avh-text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ave-header-phone:hover,
.ave-header-phone:focus {
    background: var(--avh-accent);
    border-color: var(--avh-accent);
    color: #ffffff;
    text-decoration: none;
}

.ave-header-phone svg {
    width: 18px;
    height: 18px;
}

/* ====================================================================
   Hamburger toggle (mobile)
   ==================================================================== */
.ave-burger-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.ave-header-burger {
    display: none;   /* hidden on desktop */
    align-items: center;
    justify-content: center;
    width: var(--avh-icon-size);
    height: var(--avh-icon-size);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    background: transparent;
    color: var(--avh-text);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 11;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.ave-header-burger:hover {
    background: var(--avh-accent);
    border-color: var(--avh-accent);
}

.ave-burger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--avh-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ave-burger-line + .ave-burger-line {
    margin-top: 5px;
}

/* "X" shape when toggle is checked */
.ave-burger-toggle:checked ~ .ave-header-inner .ave-burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.ave-burger-toggle:checked ~ .ave-header-inner .ave-burger-line:nth-child(2) {
    opacity: 0;
}
.ave-burger-toggle:checked ~ .ave-header-inner .ave-burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ====================================================================
   Off-canvas mobile menu
   ==================================================================== */
.ave-offcanvas-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
    cursor: pointer;
}

.ave-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 85vw);
    background: #06366d;   /* darker navy panel for contrast against the page bg */
    color: #ffffff;
    padding: 32px 28px;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ave-offcanvas-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-top: 8px;
}

.ave-offcanvas-logo img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 200px;
}

.ave-offcanvas-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}

.ave-offcanvas-nav a {
    display: block;
    padding: 14px 12px;
    color: #ffffff;
    font-size: 1.0625rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.ave-offcanvas-nav a:hover,
.ave-offcanvas-nav a:focus {
    background: #FF5A3C;
    color: #ffffff;
    padding-left: 16px;
    text-decoration: none;
}

/* Reveal when checkbox is checked */
.ave-burger-toggle:checked ~ .ave-offcanvas-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.ave-burger-toggle:checked ~ .ave-offcanvas {
    transform: translateX(0);
}

/* ====================================================================
   Footer — sits on the same page navy. Centered logo + copyright.
   The PAP affiliate "Referred By: …" line is injected below by the
   CUSTOM - PAP Advanced Frontend Tracking Code plugin via wp_footer.
   ==================================================================== */
.ave-footer {
    background: transparent;
    color: #ffffff;
    padding: 56px 24px 64px;
    margin-top: 4dvh;
}

.ave-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.ave-footer-logo {
    display: inline-block;
    text-decoration: none;
}

.ave-footer-logo img {
    display: block;
    height: 96px;
    width: auto;
    max-width: 320px;
    margin: 0 auto;
}

.ave-footer-copyright {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

/* ====================================================================
   Responsive — hide desktop nav, show hamburger
   ==================================================================== */
@media (max-width: 1180px) {
    /* nav button font-size handled by clamp() */
    .ave-nav-btn {
        padding: 10px 18px;
    }
    .ave-header-nav {
        gap: 8px;
    }
}

@media (max-width: 1024px) {
    .ave-header-nav {
        display: none;
    }
    .ave-header-burger {
        display: inline-flex;
    }
    .ave-header-inner {
        justify-content: space-between;
        padding: 14px 20px;
    }
    .ave-header-logo {
        flex: 1;
    }
    .ave-footer {
        padding: 40px 20px 48px;
    }
    .ave-footer-logo img {
        height: 80px;
    }
}

@media (max-width: 480px) {
    .ave-header-inner {
        padding: 12px 14px;
        gap: 10px;
    }
    .ave-header-logo img {
        height: 38px;
        max-width: 150px;
    }
    .ave-header-phone,
    .ave-header-burger {
        --avh-icon-size: 40px;
    }
    .ave-footer-logo img {
        height: 68px;
    }
    .ave-footer-copyright {
        font-size: 0.8rem;
    }
}
