/* ==========================================================================
   1. RESET Y BASE MINIMALISTA
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   2. CABECERA PRINCIPAL (MARCA PERSONAL)
   ========================================================================== */
.main-header {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    width: 100%;
}

.main-header h1 {
    color: #000000;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
}

.main-header h1 a {
    color: inherit;
    text-decoration: none;
    outline: none;
}

.main-header h1 a:hover {
    color: #888888;
    transition: color 0.3s ease;
}

/* ==========================================================================
   3. ESTRUCTURA DE LOS CARRUSELES (INDEX) - ESCRITORIO
   ========================================================================== */
.carousel-container {
    position: relative;
    width: 100vw;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 10px 0;
    z-index: 10;
}

.carousel-track {
    display: flex;
    width: max-content;
    will-change: transform;
    gap: 0; /* Bloque continuo sin espacios */
}

/* --- TIRA SUPERIOR: FOTOS (Control de brillo al 10%) --- */
.row-photos .carousel-image {
    height: 33vh;       
    width: auto;        
    object-fit: cover;  
    cursor: pointer;
    display: block;
    filter: brightness(90%); /* Forzado al 10% de brillo por defecto */
    transition: filter 0.4s ease;
}

.row-photos .carousel-image:hover {
    filter: brightness(110%); /* Enciende la foto al pasar el cursor */
}

/* --- TIRA INFERIOR: VÍDEOS (Contenedor con Play flotante) --- */
.video-item-wrapper {
    position: relative;
    height: 33vh;
    width: auto;
    display: inline-block;
    cursor: pointer;
}

/* Mantenemos las miniaturas de vídeo al 85% para que no compitan con el 10% de arriba */
.video-item-wrapper .carousel-image {
    height: 33vh;
    width: auto;
    object-fit: cover;
    display: block;
    filter: brightness(85%); 
    transition: filter 0.3s ease;
}

.video-item-wrapper:hover .carousel-image {
    filter: brightness(105%);
}

/* Triángulo geométrico de "Play" flotante centrado */
.video-item-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%; /* Equilibrio visual del triángulo */
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid rgba(255, 255, 255, 0.8);
    z-index: 20;
    pointer-events: none;
    transition: border-left-color 0.3s ease;
}

.video-item-wrapper:hover::after {
    border-left-color: rgba(255, 255, 255, 1);
}

/* ==========================================================================
   4. INTERACCIONES DE ESCRITORIO (Zonas Hover Invisibles)
   ========================================================================== */
.row-hover-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25vw;
    z-index: 30;
    pointer-events: auto;
    cursor: pointer;
}
.zone-left { left: 0; }
.zone-right { right: 0; }

/* ==========================================================================
   5. NAVEGACIÓN INFERIOR (MENÚ MINIMALISTA)
   ========================================================================== */
.minimal-menu {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.menu-item {
    color: #888888;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    transition: color 0.3s ease;
}

.menu-item:hover {
    color: #000000;
}

.menu-separator {
    color: #e0e0e0;
    font-size: 10px;
}

/* ==========================================================================
   6. VISOR DE PROYECTOS (LIGHTBOX INTERACTIVO)
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.98);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active { display: flex; }

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img, .lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.lightbox.show-img #lightboxImg { display: block; }
.lightbox.show-vid #lightboxVid { display: block; }

.lightbox-btn, .close-btn {
    position: absolute;
    background: none; border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 40px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 1100;
}

.lightbox-btn:hover, .close-btn:hover { color: #ffffff; }
.prev { left: 30px; top: 50%; transform: translateY(-50%); }
.next { right: 30px; top: 50%; transform: translateY(-50%); }
.close-btn { top: 20px; right: 30px; font-size: 60px; }


/* ==========================================================================
   7. MÓVIL Y TABLET (Media Queries de Adaptación)
   ========================================================================== */
@media (max-width: 767px) {
    .main-header { top: 25px; }
    .main-header h1 { font-size: 11px; letter-spacing: 1.5px; }

    .carousel-container { padding: 5px 0; }
    
    .row-photos .carousel-image,
    .video-item-wrapper {
        height: 20vh;
        width: auto;
    }
    
    .video-item-wrapper .carousel-image {
        height: 20vh;
        width: auto;
    }

    .video-item-wrapper::after {
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 14px solid rgba(255, 255, 255, 0.85);
    }

    .row-hover-zone { display: none !important; }

    body { padding: 90px 24px 80px 24px; }
    .about-container, .contact-container { margin-bottom: 20px; }
    .language-block { margin-bottom: 35px; }
    .about-title, .contact-title { font-size: 13px; letter-spacing: 1.5px; margin-bottom: 8px; }
    .about-text, .contact-text { font-size: 11px; line-height: 1.8; letter-spacing: 1.2px; }

    .prev, .next { display: none !important; }
    .close-btn { top: 15px; right: 20px; font-size: 45px; }

    .minimal-menu { bottom: 25px; gap: 15px; }
    .menu-item { font-size: 11px; letter-spacing: 1.5px; }
}

/* ==========================================================================
   8. SECCIÓN DE PROYECTOS (GRID PARA SUBPÁGINAS)
   ========================================================================== */
.projects-grid-container {
    max-width: 1200px;
    margin: 120px auto 100px auto; /* Margen para no chocar con cabecera ni menú */
    padding: 0 40px;
    width: 100%;
    /* Permitimos el scroll vertical en estas páginas */
}

/* Forzar que el body permita scroll solo si no estamos en el index */
body:has(.projects-grid-container) {
    overflow-y: auto !important;
    display: block !important;
    height: auto !important;
}

.section-title {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 40px;
    color: #000000;
}

/* Rejilla de 3 columnas que se adapta sola */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.project-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background-color: #f7f7f7;
}

.project-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    filter: brightness(85%);
    transition: filter 0.4s ease, transform 0.4s ease;
}

/* Efecto elegante al pasar el ratón por encima del proyecto */
.project-item:hover .project-thumb {
    filter: brightness(105%);
    transform: scale(1.02);
}

.project-info {
    padding: 15px 0;
}

.project-info h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 5px;
}

.project-info p {
    font-size: 11px;
    color: #888888;
    letter-spacing: 0.5px;
}

/* Adaptación para pantallas móviles del Grid */
@media (max-width: 767px) {
    .projects-grid-container {
        margin: 90px auto 80px auto;
        padding: 0 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
        gap: 20px;
    }

    .project-thumb {
        height: 180px;
    }
}
