/* --- Item Grid --- */
.item-grid-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.item-card {
    display: block;
    position: relative;
    overflow: hidden;
}

.item-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 300ms ease, opacity 150ms ease;
}

.item-card:hover img {
    transform: scale(1.03);
    opacity: 0.9;
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    opacity: 0;
    transition: opacity 150ms ease;
}

.item-card:hover .item-overlay {
    opacity: 1;
}

/* Always show overlay on touch/mobile since no hover */
@media (max-width: 767px) {
    .item-overlay {
        opacity: 1;
        background: linear-gradient(transparent 30%, rgba(0,0,0,0.5));
    }
}

.item-title {
    font-family: var(--font-display);
    color: #fff;
    font-size: 1rem;
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgb(0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms, visibility 200ms;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 301;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;
    z-index: 301;
}

.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

@media (min-width: 640px) {
    .item-grid-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .item-grid-section {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}


