/* ==========================================================================
   ÍNDICE CSS - PROYECTO SINGULAR
   1. HERO SECTION (Sección inicial con imagen y título)
   2. PROJECT INTRO (Título, Concepto, Estadísticas)
   3. PROJECT GALLERY (Sticky Stack Editorial / Imágenes intercaladas)
   4. MORE PROJECTS (Sección "Más proyectos" / Botones de navegación final)
   ========================================================================== */

/* Reseteo y Base */
.project-detail-page {
    background-color: #ffffff;
    color: #111111;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    /* clip en vez de hidden: permite position:sticky en hijos */
}

/* 1. HERO SECTION */
.hero-project {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Full viewport height for maximum impact */
    overflow: hidden;

}

.hero-project__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Suave efecto parallax con JS si es necesario */
}

/* 2. PROJECT INTRO (Título, Concepto, Estadísticas) */
.project-intro {
    max-width: 1200px;
    margin: 0 auto 100px auto;
    padding: 0 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-project__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    pointer-events: none;
}

.hero-project__content {
    position: absolute;
    bottom: 10vh;
    left: 0;
    width: 100%;
    text-align: center;
    color: #ffffff;
    z-index: 2;
}

.hero-project__title {
    font-family: var(--font-primary);
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-project__location {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
    opacity: 0.9;
}

/* Reutilizando diseño de iconos de stats previo pero centrado para la intro */
.project-intro__stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 60px;
    width: 100%;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    padding: 40px 0;
}

.project-intro__stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-intro__stats svg {
    width: 36px;
    height: 36px;
    stroke: #000;
    fill: none;
    stroke-width: 1;
    margin-bottom: 15px;
}

.project-intro__stats .stat-value {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 500;
    color: #000;
    margin-bottom: 5px;
}

.project-intro__stats .stat-label {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-intro__text {
    max-width: 800px;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    font-weight: 300;
}

/* 3. PROJECT GALLERY — Sticky Stack Editorial */

/* Contenedor de la galería: block para que sticky funcione */
.project-gallery {
    padding: 0;
    margin: 0;
    background: #000;
    /* scroll-behavior: auto para evitar latigazo */
    scroll-behavior: auto;
}

/* Wrapper del stack: genera el espacio de scroll */
.gallery {
    display: block;
    position: relative;
}

/* ── Tarjeta ── */
.gallery-card {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    /* sin parpadeo al mostrar/ocultar barra móvil */
    overflow: hidden;
    cursor: pointer;
    /* El z-index se asigna via JS (1, 2, 3…) */
}

/* Sin hover transform en el contenedor — la imagen ya hace zoom */
.gallery-card:hover {
    transform: none;
}

/* ── Imagen protagonista ── */
.gallery-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.gallery-card:hover .gallery-media {
    transform: scale(1.04);
}

/* ── Degradado sofisticado ── */
.gallery-overlay {
    position: absolute;
    inset: 0;
    /* Degradado triple: oscuro abajo + toque arriba para contexto */
    background:
        linear-gradient(to top,
            rgba(0, 0, 0, 0.80) 0%,
            rgba(0, 0, 0, 0.20) 40%,
            rgba(0, 0, 0, 0) 70%),
        linear-gradient(to bottom,
            rgba(0, 0, 0, 0.30) 0%,
            rgba(0, 0, 0, 0) 25%);
    transition: opacity 0.5s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 0.9;
}

/* ── Bloque editorial inferior-izquierda ── */
.gallery-content {
    position: absolute;
    inset: auto 0 0 0;
    padding: clamp(24px, 5vw, 60px);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Visible por defecto — es una galería de scroll, no de hover */
    opacity: 1;
    transform: none;
}

/* Número de imagen — estilo editorial */
.gallery-content__index {
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 4px;
}

.gallery-content__category {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.55);
}

.gallery-content__title {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 200;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.gallery-content__desc {
    font-size: clamp(0.78rem, 1.2vw, 0.9rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.72);
    margin: 4px 0 0 0;
    line-height: 1.6;
    max-width: 480px;
}

/* Fina línea separadora decorativa entre número y título */
.gallery-content__divider {
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
    margin: 6px 0;
}

/* ── Número de posición absoluta en esquina superior derecha ── */
.gallery-card__counter {
    position: absolute;
    top: clamp(20px, 4vw, 48px);
    right: clamp(20px, 4vw, 48px);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.38);
    text-transform: uppercase;
    z-index: 2;
}


/* Responsive */
@media (max-width: 1024px) {
    .project-intro__stats {
        gap: 30px;
    }

    .hero-project__title {
        font-size: 2.5rem;
    }

    .project-gallery {
        gap: 80px;
    }
}

@media (max-width: 768px) {

    /* El hero hereda height: 100vh / 100dvh de la regla global para ocupar toda la pantalla */
    .hero-project__content {
        bottom: 18vh;
        /* Elevar el texto para que no pise la flecha de scroll */
    }

    .project-intro {
        margin-bottom: 60px;
    }

    .project-intro__stats {
        flex-wrap: wrap;
        gap: 40px 20px;
    }

    .project-intro__stats .stat-item {
        flex: 0 0 45%;
    }

    .gallery-row.half {
        flex-direction: column;
        gap: 40px;
    }

    .project-gallery {
        gap: 60px;
    }
}