/* ============================================================
   VALLEY VISION — custom.css

   Purpose: Header/footer styles + Elementor widget overrides.

   This file contains:
     - .site-header styles (sticky nav)
     - .site-footer styles (4-column grid)
     - Elementor-specific overrides
     - Mobile responsive rules

   DO NOT add page-specific layout styles here.
   Page layout belongs in Elementor templates.
   ============================================================ */


/* ============================================================
   HEADER — Sticky navigation bar
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: var(--color-primary);
    height: var(--header-height);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Darken slightly after user scrolls down */
.site-header.scrolled {
    background-color: var(--color-footer-bg);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

/* Admin bar offset — WordPress adds 32px bar at top when logged in */
.admin-bar .site-header {
    top: 32px;
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 52px;
    width: auto;
    display: block;
}

/* Invert logo to white on dark navy header */
.header-logo img,
.header-logo .custom-logo {
    filter: brightness(0) invert(1);
}

/* Primary nav — takes all available middle space */
.primary-nav {
    flex: 1;
}

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

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: block;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current-page-ancestor > a {
    color: var(--color-secondary);
    background-color: rgba(201, 148, 58, 0.12);
}

/* Header right-side actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-phone {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.header-phone:hover {
    color: var(--color-secondary);
}

.header-cta {
    font-size: 12px;
    padding: 10px 20px;
    white-space: nowrap;
}

/* ── Hamburger button ── */
.hamburger-btn {
    display: none !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-white);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger → X when active */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-white);
}

/* 4-column main footer */
.footer-main {
    padding: 64px var(--section-px) 48px;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.6fr;
    gap: 48px;
}

/* Logo in footer — invert to white */
.footer-logo-link img {
    height: 48px;
    width: auto;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
}

.footer-tagline {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-secondary);
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.footer-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 20px;
    font-style: italic;
}

.footer-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(201, 148, 58, 0.25);
}

.footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-list a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: block;
}

.footer-list a:hover {
    color: var(--color-secondary);
    padding-left: 4px;
}

/* Contact column */
.footer-address {
    font-style: normal;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.65;
}

.footer-address p {
    margin: 0 0 10px;
}

.footer-address a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-address a:hover {
    color: var(--color-secondary);
}

.footer-hours {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.footer-license {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 4px !important;
}

.footer-response {
    font-size: 13px;
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 0 !important;
}

/* HBA badge */
.footer-badge {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(201, 148, 58, 0.35);
    border-radius: var(--border-radius);
    background-color: rgba(201, 148, 58, 0.06);
}

.footer-badge-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
}

/* Copyright bar */
.footer-copyright {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 14px var(--section-px);
}

.footer-copyright-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copyright p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.footer-credit a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-credit a:hover {
    color: var(--color-secondary);
}


/* ============================================================
   ELEMENTOR OVERRIDES
   Override Elementor default styles to match brand design.
   ============================================================ */

/* Compensate for admin bar on mobile */
@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* All page content area — Elementor's first section should
   NOT need extra padding because #main-content already has
   padding-top: var(--header-height). */
.elementor-page #main-content {
    padding-top: var(--header-height);
}

/* Elementor Pro button — override with brand colors */
.elementor-widget-button .elementor-button {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    border-radius: var(--border-radius) !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

/* Elementor heading widget — use brand font */
.elementor-widget-heading .elementor-heading-title {
    font-family: var(--font-heading);
}

/* Elementor text editor — use body font */
.elementor-widget-text-editor {
    font-family: var(--font-body);
    line-height: 1.7;
}

/* Elementor icon box — consistent spacing */
.elementor-widget-icon-box .elementor-icon-box-wrapper {
    text-align: center;
}

/* Elementor form — style the submit button */
.elementor-widget-form .elementor-button[type="submit"] {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Elementor form — input fields */
.elementor-widget-form .elementor-field-group input,
.elementor-widget-form .elementor-field-group textarea,
.elementor-widget-form .elementor-field-group select {
    border-radius: var(--border-radius) !important;
    font-family: var(--font-body) !important;
}

/* Remove default Elementor section padding on mobile so our
   CSS variables control the spacing */
@media (max-width: 767px) {
    .elementor-section .elementor-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* ============================================================
   RESPONSIVE — Tablet (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }

    .header-phone {
        font-size: 13px;
    }
}

/* ============================================================
   RESPONSIVE — Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* Hide phone number in header on small screens */
    .header-phone {
        display: none;
    }

    /* Mobile nav — slide down from header */
    .primary-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-primary);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        z-index: 9998;
    }

    .primary-nav.nav-open {
        max-height: 500px;
        padding: 8px 0 16px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
        align-items: stretch;
    }

    .nav-menu a {
        display: block;
        padding: 14px 16px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
    }

    .nav-menu a:hover {
        background-color: rgba(201, 148, 58, 0.15);
        padding-left: 24px;
    }

    /* Show hamburger on mobile */
    .hamburger-btn {
        display: flex !important; 
    }

    /* Compact CTA on mobile */
    .header-cta {
        font-size: 11px;
        padding: 8px 14px;
    }

    /* Footer — single column stack */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-main {
        padding: 48px var(--section-px) 32px;
    }

    .footer-copyright-inner {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

/* ============================================================
   RESPONSIVE — Small mobile (max 480px)
   ============================================================ */
@media (max-width: 480px) {

    /* Hide CTA button entirely — hamburger + logo only */
    .header-cta {
        display: none;
    }
}
