/* shared-nav.css — Single source of truth for site navigation styles.
   Owns: .site-nav, .nav-logo, .nav-link, .nav-cta, mobile hamburger menu, search.
   Does NOT own: page-specific layouts, blog grids, footer. */

/* NAV */
.site-nav {
    background: var(--cream, #f5f0e8);
    border-bottom: 1px solid rgba(74,103,65,0.12);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark, #1a1a18);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo span {
    color: var(--sage, #4a6741);
}

.nav-logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-logo-text {
    display: inline;
    line-height: 1;
    white-space: nowrap;
}

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--sage, #4a6741);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-link:hover { opacity: 0.75; }

.nav-cta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--sage, #4a6741);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 100px;
    transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.88; }

/* === SEARCH === */
.nav-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--sage, #4a6741);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.nav-search-btn:hover {
    background: rgba(74,103,65,0.08);
}

.nav-search-btn svg {
    display: block;
}

/* Hidden field — shown when .search-open */
.nav-search-field {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1.5px solid rgba(74,103,65,0.25);
    border-radius: 8px;
    padding: 4px 8px 4px 12px;
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: width 0.25s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.search-open .nav-search-field {
    width: 280px;
    opacity: 1;
    pointer-events: auto;
}

.search-open .nav-search-btn {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.nav-search-field input {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--dark, #1a1a18);
    width: 100%;
    padding: 4px 0;
}

.nav-search-field input::placeholder {
    color: rgba(74,103,65,0.45);
}

.nav-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(74,103,65,0.5);
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}

.nav-search-close:hover {
    color: var(--sage, #4a6741);
}

/* Results dropdown */
.nav-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 340px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(74,103,65,0.15);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 200;
}

.nav-search-result {
    padding: 0;
}

.nav-search-result a {
    display: block;
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--dark, #1a1a18);
    text-decoration: none;
    transition: background 0.12s;
}

.nav-search-result:hover a,
.nav-search-result.active a {
    background: rgba(74,103,65,0.06);
    color: var(--sage, #4a6741);
}

.nav-search-empty {
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(74,103,65,0.55);
    text-align: center;
    list-style: none;
}

/* === MOBILE BURGER MENU === */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    background: rgba(245, 240, 232, 0.95);
    border: 1px solid rgba(74, 103, 65, 0.15);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a18;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.nav-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.nav-open span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.nav-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 60px 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.nav-open { display: flex; opacity: 1; }

.mobile-menu-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none; border: none;
    font-size: 32px; color: #fff;
    cursor: pointer;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease;
    z-index: 1002;
}

.mobile-menu-close:hover { transform: scale(1.1); }

.mobile-menu-items {
    display: flex; flex-direction: column;
    align-items: center; gap: 32px; text-align: center;
}

.mobile-menu-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px; font-weight: 700;
    color: #fff; text-decoration: none;
    transition: color 0.2s ease;
    animation: mobileMenuFadeIn 0.5s ease forwards;
    opacity: 0;
}

.mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-item:nth-child(2) { animation-delay: 0.18s; }
.mobile-menu-item:nth-child(3) { animation-delay: 0.26s; }
.mobile-menu-item:nth-child(4) { animation-delay: 0.34s; }
.mobile-menu-item:hover { color: #f59e0b; }

@keyframes mobileMenuFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-menu-cta {
    display: block; width: 80%; max-width: 300px;
    padding: 16px 24px; background: #10b981; color: #fff;
    text-decoration: none; text-align: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px; font-weight: 600;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: 16px;
    animation: mobileMenuFadeIn 0.5s ease forwards;
    animation-delay: 0.42s;
    opacity: 0;
}

.mobile-menu-cta:hover { background: #059669; transform: translateY(-2px); }

.mobile-menu-footer {
    position: absolute; bottom: 40px; left: 0; right: 0;
    text-align: center;
    animation: mobileMenuFadeIn 0.5s ease forwards;
    animation-delay: 0.5s; opacity: 0;
}

.mobile-menu-footer a {
    color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 12px; margin: 0 12px;
    transition: color 0.2s ease;
}

.mobile-menu-footer a:hover { color: rgba(255,255,255,0.9); }
.mobile-menu-footer span { color: rgba(255,255,255,0.3); }

/* Responsive: show hamburger on mobile, hide desktop nav links */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: flex; }
    .site-nav .nav-link,
    .site-nav .nav-cta {
        display: none !important;
    }
    .nav-logo-img {
        height: 50px;
    }
    .nav-logo {
        font-size: 16px;
        gap: 8px;
    }

    /* Search on mobile: full width with adjusted positioning */
    .nav-search-wrap {
        position: static;
    }
    .nav-search-field {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 60px;
        transform: none;
        z-index: 1003;
    }
    .search-open .nav-search-field {
        width: auto;
    }
    .nav-search-btn {
        position: fixed;
        top: 18px;
        right: 64px;
        z-index: 1001;
        background: rgba(245, 240, 232, 0.95);
        border: 1px solid rgba(74, 103, 65, 0.15);
        border-radius: 8px;
        width: 40px;
        height: 40px;
    }
    .search-open .nav-search-btn {
        position: fixed;
    }
    .nav-search-results {
        position: fixed;
        top: 56px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: 50vh;
        z-index: 1003;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle { display: none !important; }
    .mobile-menu-overlay { display: none !important; }
}
