/* =============================================
   KPO Alpha — Mapbox Storytelling CSS
   Solo cargado en /inicio
============================================= */

body.page-inicio {
    overflow-x: hidden;
}

/* =============================================
   MAPA FIJO
============================================= */
#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

/* =============================================
   OVERLAY DE VIDEO — una sola definición limpia
============================================= */
#map-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;           /* encima del mapa, debajo del story */

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

#map-overlay.active {
    opacity: 1;
}

#map-overlay video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Capa oscura encima del video */
#map-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(1.5px);
}

/* =============================================
   STORY — scrollea sobre el mapa
============================================= */
#story {
    position: relative;
    z-index: 5;
    pointer-events: none;
}

/* =============================================
   HEADER del storytelling
============================================= */
#header {
    margin: 0 auto;
    width: 100%;
    padding-top: calc(var(--header-h) + 6vh);
    padding-bottom: 4vh;
    pointer-events: none;
}

#header h1 {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 0 2vw 1vh;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

#header h2 {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 0 2vw 0.5vh;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
}

#header p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 0 2vw;
    margin: 0;
}

/* Footer del storytelling */
#footer {
    width: 100%;
    padding: 3vh 2vw;
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255,255,255,0.55);
    pointer-events: all;
}
#footer a { color: var(--clr-green-light); }

/* =============================================
   STEPS — cada capítulo
============================================= */
.hidden { visibility: hidden; }

.step {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-h);

    /* Entrada animada */
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Posicionamiento */
.lefty  { justify-content: flex-start; padding-left: 8vw; }
.righty { justify-content: flex-end;   padding-right: 8vw; }
.centered { justify-content: center; }
.fully  { width: 100%; margin: auto; }

/* Caja de texto */
.step > div {
    width: 100%;
    max-width: 480px;
    padding: 36px 40px;
    background: linear-gradient(
        160deg,
        rgba(15, 25, 20, 0.88),
        rgba(15, 25, 20, 0.94)
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(82, 183, 136, 0.12);
    border-radius: 4px;
}

.step h3 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.step p {
    margin: 0;
    line-height: 1.7;
    font-size: 0.9rem;
}

.step img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 14px;
    opacity: 0.92;
}

/* Temas */
.light {
    color: #333;
    background: rgba(248, 248, 248, 0.96);
}
.dark {
    color: #e8f0ec;
}

/* =============================================
   INDICADOR DE SCROLL — flecha animada
============================================= */
.scroll-hint {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.scroll-hint span {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    font-family: var(--font-primary);
}

.scroll-hint__arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid rgba(255,255,255,0.45);
    border-bottom: 2px solid rgba(255,255,255,0.45);
    transform: rotate(45deg);
    animation: bounce-arrow 1.6s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.55; }
    50%       { transform: rotate(45deg) translateY(5px); opacity: 1; }
}

.scroll-hint.hidden-hint {
    opacity: 0;
}

/* =============================================
   PROGRESS DOTS — indicador de capítulo
============================================= */
.chapter-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.chapter-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
    transition: background 0.35s ease, transform 0.35s ease;
}

.chapter-dot.active {
    background: var(--clr-green-light);
    transform: scale(1.4);
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 750px) {
    .lefty, .righty, .centered, .fully {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .step > div {
        width: 88vw;
        max-width: none;
        padding: 26px 22px;
    }

    .chapter-dots { display: none; }
}

/* Fix táctil mobile */
.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
    touch-action: unset;
}