/* Color Variables for easy theme management */
:root {
    --bg-dark: #000000;
    --bg-surface: #1e1e1e; /* Used for solid elements like header/footer */
    --panel-bg: rgba(30, 30, 30, 0.75); /* Translucent background for panels */
    --accent-red: #d32f2f;
    --accent-red-hover: #b71c1c;
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    --accent-border: #333; 
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Black fading to dark red, fixed to the viewport */
    background: linear-gradient(to bottom, #000000 0%, #2e0000 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
}


/* --- Top Banner --- */
.banner {
    width: 100%;
    min-height: 250px; 
    /* REMEMBER TO CHANGE 'YOUR-IMAGE-NAME.jpg' TO YOUR ACTUAL BACKGROUND IMAGE PATH */
    background: linear-gradient(rgba(18, 18, 18, 0.5), rgba(18, 18, 18, 0.5)), url('images/header.jpg') center/cover no-repeat;
    display: flex;
    border-bottom: 3px solid var(--accent-red);
    align-items: center;
}

/* Inner container keeps things aligned and prevents stretching on ultrawide monitors */
.banner-content {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between; /* Pushes logo left, text right */
    align-items: center;
}

.logo {
    max-height: 170px; /* Slightly larger to balance the big text */
}

/* Header Text Styling */
.header-text {
    text-align: left;
}

.header-subtitle {
    font-family: 'Xirod', sans-serif; /* Uses your cinematic custom font */
    font-size: 1.0rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    font-weight: 200;
    margin-bottom: 5px;
    padding-left: 20px;
}

.header-title {
    font-family: 'Xirod', sans-serif; /* Uses your cinematic custom font */
    font-size: 2.5rem; /* Much larger font */
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    line-height: 1;
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.9); /* Heavy drop shadow to pop against the background image */
    padding-left: 20px;
}


/* --- Sticky Main Menu --- */
.main-menu {
    background-color: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: padding 0.3s ease;
}

.main-menu.scrolled {
    padding: 5px 0;
}

.main-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.main-menu li {
    margin: 0 20px;
}

.main-menu a {
    font-family: 'Xirod', sans-serif;
    font-size: 10pt;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.main-menu a:hover {
    color: var(--accent-red);
}

/* --- Main Content Layout --- */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-section {
    padding: 60px 0;
    border-bottom: 1px solid var(--accent-border);
}

.content-section:last-of-type {
    border-bottom: none;
}

.content-section h2 {
    color: var(--text-main);
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-transform: uppercase;
}

.content-section h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #ffffff;
}

/* Split Content (What We Do / Who We Are) */
.split-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.split-content.reverse {
    flex-direction: row-reverse;
}

.split-content .text, 
.split-content .image {
    flex: 1;
}

.split-content img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 4px solid var(--accent-red);
}

/* Grid Content (Latest Section) */
.grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--panel-bg);
    backdrop-filter: blur(6px); /* Creates the frosted glass effect */
    -webkit-backdrop-filter: blur(6px); /* Safari support */
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--accent-border);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-red);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid var(--accent-red);
}

.card h3 {
    padding: 20px 20px 10px;
}

.card p {
    padding: 0 20px 25px;
    color: var(--text-muted);
}

/* =========================================
   Join Page Specific Styles
   ========================================= */
/* Main Content Container for the Join Page */
.page-content {
    max-width: 1000px; /* Restricts the width so it doesn't stretch infinitely */
    margin: 40px auto; /* The 'auto' pushes it to the center, creating the side margins */
    padding: 0 20px;   /* Adds breathing room on the inside edges for mobile screens */
}

/* Introduction */
.intro-section {
    text-align: center;
    margin-bottom: 50px;
}

.intro-section h1 {
    font-size: 3rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--accent-border);
    padding-bottom: 10px;
    display: inline-block;
}

.intro-section p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Card Layout for Join Steps */
.step-section {
    background-color: var(--panel-bg);
    backdrop-filter: blur(6px); /* Creates the frosted glass effect */
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--accent-border);
    border-left: 4px solid var(--accent-red);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.step-section h2 {
    color: var(--text-main);
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.step-section ul {
    margin: 15px 0 15px 40px;
    color: var(--text-muted);
}

.step-section p {
    margin-bottom: 15px;
}

.step-section a {
    color: var(--accent-red);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-red);
}

/* Image Gallery Grid (Application Example) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-grid figure {
    background-color: var(--bg-dark);
    border: 1px solid var(--accent-border);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid figure:hover {
    transform: translateY(-5px);
    border-color: var(--accent-red);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
}

.gallery-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.gallery-grid figcaption {
    text-align: center;
    padding: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-top: 1px solid var(--accent-border);
}

/* Call to Action Button */
.cta-section {
    text-align: center;
    margin: 60px 0;
}

.apply-btn {
    display: inline-block;
    background-color: var(--accent-red);
    color: #fff;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(211, 47, 47, 0.2);
}

.apply-btn:hover {
    background-color: var(--accent-red-hover);
    box-shadow: 0 0 25px rgba(183, 28, 28, 0.6);
    transform: scale(1.05);
    color: #fff;
}

/* --- Footer --- */
footer {
    background-color: var(--bg-surface); /* Kept solid so the bottom edge grounds the site */
    text-align: center;
    padding: 40px 20px;
    border-top: 4px solid var(--accent-red);
    color: var(--text-muted);
}

/* =========================================
   Custom Fonts & Header Effects
   ========================================= */

/* =========================================
   Custom Fonts & Header Effects
   ========================================= */

/* =========================================
   Custom Fonts & Aurebesh Effects
   ========================================= */

@font-face {
    font-family: 'Ailerons';
    src: url('Ailerons-Regular.otf') format('opentype');
}

@font-face {
    font-family: 'Aurebesh';
    src: url('Aurebesh.otf') format('opentype');
}

@font-face {
    font-family: 'Xirod';
    src: url('Xirod.otf') format('opentype');
}

/* Base style for ANY heading using the aurebesh attribute */
[aurebesh] {
    font-family: 'Xirod', sans-serif;
        font-size: 1.5rem !important;
    position: relative;
    z-index: 2; /* Main text in front */
    border: none !important; /* Kills the 1px line */
    border-bottom: none !important;
    padding-bottom: 0;
    letter-spacing: 3px;
    color: var(--text-main);
}

/* The Aurebesh Background Layer */
[aurebesh]::before {
    content: attr(aurebesh); /* Pulls from your new aurebesh="Text" attribute */
    font-family: 'Aurebesh', sans-serif;
    position: absolute;
    top: 50%;
    color: var(--text-muted);
    opacity: 0.1;
    z-index: -1; /* Pushes it directly behind the Ailerons text */
    font-size: 1.1em; /* 60% larger than main text */
    letter-spacing: 5px;
    white-space: nowrap;
    pointer-events: none;
}

/* Modifier: Centered Alignment */
.aurebesh-center {
    text-align: center;
    width: 100%;
}
.aurebesh-center::before {
    left: 50%;
    transform: translate(-50%, -30%);
}

/* Modifier: Left Alignment */
.aurebesh-left {
    text-align: left;
}
.aurebesh-left::before {
    left: 0;
    transform: translate(2%, -30%);
}

/* =========================================
   Members Page Grid Layouts
   ========================================= */

/* 2-Column Grid for Temple Command (2x2) */
.team-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    
    /* FIX: Adds left/right margins and stops it from stretching too wide */
    max-width: 1000px; 
    margin: 40px auto; 
    padding: 0 20px; 
}

/* 3-Column Grid for General Members (3x3) */
.team-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    
    /* FIX: Adds left/right margins and stops it from stretching too wide */
    max-width: 1200px; /* Slightly wider than the 2-column to fit 3 cards nicely */
    margin: 40px auto; 
    padding: 0 20px; 
}

/* Individual Member Cards */
.team-card {
    background-color: var(--panel-bg, rgba(30, 30, 30, 0.75));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--accent-border, #333);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-red, #d32f2f);
}

/* FIX: Image Aspect Ratio */
.team-card img {
    width: 100%;
    height: auto; /* Lets the image load in its natural aspect ratio! */
    border-bottom: 2px solid var(--accent-red, #d32f2f);
    display: block;
}

/* =========================================
   Image Gallery & Lightbox Styles
   ========================================= */

/* Dynamic Grid Layout */
.photo-gallery {
    display: grid;
    /* This auto-fits as many 250px wide images as possible into the row! */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Uniform Image Sizing & Hover Effects */
.gallery-image {
    width: 100%;
    height: 250px; /* Forces all images to be the exact same height */
    object-fit: cover; /* Crops the image proportionally to fill the box without stretching */
    border-radius: 8px;
    border: 1px solid var(--accent-border, #333);
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.03); /* A subtle pop-out zoom effect */
    border-color: var(--accent-red, #d32f2f);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
}

/* Lightbox Modal Overlay */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Ensures it sits on top of your sticky header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* 90% solid black overlay */
    align-items: center;
    justify-content: center;
    cursor: pointer; /* Clicking anywhere closes the modal */
}

/* The Enlarged Image Inside the Lightbox */
.lightbox-content {
    max-width: 90%;
    max-height: 90vh; /* Prevents extremely tall images from going off-screen */
    border: 2px solid var(--accent-red, #d32f2f);
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

/* The 'X' Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--text-main, #e0e0e0);
    font-size: 40px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--accent-red, #d32f2f);
}

/* Quick pop-in animation for the lightbox */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================
   Contact Page Styles
   ========================================= */

/* Flexbox layout for the contact cards */
.contact-flex {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.icon-logo {
    font-size: 4rem;
    flex-shrink: 0;
    margin-top: 10px;
}

.contact-info {
    flex-grow: 1;
}

/* Form Styling */
.custom-contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
}

.custom-contact-form input, 
.custom-contact-form textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-dark); /* Blends perfectly into the page background */
    border: 1px solid var(--accent-border); 
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Glowing red border when typing */
.custom-contact-form input:focus, 
.custom-contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.3);
}

.custom-contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* Status Alert Messages */
.status-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-weight: 500;
}

.status-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
}

.status-message.error {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

/* =========================================
   Button Unification (Fixes <button> vs <a>)
   ========================================= */

/* Strips default browser styling off form buttons so they match links */
button.apply-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    /* Ensure the button doesn't stretch full width unless we want it to */
    display: inline-block; 
}

/* A slightly scaled-down modifier for cards/forms so they aren't massive */
.apply-btn.contact-btn {
    font-size: 1.1rem;
    padding: 12px 25px;
    margin-top: 15px;
}

/* Prevent card link styles from hijacking our button styles */
.step-section a.apply-btn {
    color: #ffffff !important; 
    border-bottom: none !important; 
}

.step-section a.apply-btn:hover {
    color: #ffffff !important;
}

/* =========================================
   Full Article Layout Styles
   ========================================= */

/* =========================================
   Universal WordPress Gallery Fix (article.php)
   ========================================= */

/* Targets BOTH Gutenberg Galleries and Classic Editor Galleries */
.article-content .wp-block-gallery,
.article-content .gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 15px !important;
    margin: 30px 0 !important;
    padding: 0 !important;
}

/* Forces exactly 3 columns if WP asks for it */
.article-content .wp-block-gallery.columns-3,
.article-content .gallery.gallery-columns-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Cleans up the invisible wrappers WP puts around images */
.article-content .wp-block-gallery .wp-block-image,
.article-content .gallery .gallery-item {
    margin: 0 !important;
    width: 100% !important;
    float: none !important; /* Stops classic WP from doing weird floating layouts */
}

/* =========================================
   Standalone Article Images
   ========================================= */
.article-content img {
    display: block;
    margin: 20px auto; /* Centers the image perfectly and gives it breathing room */
    max-width: 90%; /* Prevents the image from stretching to the very edges of the text */
    max-height: 550px; /* Stops vertical photos from taking up the entire screen */
    width: 700px;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--accent-border, #333);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Adds a subtle dark shadow */
}


/* Forces the images to be uniform, sleek, and match the dark theme */
.article-content .wp-block-gallery .wp-block-image img,
.article-content .gallery .gallery-icon img {
    width: 100% !important;
    height: 250px !important; /* Locks them all to the exact same height */
    object-fit: cover !important; /* Crops cleanly like a picture frame */
    border-radius: 4px;
    border: 1px solid var(--accent-border, #333);
    margin: 0 !important;
}

/* Hide the ugly default caption text on classic galleries if it breaks the layout */
.article-content .gallery .wp-caption-text,
.article-content .gallery .gallery-caption {
    display: none !important;
}

.article-content { max-width: 750px; }

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .article-content .wp-block-gallery.columns-3,
    .article-content .gallery.gallery-columns-3 {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 columns on tablets */
    }

    .banner-content {
        flex-direction: column; /* Stacks the logo and text on phones */
        justify-content: center;
        gap: 20px;
    }
    
    .header-text {
        text-align: center; /* Centers the text under the logo on phones */
    }
    
    .header-title {
        font-size: 2.5rem; /* Scales the massive text down so it fits mobile screens */
    }

    .contact-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .contact-flex .icon-logo {
        margin-top: 0;
    }

    /* Recenter the Aurebesh text on mobile */
    .contact-flex .aurebesh-left {
        text-align: center;
    }
    .contact-flex .aurebesh-left::before {
        left: 50%;
        transform: translate(-50%, -50%);
    }


    .team-grid-2,
    .team-grid-3 {
        grid-template-columns: 1fr; /* Stacks everything into a single column on phones */
    }


    .split-content, 
    .split-content.reverse {
        flex-direction: column;
    }
    
    .main-menu ul {
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
    }
    
    .main-menu li {
        margin: 10px 0;
    }
}


@media (max-width: 480px) {
    .article-content .wp-block-gallery,
    .article-content .wp-block-gallery.columns-3,
    .article-content .gallery,
    .article-content .gallery.gallery-columns-3 {
        grid-template-columns: 1fr !important; /* Stacks to 1 column on phones */
    }
}