/* Explain: Styles for the photo and video gallery grid and lightbox. */
/* Gallery grid */
.gallery-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.gallery-tile {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    background: var(--surface-raised);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-tile img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(163, 38, 32, 0.45);
    box-shadow: 0 22px 50px rgba(51, 35, 27, 0.16);
}

.gallery-tile:hover img {
    transform: scale(1.06);
}

.gallery-tile:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.gallery-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(24, 15, 11, 0) 44%, rgba(24, 15, 11, 0.84) 100%);
}

.gallery-badge {
    position: absolute;
    left: 0.7rem;
    top: 0.7rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(250, 246, 241, 0.92);
    padding: 0.28rem 0.7rem;
    color: var(--primary-color);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gallery-caption {
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.8rem;
    color: #FFFFFF;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
}

.gallery-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-play > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(250, 246, 241, 0.9);
    color: var(--primary-color);
    backdrop-filter: blur(6px);
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(18, 11, 8, 0.93);
    backdrop-filter: blur(10px);
}

.lightbox-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    width: 100%;
    max-width: min(94vw, 68rem);
}

.lightbox-media-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.lightbox-media {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 1.25rem;
    background: #120B08;
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    max-width: 52rem;
    text-align: center;
    color: #F1DDC4;
}

.lightbox-caption p:first-child {
    font-size: 1rem;
    font-weight: 600;
}

.lightbox-caption p:last-child {
    margin-top: 0.35rem;
    color: rgba(241, 221, 196, 0.6);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lightbox-btn {
    position: fixed;
    z-index: 130;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid rgba(250, 246, 241, 0.3);
    background: rgba(250, 246, 241, 0.12);
    color: #FFFFFF;
    backdrop-filter: blur(8px);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox-btn:hover {
    background: rgba(250, 246, 241, 0.26);
    border-color: rgba(250, 246, 241, 0.65);
}

.lightbox-close {
    top: clamp(1rem, 3vw, 1.75rem);
    right: clamp(1rem, 3vw, 1.75rem);
}

.lightbox-prev {
    left: clamp(0.6rem, 2vw, 1.75rem);
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: clamp(0.6rem, 2vw, 1.75rem);
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 640px) {
    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: clamp(1rem, 3vw, 1.75rem);
        transform: none;
    }

    .lightbox-prev {
        left: calc(50% - 3.5rem);
    }

    .lightbox-next {
        right: calc(50% - 3.5rem);
    }
}