/* === WORK SECTION (work.html) === */
.work-container {
    min-height: 100vh;
    padding-top: 150px;
    padding-left: 5%;
    padding-right: 5%;
    background: var(--color-dark);
}

.work-container {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-accent) 50%, var(--color-dark) 100%);
}

.work-header {
    text-align: center;
    padding: 1.5rem 5%;
    margin-bottom: 0rem;
}

.work-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 3rem;
    margin-top: 3rem;
    text-align: center; /* Centrar el título de Work */
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5% 6rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* --- REGLA MODIFICADA PARA EL TRAILER --- */
/* Esto hace que el primer item ocupe las 2 columnas, pero sea más pequeño */
.gallery-grid .gallery-item:first-child {
    grid-column: 1 / -1; 
    max-width: 80%;     /* <-- MODIFICADO: Puedes ajustar este % (ej. 70%) */
    justify-self: center; /* <-- AÑADIDO: Esto lo centra */
}
/* --- FIN DE REGLA --- */


.gallery-item {
    display: flex;
    flex-direction: column-reverse;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: transparent;
}

.gallery-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: all 0.4s ease;
}

.gallery-overlay {
    position: static;
    background: transparent;
    opacity: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    text-align: center;
}

.gallery-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-description {
    font-family: var(--font-secondary);
    font-size: 1.0rem;
    opacity: 0.9;
    line-height: 1.4;
    color: var(--color-light);
    font-weight: 300;
}

/* === MORE WORK LINK (work.html) === */
.more-work-container {
    text-align: center;
    padding: 3rem 0 1rem;
}

.more-link {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 2.0rem;
    text-transform: uppercase;
    letter-spacing: 5.5px;
    color: var(--color-light);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.more-link:hover {
    color: var(--color-primary);
    letter-spacing: 2.5px;
}

/* === VIDEO MODAL (work.html) === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
    background: var(--color-dark);
    border-radius: 12px;
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.modal-video {
    width: 100%;
    height: 100%;
}

.modal-info {
    display: none;
}

.modal-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.modal-description {
    font-family: var(--font-secondary);
    opacity: 0.9;
    line-height: 1.5;
    font-weight: 300;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    border: none;
    color: var(--color-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--color-primary);
    transform: scale(1.1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* === RESPONSIVE STYLES (WORK PAGE) === */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* --- REGLA RESPONSIVE MODIFICADA --- */
    /* Resetea el trailer para que ocupe el 100% en móvil */
    .gallery-grid .gallery-item:first-child {
        grid-column: auto;
        max-width: 100%;     /* <-- MODIFICADO */
        justify-self: auto;  /* <-- MODIFICADO */
    }
    /* --- FIN DE REGLA --- */

    .work-container {
        padding-top: 150px;
    }
    body#work-page .work-container {
        padding-top: 150px;
    }
    body#work-page .work-header {
      margin-top: 0;
      margin-bottom: 2rem;
    }
    .work-title {
       font-size: 3.5rem;
       margin-bottom: 2rem;
       margin-top: 2rem;
    }
    .gallery-title {
        font-size: 0.9rem;
    }
    .gallery-description {
        font-size: 0.7rem;
    }
}