.sv-gallery-page {
    overflow-x: hidden;
}

.sv-gallery-page__body {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.sv-gallery-empty {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.sv-gallery-album-intro {
    max-width: 720px;
    margin: 0 auto 2rem;
    text-align: center;
    color: #555;
    line-height: 1.6;
}

.sv-gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sv-gallery-album-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sv-gallery-album-card__link:hover,
.sv-gallery-album-card__link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
}

.sv-gallery-album-card__media {
    display: block;
    aspect-ratio: 3 / 2;
    background: #eef1f4;
    overflow: hidden;
}

.sv-gallery-album-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sv-gallery-album-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(135deg, #e8ecef 0%, #d8dee4 100%);
}

.sv-gallery-album-card__body {
    padding: 1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sv-gallery-album-card__title {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
}

.sv-gallery-album-card__summary {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sv-gallery-album-card__count {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.sv-gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem 1.15rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sv-gallery-photo-grid__item {
    margin: 0;
}

.sv-gallery-photo-grid__trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.sv-gallery-photo-grid__trigger:hover,
.sv-gallery-photo-grid__trigger:focus-visible {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    outline: 2px solid #f7941d;
    outline-offset: 2px;
}

.sv-gallery-photo-grid__trigger img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

.sv-gallery-photo-grid__caption {
    font-size: 0.85rem;
    color: #555;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

/* Lightbox */
.sv-gallery-lightbox[hidden] {
    display: none !important;
}

.sv-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
}

.sv-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.sv-gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 3rem 3.5rem;
    box-sizing: border-box;
    pointer-events: none;
}

.sv-gallery-lightbox__figure {
    margin: 0;
    max-width: min(960px, 100%);
    max-height: calc(100vh - 6rem);
    pointer-events: auto;
    text-align: center;
}

.sv-gallery-lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sv-gallery-lightbox__caption {
    color: #eee;
    font-size: 0.95rem;
    margin-top: 0.75rem;
    line-height: 1.45;
}

.sv-gallery-lightbox__close,
.sv-gallery-lightbox__nav {
    position: absolute;
    z-index: 2;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    pointer-events: auto;
    transition: background 0.15s ease;
}

.sv-gallery-lightbox__close:hover,
.sv-gallery-lightbox__close:focus-visible,
.sv-gallery-lightbox__nav:hover,
.sv-gallery-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sv-gallery-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    line-height: 1;
}

.sv-gallery-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 3rem;
    font-size: 1.25rem;
}

.sv-gallery-lightbox__nav--prev {
    left: 0.75rem;
}

.sv-gallery-lightbox__nav--next {
    right: 0.75rem;
}

@media (max-width: 575px) {
    .sv-gallery-lightbox__dialog {
        padding: 2.5rem 0.5rem;
    }

    .sv-gallery-lightbox__nav--prev {
        left: 0.25rem;
    }

    .sv-gallery-lightbox__nav--next {
        right: 0.25rem;
    }
}
