/* SKY Public School - gallery page layout */
.gallery-page {
    overflow: hidden;
}

.gallery-page .gallery-toolbar {
    align-items: center;
}

.gallery-page__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    align-items: start;
}

.gallery-page__grid .gallery-card,
.gallery-page__grid .gallery-card:nth-child(7n + 1),
.gallery-page__grid .gallery-card.is-featured {
    width: 100%;
    height: 400px;
    min-height: 0;
    display: block;
    isolation: isolate;
}

.gallery-page__grid .gallery-card {
    grid-column: span 4;
}

.gallery-page__grid .gallery-card:nth-child(7n + 1),
.gallery-page__grid .gallery-card.is-featured {
    grid-column: span 8;
}

.gallery-page__grid .gallery-card > img {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--gallery-image-x, 50%) var(--gallery-image-y, 50%);
    transform: scale(var(--gallery-image-zoom, 1));
    transform-origin: var(--gallery-image-x, 50%) var(--gallery-image-y, 50%);
}

.gallery-page__grid .gallery-card::after {
    z-index: 1;
}

.gallery-page__grid .gallery-card__copy {
    z-index: 2;
}

.gallery-card__open {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 13px;
    background: rgba(4, 18, 48, .58);
    color: #fff;
    font-size: .78rem;
    opacity: 0;
    transform: translateY(-7px);
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
    backdrop-filter: blur(8px);
}

.gallery-page__grid .gallery-card:hover .gallery-card__open,
.gallery-page__grid .gallery-card:focus-visible .gallery-card__open {
    opacity: 1;
    transform: none;
}

.gallery-page__grid .gallery-card:focus-visible {
    outline: 4px solid rgba(46, 158, 255, .4);
    outline-offset: 4px;
}

@media (max-width: 1100px) {
    .gallery-page__grid .gallery-card,
    .gallery-page__grid .gallery-card:nth-child(7n + 1),
    .gallery-page__grid .gallery-card.is-featured {
        height: 350px;
    }
}

@media (max-width: 900px) {
    .gallery-page__grid .gallery-card,
    .gallery-page__grid .gallery-card:nth-child(7n + 1),
    .gallery-page__grid .gallery-card.is-featured {
        grid-column: span 6;
        height: 330px;
    }

    .gallery-card__open {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 680px) {
    .gallery-page {
        padding-top: 58px;
    }

    .gallery-page .section-heading {
        margin-bottom: 25px;
    }

    .gallery-page .gallery-toolbar {
        flex-wrap: nowrap;
        gap: 8px;
        margin-right: -14px;
        margin-bottom: 25px;
        padding-right: 14px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .gallery-page .gallery-toolbar::-webkit-scrollbar {
        display: none;
    }

    .gallery-page .filter-button {
        flex: 0 0 auto;
        min-height: 42px;
        padding-inline: 15px;
    }

    .gallery-page__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-page__grid .gallery-card,
    .gallery-page__grid .gallery-card:nth-child(7n + 1),
    .gallery-page__grid .gallery-card.is-featured {
        grid-column: auto;
        height: 300px;
        min-height: 0;
        border-radius: 21px;
    }

    .gallery-page__grid .gallery-card__copy {
        padding: 21px 18px;
    }

    .gallery-page__grid .gallery-card__copy strong {
        font-size: 1.28rem;
    }

    .gallery-page__grid .gallery-card__copy small {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .gallery-card__open {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }
}

@media (max-width: 390px) {
    .gallery-page__grid .gallery-card,
    .gallery-page__grid .gallery-card:nth-child(7n + 1),
    .gallery-page__grid .gallery-card.is-featured {
        height: 270px;
    }
}
