/* ==========================================================================
   1. BASE Y CONFIGURACIÓN GENERAL
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Montserrat', sans-serif; display: flex; overflow-x: hidden; background-color: #fff; }

/* HEADER MÓVIL (Solo se activa en pantallas pequeñas) */
.mobile-header {
    display: none; 
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background: #030c25; color: #fff; z-index: 1001;
    align-items: center; justify-content: space-between; padding: 0 20px;
}
.mobile-logo img { height: 38px; }
.menu-toggle { font-size: 24px; cursor: pointer; }

/* ==========================================================================
   2. SIDEBAR (Escritorio y Móvil)
   ========================================================================== */
.sidebar {
    width: 280px; height: 100vh; position: fixed; left: 0; top: 0;
    padding: 25px 30px; display: flex; flex-direction: column; color: white;
    background: linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.0)), url('contenido_general/sidebar_pato_berroeta.png');
    background-size: cover; z-index: 1000; transition: transform 0.3s ease;
}
.logo img { width: 210px; margin-bottom: 50px; }
.main-nav ul { list-style: none; margin-bottom: 40px; }
.main-nav li { margin-bottom: 15px; }
.main-nav a { color: #fff; text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.active-nav { color: #eca492 !important; font-weight: 900 !important; }

.invitation { font-size: 0.85rem; line-height: 1.6; font-weight: 300; margin-top: 20px; margin-bottom: 40px; }
.social-icons { margin-top: auto; display: flex; gap: 20px; }
.social-icons a { color: white; font-size: 1.2rem; }

/* ==========================================================================
   3. ÁREA PRINCIPAL Y GRILLA
   ========================================================================== */
.main-content { margin-left: 280px; width: calc(100% - 280px); min-height: 100vh; }

.filter-menu { 
    background: #e1e1e1; padding: 20px; position: sticky; top: 0; z-index: 900;
    border-bottom: 1px solid #191c44;
}
.filter-menu ul { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; justify-content: center; }
.filter-menu li {
    padding: 6px 15px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    border: 1px solid #c3c3c3; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.active-filter, .filter-menu li:hover { background: #191c44; color: #eca492; border-color: #000; }

.gallery-grid { width: 100%; display: flex; flex-wrap: wrap; }
.work-item { width: 20%; aspect-ratio: 1/1; position: relative; cursor: pointer; overflow: hidden; }
.work-item img { width: 100%; height: 100%; object-fit: cover; }

.work-info {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95); opacity: 0; transition: 0.4s;
    display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px;
}
.work-item:hover .work-info { opacity: 1; }
.project-name { font-weight: 900; text-align: center; color: #000; }
.category { font-size: 0.6rem; color: #777; margin-bottom: 5px; }

/* ==========================================================================
   4. MODALES (PROYECTOS Y PERFIL)
   ========================================================================== */
.modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.85);
}

/* Modal de Proyectos (Medida Perfecta Desktop) */
.modal-container {
    background: #e1e1e1; width: 60%; max-width: 850px;
    margin: 40px auto; border-radius: 4px; position: relative;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Botón Cerrar Circular Blanco */
.close-modal { 
    position: absolute; top: 20px; right: 20px; 
    font-size: 40px; cursor: pointer; z-index: 100; 
    color: #333; background: white; 
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2); transition: 0.3s;
}







/* ==========================================================================
   4. MODALES (PROYECTOS Y PERFIL) - CONFIGURACIÓN DE PROPORCIONES
   ========================================================================== */

.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0;
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.90);
}

.modal-container {
    background: #e1e1e1; 
    width: 60%; 
    max-width: 850px; 
    margin: 40px auto; 
    border-radius: 8px; 
    position: relative; 
    max-height: 90vh; 
    overflow-y: auto;
}

/* --- ESTA ES LA PARTE CLAVE --- */

/* Caso 1: Cuando el proyecto es una IMAGEN (Usa tu proporción 20:13) */
.modal.is-image .swiper {
    width: 100%;
    aspect-ratio: 20 / 13; /* Ajustado a tus imágenes */
    background: #fff; 
    border-radius: 8px 8px 0 0;
}

.modal.is-image .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Para que llene todo el 20:13 sin bordes */
}

/* Caso 2: Cuando el proyecto es un VIDEO (Usa proporción 16:9) */
.modal.is-video .swiper {
    width: 100%;
    aspect-ratio: 16 / 9; 
    background: #000;
}

/* Forzamos al slide y al contenedor del iframe a llenar todo el swiper */
.modal.is-video .swiper-slide,
.modal.is-video .iframe-container {
    width: 100% !important;
    height: 100% !important;
    display: flex;
}

/* Forzamos al iframe a expandirse completamente */
.modal.is-video .iframe-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
}


/* --- FIN DE LA PARTE CLAVE --- */

.modal-text { padding: 30px; }





/* Estilo de etiqueta negra para la categoría */
.modal-category-badge {
    background-color: #040e1a !important; /* Fondo negro */
    color: #eca492 !important;           /* Texto blanco */
    display: inline-block;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.60rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.0px;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
}





/* Pop-up Especial de PERFIL */
.profile-modal-container {
    width: 85%; max-width: 1100px; height: 90vh; margin: 5vh auto; overflow: hidden;
}
.profile-iframe { width: 100%; height: 100%; border: none; border-radius: 8px; }

/* ==========================================================================
   5. RESPONSIVO (MÓVIL)
   ========================================================================= */
@media screen and (max-width: 1024px) {
    .work-item { width: 33.33%; }
    .modal-container { width: 90%; }
}

@media screen and (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar {
        transform: translateX(-100%); /* Oculto */
        width: 100%; height: auto; top: 60px; background: #030c25; padding: 30px 20px;
    }
    .sidebar.active { transform: translateX(0); }
    .desktop-only { display: none; }
    
    .main-content { margin-left: 0; width: 100%; padding-top: 60px; }
    .work-item { width: 50%; }
    
    .filter-menu { position: relative; top: 0; }
    .profile-modal-container { width: 95%; height: 95vh; margin: 2.5vh auto; }
    
    /* En móvil el modal de proyectos usa más pantalla */
    .modal-container { width: 95%; margin: 10px auto; }
}