/*
--- TRAJECTORY - NEW HIGH-END DARK THEME ---
*/

/* --- 1. Global Reset & Root Variables --- */
:root {
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
    
    /* Dark Mode Color Palette */
    --color-primary: #35a76f;       /* Main accent green */
    --color-primary-dark: #2a8a5c; /* Darker green for hover */
    
    --color-bg: #121212;            /* Deepest black bg */
    --color-bg-light: #1c1c1c;     /* Lighter bg for sections */
    --color-card: #222222;          /* Card background */
    
    --color-text-light: #ffffff;    /* Headings */
    --color-text-body: #b3b3b3;     /* Body text */
    --color-text-subtle: #888888;   /* Footer/meta text */

    --color-border: #333333;

    --shadow-light: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-medium: 0 6px 20px rgba(0,0,0,0.3);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Prevent layout shift from scrollbar */
    overflow-y: scroll;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-body);
    background-color: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. Typography & Base Elements --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-text-light);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.25rem;
    font-weight: 600;
    text-align: center;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2.5rem;
}

h4 {
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
}

.section-gray {
    background-color: var(--color-bg-light);
}

.section-header {
    max-width: 700px;
    margin: 0 auto 4rem auto;
    text-align: center;
}

.section-header p {
    font-size: 1.15rem;
    color: var(--color-text-body);
}

.text-center {
    text-align: center;
}

/* --- 3. Buttons --- */
.btn {
    display: inline-block;
    padding: 15px 35px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #000000;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #000000;
    transform: scale(1.03);
    box-shadow: var(--shadow-light);
}

.btn-hero {
    background-color: var(--color-primary);
    color: #FFFFFF;
    font-size: 1rem;
    padding: 16px 38px;
}

.btn-hero:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #000000;
    transform: scale(1.03);
    box-shadow: var(--shadow-light);
}

.btn-nav {
    background-color: var(--color-primary);
    color: #000000;
    padding: 12px 30px; 
    font-size: 0.85rem;
    line-height: 1.3;
    margin-left: 25px; /* Spacing */
}
.btn-nav:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #000000;
    transform: scale(1.03);
}


/* --- 4. Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(24, 24, 24, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 15px 0;
}

.header > .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 45px; /* Slightly smaller */
    width: auto; /* FIX: Prevents distortion */
    object-fit: contain;
}

.nav-desktop {
    display: flex; /* Show by default */
    align-items: center;
}

.nav-desktop a {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-light);
    margin-left: 25px;
    font-size: 1rem;
    position: relative;
    padding: 5px 5px;
}

.nav-desktop a:not(.btn):after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-desktop a:hover:not(.btn) {
    color: var(--color-text-light);
}

.nav-desktop a:hover:not(.btn):after {
    width: 100%;
}

.nav-mobile-toggle {
    display: none; /* Hide by default */
    cursor: pointer;
    width: 28px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1001; /* Ensure it's clickable */
}

.nav-mobile-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-text-light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}
.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

.nav-mobile {
    display: none; /* Hide by default */
    flex-direction: column;
    background-color: var(--color-card);
    position: absolute;
    top: 75px; /* Header height */
    left: 0;
    width: 100%;
    padding: 10px 0;
    box-shadow: var(--shadow-medium);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.nav-mobile.active {
    display: flex;
    max-height: 500px;
}

.nav-mobile a {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-text-light);
    padding: 15px 5%;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
.nav-mobile a:last-child {
    border-bottom: none;
}
.nav-mobile a:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

/* --- 5. Hero Section --- */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-light);
    overflow: hidden;
    margin-top: 75px; /* Offset for fixed header */
}

.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.video-background iframe {
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
    min-width: 177.77vh; /* 16:9 aspect ratio */
    min-height: 100vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.9) 0%, rgba(18, 18, 18, 0.6) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

.hero h1 {
    color: var(--color-text-light);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-text-body);
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* --- 6. Mission & Creed Section --- */
.creed-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.creed-item {
    text-align: center;
    padding: 30px;
    background-color: var(--color-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.creed-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--color-primary);
}

.creed-item i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.creed-item h4 {
    font-size: 1.2rem;
    color: var(--color-text-light);
}
.creed-item h4 span {
    color: var(--color-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}
.creed-item p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- 7. How It Works Section --- */
.how-it-works-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    background: var(--color-card);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.how-it-works-content p {
    font-size: 1.1rem;
}

.how-it-works-content strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* --- 8. Gatherings (Events) Section --- */
.event-next {
    display: flex;
    background-color: var(--color-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
}

.event-next-image {
    flex-basis: 40%;
    min-height: 300px;
}

.event-next-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.event-next-details {
    flex-basis: 60%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-next-details h3 {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.event-meta {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}
.event-meta span {
    display: inline-block;
    margin-right: 20px;
    color: var(--color-text-body);
}
.event-meta i {
    color: var(--color-primary);
    margin-right: 8px;
}
.event-location {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}
.event-location i {
    color: var(--color-primary);
    margin-right: 8px;
}

.upcoming-events-header {
    text-align: center;
    font-size: 1.75rem;
    margin-top: 4rem;
    margin-bottom: 2.5rem;
}

.event-list {
    max-width: 900px;
    margin: 0 auto;
}

.event-list-item {
    display: flex;
    align-items: center;
    background-color: var(--color-card);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.event-list-date {
    background-color: var(--color-primary);
    color: #000;
    border-radius: var(--border-radius);
    text-align: center;
    padding: 10px 15px;
    margin-right: 20px;
    font-weight: 700;
}
.event-list-date .month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    line-height: 1.2;
}
.event-list-date .day {
    display: block;
    font-size: 1.5rem;
    line-height: 1.1;
}

.event-list-details h4 {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.event-list-details p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--color-text-body);
}


/* --- 9. Impact Section --- */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.impact-item {
    background: var(--color-card);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-primary);
}

.impact-item i {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.impact-item h4 {
    text-align: left;
    color: var(--color-text-light);
}
.impact-item p {
    font-size: 1rem;
}


/* --- 10. Book Section --- */
.book-content {
    display: flex;
    align-items: center;
    gap: 40px;
    background: var(--color-card);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.book-image {
    flex: 0 0 300px;
}
.book-image img {
    box-shadow: var(--shadow-medium);
}

.book-details h3 {
    text-align: left;
    color: var(--color-text-light);
}

.authors-header {
    font-size: 1.75rem;
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 2.5rem;
}

.author-slider .slick-slide {
    padding: 0 15px;
}

.author-item {
    text-align: center;
    cursor: pointer;
    outline: none;
}

.author-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    border: 3px solid var(--color-border);
    transition: border-color 0.3s ease;
}

.author-item h4 {
    color: var(--color-text-body);
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.author-item:hover h4 {
    color: var(--color-primary);
}
.author-item:hover img {
    border-color: var(--color-primary);
}

.slick-dots li button:before {
    font-size: 10px;
    color: var(--color-text-subtle);
}
.slick-dots li.slick-active button:before {
    color: var(--color-primary);
}

/* --- 11. Contact Section --- */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background: var(--color-bg-light);
    padding: 40px;
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #2b2b2b;
    color: var(--color-text-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-text-subtle);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(53, 167, 111, 0.3);
}

.contact-form textarea {
    resize: vertical;
}

/* --- 12. Footer --- */
.footer {
    background-color: var(--color-bg-light);
    color: var(--color-text-subtle);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}
.footer p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- 13. Popups --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
}

.popup-content {
    background-color: var(--color-card);
    padding: 30px; /* Reduced padding for mobile */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--color-border);
    width: 100%; /* Full width on small screens */
    max-width: 500px;
    position: relative;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

.popup-content h3 {
    margin-bottom: 0.5rem;
}
.popup-content p {
    margin-bottom: 1.5rem;
    color: var(--color-text-body);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-text-subtle);
    cursor: pointer;
    line-height: 1;
}
.popup-close:hover {
    color: var(--color-text-light);
}

.popup-content form .form-group {
    margin-bottom: 1rem;
}
.popup-content form input {
    width: 100%;
    padding: 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #2b2b2b;
    color: var(--color-text-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}
.popup-content form input::placeholder {
    color: var(--color-text-subtle);
}
.popup-content form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(53, 167, 111, 0.3);
}

.popup-content form .btn {
    width: 100%;
}
.submission-message {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text-light);
}

/* Author Popup Specifics */
.author-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    border: 3px solid var(--color-primary);
}
.author-name {
    font-size: 1.75rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}
.author-bio {
    font-size: 1rem;
    text-align: left;
    margin-bottom: 1.5rem;
}
.author-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.author-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* --- 14. Responsive Design --- */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    .hero h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    
    .creed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .event-next {
        flex-direction: column;
    }
    .event-next-image {
        flex-basis: auto;
        height: 300px;
    }

    .impact-grid {
        grid-template-columns: 1fr;
    }
    
    .book-content {
        flex-direction: column;
    }
    .book-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
        margin-bottom: 2rem;
    }
    .book-details h3 {
        text-align: center;
    }
    .book-details {
        text-align: center;
    }
}

/* --- THIS IS THE MAIN MOBILE FIX --- */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    
    /* 1. Fix Nav */
    .nav-desktop {
        display: none; /* Hide desktop nav */
    }
    .nav-mobile-toggle {
        display: flex; /* Show hamburger */
    }
    
    /* 2. Fix Hero */
    .hero {
        height: 70vh;
        min-height: 400px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    
    /* 3. Fix Grids */
    .creed-grid {
        grid-template-columns: 1fr; /* Stack to 1 column */
    }
    
    .creed-item h4 {
        font-size: 1.3rem;
    }

    /* 4. Fix How It Works */
    .how-it-works-content {
        padding: 30px;
    }
    
    /* 5. Fix Event List */
    .event-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .event-list-date {
        margin-bottom: 15px;
        margin-right: 0;
    }
    .event-list-details h4 {
        font-size: 1.05rem;
    }

    /* 6. Fix Contact Form */
    .contact-form {
        padding: 30px;
    }
    
    /* 7. Fix Popup Content */
    .popup-content {
        padding: 20px;
    }
    .author-bio {
        font-size: 0.95rem;
    }

    /* 8. Fix Author Slider */
    .author-slider .slick-slide {
        padding: 0 10px;
    }
    .author-item img {
        width: 120px;
        height: 120px;
    }
}

