/* ==========================================================================
   STATION GROUP - ISOLATED HEADER & MENU STYLES (menu.css)
   ========================================================================== */

/* --- 1. HEADER WRAPPER --- */
header {
    background-color: #141B2D !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px !important;
    z-index: 10000;
    border-bottom: none !important; /* FIXED: Removed the faint white hairline */
    display: flex;
    align-items: center;
    transition: background-color 0.4s ease !important;
}
/* --- 2. DESKTOP GRID LAYOUT --- */
.header-content { 
    display: grid; 
    grid-template-columns: auto 1fr; 
    grid-template-rows: 1fr 1fr; 
    align-items: center; 
    width: 100%; 
    height: 100%; 
    max-width: 100%; /* <-- Changed from 1200px to allow full width */
    margin: 0; 
    padding: 0 50px; /* <-- The '50px' creates the nice gap from the left and right edges */
    gap: 0 20px; 
}

.brand-name { 
    grid-column: 1 / 2; 
    grid-row: 1 / 3; 
    display: flex; 
    align-items: center; 
}
.brand-name img { 
    height: 65px !important; 
    width: auto; 
    display: block; 
    border: none !important; 
    margin-left: 30px !important; /* <-- Adds the gap on the left */
}


/* --- 3. SEARCH BAR --- */
.search-container { 
    grid-column: 2 / 3; 
    grid-row: 1 / 2; 
    justify-self: flex-end; 
    align-self: flex-end; 
    display: flex; 
    align-items: center; 
    position: relative; 
    margin-bottom: 8px; 
}

.search-box { 
    /* Added left padding to make room for the magnifying glass */
    padding: 6px 15px 6px 35px; 
    border-radius: 20px; 
    border: 1px solid rgba(255,255,255,0.3); 
    
    /* White Magnifying Glass Icon */
    background: rgba(0,0,0,0.3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23ffffff'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 456.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E") no-repeat 12px center;
    background-size: 14px;
    
    color: white; 
    outline: none; 
    font-size: 12px; 
    transition: all 0.3s ease; 
    width: 180px; /* Made the default box slightly wider */
    font-family: 'Montserrat', sans-serif;
}
.search-box::placeholder { color: #ddd; }

.search-box:focus { 
    background-color: #ffffff !important; 
    
    /* Golden Magnifying Glass Icon when typing */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23c5a059'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 456.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E") !important;
    
    color: #000000 !important; 
    width: 320px; /* Made it much wider when focused! */
    border-color: #c5a059; 
    max-width: 100%; 
    opacity: 1 !important;
}
.search-box:focus::placeholder { color: #888; }



/* --- ENLARGED SEARCH DROPDOWN FIX --- */
#search-dropdown { 
    position: absolute; 
    top: 45px; /* Gives a little breathing room below the search bar */
    right: 0; 
    background: #fff; 
    color: #333; 
    width: 600px; /* Increased from 250px to fit the search text */
    max-width: 90vw; /* Keeps it from breaking mobile screens */
    max-height: 70vh; /* Increased from 300px to show more results */
    overflow-y: auto; /* Keeps vertical scrolling */
    overflow-x: hidden; /* Kills the ugly horizontal scrollbar */
    border: 2px solid var(--accent-gold); 
    border-radius: 4px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.4); /* Stronger shadow for depth */
    display: none; 
    z-index: 20000; /* Bumped up to ensure it stays above everything */
    padding: 20px; 
    text-align: left; 
}


/* --- 4. MAIN NAV MENU --- */
nav#nav-menu { 
    grid-column: 2 / 3; 
    grid-row: 2 / 3; 
    justify-self: flex-end; 
    align-self: flex-start; 
    display: flex; 
    margin-top: 8px; 
}
.menu { 
    display: flex; 
    list-style: none !important; 
    gap: 20px; 
    margin: 0; 
    padding: 0; 
    align-items: center; 
}
.menu > li { position: relative; padding: 0 10px; list-style: none !important; }
.menu > li > a { 
    font-family: 'Montserrat', sans-serif;
    color: #efefef; 
    text-decoration: none !important; 
    font-size: 13px !important; 
    font-weight: 600; 
    text-transform: uppercase; 
    transition: color 0.3s; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); 
    white-space: nowrap; 
    border: none !important; 
}
.menu > li > a:hover, .menu > li > a.active-page { color: #c5a059 !important; }

/* --- 5. DROPDOWNS (NO BULLETS, BOLD SMALL-CAPS) --- */
.dropdown { 
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background-color: #fff; 
    min-width: 260px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    border-top: 2px solid #c5a059; 
    padding: 5px 0; 
    z-index: 10000; 
    list-style: none !important; 
    margin: 0 !important; 
}
.has-dropdown:hover .dropdown { display: block; }
.dropdown li { width: 100%; list-style: none !important; margin: 0; padding: 0; }
.dropdown li a { 
    font-family: 'Montserrat', sans-serif;
    display: block; 
    padding: 10px 20px; 
    color: #000000 !important; /* Changed to Pure Black */
    text-decoration: none; 
    font-size: 13px !important; 
    font-weight: 600; /* Bumped to Semi-Bold for thicker letters */
    font-variant: small-caps; 
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0; 
    text-shadow: none; 
    text-transform: none; 
    transition: background 0.3s, color 0.3s;
}
.dropdown li a:hover, .dropdown li a.active-page { 
    background: #f9f9f9; 
    color: #c5a059 !important; 
}

/* --- 6. MOBILE RESPONSIVENESS --- */
.hamburger { display: none; }

@media (max-width: 1150px) {
    header { height: auto !important; padding: 10px 0 !important; }
    .header-content { display: flex !important; flex-direction: row !important; justify-content: space-between !important; align-items: center !important; padding: 0 15px !important; }
    .brand-name { flex: 1 1 auto; min-width: 0; overflow: hidden; }
    .brand-name img { 
    height: 40px !important; 
    margin: 0 0 0 15px !important; /* <-- Keeps a neat 15px gap on phones */
    flex-shrink: 0; 
}
    
    .search-container { margin: 0 15px 0 auto !important; order: 2; flex-shrink: 0; z-index: 999999 !important; }
    .search-box { width: 110px !important; min-width: 110px !important; padding: 6px 12px; font-size: 11px; flex-shrink: 0; }
    .search-box:focus { width: 220px !important; min-width: 220px !important; position: absolute; right: 0; z-index: 20000; }
    
    .hamburger { display: flex; flex-direction: column; justify-content: space-between; width: 28px; height: 20px; cursor: pointer; z-index: 10001; order: 3; }
    .hamburger span { display: block; height: 3px; width: 100%; background-color: #fff; border-radius: 3px; transition: all 0.3s ease-in-out; }
    .hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

    nav#nav-menu { display: none !important; position: absolute; top: 100%; left: 0; width: 100%; background-color: #141B2D; padding: 20px 30px !important; border-top: 1px solid rgba(255,255,255,0.05); box-shadow: 0 15px 25px rgba(0,0,0,0.5); z-index: 10000; margin-top: 0 !important; }
    nav#nav-menu.active { display: flex !important; flex-direction: column !important; }
    
    .menu { flex-direction: column !important; align-items: flex-start !important; width: 100%; gap: 10px !important; padding: 0 !important; }
    .menu > li { width: 100%; padding: 0 !important; border: none !important; }
    .menu > li > a { display: flex; justify-content: flex-start; align-items: center; width: 100%; font-size: 14px !important; color: #ffffff !important; padding: 8px 0 !important; border: none !important; font-weight: 700; gap: 8px; }
    .menu > li > a i { color: #c5a059 !important; font-size: 16px !important; padding-right: 15px; }
    
/* Inside your @media (max-width: 1150px) block in menu.css */

.sticky-page-title {
    /* Matches your 60px mobile header height to close the gap */
    top: 60px !important; 
    margin-top: 0 !important;
    background-color: #fcfcfc !important; /* Ensures it stays solid */
    z-index: 9999 !important; /* Stays just below the main header */
}

/* Ensure the sidebar also adjusts so it doesn't hide behind the frozen title */
@media (max-width: 850px) {
    .modern-sidebar {
        top: 130px !important; 
    }
}
    
/* --- UPDATED STATION GROUP DROPDOWN FIX --- */
    .dropdown { 
        position: static !important; 
        display: none !important; /* Hidden by default */
        background-color: rgba(255,255,255,0.05) !important; /* Slight highlight for sub-menu */
        border: none !important; 
        box-shadow: none !important; 
        padding-left: 15px !important; 
        margin-top: 5px; 
        width: 100%; 
    }
    
    /* When the Javascript adds '.active' or '.open', force it to show! */
    .has-dropdown.active > .dropdown,
    .has-dropdown.open > .dropdown,
    .dropdown.active { 
        display: block !important; 
    }
    
    /* Rotate the arrow icon */
    .has-dropdown.active > a i,
    .has-dropdown.open > a i { 
        transform: rotate(180deg); 
        transition: transform 0.3s ease;
    }
    
    /* Mobile dropdown links usually look better standard instead of small caps */
    .dropdown li a { color: #e0e0e0 !important; border: none !important; padding: 8px 0 !important; font-size: 13px !important; text-transform: uppercase !important; font-variant: normal; display: block; width: 100%; }
    .dropdown li a:hover { color: #c5a059 !important; background: transparent; }
}

/* Hide mobile search button on desktop */
.mobile-search-btn {
    display: none; 
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* Show it only on mobile screens */
@media (max-width: 992px) {
    .search-container {
        display: none !important; /* Hides the big desktop bar */
    }
    .mobile-search-btn {
        display: block; /* Shows the magnifying glass */
    }
}


/* 1. Stop the desktop search icon from repeating */
.search-box {
    background-repeat: no-repeat !important;
    background-position: 15px center !important;
}

/* 2. Setup the mobile search drop-down */
@media (max-width: 992px) {
    .search-container {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%; /* Drops exactly below the header */
        left: 0;
        width: 100%;
        background-color: #141B2D;
        padding: 15px 20px;
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 999;
    }
    
    /* This class is added by Javascript when the button is clicked */
    .search-container.show-mobile-search {
        display: block !important; 
    }
}

/* --- FIX: PREVENT DROPDOWN TEXT WRAPPING ON DESKTOP --- */
@media (min-width: 1151px) {
    nav .menu > li .dropdown, 
    nav .menu > li .sub-menu {
        width: max-content !important; /* Allows the box to expand to fit the text */
        min-width: 260px; /* Keeps a nice minimum width for shorter menus */
    }

    nav .menu > li .dropdown a, 
    nav .menu > li .sub-menu a {
        white-space: nowrap !important; /* Forces the text to stay on one line */
    }
}

/* ==========================================================================
   SCROLLSPY ACTIVE SECTION HIGHLIGHT
   ========================================================================== */
#nav-menu a.active-section {
    color: #c5a059 !important; /* Golden color */
    font-weight: 800 !important;
    transition: color 0.3s ease;
}

/* If a section is active, ensure its parent dropdown title also turns gold */
#nav-menu .has-dropdown > a.active-section {
    color: #c5a059 !important;
}