/* ================== Base ================== */
:root {
    --carousel-cycle: 15s;
    --fade-duration: 1s;
    --nav-h: 80px;

    /* Fallbacks si no se sobreescriben en Blade */
    --img-base: url('../../images/kinder_fachada.webp');
    --img-2:    url('../../images/daycare-1.webp');
    --img-3:    url('../../images/daycare-2.webp');
}

body {
    background-color: #f8f9fa;
    margin: 0;
}

/* ================== Header / Carrusel ================== */
.header {
    position: relative;
    height: calc(100vh - var(--nav-h));
    min-height: 420px;
    color: #fff;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;

    /* Precarga imágenes */
    background:
        var(--img-base) no-repeat -9999px -9999px,
        var(--img-2)    no-repeat -9999px -9999px,
        var(--img-3)    no-repeat -9999px -9999px;
}

/* Imagen de fondo base */
.header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.25) 100%),
        var(--img-base);
    z-index: -2;
}

/* Capa animada (imagen 2 y 3) */
.header::after {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-image:
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.25) 100%),
        var(--img-2);
    z-index: -1;
    opacity: 0;
    animation:
        fadeCycle var(--carousel-cycle) linear infinite both,
        changeImage var(--carousel-cycle) steps(1, end) infinite both;
}

/* ================== Tipografía interna ================== */
.header h1 {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    line-height: 1;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
    display: inline-block;
    padding: 0.25em 0.6em;
    color: #fff;
    background: linear-gradient(90deg, #0d324d 0%, #09323d 100%);
    border-radius: 50px;
    opacity: 0.7;
}

.breadcrumb-nav {
    font-size: 1.1rem;
    color: #dee2e6;
}

.breadcrumb-nav a {
    color: #dee2e6;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: #dee2e6;
}

/* ================== Animaciones sincronizadas ================== */
@keyframes fadeCycle {
    0%, 30%   { opacity: 0; }
    33.333%   { opacity: 1; }
    63.333%   { opacity: 1; }
    66.666%   { opacity: 0; }  /* se apaga antes del cambio */
    70%       { opacity: 1; }  /* enciende ya con la nueva imagen */
    96.666%   { opacity: 1; }
    100%      { opacity: 0; }
}

@keyframes changeImage {
    0%, 66.665% {
        background-image:
            linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.25) 100%),
            var(--img-2);
    }
    66.666%, 100% {
        background-image:
            linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.25) 100%),
            var(--img-3);
    }
}

/* ================== Accesibilidad ================== */
@media (prefers-reduced-motion: reduce) {
    .header::after {
        animation: none;
        opacity: 0;
    }
}

/* ================== Responsive ================== */
@media (max-width: 768px) {
    :root {
        --carousel-cycle: 12s;
        --fade-duration: 0.8s;
    }

    .header {
        height: 50vh;
        min-height: 350px;
    }
}

/* --- reset base --- */
html, body {
    height: 100%;
}

/* iOS/Safari antiguo fallback */
@supports not (height: 100dvh) {
    html { height: -webkit-fill-available; }
    body { min-height: -webkit-fill-available; }
    .header { height: -webkit-fill-available !important; }
}

/* Navegadores modernos */
@supports (height: 100dvh) {
    .header { height: 100dvh !important; }
}

/* En móvil no restes navbar si es fixed */
@media (max-width: 992px) {
    :root { --nav-h: 0px; }
    .header { height: 100svh !important; }
}
