/**
 * Gallery Block Styles
 */

.block-gallery {
    padding: 5em 2.5em;
    background-color: var(--color-1, #F8F2E5);
}

@media screen and (max-width: 1024px) {
    .block-gallery {
        padding: 3em 0.5em;
    }
}

.block-gallery__container {
    max-width: 87.75em;
    margin: 0 auto;
}

/* Header */
.block-gallery__header {
    margin-bottom: 8.75em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__header {
        margin-bottom: 2em;
    }
}

.block-gallery__title {
    margin: 0;
    color: var(--color-2, #03090D);
}

/* Main Layout */

.block-gallery__main {
    display: grid;
    grid-template-columns: 16.675em auto;
    gap: 10.1875em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__main {
        grid-template-columns: 8em 1fr;
        gap: 2em;
    }
}

@media screen and (max-width: 1024px) {
    .block-gallery__main {
        grid-template-columns: 1fr;
        gap: 1.5em;
    }
}

/* Sidebar Filters */
.block-gallery__sidebar {
    position: sticky;
    top: 6em;
    height: fit-content;
}

@media screen and (max-width: 1024px) {
    .block-gallery__sidebar {
        position: static;
    }
}

.block-gallery__filter-label {
    display: block;
    margin-bottom: 1.5em;
    color: rgba(3, 9, 13, 0.5);
}

.block-gallery__filters {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75em 1.5em;
    }
}

.block-gallery__filter-btn {
    background: transparent;
    border: none;
    padding: 0.25em 0;
    cursor: pointer;
    font-family: var(--font-primary, sans-serif);
    font-size: 0.875em;
    line-height: 1;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-2, #03090D);
    position: relative;
    transition: color 0.3s ease, background 0.3s ease, padding 0.3s ease;
    border-radius: 0.125em;
}

.block-gallery__filter-btn.is-active {
    color: #fff;
    background: #000;
    padding: 0.25em 0.375em; 
}

.block-gallery__filter-btn--all {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid rgba(0, 0, 0, .15);
    width: 100%;
    text-align: left;
}

@media screen and (max-width: 1024px) {
    .block-gallery__filter-btn--all {
        margin-top: 0;
        padding-top: 0.25em;
        border-top: none;
    }
}

/* Gallery Grid */
.block-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5em;
    }
}

.block-gallery__item {
    margin: 0;
    overflow: hidden;
    border-radius: 0.25em;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.block-gallery__item:hover {
    transform: scale(1.02);
}

.block-gallery__item.is-hidden {
    display: none;
}

.block-gallery__item.is-animating-out {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

.block-gallery__item.is-animating-in {
    opacity: 0;
    transform: translateY(1.25em);
}

.block-gallery__image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.2;
    object-fit: cover;
    display: block;
}

/* Footer */
.block-gallery__footer {
    display: flex;
    justify-content: center;
    margin-top: 3em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__footer {
        margin-top: 2em;
    }
}

/* =====================
   LIGHTBOX STYLES
   ===================== */

.block-gallery__lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.block-gallery__lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.block-gallery__lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-1, #F8F2E5);
}

.block-gallery__lightbox-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5em 2.5em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-container {
        padding: 1em;
    }
}

/* Lightbox Header */
.block-gallery__lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5em;
    max-width: 45em;
    background: var(--color-6);
    margin: auto auto 1.5em;
    width: 100%;
    padding: 1.5rem 2em;
    border-radius: 0.375em;
    height: 3.75em;
}


.block-gallery__lightbox-label {
    font-size: 0.6875em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-2, #03090D);
}

.block-gallery__lightbox-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    font-weight: 400;
    color: var(--color-2, #03090D);
}

.block-gallery__lightbox-separator {
    margin: 0 0.25em;
    opacity: 0.5;
}

.block-gallery__lightbox-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-2, #03090D);
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.block-gallery__lightbox-close:hover {
    opacity: 0.6;
}

/* Lightbox Main */
.block-gallery__lightbox-main {
    flex: 1;
    display: flex;
    gap: 1.5em;
    min-height: 0;
    overflow: hidden;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-main {
        flex-direction: column;
    }
}

/* Lightbox Thumbnails - Desktop (Left side) */
.block-gallery__lightbox-thumbs {
    width: 5em;
    flex-shrink: 0;
    overflow: hidden;
    position: absolute;
    right: 0.875em;
    top: 0;
    bottom: 0;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-thumbs {
        width: 100%;
        right: 0;
        bottom: 9px;
        top: auto;
    }
}

.block-gallery__lightbox-thumbs-track {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    height: 100%;
}

.block-gallery__lightbox-thumbs-track::-webkit-scrollbar {
    display: none;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-thumbs-track {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

.block-gallery__lightbox-thumb {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.25em;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-thumb {
        width: 4em;
        height: 100%;
    }
}

.block-gallery__lightbox-thumb:hover,
.block-gallery__lightbox-thumb.is-active {
    opacity: 1;
}

.block-gallery__lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox Main Image */
.block-gallery__lightbox-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-image-wrapper {
        order: 1;
        max-height: 75%;
        width: 100%;
    }
}

.block-gallery__lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.375em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-image {
        height: 100%;
        width: 100%;
    }
}

/* Lightbox Navigation */
.block-gallery__lightbox-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5em;
    margin-top: 1.5em;
    padding-bottom: 0.5em;
}

@media screen and (max-width: 1024px) {
    .block-gallery__lightbox-nav {
        position: absolute;
        bottom: 5.5em;
        left: 0;
        right: 0;
        margin-top: 0;
        padding-bottom: 0;
    }
}

.block-gallery__lightbox-prev,
.block-gallery__lightbox-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5em;
    height: 2.5em;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-2, #03090D);
    transition: opacity 0.3s ease;
    padding: 0;
}

.block-gallery__lightbox-prev:hover,
.block-gallery__lightbox-next:hover {
    opacity: 0.6;
}

.block-gallery__lightbox-prev svg,
.block-gallery__lightbox-next svg {
    width: 1.25em;
    height: auto;
}

.block-gallery__lightbox-progress {
    width: 6em;
    height: 1px;
    background-color: rgba(3, 9, 13, 0.2);
    position: relative;
    overflow: hidden;
}

.block-gallery__lightbox-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--color-2, #03090D);
    transition: width 0.3s ease;
}
