.chez-activity-gallery {
    border-top: 1px solid rgba(37, 51, 47, 0.16);
    margin-top: clamp(3.5rem, 8vw, 7rem);
    padding-top: clamp(2.5rem, 5vw, 4.5rem);
}

.chez-activity-gallery__header {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.chez-activity-gallery__header p,
.chez-activity-gallery__header h2 { margin: 0; }

.chez-activity-gallery__header p {
    color: var(--chez-activity-accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chez-activity-gallery__header h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.03em;
}

.chez-activity-gallery__masonry {
    display: grid;
    gap: clamp(0.75rem, 1.8vw, 1.35rem);
    grid-auto-flow: dense;
    grid-auto-rows: clamp(120px, 12vw, 180px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chez-activity-gallery__item {
    animation: chez-gallery-reveal 260ms ease both;
    border-radius: clamp(14px, 1.6vw, 22px);
    grid-row: span 2;
    margin: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.chez-activity-gallery__item:nth-child(8n + 1),
.chez-activity-gallery__item:nth-child(8n + 6) {
    grid-column: span 2;
    grid-row: span 3;
}

.chez-activity-gallery__item:nth-child(8n + 4) {
    grid-column: span 2;
}

.chez-activity-gallery__trigger {
    background: #e9eeeb;
    border: 0;
    color: inherit;
    cursor: zoom-in;
    display: block;
    height: 100%;
    padding: 0;
    position: relative;
    width: 100%;
}

.chez-activity-gallery__item--video .chez-activity-gallery__trigger { cursor: pointer; }

.chez-activity-gallery__item img,
.chez-activity-gallery__video-preview {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform 320ms ease, filter 320ms ease;
    width: 100%;
}

.chez-activity-gallery__trigger:hover img,
.chez-activity-gallery__trigger:hover .chez-activity-gallery__video-preview {
    transform: scale(1.035);
}

.chez-activity-gallery__trigger:focus-visible {
    outline: 3px solid var(--chez-activity-accent);
    outline-offset: 4px;
}

.chez-activity-gallery__play {
    align-items: center;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    display: flex;
    height: clamp(48px, 5vw, 68px);
    justify-content: center;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: clamp(48px, 5vw, 68px);
}

.chez-activity-gallery__play span {
    border-bottom: 8px solid transparent;
    border-left: 13px solid var(--chez-activity-accent);
    border-top: 8px solid transparent;
    margin-left: 4px;
}

.chez-activity-gallery__actions {
    display: flex;
    justify-content: center;
    margin-top: clamp(2rem, 5vw, 3.5rem);
}

.chez-activity-gallery__load {
    background: var(--chez-activity-accent);
    border: 2px solid var(--chez-activity-accent);
    border-radius: var(--bs-border-radius-pill, 50rem);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-width: 11rem;
    padding: 0.75rem 1.5rem;
}

.chez-activity-gallery__load:disabled { cursor: wait; opacity: 0.65; }
.chez-activity-gallery__status { min-height: 1.5em; text-align: center; }
.chez-activity-gallery__status[data-state="error"] { color: #9b241b; }
.chez-lightbox-open { overflow: hidden; }
.chez-activity-lightbox[hidden] { display: none; }
.chez-activity-lightbox { inset: 0; position: fixed; z-index: 100000; }
.chez-activity-lightbox__backdrop { background: rgba(6, 18, 15, 0.94); inset: 0; position: absolute; }

.chez-activity-lightbox__panel {
    align-items: center;
    color: #fff;
    display: grid;
    grid-template-columns: minmax(44px, 72px) minmax(0, 1fr) minmax(44px, 72px);
    inset: 0;
    padding: clamp(56px, 7vw, 88px) clamp(12px, 3vw, 42px) 28px;
    position: absolute;
}

.chez-activity-lightbox button {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 48px;
    position: relative;
    width: 48px;
    z-index: 1;
}

.chez-activity-lightbox button:focus-visible { outline-color: #fff; }
.chez-activity-lightbox__close { position: absolute !important; right: clamp(16px, 3vw, 42px); top: 16px; }
.chez-activity-lightbox__previous { justify-self: start; }
.chez-activity-lightbox__next { justify-self: end; }

.chez-activity-lightbox__figure {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    margin: 0;
    min-height: 0;
}

.chez-activity-lightbox__image,
.chez-activity-lightbox__video {
    border-radius: 12px;
    display: block;
    max-height: calc(100vh - 155px);
    max-width: 100%;
    object-fit: contain;
}

.chez-activity-lightbox__video { width: min(100%, 1200px); }
.chez-activity-lightbox__video[hidden],
.chez-activity-lightbox__image[hidden] { display: none; }
.chez-activity-lightbox__caption { line-height: 1.5; margin-top: 12px; max-width: 70ch; text-align: center; }
.chez-activity-lightbox__counter { bottom: 12px; grid-column: 1 / -1; left: 0; margin: 0; position: absolute; text-align: center; width: 100%; }

@keyframes chez-gallery-reveal { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 1100px) {
    .chez-activity-gallery__masonry { grid-auto-rows: clamp(115px, 18vw, 165px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .chez-activity-gallery__item:nth-child(8n + 1),
    .chez-activity-gallery__item:nth-child(8n + 6) { grid-column: span 2; }
}

@media (max-width: 767px) {
    .chez-activity-gallery__header { align-items: start; flex-direction: column; gap: 0.75rem; }
    .chez-activity-gallery__masonry { grid-auto-rows: clamp(105px, 30vw, 150px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chez-activity-gallery__item,
    .chez-activity-gallery__item:nth-child(8n + 1),
    .chez-activity-gallery__item:nth-child(8n + 6) { grid-column: span 1; grid-row: span 2; }
    .chez-activity-gallery__item:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
    .chez-activity-lightbox__panel { grid-template-columns: 48px minmax(0, 1fr) 48px; padding-inline: 8px; }
}

@media (max-width: 480px) {
    .chez-activity-gallery__masonry { grid-auto-rows: 115px; }
    .chez-activity-gallery__item { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .chez-activity-gallery__item { animation: none; }
    .chez-activity-gallery__item img,
    .chez-activity-gallery__video-preview { transition: none; }
}
