/* Reset y Variables */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --font-main: 'Montserrat', sans-serif;
    --input-bg: #111111; 
    --input-border: #333333; 
    --btn-blue: #254685; 
    --btn-blue-hover: #1d3666;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-weight: 300;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Títulos y Encabezados Globales */
h1, h2, h3 {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

p {
    font-weight: 400;
    line-height: 1.8;
}

/* HEADER GENERAL */
header {
    background: linear-gradient(to bottom, #141414, #000000);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo-container { margin-left: 20px; z-index: 1001; } 
.logo-container img {
    height: 70px;
    width: auto;
    display: block;
    max-width: 250px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Navegación Desktop */
.desktop-nav {
    flex: 2;
    display: flex;
    justify-content: center;
    margin: 0 40px;
}

.desktop-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    width: 100%;
    max-width: 800px;
    justify-content: space-between;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 300; 
    text-transform: none;
    letter-spacing: 0.5px;
    text-shadow: 0px 2px 5px rgba(0,0,0,0.9);
    transition: color 0.3s, opacity 0.3s;
}

.desktop-nav a:hover { color: #fff; opacity: 0.8; }

/* Redes Sociales Desktop */
.desktop-social {
    display: flex;
    gap: 25px;
    align-items: center;
}

.header-social a {
    color: white; font-size: 1.1rem;
    transition: transform 0.3s, color 0.3s;
    text-shadow: 0px 2px 5px rgba(0,0,0,0.9);
}
.header-social a:hover { color: #ccc; transform: scale(1.1); }

/* MENÚ MÓVIL */
.menu-toggle {
    display: none; 
    cursor: pointer;
    z-index: 1002;
    flex-direction: column;
    gap: 6px; 
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px; 
    height: 2px; 
    background-color: white;
}

.mobile-menu-overlay {
    display: none; 
    position: fixed;
    top: 0;
    right: 0; 
    width: 100%; 
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.mobile-menu-overlay.active { display: flex; }

.mobile-menu-overlay ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-menu-overlay a {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: 600; 
    text-transform: uppercase;
}

.mobile-social {
    margin-top: 40px;
    display: flex;
    gap: 30px;
}

.mobile-social a { font-size: 1.8rem; }

/* HEADER TRANSPARENT MODE */
body.transparent-mode header {
    background: linear-gradient(to bottom, rgba(58, 58, 58, 0) 60%, rgba(58, 58, 58, 0.2) 100%) !important;
    padding-top: 30px;
    padding-bottom: 30px; 
}
body.transparent-mode main { margin-top: 0 !important; }
body.transparent-mode .project-hero,
body.transparent-mode .about-banner,
body.transparent-mode .projects-menu { padding-top: 100px; }

/* CARRUSEL HOME */
.carousel-container {
    position: relative; 
    width: 95%; 
    max-width: 1800px; 
    margin: 0 auto; 
    height: 85vh; 
    overflow: hidden; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background-color: #000; 
}

.carousel-slide { width: 100%; height: 100%; object-fit: cover; display: none; }
.carousel-slide.active { display: block !important; }

.prev, .next {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px;
    margin-top: -22px; color: white; font-weight: 900; font-size: 24px;
    background-color: rgba(0,0,0,0.3); border-radius: 3px; z-index: 10;
}
.next { right: 0; } .prev { left: 0; }

/* FOOTER */
footer {
    background-color: white;
    padding: 40px 20px;
    text-align: center;
}
footer .social-icons-footer a { color: black; font-size: 1.5rem; margin: 0 15px; }

/* PROYECTOS MENU */
.projects-menu {
    height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    background-size: cover; background-position: center;
    background-image: url('../img/proyectos/general/fondoProy.jpg');
    text-align: center;
    transition: background-image 0.5s ease-in-out;
}
.project-link {
    font-family: var(--font-main); font-weight: 900; font-size: 3.5rem; 
    margin: 15px 0; cursor: pointer; color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8); text-decoration: none;
    transition: transform 0.3s, letter-spacing 0.3s, opacity 0.3s;
}
.project-link-dark { font-weight: 300 !important; color: #000000 !important; text-shadow: none !important; }
.project-link:hover { transform: scale(1.05); letter-spacing: 5px; opacity: 1 !important; }

/* HERO TEXTOS */
.project-hero { background-attachment: scroll; }
.hero-text {
    position: relative; z-index: 2; text-align: left; 
    width: 90%; max-width: 1400px; padding: 20px; margin-top: 50px;
}
.hero-text h1 { font-size: 2.5rem; font-weight: 600; margin-bottom: 20px; text-transform: uppercase; }
.hero-text p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 10px; color: #ddd; }

/* ACERCA DE MI */
.about-banner {
    position: relative; width: 100%; min-height: 100vh; 
    background-image: url('../img/acerca/bannerAcerca.jpg');
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
}
.about-banner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6);
}
.about-text {
    position: relative; z-index: 2; text-align: left;
    width: 90%; max-width: 1400px; padding: 40px; color: white; margin-top: 60px; 
}
.profile-photo-section { padding: 50px 0; text-align: center; background-color: #000; }
.profile-photo-section img { max-width: 400px; border-radius: 5px; box-shadow: 0 4px 15px rgba(255,255,255,0.1); }

/* FONDO BLANCO GENERAL */
.project-white-area {
    background-color: #ffffff;
    width: 100%;
    padding: 60px 20px; 
    display: flex; flex-direction: column; align-items: center;
    min-height: 60vh;
}
.project-nav-thin {
    width: 100%; max-width: 900px; display: flex; justify-content: space-between;
    margin-top: 40px; padding: 0 20px;
}
.project-nav-thin a {
    text-decoration: none; color: #000000; font-family: var(--font-main);
    font-weight: 300; font-size: 1.2rem; text-transform: uppercase; transition: opacity 0.3s;
}
.project-nav-thin a:hover { opacity: 0.6; }

/* LIGHTBOX (Base Desktop) */
.lightbox {
    display: none; position: fixed; z-index: 5000; 
    padding-top: 50px; left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0, 0, 0, 0.95);
}
.lightbox-content {
    margin: auto; display: block; width: auto; height: auto;
    max-width: 90%; max-height: 85vh; object-fit: contain; 
}
.close-lightbox {
    position: absolute; top: 20px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; cursor: pointer; z-index: 5001;
}
.lightbox-prev, .lightbox-next {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px;
    margin-top: -50px; color: white; font-weight: bold; font-size: 40px;
    user-select: none; z-index: 5001;
}
.lightbox-next { right: 20px; } .lightbox-prev { left: 20px; }

/* OTROS ELEMENTOS */
.cursos-section h1, .video-section h1 { font-weight: 900; }
.video-section, .cursos-section { padding-bottom: 200px; }
.video-card { border: 1px solid #333; }
.contact-section { padding: 50px 20px; max-width: 800px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 25px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 15px; background-color: var(--input-bg);
    border: 1px solid var(--input-border); color: #fff;
    font-family: var(--font-main); font-size: 1rem; border-radius: 6px;
}
.btn-submit {
    width: 100%; padding: 18px 20px; background-color: var(--btn-blue);
    color: #fff; border: none; font-weight: 900; text-transform: uppercase;
    cursor: pointer; font-size: 1.1rem; border-radius: 6px;
}
main { margin-top: 100px; min-height: 90vh; }

/* RESPONSIVE HEADERS */
@media screen and (max-width: 1024px) {
    header { padding: 15px 20px; }
    nav ul { gap: 20px; max-width: 100%; } 
    .logo-container img { height: 50px; }
}
@media screen and (max-width: 768px) {
    header { padding: 20px; height: auto; }
    body.transparent-mode header { 
        background: linear-gradient(to bottom, rgba(58, 58, 58, 0) 60%, rgba(58, 58, 58, 0.2) 100%) !important;
    }
    body.transparent-mode main { margin-top: 0; }
    .desktop-nav, .desktop-social { display: none; }
    .menu-toggle { display: flex; }
    .carousel-container:not(.project-carousel-frame) { height: 75vh; width: auto; margin: 20px; }
    .project-hero, .about-banner { height: auto !important; min-height: 60vh; padding-bottom: 60px; align-items: flex-end; }
    .hero-text, .about-text { margin-top: 100px; width: 100%; max-width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
    .project-link { font-size: 2rem; margin: 25px 0; }
}

/* GALERÍA SCROLL */
.scroll-gallery-container {
    display: flex; flex-direction: column; width: 100%;
    max-width: 1200px; margin: 0 auto; padding: 20px 0; gap: 60px; 
}
.gallery-item {
    display: block; max-width: 80%; height: auto; cursor: zoom-in;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); opacity: 0;
    transform: translateY(100px) scale(0.98); 
    transition: opacity 1s ease-out, transform 1s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}
.gallery-item.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.align-center { margin-left: auto; margin-right: auto; }
.align-left { margin-right: auto; margin-left: 10%; }
.align-right { margin-left: auto; margin-right: 10%; }
.gallery-item.is-portrait { max-width: 45%; }
.gallery-item.is-landscape { max-width: 85%; }
@media screen and (max-width: 768px) {
    .scroll-gallery-container { gap: 40px; }
    .align-left, .align-right, .align-center { margin-left: auto; margin-right: auto; }
    .gallery-item.is-landscape { max-width: 95%; }
    .gallery-item.is-portrait { max-width: 70%; }
}

/* BOTÓN VOLVER ARRIBA */
#backToTop {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background-color: rgba(0, 0, 0, 0.4); color: white; border: none;
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 3000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, background-color 0.3s ease, transform 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
#backToTop.show { opacity: 1; visibility: visible; }
#backToTop:hover { background-color: rgba(0, 0, 0, 0.8); transform: translateY(-3px); }

/* AUTO-PLAY MENU MÓVIL */
@media screen and (max-width: 768px) {
    .projects-menu { height: 100vh !important; justify-content: center; padding-top: 0; padding-bottom: 0; }
    .project-link {
        font-size: 1.5rem; margin: 25px 0; opacity: 0.4; 
        transition: opacity 0.5s ease, transform 0.5s ease; 
        position: relative; display: inline-block; pointer-events: auto; 
    }
    .project-link.active-project {
        opacity: 1 !important; transform: scale(1.15);
        text-shadow: 0 0 15px rgba(255,255,255,0.6);
    }
    .project-link.active-project::before {
        content: ''; position: absolute; left: -20px; top: 50%;
        transform: translateY(-50%); width: 10px; height: 10px;
        background-color: #fff; border-radius: 50%;
        box-shadow: 0 0 12px rgba(255, 255, 255, 1); 
        animation: pulseDot 2s infinite;
    }
}
@keyframes pulseDot {
    0% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.3); opacity: 0.7; }
    100% { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* =========================================================
   ESTILOS LIGHTBOX MÓVIL (GALERÍA NATIVA / SNAP / ZOOM)
   ========================================================= */
.mobile-snap-wrapper {
    display: none; 
}

@media screen and (max-width: 768px) {
    .lightbox-prev, .lightbox-next, .close-lightbox, #lightbox-img { 
        display: none !important; 
    }
    
    .lightbox {
        padding: 0 !important;
        background-color: #000 !important; 
        align-items: flex-start !important; 
    }

    .mobile-snap-wrapper {
        display: flex;
        width: 100%;
        height: 100%;
        overflow-x: scroll; 
        overflow-y: hidden;
        scroll-snap-type: x mandatory; 
        scroll-snap-stop: always; 
        -webkit-overflow-scrolling: touch; 
        scroll-behavior: smooth; 
    }

    .mobile-snap-item {
        flex: 0 0 100%; 
        width: 100vw;
        height: 100vh;
        scroll-snap-align: center; 
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden; /* Importante para el zoom */
    }

    .mobile-snap-item img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain; 
        user-select: none;
        transform-origin: center center;
        /* Transición suave para el doble tap */
        transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}