/* ============================================================
   CONSTRUFACH — TRABAJO DETALLE (mostrar)
   ============================================================ */

/* Variables globales (asegúrate de tenerlas definidas en tu CSS global) */
:root {
    --header-h: 80px; /* Ajusta según tu header real */
    --navy: #0B3557;
    --red: #C1272D;
    --white: #FFFFFF;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Layout principal ──────────────────────────────────────── */
.trabajo-detalle {
    background: #f0ede8;
    min-height: 100vh;
    padding-top: var(--header-h);
}

.trabajo-detalle-article {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 3rem 6rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0 4rem;
}

/* ── Título ────────────────────────────────────────────────── */
.trabajo-detalle-titulo {
    grid-column: 1 / -1;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--navy);
    line-height: 1.2;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(11, 53, 87, 0.1);
    position: relative;
}

.trabajo-detalle-titulo::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 56px;
    height: 3px;
    background: var(--red);
}

/* ── Galería / Swiper ──────────────────────────────────────── */
.trabajo-detalle-galeria {
    grid-column: 1 / 2;
    grid-row: 2;
    overflow: hidden;
}

.swiper.mySwiper {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.swiper-slide {
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trabajo-detalle-imagen {
    width: 100%;
    height: 480px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s var(--ease-out-expo);
}

@media (max-width: 768px) {
    .trabajo-detalle-imagen {
        height: 300px;
    }
}

.swiper-slide:hover .trabajo-detalle-imagen {
    transform: scale(1.02);
}

/* Botones de navegación Swiper */
.swiper-button-next,
.swiper-button-prev {
    width: 44px !important;
    height: 44px !important;
    background: var(--navy) !important;
    color: var(--white) !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    transition: background 0.25s ease, border-color 0.25s ease !important;
    border-radius: 0 !important;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--red) !important;
    border-color: var(--red) !important;
}

/* Paginación */
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
    width: 6px !important;
    height: 6px !important;
    transition: all 0.3s var(--ease-out-expo) !important;
    border-radius: 3px !important;
}

.swiper-pagination-bullet-active {
    background: var(--red) !important;
    width: 18px !important;
}

/* ── Descripción ───────────────────────────────────────────── */
.trabajo-detalle-descripcion {
    grid-column: 1 / 2;
    grid-row: 3;
    margin-top: 2.5rem;
}

.trabajo-detalle-texto {
    font-family: 'Barlow', sans-serif;
    font-size: 0.97rem;
    font-weight: 300;
    line-height: 1.85;
    color: #5a6a7a;
}

/* ── Meta / sidebar ────────────────────────────────────────── */
.trabajo-detalle-meta {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
}

.trabajo-detalle-meta-lista {
    background: var(--white);
    border-top: 3px solid var(--red);
    padding: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.trabajo-meta-titulo {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    padding: 1.25rem 1.5rem 0.25rem;
    margin: 0;
}

.trabajo-meta-valor {
    font-family: 'Barlow', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--navy);
    padding: 0 1.5rem 1.25rem;
    margin: 0;
    border-bottom: 1px solid #eee;
}

.trabajo-meta-valor:last-child {
    border-bottom: none;
}

/* ── Volver ────────────────────────────────────────────────── */
.trabajo-detalle-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--navy);
    padding: 1.25rem 3rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
    transition: color 0.25s ease, gap 0.25s ease;
}

.trabajo-detalle-volver:hover {
    color: var(--red);
    gap: 0.7rem;
}

/* ── No encontrado ─────────────────────────────────────────── */
.trabajo-no-encontrado {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: var(--header-h);
    background: #f0ede8;
    text-align: center;
}

.trabajo-no-encontrado-titulo {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--navy);
}

.trabajo-no-encontrado-texto {
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    color: #7a8a9a;
}

/* ── Modal zoom ────────────────────────────────────────────── */
.modal-zoom {
    position: fixed;
    inset: 0;
    background: rgba(7, 31, 52, 0.97);
    z-index: 9999;
    display: none !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-zoom.visible {
    display: flex !important;
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-imagen {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.cerrar-modal {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
    font-family: monospace;
}

.cerrar-modal:hover {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

/* Mensaje de no imágenes */
.no-imagenes {
    background: #e0ddd8;
    padding: 4rem 2rem;
    text-align: center;
    font-family: 'Barlow', sans-serif;
    color: #7a8a9a;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .trabajo-detalle-article {
        grid-template-columns: 1fr;
        padding: 3rem 1.5rem 4rem;
        gap: 0;
    }

    .trabajo-detalle-titulo {
        grid-column: 1;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .trabajo-detalle-galeria {
        grid-column: 1;
    }

    .trabajo-detalle-descripcion {
        grid-column: 1;
        margin-top: 2rem;
    }

    .trabajo-detalle-meta {
        grid-column: 1;
        position: static;
        margin-top: 2rem;
    }

    .trabajo-detalle-volver {
        padding: 1rem 1.5rem 3rem;
    }
    
    .modal-imagen {
        max-width: 95vw;
        max-height: 85vh;
    }
}