
/* =========================================
   PROYECTOS
========================================= */

.projects {
    background-color: var(--color-light);
    padding: 190px 0 250px;
}


/* =========================================
   HEADER
========================================= */

.projects-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    gap: 24px;

    margin-bottom: 38px;
}


.projects-header > div:first-child {
    max-width: 600px;
    width: 100%;
}


/* =========================================
   TEXTO Y BOTÓN
========================================= */

.projects .section-header-right {
    max-width: 100%;
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}


.projects .section-header-right p {
    margin-bottom: 14px;

    color: var(--color-text-light);

    font-size: 0.88rem;

    line-height: 1.65;
}


.projects .section-header-right a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    color: var(--color-primary);

    font-size: 0.82rem;

    font-weight: 700;
    text-decoration: none;
}


.projects .section-header-right a i {
    font-size: 0.72rem;

    transition: transform var(--transition-normal);
}


.projects .section-header-right a:hover i {
    transform: translateX(5px);
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 1100px) {

    .projects-grid {
        gap: 16px;
    }


    .project-image {
        height: 200px;
    }

}


/* =========================================
   MÓVIL
========================================= */

@media (max-width: 768px) {

    .projects-header {
        flex-direction: column;
        align-items: center;

        gap: 18px;

        text-align: center;
    }


    .projects .section-header-right {
        max-width: 100%;
        align-items: center;
        text-align: center;
    }


    .projects-grid {
        grid-template-columns: 1fr;

        gap: 35px;
    }


    .project-image {
        height: 230px;
    }

}


/* =========================================
   MÓVIL PEQUEÑO
========================================= */

@media (max-width: 480px) {

    .project-image {
        height: 180px;
    }


    .project-image span {
        top: 8px;
        left: 8px;

        font-size: 0.62rem;
    }

}

/* =========================================
   PANEL DE GALERÍA DE PROYECTOS
========================================= */

.projects-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


/* PANEL ABIERTO */

.projects-modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}


/* FONDO OSCURO */

.projects-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(10, 18, 30, 0.78);
    backdrop-filter: blur(5px);
}


/* CONTENEDOR PRINCIPAL */

.projects-modal-content {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 1050px;
    max-height: 90vh;

    overflow-y: auto;

    background: #ffffff;
    border-radius: 16px;

    padding: 40px;

    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.projects-modal.active .projects-modal-content {
    transform: translateY(0);
}


/* =========================================
   ENCABEZADO DEL PANEL
========================================= */

.projects-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 25px;

    padding-bottom: 28px;
    border-bottom: 1px solid #e8e8e8;
}

.projects-modal-header h2 {
    margin: 8px 0 12px;

    color: #1b1b1b;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.2;
}

.projects-modal-subtitle {
    color: #777777;
    font-size: 0.95rem;
    line-height: 1.7;
}


/* BOTÓN CERRAR */

.projects-modal-close {
    flex-shrink: 0;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #e5e5e5;
    border-radius: 50%;

    background: #ffffff;
    color: #1b1b1b;

    font-size: 1.2rem;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease;
}

.projects-modal-close:hover {
    background: #1b1b1b;
    color: #ffffff;
}


/* =========================================
   LISTA DE PROYECTOS
========================================= */

.projects-modal-list {
    display: flex;
    flex-direction: column;

    gap: 35px;

    padding-top: 30px;
}


/* TARJETA DE PROYECTO */

.project-gallery-card {
    padding: 28px;

    background: #f8f9fb;
    border: 1px solid #eeeeee;
    border-radius: 12px;
}

.project-gallery-card h3 {
    margin-bottom: 24px;

    color: #1b1b1b;
    font-size: 1.35rem;
    line-height: 1.4;
}


/* =========================================
   VIDEOS ANTES Y DESPUÉS
========================================= */

.project-gallery-videos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 24px;
}


/* COLUMNA DE VIDEO */

.project-gallery-video-item {
    min-width: 0;
}


/* CUADRO DEL VIDEO */

.project-gallery-video {
    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #e5e7eb;
    border-radius: 8px;
}

.project-gallery-video video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    background: #e5e7eb;
}


/* ETIQUETAS DEBAJO DEL VIDEO */

.project-video-label {
    display: block;

    margin-top: 12px;

    color: var(--color-primary);

    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.5px;

    text-align: center;
}


/* =========================================
   DESCRIPCIÓN
========================================= */

.project-gallery-description {
    margin-top: 24px;

    color: #666666;

    font-size: 0.92rem;
    line-height: 1.8;
}


/* =========================================
   BLOQUEAR SCROLL DEL FONDO
========================================= */

body.projects-modal-open {
    overflow: hidden;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 768px) {

    .projects-modal {
        padding: 14px;
    }

    .projects-modal-content {
        max-height: 92vh;
        padding: 25px;
        border-radius: 12px;
    }

    .projects-modal-header {
        gap: 15px;
        padding-bottom: 22px;
    }

    .projects-modal-list {
        gap: 25px;
        padding-top: 22px;
    }

    .project-gallery-card {
        padding: 20px;
    }

    .project-gallery-videos {
        gap: 14px;
    }

}


/* =========================================
   MÓVIL PEQUEÑO
========================================= */

@media (max-width: 480px) {

    .projects-modal {
        padding: 8px;
    }

    .projects-modal-content {
        max-height: 94vh;
        padding: 18px;
    }

    .projects-modal-header h2 {
        font-size: 1.55rem;
    }

    .projects-modal-subtitle {
        font-size: 0.85rem;
    }

    .projects-modal-close {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .project-gallery-card {
        padding: 15px;
    }

    .project-gallery-card h3 {
        font-size: 1.1rem;
        margin-bottom: 18px;
    }

    .project-gallery-videos {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .project-video-label {
        margin-top: 9px;
    }

    .project-gallery-description {
        margin-top: 20px;
        font-size: 0.88rem;
    }

}