/* Estilos noticias.html */

/* 1. EL CONTENEDOR PRINCIPAL: Ahora ocupa de lado a lado de la pantalla */
.calendarEvents {
    position: relative; /* <--- AÑADE SOLO ESTA LÍNEA AQUÍ */
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-bottom: 10vh;
    overflow: hidden; 
}

/* --- LOS DIFUMINADOS LATERALES FANTASMAS --- */
.calendarEvents::before,
.calendarEvents::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18vw; /* Un poco menos que tus 20vw de margen para que la tarjeta asome suavemente */
    z-index: 10; /* Para que quede por encima de las tarjetas */
    pointer-events: none; /* ¡CRÍTICO! Esto permite que puedas hacer clic en las flechas y tarjetas a través del degradado */
}

/* Difuminado Izquierdo (De blanco puro a transparente) */
.calendarEvents::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 5%, rgba(255, 255, 255, 0) 100%);
}

/* Difuminado Derecho (De transparente a blanco puro) */
.calendarEvents::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 5%, rgba(255, 255, 255, 0) 100%);
}

/* 2. EL TÍTULO Y LAS FLECHAS: Les ponemos el margen interno para que sigan alineados */
.calendarEvents .calendarEventTitle,
.Arrows {
    padding: 0 20vw; /* Usamos padding en lugar de margin */
}

.calendarEvents .calendarEventTitle {
    color: var(--primaryColor);
    font-family: var(--textFont);
    font-size: var(--font-big);
    font-weight: var(--font-weight-big);
}

.Arrows {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Alinea las flechas a la derecha */
    gap: 10px;
}

.Arrows button {
    width: 25px;
    height: 25px;
    background-color: var(--light-grey);
    border: none;
    border-radius: 10px;
    transition: all 0.5s ease;
    cursor: pointer; /* Un buen detalle para saber que son clicables */
}

.Arrows button:hover {
    width: 30px;
    height: 30px;
    background-color: var(--grey);
}

.Arrows button i {
    color: var(--black);
    font-family: var(--textFont);
    font-size: var(--font-normal);
    font-weight: var(--font-weight-normal);
}

/* 3. LA REJILLA DE EVENTOS (El efecto Netflix) */
.eventsGrid {
    display: flex;
    gap: 30px;
    
    /* LA MAGIA: El padding izquierdo hace que empiece alineado. 
       El padding derecho asegura que quede hueco al final del carrusel. */
    padding: 20px 20vw; 

    overflow-x: auto; /* Permite deslizar horizontalmente */
    flex-wrap: nowrap; /* Impide que bajen de línea */
    scroll-behavior: smooth; /* Deslizamiento suave */
    
    /* Ocultar la barra de scroll para que se vea limpio */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

.eventsGrid::-webkit-scrollbar {
    display: none; 
}

/* --- ESTRUCTURA 3D FLIP CARD --- */
.eventCard-wrapper {
    /* ESTO ES CRÍTICO: Evita que la tarjeta se encoja para caber en la pantalla */
    flex: 0 0 auto; 
    
    width: 15vw; 
    height: 40vh;
    min-width: 260px; /* Asegura que no se deformen en pantallas raras */
    min-height: 380px; 
    
    perspective: 1000px;
    cursor: pointer;
}

.eventCard-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1); /* Giro muy suave y elegante */
    transform-style: preserve-3d; /* Permite el efecto 3D */
    
    /* Sombras más naturales: una grande y difuminada, otra pequeñita para el borde */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.03);
    border-radius: 15px;
}

/* La clase que se activa al hacer CLIC */
.eventCard-wrapper.flipped .eventCard-inner {
    transform: rotateY(180deg);
}

.eventCard-front, .eventCard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Oculta la parte que queda detrás */
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden; /* Evita que la imagen se salga por las esquinas redondas */
}

/* --- CARA FRONTAL --- */
.eventCard-front {
    background-color: #fcfcfc; /* Un blanco/gris hiper luminoso */
    display: flex;
    flex-direction: column;
}

.eventContent {
    height: 18vh;
    background-image: url('/img/ArduinoImage.png');
    background-size: cover;
    background-position: center;
    background-color: #fff; /* Por si la imagen tiene transparencias */
    position: relative;
}

.eventDate {
    position: absolute;
    top: 0;
    left: 20px;
    background-color: var(--orange);
    color: white;
    padding: 8px 12px;
    border-radius: 0 0 10px 10px; /* Hace efecto de lazo colgando de arriba */
    text-align: center;
    line-height: 1.2;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2); /* Sombra para que el lazo flote */
}

.eventDate p {
    font-family: var(--textFont);
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0;
}

.eventText {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1; /* Ocupa todo el espacio sobrante hacia abajo */
}

.eventTitle {
    color: var(--primaryColorDarker);
    font-family: var(--textFont);
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

/* LA MAGIA DE LOS 3 PUNTOS */
.eventDescription {
    color: var(--secondaryColor);
    font-family: var(--textFont);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    
    /* CSS para cortar el texto a 3 líneas exactamente */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hour-more {
    display: flex;
    flex-direction: row;

    align-items: center;
    justify-content: space-between;
}

.eventHour {
    margin-top: auto; /* Empuja el botón del reloj siempre abajo del todo */
    align-self: flex-start; /* Se encoge al tamaño del texto */
    background-color: rgba(255, 144, 0, 0.15); /* Naranja transparente muy elegante */
    color: var(--orange);
    font-family: var(--textFont);
    font-size: 0.85rem;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 0;
}

.moreBtn {
    text-align: center;

    background-color: var(--orange);
    color: var(--white);

    padding: 5px 10px;
    border-radius: 15px;
}



/* --- CARA TRASERA (INFO COMPLETA) --- */
.eventCard-back {
    background-color: var(--primaryColor);
    color: var(--white);
    transform: rotateY(180deg); /* Ya viene girada */
    
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra horizontalmente */
    justify-content: flex-start; /* Hace que el texto empiece desde arriba, vital para textos largos */
    
    padding: 30px;
    box-sizing: border-box; /* CRÍTICO: Evita que el padding haga crecer la tarjeta */
    overflow-y: auto; /* LA MAGIA: Añade scroll vertical si el texto es muy largo */
}

/* Scrollbar elegante para la parte trasera de la tarjeta */
.eventCard-back::-webkit-scrollbar {
    width: 6px;
}
.eventCard-back::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05); /* Carril casi transparente */
    border-radius: 10px;
}
.eventCard-back::-webkit-scrollbar-thumb {
    background: var(--orange); /* La barra en tu naranja corporativo */
    border-radius: 10px;
}

.eventTextBack {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
    width: 100%;
    margin: auto 0; /* Si hay poco texto, lo centra verticalmente. Si hay mucho, lo deja arriba */
}

.eventTextBack h2 {
    color: var(--white);
    font-family: var(--textFont);
    font-size: 1.5rem;
    margin: 0;
}

.eventTextBack p {
    font-family: var(--textFont);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e5e5e5;
    margin: 0;
}

.eventTextBack .btn-reservar {
    margin-top: 15px;
    margin-bottom: 10px; /* Un poco de aire por abajo para cuando hagas scroll a tope */
    background-color: var(--orange);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.eventTextBack .btn-reservar:hover {
    background-color: #e68200;
}

.eventTextBack .btn-reservar a {
    color: white;
    text-decoration: none;
}

/* Pequeño efecto hover para avisar de que es clickeable */
.eventCard-wrapper:hover .eventCard-inner {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* EL CONTENEDOR GENERAL */
.publicaciones {
    padding: 60px 20vw;
    background-color: var(--white, #ffffff);
}

.publicaciones-header {
    text-align: center;
    margin-bottom: 50px;
}

.publicaciones-header h1 {
    color: var(--primaryColor);
    font-family: var(--textFont);
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.publicaciones-header p {
    color: var(--secondaryColor);
    font-family: var(--textFont);
    font-size: 1.1rem;
}

/* LA CUADRÍCULA INTELIGENTE (Responsive automático) */
.publicacionesGrid {
    display: grid;
    /* Esto crea columnas de mínimo 320px. Si sobra espacio, se estiran (1fr) */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px; /* Espacio entre tarjetas */
}

/* LA TARJETA DE NOTICIA */
.newsCard {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden; /* Corta las esquinas de la foto */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Sombra suave premium */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.newsCard:hover {
    transform: translateY(-8px); /* Se eleva un poquito al pasar el ratón */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* LA IMAGEN UNIFORME (Soluciona tu problema de tamaños) */
.newsImage {
    width: 100%;
    height: 220px; /* Altura fija para TODAS las fotos */
    background-color: var(--light-grey);
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid var(--orange); /* Un toque corporativo de color */
}

/* EL CONTENIDO DE TEXTO */
.newsContent {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Ocupa el espacio sobrante si una tarjeta tiene menos texto */
    gap: 15px;
}

.newsDate {
    color: var(--orange);
    font-family: var(--textFont);
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.newsTitle {
    color: var(--primaryColorDarker);
    font-family: var(--textFont);
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.3;
    margin: 0;
}

.newsDesc {
    color: var(--secondaryColor);
    font-family: var(--textFont);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    
    /* Cortamos el texto a 4 líneas para mantener uniformidad */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;

    text-overflow: ellipsis;
}

.newsLink {
    margin-top: auto; /* Empuja el botón siempre hacia abajo del todo */
    color: var(--primaryColor);
    font-family: var(--textFont);
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.newsLink:hover {
    color: var(--orange);
}

@media (max-width: 1600px) {
    .eventCard-wrapper {
        width: 30vw; /* Tamaño fijo de la tarjeta para que no se deforme */
        height: 60vh;
    }

    .publicaciones {
        padding: 60px 10vw;
    }
}

@media (max-width: 1000px) {
    .eventCard-wrapper {
        width: 60vw; /* Tamaño fijo de la tarjeta para que no se deforme */
        height: 80vh;
    }

    .publicaciones {
        padding: 60px 1vw;
    }
}