/**
 * ESTILOS: m_portal_eventos
 * Identidad: estilos_m_portal_eventos.css
 * Consumo estricto de tokens de nucleo/estilos_tokens.css
 */

.portal-principal {
    width: 100%;
}

.portal-seccion-contenedor {
    max-width: var(--ancho-maximo-sitio);
    margin: 0 auto;
    padding: 0 var(--espaciado-contenedor);
}

/* ==========================================================================
   1. HERO INSTITUCIONAL
   ========================================================================== */
.portal-hero {
    background: linear-gradient(180deg, #eef7fb 0%, #ffffff 100%);
    /* Altura panorámica amplia para apreciar la portada completa antes de la cartelera */
    min-height: 85vh;
    min-height: 85svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--alto-barra-navegacion) + 3rem) 0 5rem;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* Variante: Portada de fondo que cubre de lado a lado con efecto Parallax (fondo fijo) */
.portal-hero.hero-con-portada {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    color: #ffffff;
}

/* Optimización Mobile-First: Evitar zoom excesivo y distorsión en pantallas táctiles / móviles */
@media (max-width: 768px) {
    .portal-hero {
        min-height: 70vh;
        min-height: 70svh;
        padding: calc(var(--alto-barra-navegacion) + 1.5rem) 0 3.5rem;
    }

    .portal-hero.hero-con-portada {
        background-attachment: scroll !important;
        background-position: center top !important;
    }
}

.portal-hero-overlay {
    display: none;
    position: absolute;
    inset: 0;
    /* Velo mínimo ultra tenue (15%-20%) sin desenfoque blur, respetando el diseño del administrador */
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.15) 0%, rgba(17, 24, 39, 0.25) 100%);
    z-index: 1;
}

.portal-hero.hero-con-portada .portal-hero-overlay {
    display: block;
}

.portal-hero-contenedor {
    position: relative;
    z-index: 2;
    max-width: var(--ancho-maximo-sitio);
    margin: 0 auto;
    padding: 0 var(--espaciado-contenedor);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.portal-hero.hero-con-portada .portal-hero-titulo {
    color: #ffffff;
    /* Contorno difuso y sombra profunda exclusiva para el cuerpo de las letras */
    text-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.9),
        0 3px 8px rgba(0, 0, 0, 0.8),
        0 6px 16px rgba(0, 0, 0, 0.7),
        0 0 24px rgba(0, 0, 0, 0.6);
}

.portal-hero.hero-con-portada .portal-hero-subtitulo {
    color: #ffffff;
    /* Contorno difuso y sombra suave exclusiva para el contorno de las letras */
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.9),
        0 2px 6px rgba(0, 0, 0, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(0, 0, 0, 0.5);
}

.portal-hero.hero-con-portada .portal-badge-causa {
    background-color: rgba(17, 24, 39, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.portal-hero.hero-con-portada .portal-cohete-tarjeta {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.portal-hero-textos {
    text-align: center;
    max-width: 680px;
}

.portal-badge-causa {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(84, 179, 206, 0.12);
    color: var(--color-marca-secundario);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radio-pildora);
    margin-bottom: 1.25rem;
}

.punto-verde {
    width: 8px;
    height: 8px;
    background-color: var(--color-estado-exito);
    border-radius: 50%;
    display: inline-block;
}

.portal-hero-titulo {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--color-texto-titulos);
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.portal-hero-subtitulo {
    font-size: 1.05rem;
    color: var(--color-texto-cuerpo);
    margin-bottom: 2rem;
    line-height: 1.55;
}

.portal-hero-acciones {
    display: flex;
    justify-content: center;
}

.portal-btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 28px;
    background-color: var(--color-marca-acento);
    color: var(--color-texto-acento);
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--radio-boton);
    box-shadow: var(--sombra-boton-cta);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.portal-btn-cta:active {
    transform: scale(0.97);
}

/* Tarjeta Visual Cohete */
.portal-hero-visual {
    width: 100%;
    max-width: 380px;
}

.portal-cohete-tarjeta {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde-suave);
    border-radius: var(--radio-tarjeta);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--sombra-tarjeta);
}

.cohete-icono {
    font-size: 2.2rem;
}

.cohete-datos {
    display: flex;
    flex-direction: column;
}

.cohete-etiqueta {
    font-size: 0.8rem;
    color: var(--color-texto-atenuado);
    font-weight: 600;
}

.cohete-valor {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-texto-titulos);
}

/* ==========================================================================
   2. SECCIÓN Y CUADRÍCULA DE EVENTOS
   ========================================================================== */
.portal-eventos-seccion {
    padding: 4rem 0;
    background-color: var(--color-fondo-nube);
}

.portal-seccion-cabecera {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}

.portal-seccion-pre {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-marca-secundario);
    display: block;
    margin-bottom: 6px;
}

.portal-seccion-titulo {
    font-size: 1.85rem;
    color: var(--color-texto-titulos);
    margin-bottom: 0.8rem;
}

.portal-seccion-bajada {
    font-size: 0.95rem;
    color: var(--color-texto-cuerpo);
}

.portal-eventos-cuadricula {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
}

/* Tarjeta / Gadget de Evento */
.gadget-evento-tarjeta {
    background-color: var(--color-superficie);
    border-radius: var(--radio-tarjeta);
    overflow: hidden;
    box-shadow: var(--sombra-tarjeta);
    border: 1px solid var(--color-borde-suave);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gadget-evento-tarjeta:hover {
    box-shadow: var(--sombra-tarjeta-hover);
    transform: translateY(-2px);
}

.gadget-evento-portada {
    position: relative;
    width: 100%;
    height: 190px;
    background-color: #e5e7eb;
}

.gadget-evento-portada img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gadget-evento-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(38, 38, 60, 0.85);
    color: var(--color-texto-invertido);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radio-pildora);
    backdrop-filter: blur(4px);
}

.gadget-cuenta-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background-color: rgba(38, 38, 60, 0.92);
    color: var(--color-boton-cta, #f7d158);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radio-pildora);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
}

.gadget-evento-tipo {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: var(--color-marca-acento);
    color: var(--color-texto-acento);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radio-pildora);
}

.gadget-evento-cuerpo {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gadget-evento-titulo {
    font-size: 1.25rem;
    color: var(--color-texto-titulos);
    margin-bottom: 6px;
    line-height: 1.3;
}

.gadget-evento-subtitulo {
    font-size: 0.88rem;
    color: var(--color-marca-secundario);
    font-weight: 600;
    margin-bottom: 1rem;
}

.gadget-evento-detalles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--color-fondo-nube);
    padding: 12px 14px;
    border-radius: var(--radio-campo);
    margin-bottom: 1rem;
}

.gadget-detalle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--color-texto-cuerpo);
    font-weight: 600;
}

.gadget-evento-desc {
    font-size: 0.88rem;
    color: var(--color-texto-cuerpo);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.gadget-evento-pie {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid var(--color-borde-suave);
}

.gadget-evento-precio {
    display: flex;
    flex-direction: column;
}

.precio-etiqueta {
    font-size: 0.72rem;
    color: var(--color-texto-atenuado);
    text-transform: uppercase;
    font-weight: 700;
}

.precio-monto {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-marca-primario);
}

.gadget-evento-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px;
    background-color: var(--color-marca-primario);
    color: var(--color-texto-invertido);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radio-boton);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.gadget-evento-btn:active {
    transform: scale(0.96);
    background-color: #1a1a2e;
}

/* ==========================================================================
   3. SECCIÓN LA CAUSA DE AIDI
   ========================================================================== */
.portal-causa-seccion {
    padding: 4rem 0;
    background-color: var(--color-fondo-base);
}

.portal-causa-tarjeta {
    background: linear-gradient(135deg, #26263c 0%, #1a1a2e 100%);
    border-radius: var(--radio-tarjeta);
    padding: 2.5rem 1.75rem;
    color: var(--color-texto-invertido);
    box-shadow: var(--sombra-tarjeta);
}

.portal-causa-insignia {
    display: inline-block;
    background-color: rgba(247, 209, 88, 0.2);
    color: var(--color-marca-acento);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radio-pildora);
    margin-bottom: 1rem;
}

.portal-causa-titulo {
    font-size: 1.8rem;
    color: var(--color-texto-invertido);
    margin-bottom: 0.5rem;
}

.portal-causa-subtitulo {
    font-size: 1.1rem;
    color: var(--color-marca-acento);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.portal-causa-descripcion {
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.portal-btn-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    background-color: var(--color-texto-invertido);
    color: var(--color-marca-primario);
    font-weight: 700;
    border-radius: var(--radio-boton);
    transition: transform 0.15s ease;
}

.portal-btn-secundario:active {
    transform: scale(0.97);
}

/* ==========================================================================
   4. PIE DE PÁGINA
   ========================================================================== */
.portal-pie {
    background-color: #1a1a29;
    color: #cbd5e1;
    padding: 3rem 0 2rem;
    font-size: 0.9rem;
}

.portal-pie-cuadricula {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.portal-pie-titulo {
    color: var(--color-texto-invertido);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.portal-pie-texto {
    color: #94a3b8;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.portal-pie-enlaces {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-pie-enlaces a {
    color: var(--color-marca-secundario);
    font-weight: 600;
}

.portal-pie-creditos {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
}

/* Badge de Versionado y Entorno (Inspirado en InnovAPP) */
.portal-pie-version-contenedor {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.portal-version-wrapper {
    position: relative;
    display: inline-flex;
}

.portal-badge-version {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radio-pildora);
    font-size: 0.76rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.02em;
    background-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    user-select: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.portal-badge-version:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.portal-badge-punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8;
    display: inline-block;
    transition: box-shadow 0.2s ease;
}

/* Tooltip Flotante Interactivo al pasar el mouse o tocar */
.portal-version-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background-color: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

/* Triángulo / Flecha indicadora apuntando al badge */
.portal-version-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1a1a2e transparent transparent transparent;
}

/* Mostrar tooltip al pasar el cursor o al dar clic/toque táctil */
.portal-version-wrapper:hover .portal-version-tooltip,
.portal-version-tooltip.activo {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.portal-tooltip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.portal-tooltip-clave {
    color: #94a3b8;
    font-weight: 600;
}

.portal-tooltip-valor {
    color: #f8fafc;
    font-weight: 700;
}

/* Estilo: Entorno Local (Azul Institucional / Cian) */
.portal-badge-version.entorno-local {
    background-color: rgba(84, 179, 206, 0.14);
    border-color: rgba(84, 179, 206, 0.45);
    color: #54b3ce;
}

.portal-badge-version.entorno-local:hover {
    border-color: #54b3ce;
}

.portal-badge-version.entorno-local .portal-badge-punto {
    background-color: #54b3ce;
    box-shadow: 0 0 10px #54b3ce;
}

/* Estilo: Entorno Producción (Verde Esmeralda) */
.portal-badge-version.entorno-produccion {
    background-color: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.portal-badge-version.entorno-produccion:hover {
    border-color: #34d399;
}

.portal-badge-version.entorno-produccion .portal-badge-punto {
    background-color: #34d399;
    box-shadow: 0 0 10px #34d399;
}

/* Estilo: Entorno Pruebas (Amarillo) */
.portal-badge-version.entorno-pruebas {
    background-color: rgba(247, 209, 88, 0.16);
    border-color: rgba(247, 209, 88, 0.5);
    color: #f7d158;
}

.portal-badge-version.entorno-pruebas:hover {
    border-color: #f7d158;
}

.portal-badge-version.entorno-pruebas .portal-badge-punto {
    background-color: #f7d158;
    box-shadow: 0 0 10px #f7d158;
}

/* ==========================================================================
   RESPONSIVIDAD TABLET / ESCRITORIO
   ========================================================================== */
@media (min-width: 768px) {
    .portal-hero {
        padding: 5rem 0 6rem;
    }

    .portal-hero-contenedor {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .portal-hero-textos {
        text-align: left;
    }

    .portal-hero-titulo {
        font-size: 3rem;
    }

    .portal-hero-acciones {
        justify-content: flex-start;
    }

    .portal-eventos-cuadricula {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-causa-tarjeta {
        padding: 3.5rem;
    }

    .portal-pie-cuadricula {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .portal-eventos-cuadricula {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   SKELETON SHIMMER CARDS (PREVENCIÓN DE DESCUADRE VISUAL)
   ========================================================================== */
.gadget-evento-skeleton {
    background-color: #ffffff;
    border-radius: var(--radio-tarjeta, 16px);
    overflow: hidden;
    border: 1px solid var(--color-borde-suave, #e5e7eb);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f0f2f5 25%, #e4e7eb 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: aidiShimmer 1.5s infinite;
}

@keyframes aidiShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-portada {
    width: 100%;
    height: 190px;
}

.skeleton-cuerpo {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-linea {
    height: 14px;
    border-radius: 6px;
}

.skeleton-linea-titulo {
    height: 22px;
    width: 85%;
}

.skeleton-linea-subtitulo {
    height: 14px;
    width: 60%;
}

.skeleton-caja-detalles {
    height: 60px;
    border-radius: 8px;
    margin: 4px 0;
}

.skeleton-pie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid #f0f2f5;
}

.skeleton-boton {
    width: 110px;
    height: 38px;
    border-radius: 8px;
}
