/**
 * Estilos del Popup Modal y Carrusel de Comunicados - EPS Marañón
 * Replicando fielmente el diseño del prototipo Blade + Tailwind:
 * - modal-overlay: bg-gray-900 opacity-50
 * - modal-container: bg-white w-11/12 md:max-w-md rounded shadow-lg
 * - modal-content: p-4 text-left
 * - texto (ESC): text-sm color negro arriba a la izquierda
 * - puntos de slider centrados
 */

/* 1. Overlay Exterior (bg-gray-900 opacity-50 fixed w-full h-full top-0 left-0 flex items-center justify-center) */
.epsm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 24, 39, 0.6);
    /* gray-900 ~50-60% */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
    box-sizing: border-box;
}

.epsm-modal-overlay.is-visible {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.epsm-modal-open {
    overflow-x: hidden;
    overflow-y: hidden !important;
}

/* 2. Contenedor del Modal (bg-white w-11/12 md:max-w-md mx-auto rounded shadow-lg overflow-y-auto) */
.epsm-modal-container {
    background-color: #ffffff;
    width: 91.666667%;
    /* w-11/12 */
    max-width: 28rem;
    /* md:max-w-md = 448px */
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.25rem;
    /* rounded = 4px */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* shadow-lg */
    overflow-y: auto;
    max-height: 90vh;
    box-sizing: border-box;
}

/* 3. Contenido interior con padding (p-4 text-left) */
.epsm-modal-content {
    padding: 1rem;
    /* p-4 */
    text-align: left;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* 4. Barra superior con texto (ESC) a la izquierda */
.epsm-modal-top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.5rem;
}

.epsm-modal-close-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.epsm-modal-close-btn:hover {
    color: #4b5563;
}

.epsm-modal-close-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 5. Slider / Carrusel (reemplazo ligero de Splide) */
.epsm-slider {
    position: relative;
    width: 100%;
}

.epsm-slider-track {
    position: relative;
    width: 100%;
    display: grid;
    overflow: hidden;
}

.epsm-slide {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.epsm-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.epsm-slide-link {
    display: block;
    width: 100%;
    line-height: 0;
    cursor: pointer;
}

.epsm-slide-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    object-fit: contain;
}

/* 6. Paginación por Puntos (Splide pagination dots) */
.epsm-slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 4px 0;
}

.epsm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cbd5e1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.epsm-dot:hover {
    background-color: #94a3b8;
}

.epsm-dot.is-active {
    background-color: #3b82f6;
    /* blue-500 en prototipo */
    transform: scale(1.15);
}

.epsm-dot:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Accesibilidad */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
