/* --- Universal Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Light Theme Variables --- */
:root {
    --background-color: #f4f4f4;
    --text-color: #212121;
    --primary-gold: #c5a553;
    --header-font: 'Teko', sans-serif;
    --body-font: 'Roboto', sans-serif;
}

/* --- Sticky Footer & Page Structure --- */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--body-font);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    display: flex; /* New */
    flex-direction: column; /* New */
    min-height: 100vh; /* New */
}

.site-wrapper {
    display: flex;
    flex-grow: 1; /* New: Makes content area grow to fill empty space */
}

.main-content {
    margin-left: 240px;
    padding: 2rem;
}

/* --- Desktop Navigation --- */
.side-nav {
    width: 240px;
    background-color: var(--background-color);
    border-right: 1px solid var(--primary-gold);
    min-height: 100vh;
    padding: 1.5rem;
    position: fixed;
    z-index: 1000;
}

.side-nav .logo-text {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-gold);
    font-family: var(--header-font);
}

.side-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.side-nav ul li a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s, color 0.2s;
}

.side-nav ul li a:hover {
    background-color: var(--primary-gold);
    color: #fff;
}

/* --- Hamburger Menu (Hidden on Desktop) --- */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* --- Footer --- */
footer {
    padding: 1rem;
    text-align: center;
}

.theme-switcher button {
    background-color: #fff;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 5px;
}

.theme-switcher button:hover {
    background-color: var(--primary-gold);
    color: #fff;
}

/* ==========================================================================
   Squad Card Styles
   ========================================================================== */

.squads-container {
    margin-top: 2rem;
}

.squad-card {
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden; /* Ensures the image corners are rounded */
    background-color: var(--background-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.squad-card img {
    width: 25%;
    height: auto;
    display: block;
    border-bottom: 1px solid var(--primary-gold);
}

.squad-card .squad-info {
    padding: 1.5rem;
}

.squad-card h3 {
    margin-top: 0;
    color: var(--primary-gold);
    font-family: var(--header-font);
    font-size: 2rem;
}

/* ==========================================================================
   Staff Profile Styles
   ========================================================================== */

.staff-container {
    margin-top: 2rem;
}

.staff-member {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    background-color: var(--background-color);
}

.staff-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Makes the photo circular */
    object-fit: cover; /* Prevents the image from being stretched */
    margin-right: 1.5rem;
    border: 2px solid var(--primary-gold);
}

.staff-details h3 {
    margin: 0 0 0.25rem 0;
    font-family: var(--header-font);
    font-size: 2rem;
    color: var(--primary-gold);
}

.staff-details h4 {
    margin: 0 0 1rem 0;
    font-family: var(--body-font);
    font-weight: normal;
    font-style: italic;
}

/* On smaller screens, stack the image on top of the text */
@media (max-width: 768px) {
    .staff-member {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .staff-photo {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}


/* ==========================================================================
   Preloader Styles
   ========================================================================== */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.9); /* The dim overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensures it's on top of everything */
    transition: opacity 0.75s ease, visibility 0.75s ease; /* For the fade-out effect */
}

.preloader-logo {
    max-width: 200px; /* Adjust size as needed */
    /* This animation makes the logo start dark and become light over 5 seconds */
    animation: revealLogo 5s ease-in-out forwards;
}

/* This is the animation definition */
@keyframes revealLogo {
    0% {
        filter: brightness(0);
        transform: scale(0.95);
    }
    100% {
        filter: brightness(1);
        transform: scale(1);
    }
}

/* This class will be added by JavaScript to hide the preloader */
.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================================================
   Custom Cursor Styles
   ========================================================================== */

/* Hide the default system cursor */
body, a, button {
    cursor: none;
}

.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    z-index: 10001; /* Now higher than the modal's z-index */
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #121212; /* Black dot for light theme */
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-gold);
    transition: transform 0.2s ease-out; /* Creates a slight trailing effect */
}

/* Change dot color for dark theme */
body.dark-mode .cursor-dot {
    background-color: #e0e0e0; /* White dot for dark theme */
}

/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */
.admin-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--primary-gold);
}
.admin-table th {
    font-family: var(--header-font);
    font-size: 1.2rem;
}

/* ==========================================================================
   Article Drag-to-Scroll Carousel Styles
========================================================================== */

.articles-container {
    display: flex;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden;
    padding-bottom: 20px;
    cursor: grab; /* Show a "grab" hand cursor */
    -webkit-overflow-scrolling: touch;
    /* Hide the default scrollbar */
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none;  /* For Internet Explorer and Edge */
}
.articles-container::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}

/* Change cursor to "grabbing" when user is actively dragging */
.articles-container.active {
    cursor: grabbing;
}

.article-card {
    flex: 0 0 350px; /* Set a fixed width for each card */
    margin-right: 1.5rem;
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--background-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    user-select: none; /* Prevents text selection while dragging */
}

.article-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.article-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-card-content h2 {
    margin-top: 0;
    font-family: var(--header-font);
    font-size: 1.5rem;
    color: var(--primary-gold);
}

.article-meta {
    font-style: italic;
    opacity: 0.8;
    margin-top: -0.75rem;
    font-size: 0.8rem;
}

.article-excerpt {
    flex-grow: 1;
    font-size: 0.9rem;
}

.read-more-btn {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--primary-gold);
    color: #121212;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 1rem;
    transition: transform 0.2s ease;
}

.read-more-btn:hover {
    transform: scale(1.05);
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background-color);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.modal-body {
    padding: 2rem;
}

#modal-title {
    margin-top: 0;
    font-family: var(--header-font);
    font-size: 2.5rem;
    color: var(--primary-gold);
}

/* ==========================================================================
   Single Article Page Styles
   ========================================================================== */

.article-full-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.article-full-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.article-full-content p {
    line-height: 1.7;
    font-size: 1.1rem;
}

#modal-view-page-btn {
    margin-top: 1.5rem;
}

/* ==========================================================================
   MOBILE STYLES - This block MUST be at the end of the file
   ========================================================================== */
@media (max-width: 992px) {
    /* New: Stack the main content below the top nav bar */
    .site-wrapper {
        flex-direction: column;
    }

    .side-nav {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--primary-gold);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: block;
    }

    .side-nav .nav-links {
        display: none;
        width: 100%;
        margin-top: 10px;
        border-top: 1px solid var(--primary-gold);
    }

    .side-nav .nav-links.active {
        display: block;
    }

    .side-nav .nav-links li a {
        text-align: center;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .hamburger-btn.active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-btn.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-btn.active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}