/* ==========================================
   GALERÍA POR EJES TEMÁTICOS
   ========================================== */

.eje-1 { --eje-fondo: #f7ac4b; --eje-texto: #241705; }
.eje-2 { --eje-fondo: #f478b3; --eje-texto: #2b0a1a; }
.eje-3 { --eje-fondo: #5777ce; --eje-texto: #ffffff; }

.eje {
    background-color: var(--eje-fondo);
    color: var(--eje-texto);
    padding: 0;
}

.eje-texto {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--space-4xl) var(--space-lg);
}

.eje-titulo {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: var(--eje-texto);
    margin: 0 0 var(--space-lg) 0;
}

.eje-texto p {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--eje-texto);
    opacity: 0.9;
    margin: 0;
    max-width: 70ch;
}

.eje-texto-intro p {
    opacity: 1;
}

.eje .photo-info,
.eje .photo-name,
.eje .photo-meta,
.eje .photo-trayecto,
.eje .photo-relato,
.eje .photo-acompañante {
    color: var(--eje-texto);
}

.eje .photo-relato,
.eje .photo-meta {
    opacity: 0.9;
}

.eje .photo-acompañante {
    border-top-color: rgba(127, 127, 127, 0.4);
}

.slider-margenes .photo-info {
    display: none;
}

/* ---- APILADO: Overlay inferior ---- */
.apilado .photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 60px 40px 80px 40px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0.95) 100%);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    margin: 0;
    gap: 0;
}

.eje-2 .apilado .photo-info {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0.95) 100%);
}

.eje-3 .apilado .photo-info {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0.95) 100%);
}

.apilado .photo-titulo {
    display: block !important;
    max-width: 700px !important;
    width: auto !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    font-size: clamp(1.25rem, 1.5vw, 1.5rem) !important;
    line-height: 1.35 !important;
    box-sizing: border-box;
    text-align: left;
}

.apilado .photo-relato {
    margin: 0;
    max-width: 700px;
    width: auto;
    padding: 0;
    color: #ffffff !important;
    box-sizing: border-box;
}

.apilado .photo-relato p {
    color: #ffffff !important;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

.apilado .photo-name,
.apilado .photo-meta,
.apilado .photo-trayecto:not(.photo-titulo),
.apilado .photo-acompañante {
    display: none;
}

/* ==========================================
   APILADO de las 3 fotos destacadas
   ========================================== */
.apilado {
    position: relative;
}

.apilado-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.apilado .photo-item {
    display: block !important;
    height: 100%;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: auto !important;
    position: relative;
}

.apilado .photo-item > div:first-child {
    height: 100%;
}

.apilado .photo-image {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center 15%;
}

.photo-item.estilo-margenes > div:first-child {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--space-lg);
    box-sizing: border-box;
}

.photo-item.estilo-margenes .photo-image {
    width: 100%;
}

.slider {
    position: relative;
}

.slider-track {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.slider-track::-webkit-scrollbar { display: none; }

.slider-track > .photo-item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    transform: none !important;
    z-index: 0 !important;
}

.slider-arrow {
    position: absolute;
    top: 38%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background-color: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.slider-arrow:hover:not(:disabled) {
    background-color: var(--eje-texto);
    border-color: var(--eje-texto);
    color: var(--eje-fondo);
}

.slider-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.slider-prev { left: var(--space-lg); }
.slider-next { right: var(--space-lg); }

.slider-margenes .slider-prev { left: calc(var(--space-lg) * 2); }
.slider-margenes .slider-next { right: calc(var(--space-lg) * 2); }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) 0 0;
    position: relative;
    z-index: 5;
}

.slider-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--eje-texto);
    background: transparent;
    opacity: 0.55;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.slider-dot.is-active {
    background-color: var(--eje-texto);
    opacity: 1;
}

@media (min-width: 641px) {
    .hscroll {
        position: relative;
        width: 100%;
    }

    .hscroll-sticky {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100svh;
        width: 100%;
        overflow: hidden;
        background-color: var(--eje-fondo, #000);
    }

    .hscroll-track {
        display: flex;
        flex-wrap: nowrap;
        height: 100%;
        width: max-content;
        will-change: transform;
    }

    .hscroll .photo-item {
        transform: none !important;
        flex: 0 0 100vw;
        width: 100vw;
        height: 100%;
        display: flex !important;
        flex-direction: row;
        align-items: stretch;
        margin: 0 !important;
        left: auto !important;
        right: auto !important;
    }

    .hscroll .photo-item > div:first-child {
        flex: 0 0 60%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .hscroll .photo-image {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: contain;
        background-color: transparent;
    }

    .hscroll .photo-info {
        flex: 0 0 40%;
        max-width: none;
        margin: 0;
        height: 100%;
        padding: var(--space-2xl) 64px var(--space-2xl) var(--space-2xl);
        justify-content: flex-start;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hscroll .photo-info > :first-child { margin-top: auto; }
    .hscroll .photo-info > :last-child { margin-bottom: auto; }

    .hscroll .photo-info {
        gap: 0;
    }

    .hscroll .photo-meta {
        margin: 0 0 0.25rem 0;
    }

    .hscroll .photo-trayecto {
        font-size: clamp(1.25rem, 1.5vw, 1.5rem);
        line-height: 1.35;
        margin: 0 0 0.75rem 0;
    }

    .hscroll .photo-relato {
        margin: 0;
        max-width: 600px;
    }

    .hscroll .photo-relato p {
        margin-bottom: 0.75rem;
    }

    .hscroll .photo-relato p:last-child {
        margin-bottom: 0;
    }
}

#gallery-container > .eje,
.eje > * {
    position: relative;
    z-index: 1 !important;
}

@media (max-width: 640px) {
    .ng-header-fullbg {
        background-position: left center !important;
    }

    .gallery {
        padding-top: 12vh !important;
    }

    .eje-texto {
        padding: var(--space-2xl) 2rem;
    }

    .eje-texto p {
        font-size: var(--font-size-base);
    }

    .photo-item .photo-info {
        padding: 1.5rem 2rem 3rem;
    }

    .photo-item.estilo-margenes > div:first-child {
        padding: 0 2rem;
    }

    .slider-track > .photo-item {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        left: auto !important;
        right: auto !important;
    }

    .hscroll .photo-item {
        position: relative;
        z-index: 1 !important;
    }

    .slider-arrow {
        width: 40px;
        height: 40px;
    }

    .slider-prev { left: 0.5rem; }
    .slider-next { right: 0.5rem; }

    .slider-margenes .slider-prev { left: 1rem; }
    .slider-margenes .slider-next { right: 1rem; }

    .site-footer {
        padding-left: 2rem;
        padding-right: 2rem;
        padding-top: 3.5rem;
    }

    .logo-footer {
        width: 60px;
    }
}

/* MOBILE ONLY - commented out to preserve 100vh on desktop */
/* .apilado-panel {
    /* height: auto; */
}
*/

.apilado .photo-item,


.scroll-to-top {
    background-color: #5cbf84 !important;
    color: #14201a;
}

.scroll-to-top:hover {
    background-color: #49ad72 !important;
    
}

.footer-intro-title {
    text-transform: none;
}

.footer-instagram {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--space-lg);
    color: #5cbf84;
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.footer-instagram:hover {
    text-decoration: underline;
}

/* ---- Z-index para paneles apilados: primero arriba, último abajo ---- */

/* ---- Z-index para paneles apilados: correctamente ordenado ---- */
.apilado-panel:nth-child(1) { z-index: 1; }
.apilado-panel:nth-child(2) { z-index: 2; }
.apilado-panel:nth-child(3) { z-index: 3; }

/* Los overlays de cada panel se ven ENCIMA de todos ---- */
.apilado-panel:nth-child(1) .photo-info { z-index: 100; }
.apilado-panel:nth-child(2) .photo-info { z-index: 99; }
.apilado-panel:nth-child(3) .photo-info { z-index: 98; }

/* ===== Aviso "Desplázate para explorar" (sobre la flecha del header) ===== */
.scroll-hint {
    font-size: 14px;
    font-style: italic;
    color: #ffffff;
    white-space: nowrap;
    opacity: 0.85;
}

/* Escritorio: absoluto sobre la flecha (la flecha está en bottom: 40px) */
.scroll-hint-desktop {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    margin: 0;
}

/* Móvil: el aviso móvil se oculta en escritorio */
.scroll-hint-mobile {
    display: none !important;
}

@media (max-width: 640px) {
    .scroll-hint-desktop {
        display: none !important;
    }

    .scroll-hint-mobile {
        display: block !important;
        position: static;
        margin: 20px 0 0 0;
    }

    /* la flecha móvil queda pegada al aviso */
    .scroll-indicator-mobile {
        margin-top: 8px !important;
    }
}

/* ===== Movimiento sutil de la flecha de scroll =====
   Nota: el scrollBounce de responsive.css no funciona porque anima
   'bottom', que está declarado con !important. Animamos transform. */
@keyframes a1mdsNudge {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(9px); }
}

.scroll-indicator-desktop {
    animation: a1mdsNudge 2.4s ease-in-out infinite;
}

@media (max-width: 640px) {
    /* en móvil transform está bloqueado con !important, usamos 'translate' */
    @keyframes a1mdsNudgeMobile {
        0%, 100% { translate: 0 0; }
        50%      { translate: 0 7px; }
    }

    .scroll-indicator-mobile {
        animation: a1mdsNudgeMobile 2.4s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-indicator-desktop,
    .scroll-indicator-mobile {
        animation: none;
    }
}

/* ===== Enlace de Instagram del footer =====
   Es flex item de .footer-intro-right (columna), por eso se estiraba a todo
   el ancho; y typography.css le da border-bottom a todo <a> en hover, que es
   la linea larga. Lo ajustamos al contenido y dejamos solo el subrayado. */
.footer-instagram {
    align-self: flex-start;
    border-bottom: none;
}

.footer-instagram:hover,
.footer-instagram:focus-visible {
    border-bottom: none;
    text-decoration: underline;
}

/* ===== Bloque de financiamiento (footer) ===== */
.footer-funding-logo {
    display: block;
    width: 320px;
    max-width: 100%;
    height: auto;
    margin: 0 auto var(--space-md);
}

.footer-bottom p {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 640px) {
    .footer-funding-logo {
        width: 280px;
    }
}

/* El boton flotante de "volver al inicio" queda sobre el bloque de
   financiamiento en movil (ocupa 72px desde el borde inferior).
   Damos aire al footer para que la glosa y el logo nunca queden tapados. */
@media (max-width: 640px) {
    .site-footer {
        padding-bottom: 104px;
    }
}

/* Entre 641 y 900px el boton flotante usa un margen mayor (ocupa 112px desde
   el borde inferior) y la glosa, centrada a 620px, alcanza a quedar debajo. */
@media (min-width: 641px) and (max-width: 900px) {
    .site-footer {
        padding-bottom: 144px;
    }
}

/* ===== Creditos de la agencia enlazados (columnas del footer) =====
   Opcion A: en reposo conserva el gris del resto de los creditos con un
   subrayado tenue; el verde se reserva para el hover, para no competir con
   los titulos verdes que estan justo encima. */
.credito-ajolote {
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    text-decoration: none;
}

.credito-ajolote:hover,
.credito-ajolote:focus-visible {
    color: #5cbf84;
    border-bottom-color: #5cbf84;
}
