/* ==========================================================================
   int.css - Estilos para Páginas Interiores y Componentes Dinámicos
   Organizado bajo la metodología Mobile First
   ========================================================================== */

/* ==========================================================================
   1. SECCIÓN: MOSAICO A SANGRE (Niveles, Talleres, Formación)
   ========================================================================== */

/* --- Hero General Interiores --- */
.hero-interior {
    background: var(--bg-hero-mobile, url('../img/fi-mobile.webp')) no-repeat center center;
    background-size: cover;
    height: 320px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 10px 20px 0px 20px;
    margin-bottom: 0;
}

.hero-content h1 {
    position: relative;
    color: var(--text-white);
    font-size: 32px;
    font-weight: 600;
    text-align: right;
    line-height: 1.1;
}

/* --- Contenedor Principal Mosaico --- */
.interior-main {
    padding: 0; 
    overflow-x: hidden;
}

.interior-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

/* --- Cluster de Texto (Cápsula + Párrafo) --- */
.mosaico-cluster {
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding: 40px 20px;
}

.title-capsule.universal-title {
    background-color: var(--bg-secondary);
    color: var(--text-white);
    border-radius: 30px;
    padding: 12px 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 0 25px 0;
    max-width: 100%;
}

.universal-title h2 {
    font-size: 22px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.text-content p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-dark);
    margin-bottom: 15px;
    font-weight: 300;
    text-align: justify;
}

.text-content p:last-child {
    margin-bottom: 0;
}

/* --- Imagen Sangrada Mosaico --- */
.img-bleed {
    width: 100%;
    min-height: 300px;
    background-color: #7a7a7a;
    display: flex;
}

.img-bleed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   2. SECCIÓN: ACTIVIDADES Y CALENDARIO (Nuevo Componente)
   ========================================================================== */

/* --- Layout Principal --- */
.actividades-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* --- Hero Actividades (Móvil: 60vh) --- */
.actividades-hero {
    position: relative;
    height: 50vh;
    width: 100%;
    /* Utiliza la variable inyectada desde el HTML */
    background: var(--bg-hero-act, url('../img/30082026.webp')) no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: flex-end; /* Empuja la tarjeta hacia abajo */
    justify-content: center;
    padding: 20px;
}

/* --- Píldora de Fecha Flotante --- */
.hero-date-badge {
    box-sizing: border-box;
    z-index: 400; /* Asegura que esté por encima de la hero */
    position: absolute; /* Fija la posición en la pantalla */
    top: 375px;
    right: 22px;
    background-color: #25449A; /* Azul Corporativo */
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    
}

/* --- Tarjeta Glassmorphism (Efecto Vidrio) --- */
.actividades-card {
    background: rgba(255, 255, 255, 0.85); /* Blanco semitransparente */
    backdrop-filter: blur(8px); /* Efecto de desenfoque nativo */
    -webkit-backdrop-filter: blur(8px); /* Soporte para Safari */
    border-radius: 15px;
    padding: 15px;
    width: 100%;
    max-width: 500px; /* Evita que sea gigante en tablets horizontales */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 2;
}

.card-title {
    color: #25449A;
    font-size: 20px;
    margin: 5px 0 5px 0;
    font-weight: 600;
    line-height: 1.5;
}

.card-text {
    color: #4a4a4a;
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

/* --- Sección del Calendario --- */
.actividades-calendar {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #d9d9d9; /* Gris claro de fondo */
    padding: 0 5px 5px 5px;    /* 0px arriba, 5px en lados y abajo a sangre con el hero */
}

/* --- Header Azul del Selector de Mes --- */
.calendar-header {
    background-color: #25449A;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-header:hover {
    background-color: #1a337a;
}

.calendar-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
}

/* Triangulito simulado con CSS para el Dropdown */
.calendar-header::after {
    content: '';
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
    margin-top: 4px;
}

/* --- Cuadrícula del Calendario (Grid) --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #fff;
    /* Genera las líneas de las celdas mediante bordes */
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

/* --- Estilos de las Celdas del Calendario --- */
.day-name {
    text-align: center;
    padding: 15px 5px;
    font-size: 12px;
    color: #25449A;
    border-top: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.calendar-cell {
    min-height: 40px;
    border-top: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 18px;
    color: #25449A;
    background-color: #ffffff;
}

.calendar-cell.empty {
    background-color: #f9f9f9;
}

/* Resaltado del Domingo (Columna 1) */
.day-name.sunday, 
.calendar-cell.sunday {
    color: #D32F2F; /* Rojo para diferenciar */
}

/* Celda con Evento Destacado */
.event-cell {
    background-color: #f0f4ff; /* Fondo sutilmente azulado */
    border: 1px solid #25449A; /* Borde de resalte */
}

.event-cell .date-number {
    font-weight: bold;
}

.event-text {
    font-size: 8px;
    color: #555;
    text-align: center;
    margin-top: 5px;
    line-height: 1.2;
}

/* ==========================================================================
   3. SECCIÓN: BREAKPOINT DESKTOP (Min-width: 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    
    /* -------------------------------------------
       3.1. Ajustes Mosaico a Sangre (Interiores)
       ------------------------------------------- */
    .hero-interior {
        background: var(--bg-hero-desktop, url('../img/hero-fi.webp')) no-repeat center center;
        background-size: cover;
        align-items: center;
        width: 100vw;
        min-height: 500px;
        padding: 0 2%;
    }
    
    .hero-content h1 { font-size: 50px; }

    .interior-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        align-items: stretch;
    }

    .mosaico-cluster {
        padding: 80px 10%;
        justify-content: center; 
    }

    .universal-title h2 { font-size: 26px; }
    .text-content p { font-size: 20px; }

    /* Magia Automática: Alternancia de Imágenes en Mosaico */
    .interior-section:nth-child(even) .img-bleed {
        order: -1;
    }

    /* -------------------------------------------
       3.2. Ajustes Actividades (Split Screen)
       ------------------------------------------- */
    .actividades-layout {
        /* Fuerza a la Hero a la derecha y el calendario a la izquierda */
        flex-direction: row-reverse; 
        min-height: 100vh; /* Altura de inmersión total */
        align-items: stretch;
    }

    .actividades-hero {
        width: 50%;
        height: 100vh;
        /* Position sticky permite que si el calendario es muy largo, 
           la foto se quede anclada mientras haces scroll a la izquierda */
        position: sticky; 
        top: 0;
        padding: 40px;
    }

    .hero-date-badge {
        /* Reposicionar la píldora arriba a la derecha en PC y asegurar z-index */
        z-index: 1005;
        top: 40px;
        right: 40px;
        font-size: 15px;
        padding: 12px 35px;
        position: absolute; /* Mantenerla fija mientras se hace scroll */
    }

    .actividades-card {
        padding: 10px;
        max-width: 700px;
    }

    .card-title {
    color: #25449A;
    font-size: 25px;
    margin: 0 0 15px 0;
    font-weight: 600;
    line-height: 1.2;
    padding: 10px 20px 0 20px;
     }

    .card-text {
        font-size: 20px;
        line-height: 1.5;
        padding: 0 20px 20px 20px;
    }

    .actividades-calendar {
        width: 50%;
        max-height: 100vh;
        min-height: 0;
        background-color: #d9d9d9; /* Gris corporativo de fondo */
        /* Arriba: 150px (libera el degradado del menú)
           Derecha: 40px
           Abajo: 50px
           Izquierda: 100px (espacio para cápsula del menú) */
        padding: 150px 40px 50px 100px; 
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        border-right: 1px solid #ddd; /* Separador sutil */
    }

    .calendar-header {
        padding: 25px 20px;
    }
    
    .calendar-header h2 {
        font-size: 25px;
    }

    /* Aumentamos el tamaño de la cuadrícula para PC */
    .day-name {
        font-size: 14px;
        padding: 5px 5px;
    }

    .calendar-cell {
        min-height: 0;
        height: calc((95vh - 278px) / 5);
        max-height: calc((95vh - 278px) / 5);
        font-size: 22px;
        padding: 5px;
        overflow: hidden;
    }

    .event-text {
        font-size: 13px;
        margin-top: 10px;
    }
}

/* ==========================================================================
   4. SECCIÓN: ANIMACIONES GLOBALES DE ENTRADA (SCROLL)
   ========================================================================== */
.slide-in-top { opacity: 0; transform: translateY(-60px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.slide-in-left { opacity: 0; transform: translateX(-80px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.slide-in-right { opacity: 0; transform: translateX(80px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }

/* Control de Retrasos (Efecto Cadena) */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* Clase activa inyectada por JavaScript (Intersection Observer) */
.slide-in-top.is-visible, 
.slide-in-left.is-visible, 
.slide-in-right.is-visible, 
.fade-in.is-visible {
    opacity: 1; transform: translate(0);
}

/* ==========================================================================
NUEVOS ESTILOS DE CALENDARIO Y CÁPSULA AZUL
========================================================================== */

/* Garantizar que la cápsula azul se vea como bloque en móviles */
.actividad-fecha {
    display: inline-block !important;
    background-color: #004b93 !important;
    color: #ffffff !important;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: capitalize;
    box-shadow: 0 2px 8px rgba(0, 75, 147, 0.3);
    letter-spacing: 0.3px;
}

@media (min-width: 1024px) {
    .actividad-fecha {
        font-size: 10px !important;
        padding: 8px 20px;
    }
}

/* Estructura del calendario dinámico */
.seccion-calendario {
    padding: 30px 20px;
}

.calendario-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
}

.selector-container {
    display: flex;
    gap: 10px;
}

.select-mes, .select-anio {
    background-color: #004b93;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.calendario-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    color: #004b93;
    padding-bottom: 10px;
    font-size: 13px;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.dia-vacio {
    min-height: 30px;
}

.dia-casillero {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-height: 30px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
}

.dia-con-evento {
    background-color: #e0f2fe;
    border-color: #004b93;
    cursor: pointer;
    font-weight: 700;
    color: #004b93;
}

.dia-con-evento:hover, .dia-activo {
    background-color: #ffcc00 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 75, 147, 0.25);
}

.evento-dot {
    width: 6px;
    height: 6px;
    background-color: #ffcc00;
    border-radius: 50%;
    margin-top: 4px;
}

.evento-titulo-preview {
    font-size: 10px;
    text-align: center;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   SELECTOR DE MES - POPUP
   ============================================================ */

.calendar-header {
    position: relative;
    cursor: pointer;
    z-index: 50;
}

/* ------------------------------------------------------------
   VENTANA EMERGENTE
   ------------------------------------------------------------ */

#month-selector {
    position: absolute;

    top: 50%;
    left: calc(100% + 18px);

    transform: translateY(-50%);

    width: 430px;

    padding: 22px;

    background: rgba(255, 255, 255, 0.98);

    border-radius: 18px;

    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.22);

    border: 1px solid rgba(0, 0, 0, 0.08);

    z-index: 9999;

    box-sizing: border-box;

    font-family: 'Montserrat', sans-serif;

    animation: monthPopupIn 0.18s ease-out;
}

/* ------------------------------------------------------------
   FLECHA DEL POPUP
   ------------------------------------------------------------ */

#month-selector::before {
    content: "";

    position: absolute;

    left: -10px;
    top: 50%;

    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;

    border-right: 10px solid rgba(255, 255, 255, 0.98);
}

/* ------------------------------------------------------------
   ANIMACIÓN
   ------------------------------------------------------------ */

@keyframes monthPopupIn {

    from {
        opacity: 0;
        transform:
            translateY(-50%)
            translateX(-8px)
            scale(0.97);
    }

    to {
        opacity: 1;
        transform:
            translateY(-50%)
            translateX(0)
            scale(1);
    }
}

/* ------------------------------------------------------------
   CONTENEDOR DE LOS AÑOS
   ------------------------------------------------------------ */

.month-year-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 9px;
    row-gap: 9px;
    margin-bottom: 18px;
}

.month-year-group:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------
   AÑO
   ------------------------------------------------------------ */

.month-year-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    grid-column: 1 / -1;
    margin-bottom: 12px;
    padding-bottom: 8px;
    color: #005198;
    font-size: 19px;
    font-weight: 600;
    border-bottom: 1px solid #e5e8ec;
}

/* ------------------------------------------------------------
   GRID DE MESES
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   BOTÓN DE MES
   ------------------------------------------------------------ */

.month-option {

    width: 100%;

    min-height: 30px;

    border: 1px solid #dfe4ea;

    border-radius: 9px;

    background: #f8fafc;

    color: #005198;

    font-family: 'Montserrat', sans-serif;

    font-size: 13px;

    font-weight: 500;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

/* ------------------------------------------------------------
   HOVER
   ------------------------------------------------------------ */

.month-option:hover {

    background: #005198;

    border-color: #005198;

    color: #ffffff;

    transform: translateY(-2px);

    box-shadow:
        0 5px 12px rgba(0, 81, 152, 0.20);
}

/* ------------------------------------------------------------
   MES SELECCIONADO
   ------------------------------------------------------------ */

.month-option.selected {

    background: #ffd800;

    border-color: #ffd800;

    color: #001c71;

    font-weight: 700;

    box-shadow:
        0 4px 10px rgba(255, 216, 0, 0.28);
}

/* ------------------------------------------------------------
   HOVER DEL SELECCIONADO
   ------------------------------------------------------------ */

.month-option.selected:hover {

    background: #ffd800;

    border-color: #ffd800;

    color: #001c71;

    transform: translateY(-2px);
}


/* ============================================================
   SELECTOR DE MES - RESPONSIVE PARA TELÉFONOS
   ============================================================ */

@media (max-width: 1023px) {

    #month-selector {
        position: fixed;

        top: 50%;
        left: 50%;

        transform: translate(-50%, -50%);

        width: calc(100vw - 30px);
        max-width: 430px;

        max-height: calc(100vh - 30px);

        overflow-y: auto;
        overflow-x: hidden;

        padding: 18px;

        border-radius: 18px;

        z-index: 9999;
    }


    #month-selector::before {
        display: none;
    }


    .month-year-group {
        column-gap: 7px;
        row-gap: 7px;
        margin-bottom: 16px;
    }


    .month-year-title {
        font-size: 18px;
        margin-bottom: 8px;
    }


    .month-option {
        min-height: 40px;
        font-size: 12px;
    }
}


/* ------------------------------------------------------------
   ASEGURAR QUE HIDDEN REALMENTE OCULTE
   ------------------------------------------------------------ */

#month-selector[hidden] {
    display: none !important;
}