@import url('https://googleapis.com');

:root {
    --bg: #090909;
    --text: #f3ede7;
    --text-soft: #888888; /* CORREGIDO: Cambiado %23 por # para activar el color gris */
    --line: #222222;
    --accent: #9e2a2f;
}

* { /* CORREGIDO: Añadido el asterisco y cerrado el root correctamente */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding-top: 60px;
}

/* ==================== NAV ==================== */
.main-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 1px solid var(--line);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background: rgba(9,9,9,0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    opacity: 0.5;
    transition: 0.3s;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--accent);
}

.nav-links .me {
    opacity: 1;
}

/* ==================== GRID BENTO CORREGIDO ==================== */
.bento-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* CORREGIDO: 2 columnas proporcionales para evitar desfasajes */
}

/* ==================== BOX BASE ==================== */
.box {
    padding: 40px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ==================== PERFIL ==================== */
.bio-box {
    grid-column: span 1; /* Al tener 2 columnas base, ocupa la primera */
    min-height: 80vh;
    padding: 20px 100px;
}

.bio-contenido-horizontal {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 70px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.bio-texto-bloque {
    flex: 1;
    max-width: 520px;
}

.perfil-foto-marco {
    width: 280px;
    flex-shrink: 0;
    border: 4px solid #F5F5DC;
    padding: 10px;
}

.foto-perfil {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* ==================== DATOS ACADÉMICOS ==================== */
.academic-data {
    grid-column: span 1; /* Ocupa la segunda columna a la derecha */
    padding: 70px 60px;
    border-right: none;
    min-width: 420px;
}

.academic-data .accent-title {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-bottom: 60px;
}

.data-item {
    margin-bottom: 40px;
}

.data-item span {
    display: block;
    margin-bottom: 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-soft);
}

.data-item p {
    font-size: 1rem;
    line-height: 1.6;
}

/* ==================== FOJA ACADÉMICA CORREGIDA ==================== */
.academic-full {
    grid-column: span 2; /* CORREGIDO: Abarca el ancho completo de las 2 columnas base */
    min-height: auto;
    border-right: none;
}

.foja-contenido {
    width: 100%;
    padding: 0px 80px;
}

.nivel-box {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.nivel-box:last-child {
    border-bottom: 1px solid var(--line);
}

.nivel-box summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.nivel-box summary::-webkit-details-marker {
    display: none;
}

.nivel-box[open] summary {
    color: var(--accent);
}

.materias {
    margin-top: 20px;
    padding-left: 10px;
}

.materias p {
    color: var(--text-soft);
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* ==================== EQUIPO + CÁTEDRA CORREGIDO ==================== */
.team-box {
    grid-column: span 1; /* Se apila abajo a la izquierda */
    min-height: 340px;
}

.catedra-box {
    grid-column: span 1; /* Se apila abajo a la derecha */
    border-right: none;  /* Saca la línea divisoria derecha sobrante */
    min-height: 420px;
    padding: 50px 40px;
}

.team-id {
    font-size: 4rem;
    font-family: 'Cormorant Garamond', serif;
    margin-bottom: 25px;
}

.member-list a {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--text-soft);
    text-decoration: none;
    transition: 0.3s;
}

.member-list a:hover {
    color: var(--accent);
}

.member-list .me {
    color: var(--text);
    font-weight: 600;
}

.catedra-info p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 4px;
}

/* ==================== TEXTOS GENERALES ==================== */
.box-label {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--text-soft);
}

.box-label span {
    color: var(--accent);
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(5.5rem, 8vw, 9rem);
    line-height: 0.8;
    font-weight: 300;
    letter-spacing: 7px;
    margin-bottom: 10px;
}

.tagline {
    color: var(--accent);
    font-size: 0.95rem;
    margin: 50px 0;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.description {
    color: var(--text-soft);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ==================== LINKS ==================== */
.view-more {
    margin-top: auto;
    padding-top: 30px;
    font-size: 0.7rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
}

/* ==================== FOOTER ==================== */
.footer-box {
    grid-column: span 2; /* CORREGIDO: Ajustado al ancho de la grilla de 2 columnas */
    border-right: none;
    padding: 35px 50px;
}

.legal-disclaimer {
    width: 100%;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.legal-disclaimer p {
    max-width: 1600px;
    color: var(--text-soft);
    font-size: 0.75rem;
    line-height: 1.7;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    font-size: 0.65rem;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== PORTFOLIO (CARRUSEL MANTENIDO) ==================== */
#galeria.bio-box {
    min-height: auto;
    padding-top: 25px;
    padding-bottom: 25px;
}

#galeria.box-label {
    margin-bottom: 15px;
}

#galeria .carrusel-contenedor {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    background-color: #000; /* CORREGIDO: hex a #000 */
    margin: 20px 0;
    transition: box-shadow 0.4s ease;
}

#galeria .carrusel-contenedor:hover {
    box-shadow: 0 0 25px rgba(158, 42, 47, 0.25);
    border-image: linear-gradient(135deg, var(--accent), rgba(9, 9, 9, 0.1)) 1;
}

#galeria .carrusel-slides {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    cursor: grab;
}

#galeria .carrusel-slides:active {
    cursor: grabbing;
}

#galeria .carrusel-slides::-webkit-scrollbar {
    display: none;
}

#galeria .carrusel-foto {
    min-width: 100%;
    height: 100%;
    flex: 0 0 100%;
    scroll-snap-align: start;
}

#galeria .carrusel-foto img,
#galeria .carrusel-foto video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

#galeria .carrusel-contenedor:hover .carrusel-foto img,
#galeria .carrusel-contenedor:hover .carrusel-foto video {
    opacity: 1;
}

/* ==================== FILA DE MINIATURAS FIJAS EN LA BASE ==================== */
.fila-miniaturas {
    position: relative;
    display: flex;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    max-width: 800px;
}

.miniatura-item {
    flex: 1;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    background-color: #000;
    text-decoration: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.miniatura-item:hover {
    box-shadow: 0 0 20px rgba(158, 42, 47, 0.2);
    border-image: linear-gradient(135deg, var(--accent), rgba(9, 9, 9, 0.1)) 1;
}

.miniatura-item img,
.miniatura-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.miniatura-item:hover img,
.miniatura-item:hover video {
    opacity: 1;
}

/* ==================== VIDEOS ==================== */

.video-box {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.video-item {
    width: 100%;
}

.video-item span {
    display: block;
    margin-bottom: 12px;
    color: var(--text-soft);
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.video-hover {
    width: 100%;
    aspect-ratio: 16 / 9;

    object-fit: cover;

    border: 1px solid var(--line);
    background: #000;

    opacity: 0.45;

    transition:
        opacity 0.4s ease,
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.video-hover:hover {
    opacity: 1;

    transform: scale(1.02);

    box-shadow:
        0 0 25px rgba(158, 42, 47, 0.25);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bio-box,
    .academic-full,
    .footer-box {
        grid-column: span 1;
    }
    .box {
        border-right: none;
        padding: 40px 25px;
    }
    .academic-data {
        min-width: auto;
    }
    .bio-contenido-horizontal {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }
    h1 {
        font-size: 4rem;
    }
    .description {
        max-width: 100%;
    }
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}
