.ewcs-gallery-section {
    padding: 6rem 1.5rem;
    background: #f9fafb;
}

.ewcs-gallery-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.ewcs-gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ewcs-gallery-kicker {
    margin-bottom: 1rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--color-primary-500, #9b7a5a);
}

.ewcs-gallery-title {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    font-weight: 800;
    color: #111827;
}

.ewcs-gallery-line {
    width: 6rem;
    height: 3px;
    margin: 0 auto 1.75rem;
    background: var(--color-primary-500, #9b7a5a);
}

.ewcs-gallery-intro {
    max-width: 42rem;
    margin: 0 auto;
    color: #4b5563;
    font-size: 1.1rem;
    line-height: 1.7;
}

.ewcs-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem 1.25rem;
    margin-bottom: 3.5rem;
}

.ewcs-gallery-filter {
    position: relative;
    border: 0;
    background: transparent;
    padding: .7rem .2rem;
    cursor: pointer;
    color: #6b7280;
    font: inherit;
    font-weight: 700;
    transition: color .25s ease;
}

.ewcs-gallery-filter::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: .35rem;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s ease;
}

.ewcs-gallery-filter:hover,
.ewcs-gallery-filter.is-active {
    color: var(--color-primary-500, #9b7a5a);
}

.ewcs-gallery-filter:hover::after,
.ewcs-gallery-filter.is-active::after {
    transform: scaleX(1);
}

.ewcs-gallery-grid {
    columns: 1;
    column-gap: 1rem;
}

@media (min-width: 640px) {
    .ewcs-gallery-grid {
        columns: 2;
    }
}

@media (min-width: 1024px) {
    .ewcs-gallery-grid {
        columns: 3;
        column-gap: 1.35rem;
    }
}

@media (min-width: 1280px) {
    .ewcs-gallery-grid {
        columns: 4;
    }
}

.ewcs-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border: 0;
    padding: 0;
    margin: 0 0 1rem;
    cursor: pointer;
    border-radius: 1.25rem;
    background: #e5e7eb;
    break-inside: avoid;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
    transition: transform .45s ease, box-shadow .45s ease, opacity .35s ease;
}

@media (min-width: 768px) {
    .ewcs-gallery-item {
        margin-bottom: 1.35rem;
    }
}

.ewcs-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 28px 70px rgba(15, 23, 42, .22);
}

.ewcs-gallery-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    transition: transform .7s ease;
}

.ewcs-gallery-item:hover .ewcs-gallery-img {
    transform: scale(1.055);
}

.ewcs-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, .05) 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

.ewcs-gallery-item:hover .ewcs-gallery-overlay {
    opacity: 1;
}

.ewcs-gallery-caption {
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.15rem;
    color: white;
    text-align: left;
    transform: translateY(12px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
}

.ewcs-gallery-item:hover .ewcs-gallery-caption {
    transform: translateY(0);
    opacity: 1;
}

.ewcs-gallery-caption span {
    display: block;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ewcs-gallery-caption strong {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .35rem;
    font-size: .95rem;
    font-weight: 600;
}

.ewcs-gallery-more-wrap {
    margin-top: 5rem;
    text-align: center;
}

.ewcs-gallery-more {
    border: 1px solid rgba(17, 24, 39, .12);
    border-radius: 999px;
    padding: 1rem 1.6rem;
    background: #111827;
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.ewcs-gallery-more:hover {
    transform: translateY(-2px);
    background: var(--color-primary-500, #9b7a5a);
    border-color: var(--color-primary-500, #9b7a5a);
}

.ewcs-gallery-more.is-hidden {
    display: none;
}

/* Lightbox */
.ewcs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(18px);
}

.ewcs-lightbox.is-open {
    display: flex;
}

.ewcs-lightbox-stage {
    position: relative;
    width: min(1180px, 100%);
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ewcs-lightbox-img {
    display: block;
    margin: 0 auto;

    max-width: 100%;
    max-height: 82vh;

    object-fit: contain;
    object-position: center;

    border-radius: 1rem;
    box-shadow: 0 35px 90px rgba(0, 0, 0, .6);
}

.ewcs-lightbox-img.is-changing {
    opacity: 0;
    transform: scale(.985);
}

.ewcs-lightbox-info {
    margin-top: 1rem;
    color: white;
}

.ewcs-lightbox-title {
    font-weight: 700;
}

.ewcs-lightbox-counter {
    margin-top: .25rem;
    font-size: .9rem;
    color: rgba(255, 255, 255, .65);
}

.ewcs-lightbox-btn {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: white;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: background .25s ease, transform .25s ease, opacity .25s ease;
}

.ewcs-lightbox-btn:hover {
    background: rgba(255, 255, 255, .22);
    transform: scale(1.05);
}

.ewcs-lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
}

.ewcs-lightbox-prev {
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.ewcs-lightbox-next {
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.ewcs-lightbox-prev:hover,
.ewcs-lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

@media (max-width: 767px) {

    .ewcs-lightbox-prev,
    .ewcs-lightbox-next {
        top: auto;
        bottom: 1.25rem;
        transform: none;
    }

    .ewcs-lightbox-prev:hover,
    .ewcs-lightbox-next:hover {
        transform: scale(1.05);
    }

    .ewcs-lightbox-img {
        max-height: 74vh;
    }
}

.celias-gallery {
    background: #fffbeb;
    --color-primary-500: #d97706;
}

.celias-gallery .ewcs-gallery-title {
    color: #292524;
}

.celias-gallery .ewcs-gallery-intro {
    color: #57534e;
}

.celias-gallery .ewcs-gallery-more {
    background: #292524;
}

.celias-gallery .ewcs-gallery-more:hover {
    background: #d97706;
    border-color: #d97706;
}