/* ==========================================================================
   ÍNDICE CSS - PÁGINA PROYECTOS
   1. GLOBAL LAYOUT
   2. HERO
      2a. Contenedor hero
      2b. Scroll indicador (flecha)
   3. SECCIÓN PROYECTOS (GRID)
      3a. Grid container
      3b. Grid items
      3c. Image wrapper
      3d. Overlay y texto
      3e. Hover effects
   4. PROJECT CARD CON ESTADÍSTICAS
      4a. Contenedor tarjeta
      4b. Estadísticas
   5. MEDIA QUERIES
      5a. Tablet (≤ 1024px)
      5b. Mobile (≤ 768px)
   ========================================================================== */


/* ══════════════════════════════════════════════════════════
   1. GLOBAL LAYOUT
   ══════════════════════════════════════════════════════════ */
.page-content {
    padding-top: 120px;
}


/* ══════════════════════════════════════════════════════════
   2. HERO
   ══════════════════════════════════════════════════════════ */

/* — 2a. Contenedor hero — */
.portfolio-video-hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    background-color: #000000;
}

.video-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.portfolio-video-hero video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-video-hero .video-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 6vh;
    transform: translate(-50%, -50%);
    color: #fff;
    opacity: 80%;
    text-align: center;
    z-index: 2;
}

/* — 2b. Scroll indicador (flecha) — */
.portfolio-scroll-indicator {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.portfolio-scroll-arrow {
    width: 45px;
    height: 45px;
    color: #ffffff;
    animation: portfolioArrowBounce 2s infinite ease-in-out;
}

@keyframes portfolioArrowBounce {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.9;
    }
}


/* ══════════════════════════════════════════════════════════
   3. SECCIÓN PROYECTOS (GRID)
   ══════════════════════════════════════════════════════════ */

/* — 3a. Grid container — */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 100px 5vw 120px 5vw;
    background-color: #ffffff;
    max-width: 1800px;
    margin: 0 auto;
}

/* — 3b. Grid items — */
.grid-item {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    background-color: #f9f9f9;
    aspect-ratio: 16 / 12;
}

/* — 3c. Image wrapper — */
.grid-item-img-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.grid-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

/* — 3d. Overlay y texto (oculto por defecto) — */
.grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.grid-item-title {
    color: #ffffff;
    margin: 0 0 10px 0;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-item-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.05s;
    max-width: 80%;
}

/* — 3e. Hover effects — */
.grid-item:hover .grid-item-img {
    transform: scale(1.05);
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
}

.grid-item:hover .grid-item-title {
    transform: translateY(0);
}


/* ══════════════════════════════════════════════════════════
   4. PROJECT CARD CON ESTADÍSTICAS
   ══════════════════════════════════════════════════════════ */

/* — 4a. Contenedor tarjeta — */
.project-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease;
}

.project-card-container:hover {
    transform: translateY(-5px);
}

/* — 4b. Estadísticas — */
.grid-item-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    padding: 0 5% 40px;
    margin-bottom: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.project-card-container:hover .grid-item-stats {
    opacity: 1;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.stat-item svg {
    width: 32px;
    height: 32px;
    stroke: #ffffff;
    fill: none;
    stroke-width: 1.2;
    margin-bottom: 12px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card-container:hover .stat-item svg {
    transform: translateY(-4px);
}

.stat-item .stat-value {
    color: #ffffff;
    margin-bottom: 6px;
}

.stat-item .stat-label {
    color: #ffffff;
}


/* ══════════════════════════════════════════════════════════
   5. MEDIA QUERIES
   ══════════════════════════════════════════════════════════ */

/* — 5a. Tablet (≤ 1024px) — */
@media (max-width: 1024px) {

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 100px 5vw 120px 5vw;
        max-width: 1800px;
        margin: 0 auto;
    }

    .grid-item-overlay {
        padding: 25px;
    }

    .grid-item-stats {
        gap: 10px;
        padding: 0 5% 25px;
    }

    .stat-item svg {
        width: 28px;
        height: 28px;
        margin-bottom: 8px;
    }
}


/* — 5b. Mobile (≤ 768px) — */
@media (max-width: 768px) {

    /* Grid */
    .projects-grid {
        display: block;
        gap: 0;
        padding: 0;
        background-color: #000000;
        max-width: 100%;
        margin: 0;
        scroll-behavior: auto;
    }

    /* Tarjeta sticky */
    .project-card-container {
        width: 100%;
        height: 100svh;
        height: 100dvh;
        border-radius: 0;
        overflow: hidden;
        position: sticky;
        top: 0;
        box-shadow: none;
        z-index: 1;
    }

    .project-card-container:active {
        transform: none;
    }

    .project-card-container:hover {
        transform: none;
    }

    /* Grid item */
    .grid-item {
        position: relative;
        display: block;
        width: 100%;
        height: 100%;
    }

    /* Image wrapper */
    .grid-item-img-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .grid-item-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* Overlay */
    .grid-item-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 70%);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
        padding: 30px 20px 105px 20px;
    }

    .grid-item-overlay::after {
        content: '';
        position: absolute;
        bottom: 110px;
        right: 20px;
        width: 24px;
        height: 24px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3Cpolyline points='12 5 19 12 12 19'%3E%3C/polyline%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
    }

    .grid-item-title {
        transform: none;
        font-size: clamp(2rem, 8vw, 3.2rem);
        padding: 0;
        text-align: left;
        max-width: 85%;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0;
    }

    /* Estadísticas */
    .grid-item-stats {
        opacity: 1;
        gap: 5px;
        padding: 15px 4% 20px;
        justify-content: space-between;
        background: transparent;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .stat-item {
        flex: 1;
        min-width: 0;
    }

    .stat-item svg {
        width: clamp(18px, 6vw, 24px);
        height: clamp(18px, 6vw, 24px);
        margin-bottom: 5px;
    }

    .stat-item .stat-value {
        font-size: clamp(0.75rem, 3vw, 1rem);
        margin-bottom: 2px;
    }

    .stat-item .stat-label {
        font-size: clamp(0.55rem, 2vw, 0.7rem);
        letter-spacing: 0.5px;
        word-wrap: break-word;
    }
}
