/* ==========================================================================
   STYLE.CSS - VERSIÓN FINAL Y ESTABLE
   ========================================================================== */

/* --- 1. CONFIGURACIÓN GLOBAL Y VARIABLES --- */
:root {
    --color-background: #f0f2f5;
    --color-surface: #ffffff;
    --color-text-primary: #1c1e21;
    --color-text-secondary: #65676b;
    --color-accent: #b72a1e;
    --color-accent-rgb: 183, 42, 30; /* Definimos el RGB de --color-accent */
    --color-border: #ddd;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --font-size-base: 1rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
    --font-size-h4: 1.1rem;
    --font-size-small: 0.9rem;
    --font-size-category: 0.8rem;
}
body.dark-theme {
    --color-background: #18191a;
    --color-surface: #242526;
    --color-text-primary: #e4e6eb;
    --color-text-secondary: #b0b3b8;
    --color-border: #3a3b3c;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.2);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- 2. LAYOUT Y UTILIDADES --- */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--color-background);
    color: var(--color-text-primary); 
    line-height: 1.6; 
    transition: background-color 0.3s, color 0.3s; 
}
.container { 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 0 2rem; 
}

a { color: var(--color-text-secondary); text-decoration: none; transition: color 0.2s ease; }
a:hover, a.active { color: var(--color-accent); }
ul { list-style: none; }
button { background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; color: inherit; }

main.container {
    position: relative;
    z-index: 2;
    background-color: var(--color-background);
}

/* --- 3. SECCIÓN DE HÉROE (EFECTO KEN BURNS) --- */
.hero-container {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    overflow: hidden;
    background-color: #18191a;
    z-index: 1;
}
.hero-background-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('https://i.ibb.co/F4H4zGvN/Hero-ept.jpg'); background-size: cover; background-position: center; animation: kenburns-effect 25s ease-in-out infinite; z-index: 1; }
.hero-container::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.25); z-index: 2; }
.hero-content { position: relative; z-index: 3; color: white; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); padding: 1rem; padding-top: 20vh; }
.hero-content h1 { font-size: 4.5rem; font-weight: 700; }
.hero-content p { font-size: 1.5rem; font-weight: 400; }
.hero-button { 
    position: absolute; 
    bottom: 25vh; 
    width: 50px; 
    height: 50px; border: 2px solid #f2f3f4; border-radius: 50%; font-size: 1.5rem; color: #f2f3f4; background: transparent; transition: background-color 0.3s, transform 0.3s; animation: bounce 2s infinite; z-index: 3; }
.hero-button:hover { background-color: rgba(255, 255, 255, 0.1); transform: scale(1.1); animation-play-state: paused; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }
@keyframes kenburns-effect { 0% { transform: scale(1.0) translate(0, 0); opacity: 0.7; } 50% { transform: scale(1.15) translate(-2%, 2%); opacity: 1; } 100% { transform: scale(1.0) translate(0, 0); opacity: 0.7; } }


/* --- 4. COMPONENTES --- */

/* 4.1 NAVEGACIÓN */
.desktop-nav { padding: 1rem 0; position: sticky; top: 0; z-index: 1000; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background-color: rgba(240, 242, 245, 0.8); transition: background-color 0.3s; }
body.dark-theme .desktop-nav { background-color: rgba(24, 25, 26, 0.8); } .desktop-nav .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; } .desktop-nav .logo img { height: 40px; display: block; } .bento-box-nav { display: flex; align-items: center; gap: 0.5rem; background-color: var(--color-surface); padding: 0.5rem; border-radius: var(--border-radius); box-shadow: var(--shadow-light); transition: background-color 0.3s; } .main-menu { flex-grow: 1; justify-content: center; } 
.nav-icon { 
    position: relative;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 44px; height: 44px; 
    border-radius: 8px; 
    transition: background-color 0.2s ease, color 0.2s ease; color: var(--color-text-secondary); font-size: 1.1rem; } .nav-icon:hover { background-color: var(--color-background); color: var(--color-accent); } .nav-icon.active { background-color: var(--color-accent); color: white; } @keyframes pulse-live { 0% { box-shadow: 0 0 0 0 rgba(183, 42, 30, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(183, 42, 30, 0); } 100% { box-shadow: 0 0 0 0 rgba(183, 42, 30, 0); } } .nav-icon.is-live { background-color: var(--color-accent); color: white; animation: pulse-live 2s infinite; border-radius: 8px; } .desktop-nav.is-at-top { background-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 1000; background-color: var(--color-surface); border-top: 1px solid var(--color-border); box-shadow: 0 -2px 5px rgba(0,0,0,0.05); padding: 0.25rem 0; justify-content: space-around; } 
.mobile-nav__link { flex-grow: 1; color: var(--color-text-secondary); display: flex; align-items: center; justify-content: center; height: 54px; font-size: 1.5rem; } 
.mobile-nav__link.active { color: var(--color-accent); } 
.mobile-nav__text { display: none; } 
.mobile-more-menu { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1002; 
    background-color: var(--color-surface); 
    border-top-left-radius: var(--border-radius); 
    border-top-right-radius: var(--border-radius); 
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1); 
    transform: translateY(100%); 
    transition: transform 0.3s ease-out; 
} 
.mobile-more-menu.is-visible { 
    transform: translateY(0); 
}
.mobile-more-menu__content { padding: 1.5rem; } 
.mobile-more-menu__item { display: flex; align-items: center; gap: 1rem; padding: 1rem; font-size: 1rem; font-weight: 500; color: var(--color-text-primary); border-radius: 8px; } .mobile-more-menu__item:hover, .mobile-more-menu__item:active { background-color: var(--color-background); } .mobile-more-menu__item i { width: 24px; text-align: center; font-size: 1.2rem; color: var(--color-text-secondary); }

/* 4.2 BENTO GRID */
/* DESPUÉS */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto); /* <-- AÑADE ESTA LÍNEA */
    gap: 1.25rem;
    padding: 2rem 0;
}
.bento-box { background-color: var(--color-surface); border-radius: var(--border-radius); box-shadow: var(--shadow-light); padding: 1.5rem; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.3s; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; position: relative; } .bento-box:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1); } body.dark-theme .bento-box:hover { box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3); } 
.post-card { 
    min-height: 250px; 
    aspect-ratio: 1 / 1;
} 
/* Nueva regla para limitar el título de los posts */
.post-card h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0; /* Aseguramos que no tenga margen inferior extra */
}
.post-card .card-excerpt {
    font-size: 0.9rem;
    line-height: 1.4;
    color: white;
    opacity: 0.8;
    margin-top: 0.5rem;
    
    /* Lógica para limitar el texto a 3 líneas */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Número máximo de líneas */
    -webkit-box-orient: vertical;
}
.bento-box--1x2 { grid-column: span 1; grid-row: span 2; } 
.bento-box--1x3 { grid-column: span 1; grid-row: span 3; }
.bento-box--1x4 { grid-column: span 1; grid-row: span 4; }
.bento-box--2x1 { grid-column: span 2; grid-row: span 1; } 
.bento-box--2x2 { grid-column: span 2; grid-row: span 2; }
.bento-box--2x3 { grid-column: span 2; grid-row: span 3; }
.bento-box--2x4 { grid-column: span 2; grid-row: span 4; }
.bento-box--3x1 { grid-column: span 3; grid-row: span 1; } 
.bento-box--3x2 { grid-column: span 3; grid-row: span 2; }
.bento-box--3x3 { grid-column: span 3; grid-row: span 3; }
.bento-box--3x4 { grid-column: span 3; grid-row: span 4; }
.bento-box--4x1 { grid-column: span 4; grid-row: span 1; }
.bento-box--4x2 { grid-column: span 4; grid-row: span 2; }
.bento-box--4x3 { grid-column: span 4; grid-row: span 3; }
.bento-box--4x4 { grid-column: span 4; grid-row: span 4; }

.bento-box[style*="background-image"] { 
    background-size: cover; background-position: center; } 
.bento-box[style*="background-image"]::after { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0; 
    /* Hacemos el gradiente más oscuro y que cubra más espacio desde abajo */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 25%, transparent 80%); 
    opacity: 1; 
    transition: opacity 0.3s; 
    pointer-events: none; 
}
.bento-box[style*="background-image"] h3, 
.bento-box[style*="background-image"] h4, 
.bento-box[style*="background-image"] p, 
.bento-box[style*="background-image"] 
    .card-category { color: white; } 
    .card-content { flex-grow: 1; display: flex; flex-direction: column; position: relative; z-index: 2; justify-content: flex-end; pointer-events: none; } 
    .card-content > * { pointer-events: auto; } .card-category { font-size: var(--font-size-category); font-weight: 500; color: var(--color-accent); margin-bottom: 0.5rem; } .bento-box.video-featured-module { padding: 0; }
.bento-style--flat { background-color: transparent !important; box-shadow: none !important; border: none !important; }
.bento-style--circle { border-radius: 50% !important; aspect-ratio: 1 / 1; align-items: center; justify-content: center; text-align: center; }
.bento-style--l-shape { -webkit-clip-path: polygon(0 0, 100% 0, 100% 40%, 40% 40%, 40% 100%, 0 100%); clip-path: polygon(0 0, 100% 0, 100% 40%, 40% 40%, 40% 100%, 0 100%); }

/* ==================================
   Estilos para el Bento de Bienvenida
   ================================== */

.welcome-module {
    /* Centra todo el contenido */
    text-align: left;
    justify-content: left; 
}

/* Parámetros para el TÍTULO GRANDE */
.welcome-module h1 {
    font-size: 4.5rem;         /* Tamaño de la fuente (el parámetro clave) */
    font-weight: 700;          /* Grosor del texto (negrita) */
    line-height: 1.1;          /* Espacio entre líneas si el texto se divide */
    letter-spacing: -0.02em;   /* Junta un poco las letras para un look más compacto */
    margin-bottom: 1.5rem;     /* Espacio debajo del título */
}

/* Parámetros para el PÁRRAFO */
.welcome-module p {
    font-size: 1.1rem;         /* Un poco más grande que el texto normal */
    max-width: 60ch;           /* Limita el ancho de línea para que sea fácil de leer */
    margin: 1 auto;            /* Centra el párrafo horizontalmente */
    color: var(--color-text-secondary); /* Un tono más suave para el texto secundario */
}

/* Ajuste para pantallas móviles */
@media (max-width: 768px) {
    .welcome-module h1 {
        font-size: 3rem; /* Hacemos el título un poco más pequeño en móviles */
    }
}

/* Estilo para el nuevo botón CTA */
.welcome-module .cta-button {
    display: inline-block;
    width: 50%;
    background-color: var(--color-accent);
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    margin-top: 1.5rem; /* Espacio sobre el botón */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.welcome-module .cta-button:hover {
    transform: scale(1.05);
    background-color: #a1241a; /* Un tono de rojo un poco más oscuro al pasar el cursor */
}

/* 4.3 MODAL DE INMERSIÓN */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(18, 18, 18, 0.85); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-overlay.is-visible { opacity: 1; visibility: visible; }
/* 1. Hacemos el contenedor del modal mucho más grande en escritorio */
.modal-container {
    background-color: var(--color-surface);
    /* Aumentamos el ancho máximo a 1200px y usamos el 90% del ancho de la ventana */
    max-width: 1200px; 
    width: 90%;
    height: 90%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.is-visible .modal-container { transform: scale(1); }
.modal-close-btn { position: absolute; top: -15px; right: -15px; width: 40px; height: 40px; background: white; color: black; border-radius: 50%; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 10; }
/* 2. Reseteamos el padding del contenido principal para que la imagen y el grid ocupen todo */
.modal-content { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 0; /* Quitamos todo el padding de aquí */
}
.modal-container--video .modal-content { padding: 0; background: #000; overflow: hidden; }
.modal-share-footer { flex-shrink: 0; padding: 1rem 2.5rem; border-top: 1px solid var(--color-border); display: flex; gap: 0.75rem; }
.modal-share-footer .share-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-border); color: var(--color-text-secondary); display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; font-size: 1.2rem; }
.modal-share-footer .share-btn:hover { background-color: var(--color-accent); color: white; border-color: var(--color-accent); }
.modal-content .post-body p { margin-bottom: 1.5em; line-height: 1.7; color: var(--color-text-primary); }
.modal-content .post-body img { 
    max-width: 100%; 
    height: auto; 
    border-radius: var(--border-radius); 
    margin: 2rem 0; 
}
.modal-content .post-body blockquote { border-left: 4px solid var(--color-accent); padding-left: 1.5rem; margin: 2rem 0; font-style: italic; color: var(--color-text-secondary); }
.modal-content .post-body a { color: var(--color-accent); text-decoration: underline; }
.modal-content h2 { font-size: var(--font-size-h2); margin-bottom: 0.5rem; }
.modal-content .post-meta { display: block; margin-bottom: 2rem; color: var(--color-text-secondary); }
.native-audio-player { width: 100%; margin: 1rem 0;}

/* Estilos para los botones dentro del modal de artículo */
/* El nuevo CSS para el contenedor y los botones */
.modal-cta-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* <<< AÑADIDO: Centra los botones horizontalmente */
}

.modal-cta-button {
    display: inline-block; /* <<< CAMBIADO: Hace que el botón se ajuste a su contenido */
    width: auto;           /* Se asegura de que el ancho sea automático */
    padding: 1rem 2rem;  /* Ajustamos el padding para que no se vea tan ancho */
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    transition: background-color 0.2s, color 0.2s;
}

.modal-cta-button:hover {
    background-color: var(--color-background);
}

.modal-cta-button.modal-cta-button--primary {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.modal-cta-button.modal-cta-button--primary:hover {
    background-color: #a1241a; /* Rojo más oscuro */
    color: white;
}

/* 3. La imagen de cabecera sigue igual, ocupando todo el ancho superior */
.modal-post-image {
    display: block;
    width: 100%;
    max-height: 350px; /* Un poco más de altura para el nuevo tamaño */
    object-fit: cover;
}

/* 4. ¡LA MAGIA! Creamos el nuevo layout de dos columnas con CSS Grid */
.modal-post-layout {
    display: grid;
    /* Columna izquierda fija de 240px, columna derecha flexible */
    grid-template-columns: 240px 1fr; 
    gap: 2.5rem; /* Espacio entre las columnas */
    padding: 2rem 2.5rem; /* Padding general para el layout */
    align-items: start; /* Alineamos los items al inicio */
}

/* 5. Estilos para la columna izquierda (metadatos) */
.modal-meta-column {
    position: sticky; /* ¡CLAVE! La columna se queda fija al hacer scroll */
    top: 2rem; /* Espacio desde la parte superior del área de scroll */
}

.modal-meta-column .author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.modal-meta-column .author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--color-border);
}

.modal-meta-column .author-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.modal-meta-column .post-date {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

/* 6. Estilos para la columna principal (contenido) */
.modal-body-column h2 {
    font-size: 2.5rem; /* Título más grande */
    line-height: 1.2;
    margin-bottom: 2rem;
}

/* El cuerpo del post ya tiene estilos, pero nos aseguramos que funcionen bien aquí */
.modal-body-column .post-body p {
    margin-bottom: 1.5em;
    font-size: 1.1rem; /* Texto un poco más grande para mejor lectura */
    line-height: 1.8;
}

.modal-body-column .post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

/* Estilos para los badges de ORCID y DOI en el modal */
.modal-meta-column .meta-badges {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.modal-meta-column .orcid-link {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.modal-meta-column .orcid-link:hover {
    color: var(--color-accent);
}

.modal-meta-column .orcid-link i {
    color: #a6ce39; /* Color oficial de ORCID */
}

/* 7. Ajuste para que los botones de CTA se vean bien */
.modal-cta-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

/* 8. Media Query para volver a una sola columna en pantallas pequeñas */
@media (max-width: 992px) {
    .modal-post-layout {
        grid-template-columns: 1fr; /* Una sola columna */
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .modal-meta-column {
        position: static; /* Quitamos el sticky en móvil */
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 1.5rem;
    }

    .modal-meta-column .author-info {
        flex-direction: row; /* Ponemos avatar y texto en fila */
        text-align: left;
        align-items: center;
        gap: 1rem;
    }

    .modal-meta-column .author-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }

    .modal-body-column h2 {
        font-size: 1.8rem;
    }
}

.modal-padded-content {
    padding: 1.5rem 1rem 2rem 1rem; /* Mantenemos el padding para el texto */
}

/* --- OTROS COMPONENTES --- */
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1001; opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s; }
.overlay.is-visible { 
    opacity: 1; 
    visibility: visible; 
}
.login-popover { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; background-color: var(--color-surface); border-radius: var(--border-radius); box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 1px solid var(--color-border); padding: 1rem; z-index: 1001; display: flex; flex-direction: column; gap: 0.75rem; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease; }
.login-popover.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.login-popover p { font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 0.25rem; }
.login-provider-btn { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    padding: 0.75rem;
    margin-bottom: 5px; 
    border-radius: 8px; 
    text-decoration: none; 
    color: var(--color-text-primary); 
    font-weight: 500; 
    transition: background-color 0.2s ease; 
}
.login-provider-btn:hover { background-color: var(--color-background); }
.login-provider-btn i { width: 20px; text-align: center; font-size: 1.2rem; }
.login-provider-btn.is-disabled { opacity: 0.5; cursor: not-allowed; background-color: transparent !important; }

/* ==========================================================================
   NUEVO REPRODUCTOR DE PODCAST PERSISTENTE
   ========================================================================== */
.bento-podcast-player { display: flex; flex-direction: column; height: 100%; }
.bento-podcast-player h3 { margin-bottom: 1rem; flex-shrink: 0; }
.podcast-episode-list { flex-grow: 1; overflow-y: auto; margin: -1.5rem; padding: 0 1.5rem; }
.podcast-episode { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.podcast-episode:hover { background-color: rgba(0,0,0,0.03); }
body.dark-theme .podcast-episode:hover { background-color: rgba(255,255,255,0.05); }
.episode-play-icon { font-size: 1.5rem; color: var(--color-text-secondary); }
.podcast-episode.is-playing .episode-play-icon { color: var(--color-accent); }
.episode-info p { margin: 0; font-weight: 500; }
.episode-info span { font-size: 0.8rem; color: var(--color-text-secondary); }

.persistent-audio-player { position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--color-surface); box-shadow: 0 -5px 15px rgba(0,0,0,0.1); z-index: 1500; transform: translateY(100%); transition: transform 0.4s ease-in-out; }
.persistent-audio-player.is-visible { transform: translateY(0); }
.player-content { max-width: 1400px; margin: 0 auto; padding: 1rem 2rem; display: grid; grid-template-columns: 1fr auto 1.5fr auto auto; align-items: center; gap: 1.5rem; }
.track-info { display: flex; align-items: center; gap: 1rem; }
.track-info img { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; }
.track-info p { margin: 0; }
#player-track-title { font-weight: 600; }
#player-track-author { font-size: 0.9rem; color: var(--color-text-secondary); }
.player-controls { display: flex; justify-content: center; align-items: center; gap: 1.5rem; }
.player-controls button { font-size: 1.2rem; color: var(--color-text-secondary); }
#player-play-btn { font-size: 2.2rem; color: var(--color-text-primary); }
.player-timeline { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: var(--color-text-secondary); }
#player-timeline-slider { flex-grow: 1; }
.player-volume { display: flex; align-items: center; gap: 0.5rem; }
#player-volume-slider { width: 80px; }
#player-close-btn { position: absolute; top: 1rem; right: 1rem; background: none; color: var(--color-text-secondary); font-size: 1.5rem; }

/* Estilos personalizados para los sliders */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { background: var(--color-border); height: 4px; border-radius: 4px; }
input[type="range"]::-moz-range-track { background: var(--color-border); height: 4px; border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -6px; background-color: var(--color-accent); height: 16px; width: 16px; border-radius: 50%; }
input[type="range"]::-moz-range-thumb { border: none; border-radius: 50%; background-color: var(--color-accent); height: 16px; width: 16px; }

/* --- 5. REGLAS RESPONSIVAS --- */
@media (max-width: 992px) {
    .player-content { grid-template-columns: auto 1fr; grid-template-rows: auto auto; grid-template-areas: "info volume" "timeline timeline" "controls controls"; padding: 0.75rem 1rem; }
    .track-info { grid-area: info; }
    .post-card {
    min-height: 240px; /* Anula la altura mínima en móviles */
    }
    .player-controls { grid-area: controls; }
    .player-timeline { grid-area: timeline; }
    .player-volume { grid-area: volume; justify-content: flex-end; }
    #player-track-author { display: none; }
    #player-close-btn { top: 0.5rem; right: 0.5rem; }
}
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .desktop-nav { display: none; }
    .mobile-nav { display: flex; }
    .post-card {
    min-height: 240px; /* Anula la altura mínima en móviles */
    }
    body { padding-bottom: 160px; } /* Espacio para menú y reproductor */
    .hero-content h1 { font-size: 2.5rem; }
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(140px, auto); }
    .bento-box { grid-column: span 1; grid-row: span 1; }
    .bento-box.mobile-full-width, .bento-box.welcome-module { grid-column: span 2; }
    .bento-box.video-featured-module, .bento-box.bento-box--1x3 { grid-column: span 2; grid-row: span 2; aspect-ratio: auto !important; }
}
/* ==========================================================================
   4.3 MODAL UNIFICADO (Login, Posts, etc.)
   ========================================================================== */

/* El fondo oscuro que cubre toda la página */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.85); /* Fondo oscuro semitransparente */
    z-index: 2000; /* Lo pone en una capa muy alta */
    display: none; /* Se activa con la clase .is-visible */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-overlay.is-visible {
    display: flex;
    opacity: 1;
}

/* La caja principal del modal */
.modal {
    background: var(--color-surface);
    width: 90%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden; /* Controla el scroll dentro del modal */
}

/* Usamos esta clase para darle un tamaño específico al modal de login */
.login-modal {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0; /* Evita que el header se encoja */
}

.modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.modal-close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    background: white;
    border: none;
    line-height: 1;
}

.modal-content {
    padding: 0; /*1.5rem 2rem 2rem 2rem*/
    overflow-y: auto; /* Permite scroll si el contenido es muy largo */
}

/* Contenedor para los botones de Google/Github */
.login-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Estilo de los botones de proveedor de login */
.login-provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    font-size: 1rem;
    transition: background-color 0.2s;
}

.login-provider-btn:hover {
    background-color: var(--color-surface);
    border-color: var(--color-text-secondary);
}

.login-provider-btn i {
    font-size: 1.5rem;
}
/* ===================================================
   ESTILOS DEFINITIVOS PARA IMAGEN Y CONTENIDO DEL MODAL
   =================================================== */

/* Estilo para la imagen de cabecera del modal */
.modal-post-image {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

/* Contenedor que AÑADE el padding solo al texto */
.modal-padded-content {
    padding: 1.5rem 2.5rem 2rem 2.5rem;
}

/* AJUSTES PARA MÓVIL */
@media (max-width: 768px) {
    /* Reduce el padding lateral en móviles para que no se vea aplastado */
    .modal-padded-content {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Reduce el tamaño del título en móviles */
    .modal-padded-content h2 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
}
/* ===================================================
   ANIMACIÓN DE CARGA PARA BENTO GRID
   =================================================== */

/* 1. Definimos la animación de "aparecer hacia arriba" */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Por defecto, los bloques están ocultos antes de la animación */
.bento-grid .bento-box {
    opacity: 1;
}

/* 3. Cuando un bloque tenga la clase .is-visible, se animará */
.bento-grid .bento-box.is-visible {
    animation: fade-in-up 0.7s ease-out forwards;
}

/* --- INICIO: ESTILOS MEJORADOS PARA EL FOOTER --- */

.site-footer {
    padding: 3rem 0;
    background-color: var(--color-background);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-small);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; /* Para que se ajuste bien en pantallas medianas */
    gap: 2rem;
}

.footer-column {
    flex: 1;
    min-width: 250px; /* Ancho mínimo para cada columna */
}

.footer-logo-text {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.footer-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.footer-link i {
    font-size: 1.2rem;
}

/* Estilos para móvil */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-badges {
        align-items: center;
    }
}

/* --- FIN: ESTILOS MEJORADOS PARA EL FOOTER --- */

/* --- INICIO: ESTILOS MEJORADOS BENTO PODCAST --- */

/* Modificamos el contenedor principal para que el header/footer se peguen a los bordes */
.bento-podcast-player {
    padding: 0; 
}

.bento-podcast-player h3 {
    margin: 0;
    color: white; /* Aseguramos que el texto del título sea blanco */
}

/* Estilos para el nuevo header rojo */
.podcast-header {
    background-color: var(--color-accent);
    padding: 1.5rem;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    flex-shrink: 0;
}

/* El contenedor de la lista ahora necesita su propio padding */
.bento-podcast-player .podcast-episode-list {
    padding: 0 1.5rem; /* Re-aplicamos el padding lateral */
    margin: 0; /* Reseteamos el margen negativo que tenía */
}

/* Estilos para el nuevo footer y el botón */
.podcast-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
    margin-top: auto; /* Empuja el footer hacia abajo */
}

.podcast-cta-button {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid var(--color-border);
}

.podcast-cta-button:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text-primary);
}

/* Estilos y animación para la ONDA DE AUDIO DECORATIVA */
.waveform-placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    margin-top: 1rem;
}

.waveform-placeholder span {
    width: 4px;
    height: 10%;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    animation: waveform-animation 1.2s ease-in-out infinite;
}

/* Damos un retraso a cada barra para que la animación se vea fluida */
.waveform-placeholder span:nth-of-type(2) { animation-delay: -1.1s; }
.waveform-placeholder span:nth-of-type(3) { animation-delay: -1.0s; }
.waveform-placeholder span:nth-of-type(4) { animation-delay: -0.9s; }
.waveform-placeholder span:nth-of-type(5) { animation-delay: -0.8s; }
.waveform-placeholder span:nth-of-type(6) { animation-delay: -0.7s; }
.waveform-placeholder span:nth-of-type(7) { animation-delay: -0.6s; }
.waveform-placeholder span:nth-of-type(8) { animation-delay: -0.5s; }
.waveform-placeholder span:nth-of-type(9) { animation-delay: -0.4s; }
.waveform-placeholder span:nth-of-type(10) { animation-delay: -0.3s; }

@keyframes waveform-animation {
    0%, 100% {
        height: 10%;
        opacity: 0.3;
    }
    50% {
        height: 100%;
        opacity: 1;
    }
}

/* --- FIN: ESTILOS MEJORADOS BENTO PODCAST --- */

/* --- INICIO: ESTILOS PARA BENTO DE LOGOS ANIMADOS --- */

.logo-ticker-bento {
    padding: 5; /* Quitamos el padding para que la animación ocupe todo el espacio */
    overflow: hidden; /* Oculta los logos que están fuera de la caja */
    cursor: default;
}

.logo-ticker-track {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    gap: 1.5rem; /* Espacio entre las dos filas de logos */
}

.ticker-row {
    display: flex;
    align-items: center; /* Centra verticalmente los logos en su fila */
    gap: 4rem; /* Espacio entre cada logo */
    flex-shrink: 0;
    min-width: 100%;
    /* Aplicamos la animación */
    animation: ticker-animation 50s linear infinite;
}

.ticker-row.reverse {
    /* Hacemos que la segunda fila se mueva en dirección contraria */
    animation-direction: reverse;
}

.ticker-row img {
    height: 45px; /* Damos una altura consistente a todos los logos */
    max-width: 150px; /* Evitamos que los logos muy anchos ocupen demasiado */
    object-fit: contain; /* Asegura que los logos no se deformen */
    flex-shrink: 0;
    opacity: 0.7; /* Hacemos los logos un poco sutiles */
    transition: opacity 0.2s ease;
}

.ticker-row:hover {
    animation-play-state: paused; /* Pausamos la animación al pasar el cursor */
}

.ticker-row img:hover {
    opacity: 1; /* Resaltamos el logo bajo el cursor */
}

/* Truco para que los logos se vean bien en TEMA OSCURO */
body.dark-theme .ticker-row img {
    /* Invierte el color de los logos (negro a blanco) y los hace monocromáticos */
    filter: invert(1) grayscale(1);
    opacity: 0.6;
}

body.dark-theme .ticker-row img:hover {
    opacity: 1;
}

/* Definición de la animación de scroll */
@keyframes ticker-animation {
    from {
        transform: translateX(0%);
    }
    to {
        /* Movemos el contenedor a la mitad, donde empieza la copia */
        transform: translateX(-50%);
    }
}

/* --- FIN: ESTILOS BENTO DE LOGOS --- */

/* --- INICIO: ESTILOS PARA NOTIFICACIONES --- */

.nav-icon.has-notifications::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    background-color: var(--color-accent);
    border-radius: 50%;
    border: 2px solid var(--color-surface);
}

.notifications-modal {
    position: fixed;
    top: 70px; /* Debajo del header */
    right: 1.5rem;
    width: 350px;
    max-height: 400px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
}

.notifications-modal.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: 380px;
}

.notifications-content h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
}

.notification-item {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.notification-item:hover {
    background-color: var(--color-background);
    color: var(--color-text-primary);
}

.notification-item p {
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.notification-item span {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* --- FIN: ESTILOS PARA NOTIFICACIONES --- */

/* --- INICIO: ESTILOS PARA NUEVOS BENTOS DE INICIO --- */

/* 1. Bento "Próximo Evento" */
#next-event-bento {
    padding: 0;
    overflow: hidden;
}
.bento-next-event {
    width: 100%;
    height: 100%;
    display: flex;
    background-size: cover;
    background-position: center;
    color: white;
}
.event-date-box {
    flex: 0 0 35%; /* Ocupa el 35% del ancho */
    background-color: rgba(var(--color-accent-rgb), 0.8); /* Añadimos transparencia (0.8) */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.date-day {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
}
.date-month {
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: capitalize;
}
.date-weekday {
    font-size: 1rem;
    margin-top: 1rem;
    opacity: 0.8;
}
.live-indicator {
    font-weight: 700;
    animation: pulse-live 2s infinite;
}
.event-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.event-details h4 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}
.event-details .cta-button {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease;
}
.event-details .cta-button:hover {
    transform: scale(1.05);
}

/* 2. Bento "Ver Todas las Publicaciones" */
.all-posts-cta {
    background-color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.all-posts-cta .cta-content h3 {
    font-size: 1.5rem;
}
.all-posts-cta .cta-content p {
    color: var(--color-text-secondary);
    margin: 0.5rem 0 1.5rem 0;
}
.all-posts-cta .cta-content .cta-button {
    font-weight: 600;
    color: var(--color-accent);
}

/* 3. Ajustes para Móvil */
@media (max-width: 768px) {
    .bento-next-event {
        flex-direction: column;
    }
    .event-date-box {
        flex-basis: auto; /* La altura se vuelve automática */
        padding: 1rem;
    }
    .date-day { font-size: 4rem; }
    .date-month { font-size: 1.2rem; }
    .event-details { padding: 1.5rem; }
    .event-details h4 { font-size: 1.3rem; }
}
/* --- FIN: ESTILOS PARA NUEVOS BENTOS --- */

/* --- INICIO: ESTILOS PARA BENTO CTA SUBSTACK --- */
.all-posts-cta-substack {
    background-color: #f4f4f4; /* Un gris claro similar a Substack */
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 1.5rem;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.all-posts-cta-substack:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
}

.substack-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.substack-logo {
    flex-shrink: 0;
}

.substack-text {
    flex-grow: 1;
}

.substack-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-primary);
}

.substack-text p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

.substack-button {
    background-color: #0072b1; /* Un azul similar al de LinkedIn (usado en Substack) */
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap; /* Evita que el texto del botón se rompa */
}

.substack-button i {
    margin-left: 0.5rem;
}

.substack-button:hover {
    background-color: #005c8e;
}

/* Ajustes para móvil */
@media (max-width: 768px) {
    .substack-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .substack-logo {
        margin-bottom: 0.5rem;
    }

    .substack-button {
        width: 100%;
        text-align: center;
    }
}

/* --- FIN: ESTILOS PARA BENTO CTA SUBSTACK --- */

/* --- Ajustes para Bento de Próximo Evento --- */
.event-date-box {
    /* Mantenemos la transparencia que pediste */
    background-color: rgba(183, 42, 30, 0.9);
}
.event-type {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.event-details {
    /* Hacemos que el contenido se alinee abajo */
    justify-content: flex-end;
}
.event-description {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: -1rem 0 1.5rem 0; /* Ajustamos el espaciado */
    /* Limitamos el texto a 3 líneas */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.event-time-info {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}
.event-details .cta-button {
    margin-top: 1.5rem; /* Espacio entre texto y botón */
    align-self: flex-start;
}

/* --- INICIO: ESTILOS PARA BENTO SUBSTACK DESTACADO --- */
.bento-substack-featured {
    padding: 0;
    color: white;
}
.bento-substack-featured .card-content {
    justify-content: space-between; /* Alinea el texto arriba y el botón abajo */
    padding: 2rem;
}
.bento-substack-featured .featured-text h4 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.bento-substack-featured .featured-text p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 50ch; /* Limita el ancho del texto para legibilidad */
}
.bento-substack-featured .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}
.bento-substack-featured .cta-button i {
    border: 2px solid white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ajustes para Móvil */
@media (max-width: 768px) {
    .bento-substack-featured .featured-text h4 {
        font-size: 1.3rem;
    }
}
/* --- FIN: ESTILOS PARA BENTO SUBSTACK DESTACADO --- */