/**
 * Gallery album photo grid — loaded on album detail pages only (cache-safe deploy).
 */

.nt-gallery-page .nt-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    align-items: stretch;
    width: 100%;
}

.nt-gallery-page .nt-photo-item {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: var(--nt-radius-sm);
    background: var(--nt-sage-soft);
    cursor: pointer;
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    text-align: left;
    appearance: none;
    font: inherit;
    color: inherit;
}

.nt-gallery-page .nt-photo-item:focus-visible {
    outline: 2px solid var(--nt-brand-bar);
    outline-offset: 3px;
}

.nt-gallery-page .nt-photo-item img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    vertical-align: middle;
    transition: transform 0.35s var(--nt-ease);
}

.nt-gallery-page .nt-photo-item:hover img,
.nt-gallery-page .nt-photo-item:focus-visible img {
    transform: scale(1.04);
}

.nt-gallery-page .nt-photo-item-hover {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem;
    background: linear-gradient(
        180deg,
        rgba(42, 61, 20, 0.15) 0%,
        rgba(42, 61, 20, 0.72) 100%
    );
    color: var(--nt-white);
    opacity: 0;
    transition: opacity 0.25s var(--nt-ease);
    pointer-events: none;
}

.nt-gallery-page .nt-photo-item:hover .nt-photo-item-hover,
.nt-gallery-page .nt-photo-item:focus-visible .nt-photo-item-hover {
    opacity: 1;
}

.nt-gallery-page .nt-photo-item-hover i {
    font-size: 1.35rem;
}

.nt-gallery-page .nt-photo-item-hover span {
    max-width: 100%;
    font-size: var(--nt-text-sm);
    line-height: 1.35;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1199px) {
    .nt-gallery-page .nt-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.85rem;
    }
}

@media (max-width: 991px) {
    .nt-gallery-page .nt-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 767px) {
    .nt-gallery-page .nt-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 479px) {
    .nt-gallery-page .nt-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }
}
