.seva-project-gallery {
    --seva-accent: #0b66bd;
    --seva-border: #e5e5e5;
    --seva-gap: 18px;
    position: relative;
    width: 100%;
    font-family: inherit;
}

.seva-gallery-filter {
    position: relative;
    z-index: 20;
    width: min(320px, 100%);
    margin: 0 0 28px;
}

.seva-gallery-filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--seva-border);
    border-radius: 8px;
    background: #fff;
    color: #111;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.seva-gallery-chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease;
}

.seva-project-gallery.is-filter-open .seva-gallery-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.seva-gallery-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--seva-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
}

.seva-gallery-option {
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #222;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

/* Highlight album name on hover/focus and keep selected album highlighted. */
.seva-gallery-option:hover,
.seva-gallery-option:focus-visible,
.seva-gallery-option.is-active {
    background: var(--seva-accent) !important;
    color: #fff !important;
}

.seva-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--seva-gallery-columns), minmax(0, 1fr));
    gap: var(--seva-gap);
}

.seva-gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: hidden;
    cursor: zoom-in;
}

.seva-gallery-item[hidden] {
    display: none !important;
}

.seva-gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    transition: transform .28s ease;
}

.seva-gallery-item:hover img,
.seva-gallery-item:focus-visible img {
    transform: scale(1.025);
}

.seva-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px 86px;
    background: rgba(0, 0, 0, .88);
}

.seva-gallery-lightbox.is-open {
    display: flex;
}

.seva-gallery-lightbox-inner {
    max-width: min(1200px, 88vw);
    max-height: 88vh;
}

.seva-gallery-lightbox-inner img {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.seva-gallery-lightbox-close,
.seva-gallery-lightbox-nav {
    position: fixed;
    z-index: 2;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(0, 0, 0, .38);
    color: #fff;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}

.seva-gallery-lightbox-close:hover,
.seva-gallery-lightbox-close:focus-visible,
.seva-gallery-lightbox-nav:hover,
.seva-gallery-lightbox-nav:focus-visible {
    background: var(--seva-accent);
    border-color: var(--seva-accent);
}

.seva-gallery-lightbox-close {
    top: 24px;
    right: 28px;
    font-size: 30px;
}

.seva-gallery-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
}

.seva-gallery-lightbox-nav:hover,
.seva-gallery-lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.05);
}

.seva-gallery-lightbox-prev {
    left: 24px;
}

.seva-gallery-lightbox-next {
    right: 24px;
}

.seva-gallery-lightbox-nav[hidden] {
    display: none !important;
}

body.seva-gallery-lightbox-open {
    overflow: hidden;
}

.seva-gallery-empty {
    padding: 20px;
    border: 1px solid #ececec;
    background: #fafafa;
    color: #555;
}

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

@media (max-width: 640px) {
    .seva-gallery-filter {
        width: 100%;
        margin-bottom: 20px;
    }

    .seva-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .seva-gallery-lightbox {
        padding: 68px 56px 24px;
    }

    .seva-gallery-lightbox-inner {
        max-width: 100%;
    }

    .seva-gallery-lightbox-close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
    }

    .seva-gallery-lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 25px;
    }

    .seva-gallery-lightbox-prev {
        left: 8px;
    }

    .seva-gallery-lightbox-next {
        right: 8px;
    }
}


/* Empty album state: album remains selectable even when no images are assigned. */
.seva-gallery-no-media {
    width: 100%;
    padding: 34px 20px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fafafa;
    color: #666;
    text-align: center;
    font: inherit;
    font-weight: 500;
}

.seva-gallery-no-media[hidden] {
    display: none !important;
}
