/* ============================================
   GALERIA DE OBRAS - SYMETRIA ENGENHARIA
   Mosaico responsivo + Lightbox interativo
   ============================================ */

/* Hero compacto da página da obra */
.obra-hero {
    background: linear-gradient(rgba(6, 27, 37, 0.75), rgba(6, 27, 37, 0.9)),
                #34415D;
    color: #fff;
    padding: 60px 20px 40px;
    text-align: center;
}
.obra-hero-loc {
    font-size: 12px;
    letter-spacing: 3px;
    color: #fff;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.obra-hero h1 {
    font-size: 38px;
    font-weight: 600;
    margin: 8px 0 20px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
}
.obra-hero-meta {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.obra-meta-item {
    text-align: center;
    color: #fff;
    opacity: 0.95;
}
.obra-meta-item strong {
    display: block;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}
.obra-meta-item span {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Descrição da obra */
.obra-descricao {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    text-align: center;
}

/* Botão voltar */
.obra-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9E1A16;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border: 2px solid #9E1A16;
    border-radius: 4px;
    transition: all 0.2s;
    margin: 20px auto 40px;
}
.obra-voltar:hover {
    background: #9E1A16;
    color: #fff;
}

/* Container da galeria */
.galeria-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== MOSAICO MASONRY (CSS Columns) ========== */
.galeria-masonry {
    column-count: 3;
    column-gap: 16px;
}
.galeria-masonry .galeria-item {
    break-inside: avoid;
    margin-bottom: 16px;
    display: block;
}

/* ========== MOSAICO GRID UNIFORME ========== */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.galeria-grid .galeria-item img {
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* ========== MOSAICO FEATURE (1 grande + grid) ========== */
.galeria-feature-main {
    margin-bottom: 16px;
}
.galeria-feature-main img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
}

/* Item da galeria (comum) */
.galeria-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.galeria-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.galeria-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}
.galeria-item:hover img {
    transform: scale(1.04);
}

/* Overlay com ícone de zoom */
.galeria-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(158, 26, 22, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}
.galeria-item:hover::after {
    background: rgba(158, 26, 22, 0.15);
}
.galeria-item::before {
    content: '⊕';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    color: #fff;
    font-size: 36px;
    background: rgba(158, 26, 22, 0.9);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}
.galeria-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========== LIGHTBOX ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: lbFadeIn 0.25s ease;
}
.lightbox.aberto {
    display: flex;
}
@keyframes lbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: lbZoomIn 0.3s ease;
}
@keyframes lbZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-contador {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
}

.lightbox-caption {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 4px;
    max-width: 80vw;
    text-align: center;
}

/* CTA final */
.obra-cta {
    background: #061B25;
    color: #fff;
    padding: 60px 24px;
    text-align: center;
    margin-top: 60px;
}
.obra-cta h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 500;
}
.obra-cta p {
    opacity: 0.85;
    margin-bottom: 24px;
    font-size: 15px;
}
.obra-cta-btn {
    display: inline-block;
    background: #9E1A16;
    color: #fff;
    padding: 14px 36px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.2s;
}
.obra-cta-btn:hover {
    background: #D85A30;
    color: #fff;
}

/* RESPONSIVO ===================================== */
@media (max-width: 992px) {
    .obra-hero h1 { font-size: 30px; }
    .galeria-masonry { column-count: 2; }
    .galeria-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .obra-hero { padding: 40px 16px 30px; }
    .obra-hero h1 { font-size: 24px; }
    .obra-hero-meta { gap: 24px; }
    .obra-meta-item strong { font-size: 16px; }
    .galeria-masonry { column-count: 1; }
    .galeria-grid { grid-template-columns: 1fr; }
    .galeria-wrap { padding: 12px; }
    .lightbox-prev, .lightbox-next {
        width: 40px; height: 40px; font-size: 20px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}
