/* ============================================================
   OBRAS — Galería tipo "sala de exposición"
   Paleta heredada de global.css: terracota #a67f69, crema #f6f6ed,
   oliva #c2bb9d, casi-negro #1a1a1a.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

.obras-section {
    padding: 8.5rem 24px 6rem;
    background-color: #f6f6ed;
    text-align: center;
    min-height: auto;
}

.obras-header {
    margin-bottom: 8px;
}

.obras-header h1 {
    font-family: "Lora", serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    line-height: 1;
    margin-bottom: 18px;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.obras-header h2 {
    font-family: "Lora", serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    max-width: 560px;
    margin: 0 auto 40px;
    color: #6b6757;
    line-height: 1.5;
}

.obras-header h3 {
    font-family: "Inter", sans-serif;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 600;
}

.obras-header h4 {
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    max-width: 50%;
    margin: 0 auto 30px;
    color: #333;
    font-weight: bolder;
}

.obras-email {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-bottom: 48px;
    margin-top: 22px;
}

.obras-technique {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 auto 52px;
    font-family: "Inter", sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #a67f69;
    font-weight: 600;
}

.obras-technique::before,
.obras-technique::after {
    content: "";
    display: block;
    width: 28px;
    height: 1px;
    background-color: rgba(166, 127, 105, 0.45);
}
/* ------------------------------------------------------------
   Índice de exposición (reemplaza los botones planos)
   ------------------------------------------------------------ */

.gallery-rooms {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    max-width: 980px;
    margin: 0 auto 56px;
    border-top: 1px solid rgba(26, 26, 26, 0.15);
    border-bottom: 1px solid rgba(26, 26, 26, 0.15);
}

.room-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    background: none;
    border: none;
    border-right: 1px solid rgba(26, 26, 26, 0.12);
    padding: 18px 10px;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    color: #6b6757;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.room-item:last-child {
    border-right: none;
}

.room-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.01em;
}

.room-range {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a67f69;
}

.room-count {
    font-size: 0.72rem;
    color: #918d7e;
    margin-top: 2px;
}

.room-item:hover {
    background-color: rgba(166, 127, 105, 0.08);
}

.room-item.active {
    background-color: #1a1a1a;
}

.room-item.active .room-label,
.room-item.active .room-range,
.room-item.active .room-count {
    color: #f6f6ed;
}

.room-item.active .room-range {
    color: #d8c2a8;
}

/* ------------------------------------------------------------
   Grid de obras
   ------------------------------------------------------------ */

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 36px 28px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 8px;
    align-items: start;
}

.work-card {
    margin: 0;
    background: none;
    cursor: pointer;
    opacity: 0;
    animation: work-in 0.5s ease forwards;
}

@keyframes work-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    background-color: #e7e3d6;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    filter: saturate(0.97);
}

.work-card:hover img {
    transform: scale(1.025);
    filter: saturate(1.05);
}

.work-caption {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.work-card:hover .work-caption {
    opacity: 1;
}

.work-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.work-label {
    flex-shrink: 0;
    font-family: "Inter", sans-serif;
    font-size: 0.48rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a67f69;
    background: rgba(166, 127, 105, 0.1);
    padding: 1px 5px;
    border-radius: 2px;
}

.work-value {
    font-size: 0.78rem;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
}

.work-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.work-meta {
    display: none;
}

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(15, 14, 12, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-stage {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: calc(100vw - 180px);
    max-width: 1100px;

}

.lightbox-image {
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 2px;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.35s ease, transform 0.35s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}


.lightbox-info {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #f6f6ed;
    text-align: center;
}

.lightbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-field .work-label {
    background: rgba(194, 187, 157, 0.12);
    color: #c2bb9d;
}

.lightbox-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f6f6ed;
    line-height: 1.3;
}

.lightbox-dims {
    font-size: 0.85rem;
    color: #c2bb9d;
}

.lightbox-dims:empty {
    display: none;
}

.lightbox-field:has(.lightbox-dims:empty) {
    display: none;
}

.lightbox-position {
    font-size: 0.72rem;
    color: #8a8676;
    margin-top: 8px;
    letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: none;
    border: none;
    color: #f6f6ed;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.75;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-close {
    top: 24px;
    right: 28px;
    font-size: 2rem;
    line-height: 1;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);

    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 2.5rem;
    line-height: 1;

    padding: 0;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}
.obras-contact {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid rgba(26,26,26,0.08);
}

.obras-contact h3 {
    margin-bottom: 18px;
    font-size: 1rem;
    font-weight: 600;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 768px) {

    .obras-section {
        padding: 5rem 16px 4rem;
    }

    .obras-technique::before,
    .obras-technique::after {
        width: 18px;
    }

    .obras-header h2 {
        max-width: 100%;
        padding: 0 8px;
    }

    .gallery-rooms {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .room-item {
        flex: 1 1 33%;
        border-bottom: 1px solid rgba(26, 26, 26, 0.12);
        padding: 14px 6px;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 24px 16px;
    }

    .work-card img {
        height: 200px;
    }

    .lightbox-stage {
        width: calc(100vw - 140px);
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 2rem;
        padding: 0;
    }

    .lightbox-close {
        top: 14px;
        right: 16px;
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 12px;
    }

    .work-card img {
        height: 160px;
    }

    .work-value {
        font-size: 0.7rem;
    }

    .work-label {
        font-size: 0.42rem;
        padding: 0 4px;
    }

    .work-row {
        gap: 4px;
    }
}

/* Respeta preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .work-card {
        animation: none;
        opacity: 1;
    }

    .work-card img,
    .lightbox-image,
    .room-item {
        transition: none;
    }
}