/* =========================================================================
   Galería — Grid automático con lightbox
   ========================================================================= */

.ghb-gallery-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px 110px;
}

.ghb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 170px;
    grid-auto-flow: dense;
    gap: 18px;
}

.ghb-gallery-item {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: #f4f1ea;
    grid-column: span 2;
    grid-row: span 2;
}

.ghb-gallery-item:nth-child(8n + 1),
.ghb-gallery-item:nth-child(8n + 5) {
    grid-column: span 3;
    grid-row: span 3;
}

.ghb-gallery-item:nth-child(8n + 3),
.ghb-gallery-item:nth-child(8n + 6) {
    grid-column: span 3;
    grid-row: span 2;
}

.ghb-gallery-item:nth-child(8n + 4),
.ghb-gallery-item:nth-child(8n + 7) {
    grid-column: span 2;
    grid-row: span 1;
}

.ghb-gallery-item img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%!important;
    object-fit: cover;
    object-position: center center;
    cursor: zoom-in;
    transition: transform 0.35s ease, opacity 0.25s ease;
}

.ghb-gallery-item:hover img {
    transform: scale(1.04);
    opacity: 0.94;
}

.ghb-gallery-empty {
    border: 1px dashed #d8cfbf;
    background: #fbf9f5;
    color: #6f6658;
    text-align: center;
    padding: 90px 24px;
}

.ghb-gallery-empty h2 {
    font-family: var(--heading-font);
    font-size: 30px;
    color: #262626;
    margin: 0 0 14px;
}

.ghb-gallery-empty p {
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
}

.ghb-gallery-empty code {
    background: #efe9dd;
    color: #262626;
    padding: 3px 7px;
}

@media (max-width: 980px) {
    .ghb-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 150px;
    }

    .ghb-gallery-item,
    .ghb-gallery-item:nth-child(8n + 1),
    .ghb-gallery-item:nth-child(8n + 3),
    .ghb-gallery-item:nth-child(8n + 5),
    .ghb-gallery-item:nth-child(8n + 6) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .ghb-gallery-item:nth-child(8n + 4),
    .ghb-gallery-item:nth-child(8n + 7) {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 620px) {
    .ghb-gallery-page {
        padding-top: 60px;
        padding-bottom: 80px;
    }

    .ghb-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 130px;
        gap: 14px;
    }

    .ghb-gallery-item,
    .ghb-gallery-item:nth-child(8n + 1),
    .ghb-gallery-item:nth-child(8n + 3),
    .ghb-gallery-item:nth-child(8n + 5),
    .ghb-gallery-item:nth-child(8n + 6) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .ghb-gallery-item:nth-child(8n + 4),
    .ghb-gallery-item:nth-child(8n + 7) {
        grid-column: span 1;
        grid-row: span 1;
    }
}
