/* ============================================
   ESTA ENSENADA — MAIN STYLESHEET
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Colors — Coastal Baja palette */
    --pine: #1a2a3a;          /* deep ocean navy (top bar, dark accents) */
    --pine-light: #264d6e;    /* ocean blue mid */
    --sky: #2e86ab;           /* pacific blue (links, accents) */
    --sky-light: #5eb8d9;     /* light wave blue */
    --snow: #faf6f0;          /* warm sand white (backgrounds) */
    --snow-dark: #ede5d8;     /* darker sand */
    --summit: #2c3e50;        /* deep charcoal */
    --sunset: #e2725b;        /* terracotta / Baja sunset */
    --sunset-dark: #c0513a;   /* deep terracotta */
    --campfire: #c0392b;      /* chile red */
    --lake: #1a7a6d;          /* sea of cortez teal */
    --lake-light: #3db8a5;    /* bright teal */
    --earth: #b8860b;         /* golden sand */
    --text: #2c3e50;
    --text-light: #5a6c7d;
    --text-muted: #95a5a6;
    --white: #ffffff;
    --border: #dde2e6;

    /* Spacing */
    --gap: 1.5rem;
    --gap-lg: 3rem;
    --gap-xl: 5rem;

    /* Typography */
    --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --font-heading: Georgia, 'Times New Roman', serif;

    /* Layout */
    --max-width: 1280px;
    --nav-height: 70px;
    --nav-mobile-breakpoint: 1100px;
    --top-bar-height: 36px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    /* Transitions */
    --transition: 0.3s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-main);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--sky-light); }
ul { list-style: none; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* --- TOP BAR --- */
.top-bar {
    background: var(--pine);
    color: var(--white);
    font-size: 0.8rem;
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.quick-info { display: flex; gap: 1.5rem; }
.quick-item { display: flex; align-items: center; gap: 0.4rem; }
.quick-item i { color: var(--sky-light); }
.quick-links { display: flex; gap: 1rem; }
.quick-links a { color: var(--snow-dark); font-weight: 500; }
.quick-links a:hover { color: var(--white); }

/* --- NAVIGATION --- */
.main-nav {
    background: var(--white);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
.logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-its { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }
.logo-bb { font-size: 1.5rem; font-weight: 800; color: var(--pine); font-family: var(--font-heading); }

/* ── Nav Toggle (hamburger — visible on smaller screens) ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1402;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

/* ── Desktop nav menu (horizontal bar) ── */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu > li {
    position: relative;
}
.nav-menu > li > a {
    padding: 0.5rem 0.55rem;
    color: var(--text);
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.3;
}
.nav-menu > li > a:hover { background: var(--snow); color: var(--pine); }
.nav-menu > li > a i.fa-chevron-down { font-size: 0.5rem; transition: transform 0.25s ease; }

/* ── Dropdown panel (desktop) ── */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    min-width: 220px;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-lg);
    padding: 0.4rem 0;
    z-index: 1500;
    list-style: none;
    margin: 0;
}

/* Keep right-side dropdowns from overflowing the viewport */
.nav-menu > li:nth-last-child(-n+4) > .dropdown-menu {
    left: auto;
    right: 0;
    transform: none;
}

/* Open state (JS click-toggle) */
.nav-dropdown.open > .dropdown-menu {
    display: block;
    animation: ddFadeIn 0.18s ease;
}
.nav-dropdown.open > a { background: var(--snow); color: var(--pine); }
.nav-dropdown.open > a i.fa-chevron-down { transform: rotate(180deg); }

.dropdown-menu li a {
    display: block;
    padding: 0.55rem 1.2rem;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.dropdown-menu li a:hover {
    background: var(--snow);
    color: var(--pine);
}

/* ── Dropdown section dividers ── */
.dropdown-divider {
    height: 0;
    margin: 0.35rem 0;
    border: 0;
    border-top: 1px solid var(--border);
}

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

button,
.btn,
.filter-btn,
.nav-toggle,
.search-box button {
    touch-action: manipulation;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--pine);
    color: var(--white);
    border-color: var(--pine);
}
.btn-primary:hover {
    background: var(--pine-light);
    border-color: var(--pine-light);
    color: var(--white);
}
.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn-secondary:hover {
    background: var(--white);
    color: var(--pine);
}
.btn-outline {
    background: transparent;
    color: var(--pine);
    border-color: var(--pine);
}
.btn-outline:hover {
    background: var(--pine);
    color: var(--white);
}

/* --- SECTIONS --- */
.section { padding: var(--gap-xl) 0; }
.section-alt { background: var(--snow); }
.section-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--pine);
    text-align: center;
    margin-bottom: var(--gap-lg);
}
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 600px;
    margin: -1.5rem auto var(--gap-lg);
    font-size: 1.1rem;
}

/* --- PAGE HEADER (for inner pages) --- */
.page-header {
    background: linear-gradient(135deg, var(--pine) 0%, var(--summit) 100%);
    color: var(--white);
    padding: 4rem 0 3rem;
    text-align: center;
}
.page-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
}
.page-header p {
    font-size: 1.15rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}
.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    opacity: 0.7;
}
.breadcrumb a { color: var(--white); }
.breadcrumb span { opacity: 0.6; }

/* --- CARDS --- */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.card-body { padding: 1.5rem; }
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--pine);
}
.card-text { color: var(--text-light); font-size: 0.95rem; }
.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--snow-dark);
}
.card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-open { background: #27ae60; color: white; }
.badge-closed { background: #c0392b; color: white; }
.badge-seasonal { background: var(--sunset); color: white; }

/* --- GRID HELPERS --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* --- FOOTER --- */
.site-footer {
    background: var(--summit);
    color: var(--snow-dark);
    padding: var(--gap-lg) 0 var(--gap);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--gap-lg);
    margin-bottom: var(--gap-lg);
}
.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.footer-col p { font-size: 0.9rem; line-height: 1.7; opacity: 0.8; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: var(--snow-dark); font-size: 0.9rem; opacity: 0.8; }
.footer-col ul li a:hover { opacity: 1; color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--gap);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* --- FILTER BAR --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--gap);
    justify-content: center;
}
.filter-btn {
    min-height: 44px;
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 25px;
    background: var(--white);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--pine);
    color: var(--white);
    border-color: var(--pine);
}

/* --- SEARCH --- */
.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto var(--gap-lg);
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.search-box input {
    flex: 1;
    padding: 0.85rem 1.2rem;
    border: none;
    font-size: 1rem;
    outline: none;
}
.search-box button {
    min-height: 44px;
    padding: 0.85rem 1.5rem;
    background: var(--pine);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}
.search-box button:hover { background: var(--pine-light); }

/* --- INFO BOX --- */
.info-box {
    background: #eaf4fe;
    border-left: 4px solid var(--sky);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: var(--gap);
}
.info-box.warning {
    background: #fef5e7;
    border-color: var(--sunset);
}
.info-box.danger {
    background: #fdedec;
    border-color: var(--campfire);
}
.info-box h4 { margin-bottom: 0.5rem; }

/* --- TABLE --- */
.data-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.data-table thead { background: var(--pine); color: var(--white); }
.data-table th, .data-table td { padding: 0.85rem 1.2rem; text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--snow); }

/* --- RESEARCH PROMPT BOX --- */
.research-prompt {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 1.5rem;
    border-radius: 12px;
    margin: var(--gap) 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    display: none; /* Hidden in production */
}
.research-prompt.visible { display: block; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    :root { --nav-height: 60px; }

    .top-bar { display: none; }
    .main-nav { z-index: 1400; }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        position: relative;
    }

    /* Full-screen vertical nav — hidden by default */
    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: var(--white);
        padding: 0;
        margin: 0;
        gap: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1401;
        border-top: 1px solid var(--snow-dark);
        box-shadow: var(--shadow-lg);
    }
    .nav-menu.active { display: flex; }

    /* Each top-level item — full width, stacked */
    .nav-menu > li {
        position: static;
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--snow-dark);
    }
    .nav-menu > li:last-child { border-bottom: none; }
    .nav-menu > li > a {
        padding: 0.9rem 1.1rem;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 48px;
        font-size: 0.95rem;
        border-radius: 0;
    }

    /* Dropdown — static, inline below the trigger (NO absolute, NO fly-out) */
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: var(--snow);
        display: none;
    }
    .nav-dropdown.open > .dropdown-menu {
        display: block;
        animation: mobileDropIn 0.22s ease;
    }

    /* Keep right-side rule from interfering */
    .nav-menu > li:nth-last-child(-n+4) > .dropdown-menu {
        left: auto;
        right: auto;
        transform: none;
    }

    .dropdown-menu li { width: 100%; }
    .dropdown-menu li a {
        padding: 0.7rem 1.1rem 0.7rem 2.2rem;
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(0,0,0,0.04);
        font-size: 0.9rem;
        white-space: normal;
    }
    .dropdown-menu li:last-child a { border-bottom: none; }
    .dropdown-menu li a:hover { background: var(--snow-dark); }

    .nav-dropdown.open > a {
        background: var(--snow);
        color: var(--pine);
        font-weight: 600;
    }
}

@keyframes mobileDropIn {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 600px; }
}

/* Extra-small: tighten spacing */
@media (max-width: 400px) {
    .nav-menu > li > a { padding: 0.75rem 0.9rem; font-size: 0.9rem; }
    .dropdown-menu li a { padding: 0.65rem 0.9rem 0.65rem 1.8rem; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    
    .footer-grid { grid-template-columns: 1fr; gap: var(--gap); }
    
    .section-title { font-size: 1.75rem; }
    .page-header h1 { font-size: 2rem; }
}


/* --- HERO MEDIA / AMBIENCE PANEL --- */
.bb-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.bb-audio-scaffold {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: rgba(9, 24, 34, 0.48);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 0.5rem 0.75rem;
    width: fit-content;
    max-width: 100%;
}
.bb-audio-scaffold strong {
    font-size: 0.95rem;
    color: #fff;
    margin-right: 0.2rem;
}
.bb-audio-scaffold button {
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.88);
    color: var(--summit);
    border-radius: 999px;
    padding: 0.24rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.bb-audio-scaffold button:hover {
    transform: translateY(-1px);
    background: #fff;
}

@media (max-width: 768px) {
    .bb-audio-scaffold {
        border-radius: 14px;
        width: 100%;
        align-items: flex-start;
    }
}
