/* Estilos propios del sitio: contador, galería, visor de fotos y animaciones.
   Se carga después de style.css (tema) para poder sobrescribirlo. */

/* ---------- Pantalla de carga ---------- */
/* Solo se muestra si hay JavaScript; así la página nunca queda en blanco. */
.fh5co-loader {
    display: none;
    transition: opacity 0.4s ease;
}
.js .fh5co-loader {
    display: block;
}
.fh5co-loader.oculto {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Contador ---------- */
.contador-contenedor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}
.contador-contenedor [hidden] {
    display: none;
}

.contador-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.btn-tiempo {
    padding: 8px 16px;
    font: inherit;
    font-size: 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-tiempo:hover,
.btn-tiempo:focus-visible {
    background: rgba(255, 255, 255, 0.25);
}
.btn-tiempo:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.btn-tiempo.activo {
    background: #F14E95;
    border-color: #F14E95;
    font-weight: 600;
}

.contador-progresivo {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.tiempo-item {
    color: #fff;
    border-radius: 10px;
    padding: 15px;
    min-width: 100px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tiempo-valor {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.tiempo-etiqueta {
    font-size: 1rem;
    text-transform: uppercase;
    margin-top: 10px;
    opacity: 0.9;
}

.contador-unico {
    color: #fff;
}
.contador-unico .tiempo-valor {
    font-size: 5rem;
}
.contador-unico .tiempo-etiqueta {
    font-size: 1.4rem;
    margin-top: 0;
}

@media screen and (max-width: 768px) {
    .contador-contenedor {
        gap: 14px;
    }
    .contador-progresivo {
        gap: 8px;
    }
    .btn-tiempo {
        padding: 6px 12px;
        font-size: 13px;
    }
    .tiempo-item {
        min-width: 86px;
        padding: 10px 8px;
    }
    .tiempo-valor {
        font-size: 2.6rem;
    }
    .tiempo-etiqueta {
        font-size: 0.9rem;
        margin-top: 4px;
    }
    .contador-unico .tiempo-valor {
        font-size: 3.2rem;
    }
}

/* ---------- Galería ---------- */
/* Las fotos son <img> con carga diferida en vez de fondos CSS. */
#fh5co-gallery-list li {
    overflow: hidden;
    background-color: #e6e6e6;
}
#fh5co-gallery-list li a > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

/* ---------- Visor de fotos ---------- */
.visor {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    overflow: hidden;
}
.visor::backdrop {
    background: rgba(0, 0, 0, 0.92);
}
.visor figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 50px 16px 20px;
    box-sizing: border-box;
}
.visor img {
    max-width: 100%;
    max-height: calc(100% - 50px);
    min-height: 0;
    object-fit: contain;
    border-radius: 4px;
}
.visor figcaption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    text-align: center;
}
.visor button {
    position: absolute;
    z-index: 1;
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.visor button:hover,
.visor button:focus-visible {
    background: #F14E95;
    outline: none;
}
.visor-cerrar {
    top: 10px;
    right: 10px;
}
.visor-anterior,
.visor-siguiente {
    top: 50%;
    transform: translateY(-50%);
}
.visor-anterior {
    left: 10px;
}
.visor-siguiente {
    right: 10px;
}

/* ---------- Animaciones de entrada ---------- */
/* Los elementos .animate-box parten ocultos solo cuando hay JavaScript. */
.js .animate-box {
    opacity: 0;
}

.animated-fast {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}
.fadeIn {
    animation-name: fadeIn;
}
.fadeInUp {
    animation-name: fadeInUp;
}
.fadeInLeft {
    animation-name: fadeInLeft;
}
.fadeInRight {
    animation-name: fadeInRight;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 40px, 0); }
    to   { opacity: 1; transform: none; }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translate3d(-50px, 0, 0); }
    to   { opacity: 1; transform: none; }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translate3d(50px, 0, 0); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .js .animate-box {
        opacity: 1;
    }
    .animated-fast {
        animation: none;
    }
}
