/* ==========================================================================
   BM Galleries - Photo Grid & Lightbox Styles
   ========================================================================== */

.bm-gallery {
    margin: 2em 0;
}

/* Header
   ========================================================================== */

.bm-gallery__header {
    margin-bottom: 1.5em;
}

.bm-gallery__title {
    margin: 0 0 0.25em;
    font-size: 1.5em;
    line-height: 1.2;
}

.bm-gallery__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1.5em;
    color: #666;
    font-size: 0.9em;
}

.bm-gallery__meta a {
    color: inherit;
    text-decoration: underline;
}

.bm-gallery__meta a:hover {
    color: #000;
}

.bm-gallery__description {
    margin-top: 0.75em;
    color: #444;
}

.bm-gallery__description p {
    margin: 0;
}

/* Grid
   ========================================================================== */

.bm-gallery__grid {
    display: grid;
    gap: 4px;
}

.bm-gallery__grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bm-gallery__grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bm-gallery__grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.bm-gallery__grid--cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Photo Items
   ========================================================================== */

.bm-gallery__item {
    position: relative;
    margin: 0;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #f0f0f0;
}

.bm-gallery__item a {
    display: block;
    width: 100%;
    height: 100%;
}

.bm-gallery__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bm-gallery__item:hover img {
    transform: scale(1.03);
}

/* Captions
   ========================================================================== */

.bm-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2em 0.75em 0.75em;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: #fff;
    font-size: 0.8em;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bm-gallery__item:hover .bm-gallery__caption {
    opacity: 1;
}

.bm-gallery__band {
    display: block;
    font-weight: 700;
}

.bm-gallery__caption-text {
    display: block;
    opacity: 0.85;
}

/* PhotoSwipe Caption Overlay
   ========================================================================== */

.bm-gallery__pswp-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1em 1.5em;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
    color: #fff;
    font-size: 0.95em;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
}

.bm-gallery__pswp-caption .bm-gallery__band {
    font-weight: 700;
    font-size: 1.05em;
}

.bm-gallery__pswp-caption .bm-gallery__caption-text {
    opacity: 0.85;
    margin-top: 0.15em;
}

/* Error State
   ========================================================================== */

.bm-gallery-error {
    padding: 1em;
    margin: 1em 0;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    font-size: 0.9em;
}

.bm-gallery-error p {
    margin: 0;
}

/* Responsive
   ========================================================================== */

@media (max-width: 575.98px) {
    .bm-gallery__grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .bm-gallery__caption {
        opacity: 1;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .bm-gallery__grid--cols-4,
    .bm-gallery__grid--cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}
