/* ============================================
   NAVIGATION STYLES (GLASSMORPHISM EFFECT)
   ============================================ */

/* Base navigation - transparent initially */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    /* background: rgba(255, 255, 255, 0); */
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

/* Navigation when scrolled - white glassmorphism */
.sticky-nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

/* Text visibility when scrolled */
.sticky-nav.scrolled .gh-head-logo,
.sticky-nav.scrolled .gh-head-menu a,
.sticky-nav.scrolled .gh-head-btn {
    color: #111827 !important;
    text-shadow: none !important;
}

.sticky-nav.scrolled .gh-burger span {
    background: #111827 !important;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .sticky-nav.scrolled {
        background: rgba(0, 0, 0, 0.95);
        border-bottom: 1px solid rgba(55, 65, 81, 0.5);
    }
    
    .sticky-nav.scrolled .gh-head-logo,
    .sticky-nav.scrolled .gh-head-menu a,
    .sticky-nav.scrolled .gh-head-btn {
        color: white !important;
    }
    
    .sticky-nav.scrolled .gh-burger span {
        background: white !important;
    }
}

/* Navigation padding */
.sticky-nav .gh-head-inner {
    padding: 1rem 2rem;
    transition: padding 0.3s ease;
}

.sticky-nav.scrolled .gh-head-inner {
    padding: 0.75rem 2rem;
}

/* Navigation text on video (before scroll) */
.sticky-nav:not(.scrolled) .gh-head-logo,
.sticky-nav:not(.scrolled) .gh-head-menu a,
.sticky-nav:not(.scrolled) .gh-head-btn {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.sticky-nav:not(.scrolled) .gh-burger span {
    background: white !important;
}

/* ============================================
   GLOBAL LAYOUT ADJUSTMENTS
   ============================================ */

body {
    padding-top: 0 !important;
}

html {
    scroll-behavior: smooth;
}

.gh-outer {
    padding: 0;
}

.site-main {
    padding-top: 80px;
}

.is-home .site-main {
    padding-top: 0;
}

/* ============================================
   VIDEO SECTION - DEFAULT/MOBILE FIRST
   ============================================ */

/* Video section positioning */
.featured-video-section {
    padding-top: 0;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Video container base styles */
.video-container {
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    position: relative;
    overflow: visible;
}

/* Home page video container */
.is-home .video-container {
    height: 100dvh !important;
    min-height: 100dvh !important;
    aspect-ratio: unset;
}

/* Video element */
.is-home .featured-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh !important;
    object-fit: cover;
    z-index: 1;
}

/* Video overlay with gradient */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 0 0;
    z-index: 2;
}

/* Video text content */
.video-content {
    text-align: center;
    padding: 20px;
    max-width: 800px;
}

.video-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.video-tagline {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.95;
    margin-bottom: 2rem;
    color: white;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.video-cta {
    display: inline-block;
    padding: 14px 32px;
    background: white;
    color: black;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.video-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* ============================================
   DESKTOP STYLES (769px+)
   ============================================ */
@media (min-width: 769px) {
    /* Desktop keeps all default styles, just ensuring they're applied */
    .featured-video-section {
        padding: 0 !important;
        background: black !important;
    }
    
    .is-home .video-container {
        position: relative;
        height: 100dvh !important;
    }
    
    .is-home .featured-video {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .video-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: -150px;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        /* margin-bottom: -100px !important; */
    }
}

/* ============================================
   TABLET PORTRAIT (769px-1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .featured-video-section {
        margin-top: -60px !important;
        padding-top: 100px   !important;
        padding-bottom: 150px !important;
        background: black !important;
    }
    
    /* Fix astronaut image zoom on tablet */
    .is-home .site-cover .cover-image {
        object-fit: contain !important;
        object-position: center center !important;
    }
    
    .video-container,
    .is-home .video-container {
        height: auto !important;
        max-height: 40vh !important;
        min-height: unset !important;
        align-items: flex-end;
    }
    
    .featured-video,
    .is-home .featured-video {
        position: relative !important;
        height: auto !important;
        max-height: 40vh !important;
        min-height: unset !important;
        width: 100% !important;
        object-fit: cover !important;
        background: black !important;
    }
    
    .featured-video {
        padding-bottom: 0 !important;
    }
}

/* ============================================
   TABLET LANDSCAPE (769px-1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 900px) and (orientation: landscape) {
    .video-container,
    .is-home .video-container {
        height: auto !important;
        max-height: 80vh !important;
    }
    
    .featured-video,
    .is-home .featured-video {
        position: relative !important;
        height: auto !important;
        max-height: 80vh !important;
        width: 100% !important;
        object-fit: cover !important;
        background: black !important;   
    }
}
/* ============================================
   MOBILE PORTRAIT (<768px) - FIXED
   ============================================ */
   @media (max-width: 768px) {
    .is-home .site-cover {
        padding: 60px 15px 40px 15px !important;
        background-color: transparent !important;
        margin-top: 0 !important;
        position: relative !important;
    }
    
    /* Ensure astronaut image is visible on mobile */
    .is-home .site-cover .cover-image {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
        z-index: 1 !important;
    }
    
    /* Ensure content appears above image */
    .is-home .site-cover .cover-content {
        position: relative !important;
        z-index: 2 !important;
    }
    /* Ensure nav takes full width and nothing is cut off */
    .sticky-nav {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        overflow: visible !important; /* Ensure menu button isn't hidden */
    }
    
    .sticky-nav .gh-head-inner {
        padding: 0.75rem 0.5rem 0.75rem 1rem !important; /* Less padding on right side */
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure burger menu is visible and positioned correctly */
    .gh-burger {
        position: relative !important;
        display: block !important;
        margin-left: auto !important; /* Push to right edge */
        margin-right: 0 !important;
        padding: 10px 5px !important; /* Reasonable padding for touch target */
        border: none !important;
        cursor: pointer !important;
        z-index: 1001 !important;
    }
}

@media (max-width: 768px) and (orientation: portrait) {

    .featured-video-section {
        margin-top: 0px !important;
        padding-top: 0px !important;
        margin-bottom: 0px !important;
        /* padding-bottom: 100px !important; */
        padding-left: 0px !important;
        padding-right: 0px !important;
        background: black !important;
        width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
    }
    
    .video-container,
    .is-home .video-container {
        height: auto !important;
        max-height: 50vh !important;
        min-height: 40vh !important;
        background: black !important;
        overflow: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
    }
    
    .featured-video,
    .is-home .featured-video {
        position: absolute !important;
        /* top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important; */
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* Changed from cover to contain to show full video width */
        background: black !important;
    }
    
    .video-overlay {
        position: absolute !important;
        bottom: 40px;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 5;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
        padding: 20px 15px;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        margin: 0 !important;
    }
    
    .video-content {
        background: transparent;
        padding: 0;
        text-align: center;
        width: 100%;
    }
    
    /* Title positioning */
    .video-title {
        margin-top: 0 !important;
        margin-bottom: 0.5rem !important;
        font-size: 2rem !important;
        color: white !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8) !important;
    }
    
    .video-tagline {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        color: white !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
    }
    
    /* Ensure button is visible */
    .video-cta {
        position: relative !important;
        z-index: 10 !important;
        margin-bottom: 0 !important;
        padding: 10px 24px !important;
        font-size: 0.95rem !important;
    }
}

@media (max-width: 768px) {
    .topic {
        background: white !important; /* White cards */
        border-radius: 16px;
        padding: 1.5rem !important;
        margin: 1rem !important;
        box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    }
    
    /* Fix text colors in topic cards */
    .topic-name a {
        color: #111827 !important; /* Dark text on white */
    }
    
    .topic-article-link {
        color: #4b5563 !important; /* Grey text on white */
    }
    
    /* Ensure page sections have proper backgrounds */
    body {
        background: #f9fafb !important; /* Light grey body background */
    }
    
    .gh-outer,
    .site-main {
        background: transparent !important; /* Let body show through */
    }
 
}

/* ============================================
   LANDSCAPE
   ============================================ */
@media (orientation: landscape) {
    /* Make toolbar black in landscape mode */
    .sticky-nav {
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    /* White text on black nav */
    .sticky-nav .gh-head-logo,
    .sticky-nav .gh-head-menu a,
    .sticky-nav .gh-head-btn {
        color: white !important;
    }
    
    /* White burger menu lines */
    .sticky-nav .gh-burger span,
    .sticky-nav .gh-burger::before,
    .sticky-nav .gh-burger::after {
        background: white !important;
    }
    
    .featured-video-section {
        margin-top: 20px;
        padding-top: 0 !important;
        padding-bottom: 150px !important;
        background: black !important;
    }
    
    .video-container,
    .is-home .video-container {
        height: 100vh !important; /* Full viewport height */
        max-height: 100vh !important;
        position: relative !important;
    }
    
    .featured-video,
    .is-home .featured-video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* Show full video without cropping */
        object-position: center center !important;
        background: black !important;
    }
    
    .video-overlay {
        position: absolute !important;
        top: 100px !important;
        bottom: -150px !important;
        padding: 10px !important;
    }
    
    .video-title {
        font-size: 3rem !important;
    }
    
    .video-tagline {
        font-size: 1.5rem !important;
    }
    
    .video-cta {
        padding: 8px 20px !important;
        font-size: 1.5rem !important;
    }
}

/* ============================================
   VERY SMALL SCREENS (<480px)
   ============================================ */
@media (max-width: 480px) {
    .featured-video-section {
        padding-top: 20px !important;
    }
    
    .sticky-nav {
        height: 50px;
    }
    
    .video-container,
    .is-home .video-container {
        max-height: 25vh !important;

    }
    
    .featured-video,
    .is-home .featured-video {
        max-height: 20vh !important;
    }
}

/* ============================================
   SITE COVER SECTION (SEARCH AREA)
   ============================================ */

/* Base site cover - FINAL DEFINITION (overrides earlier) */
.is-home .site-cover {
    margin-top: 0 !important;
    padding-top: 0px !important;
    padding-bottom: 80px !important;
    position: relative;
    overflow: hidden;
}
/* Cover content positioning */
.is-home .cover-content {
    position: relative;
    z-index: 1;
}

.is-home .cover-description {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Mobile adjustments for cover description */
@media (max-width: 768px) {
    .is-home .cover-description {
        white-space: normal;
        font-size: 1.25rem;
    }
    
    /* Prevent "In-person" from breaking */
    .is-home .cover-description span,
    .is-home .cover-description strong {
        white-space: nowrap;
    }
}

.is-home .search-form {
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* ============================================
   TOPIC CARDS SECTION
   ============================================ */

.topic {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    transition: all 0.3s ease;
}

.topic:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.topic-header {
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.topic-name a {
    color: #111827;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.topic-name a:hover {
    color: #2563eb;
}

.topic-article-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-article {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f9fafb;
}

.topic-article:last-child {
    border-bottom: none;
}

.topic-article-link {
    color: #4b5563;
    text-decoration: none;
    font-size: 1.0625rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.topic-article-link:hover {
    color: #111827;
    transform: translateX(4px);
}

.topic-article-link svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.topic-more {
    display: inline-block;
    margin-top: 1rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.topic-more:hover {
    transform: translateX(4px);
}

/* ============================================
   MOBILE MENU - CLEAN VERSION
   ============================================ */

@media (max-width: 768px) {
    /* Mobile menu toggle button styling */
    .gh-burger {
        display: block !important;
        position: relative !important;
        z-index: 1000 !important;
        cursor: pointer !important;
        padding: 5px !important;
        margin-right: 0 !important;
        width: 30px !important;
        height: 24px !important;
    }
    
    .gh-burger span {
        display: block !important;
        position: absolute !important;
        width: 100% !important;
        height: 2px !important;
        background: #111827 !important;
        top: 50% !important;
        left: 0 !important;
        transform: translateY(-30%) !important;
        transition: all 0.3s ease !important;
    }
    
    .gh-burger::before,
    .gh-burger::after {
        content: '' !important;
        display: block !important;
        position: absolute !important;
        width: 100% !important;
        height: 2px !important;
        background: #111827 !important; /* Default dark color */
        left: 0 !important;
        transition: all 0.3s ease !important;
    }
    
    .gh-burger::before {
        top: 0 !important;
    }
    
    .gh-burger::after {
        bottom: 0 !important;
    }
    
    /* Transform burger to X when menu is open */
    .is-head-open .gh-burger span {
        background: transparent !important;
    }
    
    .is-head-open #gh-head .gh-burger::before {
        transform: rotate(45deg) !important;
        top: 14px !important;
        background: white !important;
    }
    
    .is-head-open #gh-head .gh-burger::after {
        transform: rotate(-45deg) !important;
        top: 14px !important;
        background: white !important;
    }
    
    /* Ensure proper spacing for nav elements */
    .gh-head-brand {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    
    /* Logo should not take all space */
    .gh-head-brand-wrapper {
        flex: 0 1 auto !important;
    }
    
    /* Search button and burger menu container */
    .gh-head-brand > :not(.gh-head-brand-wrapper) {
        flex: 0 0 auto !important;
    }
    
    /* Search button styling on mobile */
    .gh-head-brand .gh-search {
        margin-right: 10px !important;
    }
    
    /* When nav is scrolled, change burger color */
    .sticky-nav.scrolled .gh-burger span,
    .sticky-nav.scrolled .gh-burger::before,
    .sticky-nav.scrolled .gh-burger::after {
        background: #111827 !important;
    }
    
    /* When nav is not scrolled (on white background), burger should be dark */
    .sticky-nav:not(.scrolled) .gh-burger span,
    .sticky-nav:not(.scrolled) .gh-burger::before,
    .sticky-nav:not(.scrolled) .gh-burger::after {
        background: #111827 !important; /* Changed to dark so it's visible */
    }
    
    /* Mobile menu overlay - dark theme */
    .is-head-open #gh-head {
        background: #0a0a0a !important; /* Dark background instead of white */
        height: 100% !important;
        width: 100% !important;
        max-width: 100vw !important; /* Prevent horizontal overflow */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        overflow-x: hidden !important; /* No horizontal scroll */
    }
    
    /* Fix the inner layout */
    .is-head-open #gh-head .gh-head-inner {
        display: flex !important; /* Use flexbox instead of grid */
        flex-direction: column !important;
        height: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    /* Keep brand/burger/search at top */
    .is-head-open #gh-head .gh-head-brand {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }
    
    /* Keep search icon in header */
    .is-head-open #gh-head .gh-head-brand .gh-search {
        order: 1 !important; /* Keep search before burger */
        margin-right: 1rem !important;
    }
    
    
    /* Position menu in the middle */
    .is-head-open #gh-head .gh-head-menu {
        padding: 2rem 1rem !important;
        flex: 1 1 auto !important; /* Take available space */
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Override the white background on the actions section */
    .is-head-open #gh-head .gh-head-actions {
        background: transparent !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 2rem 1rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        flex-shrink: 0 !important; /* Don't shrink */
    }
    
    /* Hide the search icon from actions area when menu is open */
    .is-head-open #gh-head .gh-head-actions .gh-search {
        display: none !important;
    }
    
    /* Make all text white in mobile menu */
    .is-head-open #gh-head .gh-head-logo,
    .is-head-open #gh-head .gh-head-menu a,
    .is-head-open #gh-head .nav a,
    .is-head-open #gh-head .gh-search {
        color: #ffffff !important;
    }
    
    
    /* Override ALL button styles in mobile menu */
    .is-head-open #gh-head .gh-head-btn,
    .is-head-open #gh-head .gh-btn {
        display: block !important;
        padding: 0.75rem 2rem !important;
        margin: 0.5rem 1rem !important;
        border-radius: 50px !important;
        font-weight: 600 !important;
        text-align: center !important;
        width: auto !important;
        max-width: 100% !important;
        transition: all 0.3s ease !important;
        text-shadow: none !important; /* Remove text shadow */
    }
    
    /* Login button - dark with white border */
    .is-head-open #gh-head .gh-head-btn:first-child,
    .is-head-open #gh-head .gh-btn:not(.gh-primary-btn) {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 2px solid #ffffff !important;
        color: #ffffff !important;
    }
    
    .is-head-open #gh-head .gh-head-btn:first-child:hover,
    .is-head-open #gh-head .gh-btn:not(.gh-primary-btn):hover {
        background: #ffffff !important;
        color: #0a0a0a !important;
    }
    
    /* Join us button - white background */
    .is-head-open #gh-head .gh-head-btn.gh-primary-btn,
    .is-head-open #gh-head .gh-btn.gh-primary-btn,
    .is-head-open #gh-head .gh-head-btn:last-child {
        background: #ffffff !important;
        color: #0a0a0a !important;
        border: 2px solid #ffffff !important;
    }
    
    .is-head-open #gh-head .gh-head-btn.gh-primary-btn:hover,
    .is-head-open #gh-head .gh-btn.gh-primary-btn:hover,
    .is-head-open #gh-head .gh-head-btn:last-child:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
    }
    
    /* Ensure buttons container is visible */
    .is-head-open #gh-head .gh-head-members {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        align-items: center !important;
        gap: 1rem !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    
    /* Add subtle hover effect to menu items */
    .is-head-open #gh-head .gh-head-menu a:hover,
    .is-head-open #gh-head .nav a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 0.5rem !important;
    }
    
    /* Make menu and actions visible when menu is open */
    .is-head-open #gh-head .gh-head-menu,
    .is-head-open #gh-head .gh-head-actions {
        display: flex !important;
        flex-direction: column !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ensure menu items are stacked vertically */
    .is-head-open #gh-head .nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        padding: 1rem 2rem !important;
    }
    
    .is-head-open #gh-head .nav li {
        width: 100% !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Hide menu and actions by default on mobile */
    @media (max-width: 768px) {
        .gh-head-menu,
        .gh-head-actions {
            display: none !important;
        }
    }
}