
/* =========================================
   DIDINA VILLAGE - GALLERY
   Responsive layout for homepage and gallery
========================================= */

.gallery-highlights {
    overflow: hidden;
}

.gallery-highlights .gallery-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 28px;
}

.gallery-heading-copy {
    max-width: 680px;
}

.gallery-heading-copy h2 {
    margin: 10px 0;
}

.gallery-heading-copy p {
    margin: 0;
    color: #647067;
    line-height: 1.7;
}

.gallery-view-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #09633f;
    font-weight: 700;
    text-decoration: none;
}

.gallery-view-all:hover {
    color: #064a2e;
}

/* Equal-sized gallery cards */
.gallery-highlight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 18px;
    align-items: stretch;
}

.gallery-highlight-grid > .gallery-highlight-card {
    position: relative;
    display: block;
    width: 100%;
    height: 245px;
    min-width: 0;
    min-height: 0;
    max-height: none;
    grid-column: auto;
    grid-row: auto;
    align-self: stretch;
    aspect-ratio: auto;
    overflow: hidden;
    border-radius: 16px;
    background: #e8eee9;
    text-decoration: none;
    isolation: isolate;
}

.gallery-highlight-grid > .gallery-highlight-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gallery-highlight-card:hover img {
    transform: scale(1.04);
}

.gallery-highlight-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding: 34px 15px 15px;
    color: #fff;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, 0.76)
    );
}

.gallery-highlight-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.gallery-highlight-arrow {
    flex-shrink: 0;
    font-size: 20px;
}

.gallery-empty {
    padding: 35px 20px;
    text-align: center;
    border: 1px dashed #cbd8ce;
    border-radius: 14px;
}

.gallery-empty a {
    color: #09633f;
    font-weight: 700;
}

/* Tablet */
@media (max-width: 900px) {
    .gallery-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .gallery-highlight-grid > .gallery-highlight-card {
        height: 230px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .gallery-highlights .gallery-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .gallery-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .gallery-highlight-grid > .gallery-highlight-card {
        height: 175px;
        border-radius: 11px;
    }

    .gallery-highlight-caption {
        padding: 25px 10px 10px;
    }

    .gallery-highlight-title {
        font-size: 12px;
    }

    .gallery-highlight-arrow {
        font-size: 16px;
    }
}

/* =========================================
   DIDINA VILLAGE - FULL GALLERY PAGE
========================================= */

.gallery-page-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.gallery-page-card {
    display: block;
    position: relative;
    width: 100%;
    height: 230px;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: #e8eee9;
    text-align: left;
}

.gallery-page-card img,
.gallery-page-card video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-page-card img {
    transition: transform .3s ease;
}

.gallery-lightbox-trigger {
    cursor: zoom-in;
}

.gallery-lightbox-trigger:hover img {
    transform: scale(1.04);
}

.gallery-page-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    padding: 28px 12px 12px;
    color: #fff;
    font-weight: 600;
    background: linear-gradient(
        transparent,
        rgba(0, 0, 0, .7)
    );
}

.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 30px;
}

.gallery-page-number {
    font-weight: 600;
}

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: rgba(0, 0, 0, .92);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox img {
    display: block;
    max-width: 95vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-lightbox-close {
    position: absolute;
    top: 12px;
    right: 22px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .gallery-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-page-card {
        height: 220px;
    }
}

@media (max-width: 600px) {
    .gallery-page-grid {
        gap: 10px;
    }

    .gallery-page-card {
        height: 170px;
        border-radius: 10px;
    }

    .gallery-page-caption {
        padding: 22px 9px 9px;
        font-size: 12px;
    }
}
