:root {
    --color-blue: #24418A;
    --color-yellow: #FEE249;
    --color-grey: #D1D3D4;
    --color-orange: #E37939;
    --color-white: #FFFFFF;
    --font-display: 'Oswald', sans-serif;
    /* Simulating Modi Thorson */
    --font-body: 'Roboto', sans-serif;
    /* Simulating Myriad Pro */
    --font-accent: 'Rajdhani', sans-serif;
    /* Sporty look */
}

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

body {
    font-family: var(--font-body);
    color: var(--color-white);
    background-color: #000;
    overflow-x: hidden;
    /* Allow scrolling on body if container isn't handling it, or for mobile fallback */
}

/* Scroll Snap Container */
.container {
    height: 100vh;
    height: 100dvh;
    /* Mobile fix */
    width: 100vw;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Common Section Styles */
section {
    height: 100vh;
    height: 100dvh;
    /* Mobile fix */
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 2rem;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(36, 65, 138, 0.6) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Typography */
h1,
h2 {
    font-family: var(--font-display);
    text-transform: uppercase;
    line-height: 1.1;
}

h3 {
    font-family: var(--font-accent);
    text-transform: uppercase;
    color: var(--color-yellow);
}

p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Specific Sections */

/* Slide 1: Hero */
#hero {
    background-image: url('../hero.png');
    background-size: cover;
    background-position: center;
}

#hero .logo-img {
    max-width: 90%;
    width: 720px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0px 0px 10px rgba(255, 255, 255, 0.2));
}

#hero .small-bottom {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--color-yellow);
}

/* Slide 2: Welcome & Academy */
#academy {
    background-color: var(--color-blue);
}

#academy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../cathedral.png');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    mix-blend-mode: luminosity;
}

/* Slide 3 & 4: Values & Teamwork */
#values {
    background-image: url('../hoop.png');
    background-size: cover;
    background-position: center;
}

#teamwork {
    background-image: url('../Escuderos equipo 4.jpg');
    background-size: cover;
    background-position: center;
}

#teamwork .overlay {
    background: linear-gradient(0deg, rgba(36, 65, 138, 0.9) 0%, rgba(36, 65, 138, 0.7) 100%);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--color-yellow);
    margin-bottom: 0.5rem;
}

.section-header h3 {
    font-size: 3rem;
    color: var(--color-white);
}

.text-block {
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-left: 4px solid var(--color-orange);
    backdrop-filter: blur(5px);
    margin-top: 2rem;
}

/* Slide 5: Professional Schedule */
#professional {
    background-color: #1a1a1a;
}

.schedule-table {
    width: 100%;
    max-width: 1000px;
    border-collapse: collapse;
    margin-top: 2rem;
    background: rgba(36, 65, 138, 0.1);
    border: 1px solid var(--color-blue);
}

.schedule-table th,
.schedule-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.schedule-table th {
    background-color: var(--color-blue);
    color: var(--color-white);
    font-family: var(--font-accent);
    text-transform: uppercase;
}

.schedule-table tr:hover {
    background-color: rgba(254, 226, 73, 0.1);
}

.nav-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--color-yellow);
    transform: scale(1.3);
}

/* Torneos Section */
#torneos {
    background-color: #0d0d0d;
}

.news-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    overflow-y: auto;
    max-height: 85vh;
}

.news-item {
    background: rgba(36, 65, 138, 0.2);
    border: 1px solid var(--color-blue);
    padding: 2rem;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateY(-5px);
    border-color: var(--color-yellow);
}

.news-date {
    color: var(--color-yellow);
    font-weight: bold;
    font-family: var(--font-accent);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.news-item h4 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-white);
    text-transform: uppercase;
}

.news-item p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
    color: #e0e0e0;
}

/* Enhanced Gallery Carousel */
.news-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    /* Bottom padding for scrollbar/shadow */
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--color-blue) rgba(255, 255, 255, 0.1);
}

.news-gallery::-webkit-scrollbar {
    height: 8px;
}

.news-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.news-gallery::-webkit-scrollbar-thumb {
    background-color: var(--color-blue);
    border-radius: 4px;
}

.news-gallery img {
    height: 200px;
    width: auto;
    /* Maintain aspect ratio */
    min-width: 150px;
    /* Ensure tiny images aren't too small */
    object-fit: cover;
    border-radius: 8px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.news-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--color-yellow);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    /* Gold glow */
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--color-yellow);
    text-decoration: none;
    cursor: pointer;
}

.lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--color-yellow);
}

/* Footer inside section */
footer {
    width: 100%;
    background-color: #000;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-grey);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 10;
}

footer a {
    color: var(--color-yellow);
    text-decoration: none;
}

/* Header Navigation */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 2rem;
    /* Reduced vertical padding */
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}

.logo-wrapper img {
    height: 70px;
    /* Adjust size as needed */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.logo-wrapper img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-white);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-transform: uppercase;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--color-yellow);
}

/* Sede Title Enhancement */
.sede-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-transform: uppercase;
    color: var(--color-white);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 0px var(--color-blue);
}

@media (max-width: 768px) {
    h1 {
        font-size: 4rem !important;
    }

    /* Fix Schedule & Table on Mobile */
    #professional {
        overflow-y: auto;
        /* Allow scrolling within the section if content overflows */
        padding-bottom: 2rem;
        /* Adjusted since footer will be relative */
        display: block;
        /* Switch to block to let content flow naturally including footer */
    }

    #professional .content {
        height: auto;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-bottom: 60px;
        /* Space for footer */
    }

    #professional footer {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: auto;
        /* Push to bottom if flex */
        width: 100%;
        background-color: transparent;
        /* Or keep black if desired, but blend with section */
    }

    .schedule-table {
        font-size: 0.8rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem;
    }

    /* Make table scrollable on mobile if needed */
    .table-container {
        overflow-x: auto;
        width: 100%;
        max-width: 95vw;
        margin-bottom: 2rem;
    }

    #hero .logo-img {
        width: 90%;
    }

    /* Torneos Mobile Fixes */
    #torneos {
        height: auto !important;
        /* Allow growing */
        min-height: 100dvh;
        overflow-y: visible;
        padding-top: 100px;
    }

    .news-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        max-height: none;
        /* Remove nested scroll constraint */
        overflow-y: visible;
        padding: 1rem;
    }

    /* Disable scroll snap on mobile if needed for better flow */
    .container {
        scroll-snap-type: none;
        height: auto;
        overflow-y: auto;
    }

    section {
        height: auto;
        min-height: 100dvh;
        /* At least full screen */
        scroll-snap-align: none;
    }
}