/* Portal14 Noticias Carrusel - estilo actualidad (verde Inter)
   Desplazamiento por arrastre/swipe + flechas + auto. */
.ifs-carrusel {
        --ifs-navy: #2FA04E;
        --ifs-navy-dark: #22833B;
        --ifs-white: #ffffff;
        --ifs-red: #22833B;
        --ifs-grey: #6b7280;
        --ifs-gap: 16px;
        --ifs-side: 16px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 0 0 var(--ifs-side);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        color: var(--ifs-navy);
}
.ifs-carrusel *,
.ifs-carrusel *::before,
.ifs-carrusel *::after {
        box-sizing: border-box;
}

/* Cabecera de sección */
.ifs-carrusel__header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        margin-bottom: 20px;
        gap: 16px;
        padding-right: var(--ifs-side);
}
.ifs-carrusel__title {
        margin: 0;
        font-size: clamp(2rem, 3.6vw, 3rem);
        font-weight: 800;
        letter-spacing: 0.01em;
        text-transform: uppercase;
        color: var(--ifs-navy);
        line-height: 1;
}
.ifs-carrusel__vertodo {
        flex: none;
        font-size: 0.9rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--ifs-navy);
        text-decoration: none;
        white-space: nowrap;
}
.ifs-carrusel__vertodo:hover {
        color: var(--ifs-red);
}

/* Viewport + flechas */
.ifs-carrusel__viewport {
        position: relative;
        width: 100%;
}

/* Pista: contenedor con scroll horizontal nativo + snap */
.ifs-carrusel__track {
        display: flex;
        gap: var(--ifs-gap);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
        -ms-overflow-style: none;       /* IE/Edge */
        cursor: grab;
        padding-bottom: 2px;
}
.ifs-carrusel__track::-webkit-scrollbar {
        display: none;                  /* Chrome/Safari */
}
.ifs-carrusel__track.is-grabbing {
        cursor: grabbing;
        scroll-behavior: auto;
        scroll-snap-type: none;
}

/* Slides: 4 visibles + la 5ª asomando (cortada) en escritorio */
.ifs-carrusel__slide {
        flex: 0 0 calc((100% - (var(--ifs-gap) * 3)) / 4.3);
        max-width: calc((100% - (var(--ifs-gap) * 3)) / 4.3);
        scroll-snap-align: start;
}

/* Tarjeta: imagen + titular debajo (contenedor con enlace de cobertura) */
.ifs-carrusel__card {
        position: relative;
        display: block;
        color: inherit;
        background: transparent;
        overflow: hidden;
        height: 100%;
}

/* Enlace que cubre la tarjeta */
.ifs-carrusel__cover {
        position: absolute;
        inset: 0;
        z-index: 1;
        text-indent: -9999px;
        overflow: hidden;
}

/* Media 16:9 */
.ifs-carrusel__media {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: hidden;
        background: var(--ifs-navy);
}
.ifs-carrusel__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.4s ease;
        pointer-events: none;
}
.ifs-carrusel__card:hover .ifs-carrusel__media img {
        transform: scale(1.05);
}
.ifs-carrusel__media--placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--ifs-navy), var(--ifs-navy-dark));
}
.ifs-carrusel__ph-text {
        color: rgba(255, 255, 255, 0.85);
        font-size: 2.4rem;
        font-weight: 800;
        letter-spacing: 0.08em;
}

/* Etiqueta categoría */
.ifs-carrusel__cat {
        position: absolute;
        left: 0;
        bottom: 0;
        z-index: 3;
        background: var(--ifs-red);
        color: var(--ifs-white);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        padding: 5px 10px;
        pointer-events: none;
}

/* Botón de PLAY (vídeo) */
.ifs-carrusel__play {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 4;
        width: 56px;
        height: 56px;
        padding: 0;
        border: none;
        background: none;
        cursor: pointer;
        transition: transform 0.2s ease;
}
.ifs-carrusel__play svg {
        width: 100%;
        height: 100%;
        display: block;
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
.ifs-carrusel__play circle {
        fill: rgba(255, 255, 255, 0.92);
}
.ifs-carrusel__play polygon {
        fill: var(--ifs-navy-dark);
}
.ifs-carrusel__play:hover {
        transform: translate(-50%, -50%) scale(1.08);
}

/* Cuerpo de tarjeta */
.ifs-carrusel__body {
        padding: 14px 0 4px;
        position: relative;
        z-index: 2;
        pointer-events: none;
}
.ifs-carrusel__card-title {
        margin: 0 0 6px;
        font-size: 1rem;
        font-weight: 800;
        line-height: 1.25;
        color: var(--ifs-navy);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
}
/* El titular es un enlace: hereda estilo del <h3> y va por encima del cover. */
.ifs-carrusel__card-title a {
        color: inherit;
        text-decoration: none;
        position: relative;
        z-index: 3;
}
.ifs-carrusel__card:hover .ifs-carrusel__card-title,
.ifs-carrusel__card-title a:hover {
        color: var(--ifs-navy-dark);
}
.ifs-carrusel__date {
        font-size: 0.8rem;
        color: var(--ifs-grey);
}
.ifs-carrusel__btn {
        display: inline-block;
        margin-top: 10px;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-decoration: none;
        color: var(--ifs-white);
        background: var(--ifs-navy);
        padding: 8px 14px;
        border-radius: 4px;
        pointer-events: auto;
        position: relative;
        z-index: 4;
        transition: background 0.2s ease;
}
.ifs-carrusel__btn:hover {
        background: var(--ifs-navy-dark);
        color: var(--ifs-white);
}

/* Flechas de navegación (centradas sobre la imagen) */
.ifs-carrusel__nav {
        position: absolute;
        top: calc((100vw - var(--ifs-side) - (var(--ifs-gap) * 3)) / 4.3 * 9 / 16 / 2);
        transform: translateY(-50%);
        z-index: 5;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 50%;
        background: var(--ifs-navy);
        color: var(--ifs-white);
        font-size: 1rem;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        transition: background 0.2s ease, transform 0.2s ease;
        opacity: 0.95;
}
.ifs-carrusel__nav:hover {
        background: var(--ifs-red);
}
.ifs-carrusel__nav:active {
        transform: translateY(-50%) scale(0.94);
}
.ifs-carrusel__nav--prev {
        left: 6px;
}
.ifs-carrusel__nav--next {
        right: 6px;
}

/* Estado vacío */
.ifs-carrusel--vacio {
        padding: 24px;
        text-align: center;
        color: var(--ifs-grey);
}

/* Responsive: tablet 2 visibles + peek */
@media (max-width: 900px) {
        .ifs-carrusel__slide {
                flex: 0 0 calc((100% - var(--ifs-gap)) / 2.3);
                max-width: calc((100% - var(--ifs-gap)) / 2.3);
        }
        .ifs-carrusel__nav {
                top: calc((100vw - var(--ifs-side) - var(--ifs-gap)) / 2.3 * 9 / 16 / 2);
        }
        .ifs-carrusel__title {
                font-size: clamp(1.7rem, 5vw, 2.2rem);
        }
}

/* Responsive: móvil 1 visible grande + peek (presencia máxima) */
@media (max-width: 560px) {
        .ifs-carrusel {
                --ifs-side: 12px;
        }
        .ifs-carrusel__header {
                margin-bottom: 14px;
        }
        .ifs-carrusel__track {
                gap: 12px;
        }
        .ifs-carrusel__slide {
                flex: 0 0 calc(100% / 1.12);
                max-width: calc(100% / 1.12);
        }
        .ifs-carrusel__nav {
                top: calc((100vw - var(--ifs-side)) / 1.12 * 9 / 16 / 2);
                width: 38px;
                height: 38px;
        }
        .ifs-carrusel__card-title {
                font-size: 1rem;
        }
        .ifs-carrusel__play {
                width: 64px;
                height: 64px;
        }
}

/* ================= MODAL DE VÍDEO (compartido Portal14) ================= */
.p14-video-modal {
        position: fixed;
        inset: 0;
        z-index: 999999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: rgba(0, 0, 0, 0.82);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
}
.p14-video-modal.is-open {
        opacity: 1;
        visibility: visible;
}
.p14-video-modal__box {
        position: relative;
        width: 100%;
        max-width: 960px;
        aspect-ratio: 16 / 9;
        background: #000;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        transform: scale(0.94);
        transition: transform 0.25s ease;
}
.p14-video-modal.is-open .p14-video-modal__box {
        transform: scale(1);
}
.p14-video-modal__box iframe,
.p14-video-modal__box video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        display: block;
}
.p14-video-modal__close {
        position: absolute;
        top: -14px;
        right: -14px;
        z-index: 2;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 50%;
        background: #fff;
        color: #111;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        transition: transform 0.15s ease;
}
.p14-video-modal__close:hover {
        transform: scale(1.08);
}
@media (max-width: 620px) {
        .p14-video-modal__close {
                top: 8px;
                right: 8px;
        }
}
