/* ============================================
   FORECOURT MAIN STYLESHEET
   Clean, semantic CSS without HubSpot dependencies
   ============================================ */

/* ============================================
   1. CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Colors */
    --primary: #002d5c;
    --accent: #78be20;
    --text: #333333;
    --text-light: #666666;
    --light-bg: #f4f6f8;
    --white: #ffffff;
    --border: #e1e4e8;
    --shadow: rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    /* Layout */
    --container-max: 1200px;
    --container-padding: 20px;
    --header-height: 72px;

    /* Navigation */
    --nav-gap: clamp(4px, 0.8vw, 14px);
    --nav-radius: 10px;
    --nav-z: 2000;
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    padding-top: var(--header-height);
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    color: var(--primary);
    margin-top: 0;
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ============================================
   3. LAYOUT CONTAINERS
   ============================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.site-main {
    padding: 40px 0;
}

/* ============================================
   3B. FOOTER
   ============================================ */
.site-footer {
    background: var(--white);
    border-top: 2px solid var(--accent);
    padding: 28px 0;
}

.site-footer .footer-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer .footer-info p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
}

.site-footer .footer-info a {
    color: var(--primary);
    font-weight: 600;
}

.site-footer .footer-hours {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.site-footer .footer-hours p {
    margin: 0;
}

.site-footer .footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.site-footer .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--light-bg);
    color: var(--primary);
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.site-footer .social-link:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.site-footer .social-link svg,
.site-footer .social-link img {
    width: 20px;
    height: 20px;
}

.site-footer .social-link svg {
    fill: currentColor;
}

.site-footer .footer-bottom {
    margin-top: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ============================================
   4. HEADER & NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--nav-z);
    background: var(--white);
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 20px;
}

/* Logo */
.site-logo {
    flex: 0 0 auto;
}

.site-logo a {
    display: inline-flex;
    align-items: center;
}

.site-logo img {
    max-height: 56px;
    width: auto;
}

/* Navigation Container */
.site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nav-gap);
    flex-wrap: nowrap;
}

/* Nav Items */
.nav-item {
    position: relative;
}

.nav-link {
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--nav-radius);
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.nav-link:hover {
    background: rgba(120, 190, 32, 0.1);
    border-color: rgba(120, 190, 32, 0.3);
    color: var(--primary);
}

.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Dropdown Caret */
.nav-item.has-dropdown>.nav-link::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.7;
    margin-left: 4px;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-width: 280px;
    padding: 16px 0 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--nav-radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
    z-index: calc(var(--nav-z) + 1);
}

/* Hover bridge for gap */
.nav-item.has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    pointer-events: none;
}

.nav-item.has-dropdown:hover::before,
.nav-item.has-dropdown:focus-within::before,
.nav-item.has-dropdown.menu-open::before {
    pointer-events: auto;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu,
.nav-item.menu-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.3;
    font-family: var(--font-body);
}

.dropdown-menu a:hover {
    background: var(--light-bg);
    color: var(--primary);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--primary);
    border-radius: var(--nav-radius);
    padding: 10px 14px;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-toggle-icon {
    width: 20px;
    height: 14px;
    position: relative;
    display: inline-block;
}

.nav-toggle-icon span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 180ms ease, opacity 180ms ease, top 180ms ease;
}

.nav-toggle-icon span:nth-child(1) {
    top: 0;
}

.nav-toggle-icon span:nth-child(2) {
    top: 6px;
}

.nav-toggle-icon span:nth-child(3) {
    top: 12px;
}

body.nav-open .nav-toggle-icon span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

body.nav-open .nav-toggle-icon span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle-icon span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
}

/* ============================================
   4B. LEGACY HEADER NORMALIZATION
   Ensures .header-container (HubSpot legacy) matches .site-header
   ============================================ */
.header-container-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: var(--nav-z) !important;
    background: var(--white) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.header-container {
    position: relative !important;
    top: auto !important;
    max-width: var(--container-max) !important;
    margin: 0 auto !important;
    padding: 0 var(--container-padding) !important;
    display: flex !important;
    align-items: center !important;
    height: var(--header-height) !important;
    background: var(--white) !important;
    border-bottom: 2px solid var(--accent) !important;
    box-shadow: 0 4px 12px var(--shadow) !important;
}

/* Legacy nav menu wrapper */
.hs-menu-wrapper {
    width: 100% !important;
}

.hs-menu-wrapper>ul {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--nav-gap) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
}

.hs-menu-wrapper>ul>li {
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hs-menu-wrapper>ul>li>a,
.hs-menu-wrapper>ul>li>button,
.hs-menu-wrapper>ul>li>.menu-toggle {
    font-family: var(--font-head) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
    color: var(--primary) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: var(--nav-radius) !important;
    padding: 10px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    transition: background-color 160ms ease, border-color 160ms ease !important;
    cursor: pointer !important;
}

.hs-menu-wrapper>ul>li>a:hover,
.hs-menu-wrapper>ul>li>button:hover,
.hs-menu-wrapper>ul>li>.menu-toggle:hover {
    background: rgba(120, 190, 32, 0.1) !important;
    border-color: rgba(120, 190, 32, 0.3) !important;
}

/* Legacy dropdown caret */
.hs-menu-wrapper>ul>li.hs-item-has-children>.menu-toggle::after {
    content: '' !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    border-top: 5px solid currentColor !important;
    opacity: 0.7 !important;
    margin-left: 4px !important;
}

/* Legacy dropdown panel */
.hs-menu-children-wrapper {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 220px !important;
    max-width: 280px !important;
    padding: 16px 0 8px !important;
    background: var(--white) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--nav-radius) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 160ms ease, visibility 160ms ease !important;
    z-index: calc(var(--nav-z) + 1) !important;
    list-style: none !important;
}

/* Hover bridge for legacy dropdowns */
.hs-menu-wrapper>ul>li.hs-item-has-children::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    pointer-events: none;
}

.hs-menu-wrapper>ul>li:hover .hs-menu-children-wrapper,
.hs-menu-wrapper>ul>li:focus-within .hs-menu-children-wrapper,
.hs-menu-wrapper>ul>li.menu-open .hs-menu-children-wrapper {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.hs-menu-wrapper>ul>li:hover::before,
.hs-menu-wrapper>ul>li:focus-within::before,
.hs-menu-wrapper>ul>li.menu-open::before {
    pointer-events: auto;
}

.hs-menu-children-wrapper li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hs-menu-children-wrapper a {
    display: block !important;
    padding: 10px 16px !important;
    color: var(--text) !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    font-family: var(--font-body) !important;
    background: transparent !important;
    border: none !important;
}

.hs-menu-children-wrapper a:hover {
    background: var(--light-bg) !important;
    color: var(--primary) !important;
}

/* Custom logo alignment for legacy */
.custom-logo {
    flex: 0 0 auto !important;
}

.custom-logo a {
    display: inline-flex !important;
    align-items: center !important;
}

.custom-logo img {
    max-height: 56px !important;
    width: auto !important;
    display: block !important;
}

/* Custom menu alignment for legacy */
.custom-menu-primary,
.custom-menu-bg {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 0 !important;
}

/* ============================================
   5. CONTENT SECTIONS
   ============================================ */
.page-section {
    margin-bottom: 40px;
}

.content-card {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.content-card h1,
.content-card h2,
.content-card h3 {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

.content-card.centered {
    text-align: center;
}

/* ============================================
   6. GRID LAYOUTS
   ============================================ */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   7. CTA / IMAGE CARDS
   ============================================ */
.cta-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.cta-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    object-fit: cover;
    aspect-ratio: 450/265;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.cta-image:hover {
    transform: translateY(-2px);
}

/* CTA Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 6px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 45, 92, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   8. MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    :root {
        --header-height: 64px;
    }

    .header-inner {
        flex-wrap: nowrap;
    }

    .site-logo img {
        max-height: 50px;
    }

    .site-footer .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    /* Show toggle, hide menu by default */
    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-menu {
        display: none;
    }

    body.nav-open .nav-menu {
        display: flex;
    }

    /* Full-screen overlay menu */
    .site-nav {
        position: static;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        padding: 16px;
        z-index: var(--nav-z);
        flex-direction: column;
        align-items: center;
    }

    .nav-menu>.nav-item {
        width: 100%;
        max-width: 400px;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        border: 1px solid var(--border);
        background: #f9fafb;
        padding: 14px 16px;
        font-size: 13px;
        border-radius: var(--nav-radius);
    }

    .nav-link:hover {
        background: #edf0f2;
        border-color: #d1d5db;
        color: var(--primary);
    }

    /* Dropdown becomes accordion */
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin-top: 8px;
        background: transparent;
        min-width: 100%;
        width: 100%;
        max-width: 100%;
    }

    .nav-item.menu-open .dropdown-menu {
        display: block;
        pointer-events: auto;
    }

    .dropdown-menu a {
        padding: 12px 16px;
        border-radius: 8px;
        background: var(--white);
        border: 1px solid #e8ecf0;
        margin-bottom: 4px;
    }

    /* Disable hover on mobile */
    .nav-item:hover .dropdown-menu {
        display: none;
    }

    .nav-item.menu-open .dropdown-menu {
        display: block;
    }

    .nav-item.has-dropdown::before {
        display: none;
    }

    /* Grids stack on mobile */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* ==========================================
       LEGACY MOBILE NAV STYLES
       ========================================== */

    /* Ensure legacy header wrapper stays fixed */
    .header-container-wrapper {
        height: var(--header-height) !important;
    }

    .header-container {
        height: var(--header-height) !important;
    }

    /* Legacy logo sizing */
    .custom-logo img {
        max-height: 50px !important;
    }

    /* Show toggle button in legacy nav */
    .header-container .nav-toggle {
        display: inline-flex !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }

    /* Hide desktop menu, show only when open */
    .hs-menu-wrapper {
        display: none !important;
    }

    body.nav-open .hs-menu-wrapper {
        display: block !important;
        position: fixed !important;
        top: var(--header-height) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        padding: 16px !important;
        z-index: var(--nav-z) !important;
    }

    body.nav-open .hs-menu-wrapper>ul {
        max-width: 400px !important;
        width: 100% !important;
        margin: 0 auto !important;
        background: var(--white) !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        max-height: calc(100vh - var(--header-height) - 40px) !important;
        overflow-y: auto !important;
    }

    body.nav-open .hs-menu-wrapper>ul>li {
        flex-direction: column !important;
    }

    body.nav-open .hs-menu-wrapper>ul>li>a,
    body.nav-open .hs-menu-wrapper>ul>li>button,
    body.nav-open .hs-menu-wrapper>ul>li>.menu-toggle {
        width: 100% !important;
        justify-content: space-between !important;
        border: 1px solid var(--border) !important;
        background: #f9fafb !important;
        padding: 14px 16px !important;
        font-size: 13px !important;
        border-radius: var(--nav-radius) !important;
    }

    body.nav-open .hs-menu-wrapper>ul>li>a:hover,
    body.nav-open .hs-menu-wrapper>ul>li>button:hover,
    body.nav-open .hs-menu-wrapper>ul>li>.menu-toggle:hover {
        background: #edf0f2 !important;
        border-color: #d1d5db !important;
    }

    /* Legacy dropdown becomes accordion on mobile */
    body.nav-open .hs-menu-children-wrapper {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin-top: 8px !important;
        background: transparent !important;
        min-width: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.nav-open .hs-menu-wrapper>ul>li.menu-open .hs-menu-children-wrapper {
        display: block !important;
        pointer-events: auto !important;
    }

    body.nav-open .hs-menu-children-wrapper a {
        padding: 12px 16px !important;
        border-radius: 8px !important;
        background: var(--white) !important;
        border: 1px solid #e8ecf0 !important;
        margin-bottom: 4px !important;
    }

    /* Disable hover on mobile for legacy */
    .hs-menu-wrapper>ul>li:hover .hs-menu-children-wrapper {
        display: none !important;
    }

    body.nav-open .hs-menu-wrapper>ul>li.menu-open .hs-menu-children-wrapper {
        display: block !important;
    }

    .hs-menu-wrapper>ul>li.hs-item-has-children::before {
        display: none !important;
    }

    /* Layout adjustments for legacy menu container */
    .custom-menu-bg,
    .custom-menu-primary {
        justify-content: flex-end !important;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 60px;
        --container-padding: 15px;
    }

    .site-logo img {
        max-height: 48px;
    }

    .nav-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }

    .content-card {
        padding: 20px;
    }
}

/* ============================================
   9. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}