/* FUENTES */
/* ROBOTO CONDENSED - Fuente principal para títulos */
/* src apuntaba a una ruta absoluta de otra máquina (rota); ahora usa la ruta relativa real del proyecto */
@font-face {
    font-family: "Europa";
    src: url("../../fonts/ShEuropaMedium-Normal.otf");
    font-display: swap;
    font-style: normal;
    font-weight: 400 500 600 700;
}

/* Inter Font */
@font-face { 
    font-family: "Inter"; 
    src: url("https://framerusercontent.com/assets/GrgcKwrN6d3Uz8EwcLHZxwEfC4.woff2"); 
    font-display: swap; 
    font-style: normal; 
    font-weight: 400; 
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 
}

/* Estilos específicos para páginas de proyecto */
body {
    background-color: #000;
    color: #fff;
    font-family: "Inter", sans-serif;
}

.project-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 60px;
    background-color: #000;
}

.project-hero {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 60px;
    border-radius: 8px;
    background-color: #1a1a1a;
}

.project-hero h1 {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 88px;
    font-weight: 500;
    letter-spacing: -2px;
    line-height: 100%;
    color: #fff;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 3;
}

.project-hero .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: 8px;
}

.project-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 2;
    border-radius: 8px;
}

.project-info-section {
    display: flex;
    gap: 60px;
    margin-bottom: 60px;
}

.project-description {
    flex: 2;
}

.project-details {
    flex: 1;
}

.project-info-section h2 {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.project-info-section p {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #fff;
    line-height: 120%;
    margin-bottom: 20px;
}

.project-deliverable {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
}

.project-deliverable h4 {
    font-family: "Roboto Condensed", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    color: #000;
    padding: 8px 16px;
    border-radius: 3px;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 60px;
}

.project-image-large {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.project-images-row {
    display: flex;
    gap: 20px;
}

/* Layout para 3 videos horizontales */
.project-videos-row {
    display: flex;
    gap: 10px; /* Reducir gap para que esté más cerca como las fotos */
    margin: 40px 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Videos verticales */
.project-video-third {
    flex: 1;
    aspect-ratio: 9/16; /* Formato vertical para videos 1080x1920 */
    background: transparent; /* Sin fondo para evitar bordes opacos */
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
    cursor: pointer;
    position: relative;
    max-height: 80vh; /* Limitar altura en desktop */
}

/* Fotos verticales (sistema similar a videos) */
.project-image-third-vertical {
    flex: 1;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    transform: scale(1);
    cursor: pointer;
    position: relative;
    opacity: 0; /* Ocultar por defecto hasta que la imagen cargue */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Mostrar imagen cuando carga correctamente */
.project-image-third-vertical.image-loaded {
    opacity: 1;
    visibility: visible;
}

/* Ocultar completamente la fila si no hay imágenes que carguen */
.project-images-row.no-vertical-images {
    display: none;
}

.project-image-third-vertical img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: all 0.3s ease;
}

.project-image-third-vertical:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.1);
}

.project-image-third-vertical:hover img {
    transform: scale(1.05);
}

/* Video solo en fila - mantener tamaño original y centrar */
.project-videos-row .project-video-third:only-child {
    flex: 0 0 calc((100% - 20px) / 3); /* Ajustado para nuevo gap de 10px */
    margin: 0 auto; /* Centrar horizontalmente */
}

/* Videos horizontales */
.project-video-horizontal {
    flex: 1;
    aspect-ratio: 16/9; /* Formato horizontal para videos estándar */
    background: transparent; /* Sin fondo para evitar bordes opacos */
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(1);
    cursor: pointer;
    position: relative;
    max-height: 60vh; /* Menor altura para videos horizontales */
}

/* Play button para ambos tipos de video */
.project-video-third::before,
.project-video-horizontal::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.project-video-third::after,
.project-video-horizontal::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50.5%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 11;
    pointer-events: none;
}

.project-video-third:hover::before,
.project-video-third:hover::after,
.project-video-horizontal:hover::before,
.project-video-horizontal:hover::after {
    opacity: 1;
}

.project-video-third:hover,
.project-video-horizontal:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

/* Ocultar play button cuando está expandido */
.project-video-third.video-expanded::before,
.project-video-third.video-expanded::after,
.project-video-horizontal.video-expanded::before,
.project-video-horizontal.video-expanded::after {
    opacity: 0 !important;
}

.project-video-third.video-expanded,
.project-video-horizontal.video-expanded {
    cursor: default;
}

.project-video-third video,
.project-video-horizontal video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Vista previa sin bordes negros */
    object-position: center;
    display: block;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Videos expandidos - mantener resolución original */
.project-video-third.video-expanded video,
.project-video-horizontal.video-expanded video {
    object-fit: contain; /* Mantener toda la imagen visible */
}

/* Efecto de expansión para videos verticales */
.project-video-third.video-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 85vh; /* Usar altura máxima disponible */
    max-width: 90vw; /* Límite de ancho para no desbordarse */
    z-index: 1000;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

/* Efecto de expansión para videos horizontales */
.project-video-horizontal.video-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85vw; /* Usar ancho máximo disponible */
    height: auto;
    max-height: 85vh; /* Límite de altura para no desbordarse */
    z-index: 1000;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

/* Cuando un video está expandido, atenuar los otros */
.project-videos-row.has-expanded .project-video-third:not(.video-expanded) {
    opacity: 0.3;
    transform: scale(0.9);
}

/* Overlay para cerrar el video expandido */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-overlay.active {
    opacity: 1;
    visibility: visible;
}

.project-image-half {
    flex: 1;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.back-navigation {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilos para imágenes y videos dentro de los contenedores */
.project-image-large img,
.project-image-large video,
.project-image-half img,
.project-image-half video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Eliminar bordes negros */
    object-position: center;
    border-radius: 0;
}

/* Configuración específica para videos */
.project-image-large video,
.project-image-half video {
    display: block;
}

/* Sobrescribir cualquier width inline en videos */
video[width] {
    width: 100% !important;
}

/* Botón de contacto de proyecto */
.contact-button-container {
    text-align: center;
    max-width: 800px;
    margin: 60px auto 40px;
    padding: 0 20px;
}

.contact-project-button {
    display: inline-block;
    background: transparent;
    color: #fff;
    text-decoration: none;
    padding: 0;
    border: none;
    font-family: "Europa", sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.contact-project-button:hover {
    color: #ccc;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* Texto de copyright */
.project-copyright {
    text-align: center;
    font-size: 18px;
    color: #999999;
    line-height: 1.5;
    margin: 20px auto 0;
    padding: 0 20px 20px;
    max-width: 800px;
}

/* Footer en páginas de trabajo */
.work-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 48px 20px 36px;
    margin-top: 20px;
}

.work-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.work-footer-logo {
    height: 80px;
    width: auto;
    opacity: 0.75;
}

.work-footer-social {
    display: flex;
    gap: 40px;
}

.work-footer-social-link {
    color: #fff;
    text-decoration: none;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.work-footer-social-link:hover {
    opacity: 1;
}

.work-footer-copy {
    font-family: "Inter", sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    margin: 0;
    letter-spacing: 0.03em;
}

@media (max-width: 768px) {
    .project-hero {
        height: 50vh;
        margin-bottom: 40px;
    }
    
    .project-hero h1 {
        font-size: 56px;
        letter-spacing: -1px;
    }
    
    .project-info-section {
        flex-direction: column;
        gap: 40px;
    }
    
    .project-images-row,
    .project-videos-row {
        flex-direction: column;
        gap: 10px; /* Mismo gap reducido en mobile */
    }
    
    .project-page-container {
        padding: 60px 16px 60px;
    }
    
    /* En móvil, mantener proporciones correctas */
    .project-image-large,
    .project-image-half {
        aspect-ratio: 16/9;
    }
    
    .project-video-third {
        aspect-ratio: 9/16;
        max-height: 65vh; /* Menos altura en mobile */
    }
    
    /* Video solo en fila en mobile - mantener tamaño y centrar */
    .project-videos-row .project-video-third:only-child {
        flex: 0 0 100%; /* En mobile ocupa el ancho completo */
        margin: 0 auto;
    }
    
    .project-video-horizontal {
        aspect-ratio: 16/9;
        max-height: 40vh; /* Altura apropiada para videos horizontales en mobile */
    }
    
    .project-images {
        gap: 30px;
    }

    .project-images-row,
    .project-videos-row {
        margin: 0;
    }

    /* Ajustar expansión en mobile */
    .project-video-third.video-expanded {
        width: 90vw;
        height: 160vw; /* 9:16 ratio adjusted (90vw * 16/9) */
        max-height: 90vh;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .project-video-horizontal.video-expanded {
        width: 95vw;
        height: 53.4375vw; /* 16:9 ratio (95vw * 9/16) */
        max-height: 60vh;
        transform: translate(-50%, -50%) scale(1);
    }
    
    /* Botón de contacto responsive */
    .contact-button-container {
        margin: 40px auto 20px;
        padding: 0 16px;
    }
    
    .contact-project-button {
        font-size: 24px;
        line-height: 1.3;
    }
}