
/* ==========================================================
   GHOSTBASE HISTÓRIA V1.7 — GALERIA UNIFORME DEFINITIVA
   Carregado por último no <head> para vencer CSS legado.
   ========================================================== */

.page-historia .gbh-gallery{
    padding:72px 0!important;
    overflow:hidden!important;
}
.page-historia .gbh-gallery .container{
    width:min(calc(100% - 36px),1180px)!important;
    max-width:1180px!important;
    margin-inline:auto!important;
}

/* RESET COMPLETO DO MOSAICO */
.page-historia .gbh-gallery-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    grid-auto-rows:250px!important;
    gap:14px!important;
    align-items:stretch!important;
    justify-items:stretch!important;
}

.page-historia .gbh-gallery-grid > figure,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-1,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-2,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-3,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-4,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-5,
.page-historia .gbh-gallery-grid > figure.gbh-gallery-item-6{
    position:relative!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    grid-column:auto!important;
    grid-row:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:250px!important;
    min-height:250px!important;
    max-height:250px!important;
    aspect-ratio:auto!important;
    margin:0!important;
    padding:10px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    border:1px solid #29414b!important;
    border-radius:14px!important;
    background:#061014!important;
    box-shadow:none!important;
}

/* FOTO SEM CROP: 100% VISÍVEL */
.page-historia .gbh-gallery-grid > figure > img{
    display:block!important;
    position:static!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center center!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:8px!important;
    background:#061014!important;
    transform:none!important;
    filter:none!important;
}
.page-historia .gbh-gallery-grid > figure:hover > img{
    transform:none!important;
    filter:none!important;
}
.page-historia .gbh-gallery-grid > figure::before,
.page-historia .gbh-gallery-grid > figure::after{
    display:none!important;
    content:none!important;
}

/* LEGENDA NÃO ALTERA O TAMANHO DO QUADRO */
.page-historia .gbh-gallery-grid > figure > figcaption{
    position:absolute!important;
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    z-index:3!important;
    max-width:calc(100% - 20px)!important;
    padding:7px 9px!important;
    border:1px solid rgba(255,255,255,.06)!important;
    border-radius:8px!important;
    background:rgba(5,10,12,.90)!important;
    color:#edf3f5!important;
    font-size:10px!important;
    line-height:1.35!important;
}

/* CARDS DE OPERAÇÕES — IMAGEM INTEIRA */
.page-historia .gbh-card-media-frame{
    width:100%!important;
    height:190px!important;
    min-height:190px!important;
    max-height:190px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    padding:10px!important;
    background:#061014!important;
    border-bottom:1px solid #1e323b!important;
}
.page-historia .gbh-card-media-frame > img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:none!important;
    filter:none!important;
}

/* Compatibilidade com cards antigos que ainda tenham img direto */
.page-historia .gbh-cards article.has-media > img{
    width:100%!important;
    height:190px!important;
    min-height:190px!important;
    max-height:190px!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:10px!important;
    box-sizing:border-box!important;
    background:#061014!important;
    transform:none!important;
}

@media(max-width:980px){
    .page-historia .gbh-gallery-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        grid-auto-rows:240px!important;
    }
    .page-historia .gbh-gallery-grid > figure,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-1,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-2,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-3,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-4,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-5,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-6{
        height:240px!important;
        min-height:240px!important;
        max-height:240px!important;
    }
}
@media(max-width:620px){
    .page-historia .gbh-gallery-grid{
        grid-template-columns:1fr!important;
        grid-auto-rows:280px!important;
    }
    .page-historia .gbh-gallery-grid > figure,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-1,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-2,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-3,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-4,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-5,
    .page-historia .gbh-gallery-grid > figure.gbh-gallery-item-6{
        height:280px!important;
        min-height:280px!important;
        max-height:280px!important;
    }
}
