/* ---------- Students' Canvas of Creativity: a masonry grid with a lightbox (hero from history.css) ---------- */

.page-canvas .h-hero::after { background: var(--c-white); }
.page-canvas .h-hero__content { padding-bottom: calc(var(--h-curve) + 1.5rem); }
.page-canvas .h-hero + .section { padding-top: clamp(1.5rem, 3vw, 2.5rem); }

.cv-gallery { background: var(--c-white); }

.cv-gallery .cv-grid { column-count: 4; column-gap: clamp(0.6rem, 1.4vw, 1.1rem); margin: 0; padding: 0; list-style: none; }
.cv-item { break-inside: avoid; margin: 0 0 clamp(0.6rem, 1.4vw, 1.1rem); }
.cv-item[hidden] { display: none; }

.cv-thumb { display: block; width: 100%; padding: 0; overflow: hidden; cursor: zoom-in; background: none; border: 0; border-radius: 12px; }
.cv-thumb img { display: block; width: 100%; height: auto; transition: transform 0.4s var(--ease); }
.cv-thumb:hover img, .cv-thumb:focus-visible img { transform: scale(1.04); }
.cv-thumb:focus-visible { outline: 3px solid var(--c-gold-500); outline-offset: 3px; }

.cv-more { display: flex; justify-content: center; margin-top: clamp(2rem, 4vw, 3rem); }
.cv-more .btn[hidden] { display: none; }

/* Lightbox */
.cv-box { width: min(96vw, 60rem); max-width: none; max-height: 96vh; padding: 0; overflow: visible; background: transparent; border: 0; }
.cv-box::backdrop { background: rgb(11 25 18 / 0.9); }
.cv-box[open] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: center; gap: clamp(0.5rem, 2vw, 1.5rem); }
.cv-box > img { width: auto; max-width: 100%; height: auto; max-height: 88vh; border-radius: 12px; }

.cv-box__nav, .cv-box__close { display: grid; place-items: center; width: 3rem; height: 3rem; font-size: 1.5rem; line-height: 1; color: var(--c-white); cursor: pointer; background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.4); border-radius: 50%; }
.cv-box__nav:hover, .cv-box__close:hover { color: var(--c-maroon-950, var(--c-maroon-950)); background: var(--c-gold-500); border-color: var(--c-gold-500); }
.cv-box__close { position: absolute; right: 0; top: -3.75rem; }

@media (max-width: 1000px) { .cv-gallery .cv-grid { column-count: 3; } }
@media (max-width: 640px) {
    .cv-gallery .cv-grid { column-count: 2; }
    .cv-box[open] { grid-template-columns: 1fr; }
    .cv-box__nav { position: absolute; bottom: -3.5rem; }
    .cv-box__nav--prev { left: calc(50% - 3.5rem); }
    .cv-box__nav--next { right: calc(50% - 3.5rem); }
}
@media (prefers-reduced-motion: reduce) { .cv-thumb img { transition: none; } }
