/* CPH Gallery: grid + carousel + lightbox. Mirrors the FooGallery/FooBox look the site launched with (icons and timings copied from them). */
.cph-gallery { --cph-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M15.5 6H10V.5c0-.28-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5V6H.5c-.28 0-.5.22-.5.5v3c0 .28.22.5.5.5H6v5.5c0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5V10h5.5c.28 0 .5-.22.5-.5v-3c0-.28-.22-.5-.5-.5z'/%3E%3C/svg%3E"); --cph-plus-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23333' d='M15.5 6H10V.5c0-.28-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5V6H.5c-.28 0-.5.22-.5.5v3c0 .28.22.5.5.5H6v5.5c0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5V10h5.5c.28 0 .5-.22.5-.5v-3c0-.28-.22-.5-.5-.5z'/%3E%3C/svg%3E"); --cph-zoom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M15.56 15.56c-0.587 0.587-1.538 0.587-2.125 0l-2.652-2.652c-1.090 0.699-2.379 1.116-3.771 1.116-3.872 0-7.012-3.139-7.012-7.012s3.14-7.012 7.012-7.012c3.873 0 7.012 3.139 7.012 7.012 0 1.392-0.417 2.68-1.116 3.771l2.652 2.652c0.587 0.587 0.587 1.538 0 2.125zM7.012 2.003c-2.766 0-5.009 2.243-5.009 5.009s2.243 5.009 5.009 5.009c2.766 0 5.009-2.242 5.009-5.009s-2.242-5.009-5.009-5.009zM8.014 10.017h-2.003v-2.003h-2.003v-2.003h2.003v-2.003h2.003v2.003h2.003v2.003h-2.003v2.003z'/%3E%3C/svg%3E"); --cph-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.5 16l1.5-1.5-6.5-6.5 6.5-6.5-1.5-1.5-8 8 8 8z'/%3E%3C/svg%3E"); margin-inline: auto; }
.cph-gallery a.cph-item { position: relative; display: block; box-sizing: content-box; overflow: hidden; background: #fff; color: #333; }
.cph-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter .3s, transform .3s; }
.cph-gallery .cph-item::after { content: ""; position: absolute; inset: 0; visibility: hidden; opacity: 0; background: rgba(0, 0, 0, .5) var(--cph-plus) center / 32px no-repeat; transition: visibility .3s, opacity .3s; }
.cph-gallery .cph-item:hover::after, .cph-gallery .cph-item:focus-visible::after { visibility: visible; opacity: 1; }

/* Grid */
.cph-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cph-gap, 10px); }
.cph-grid.cph-left { justify-content: flex-start; }
.cph-grid .cph-item { flex: none; width: var(--cph-w); height: var(--cph-h); }
.cph-grid.cph-border .cph-item { border: 10px solid #fff; }
.cph-grid.cph-icon-zoom .cph-item::after { background-image: var(--cph-zoom); }
.cph-grid.cph-hover-gray .cph-item:hover img, .cph-grid.cph-hover-gray .cph-item:focus-visible img { filter: grayscale(1); }
.cph-grid.cph-hover-scale .cph-item:hover img, .cph-grid.cph-hover-scale .cph-item:focus-visible img { transform: scale(1.15); }
.cph-grid .cph-caption { position: absolute; inset: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: center; padding: 10px; text-align: center; font: 13px/1.3 -apple-system, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #fff; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s; }
.cph-grid.cph-caption-hover .cph-item::after { display: none; }
.cph-grid.cph-caption-hover .cph-item:hover .cph-caption, .cph-grid.cph-caption-hover .cph-item:focus-visible .cph-caption, .cph-grid.cph-caption-always .cph-caption { opacity: 1; }
.cph-grid.cph-caption-always .cph-caption { inset: auto 0 0; }

/* Carousel: one slide at a time. Like FooGallery's, the outgoing slide sinks back (3D) and fades while the next comes forward. */
.cph-carousel { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; max-width: calc(var(--cph-w) + 96px); overflow: hidden; }
.cph-track { display: grid; padding: 10px 0; perspective: 150px; transform-style: preserve-3d; touch-action: pan-y; }
.cph-slide { position: relative; grid-area: 1 / 1; margin: 0; text-align: center; opacity: 0; visibility: hidden; transform: translate3d(0, 0, -150px); transition: transform 325ms ease-in-out, opacity 325ms ease-in-out, visibility 325ms ease-in-out; backface-visibility: hidden; }
.cph-slide:not(.cph-seen) { transform: translate3d(0, 200%, -150px); transition-duration: 0s; }
.cph-slide.cph-active { z-index: 1; opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); transition-duration: 300ms; }
.cph-carousel .cph-item { aspect-ratio: var(--cph-w) / var(--cph-h); background: transparent; }
.cph-carousel .cph-item img { object-fit: contain; }
.cph-carousel .cph-item::after { background-color: rgba(255, 255, 255, .8); background-image: var(--cph-plus-dark); }
.cph-carousel .cph-slide:hover .cph-item::after { visibility: visible; opacity: 1; }
.cph-carousel .cph-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0; padding: 10px; line-height: 33.6px; background: rgba(255, 255, 255, .7); font-family: 'Patua One', serif; font-size: 16px; letter-spacing: .5px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cph-prev, .cph-next { width: 48px; height: 100%; min-height: 48px; padding: 0; border: 0; cursor: pointer; background: #444; opacity: .3; -webkit-mask: var(--cph-chevron) center / 48px no-repeat; mask: var(--cph-chevron) center / 48px no-repeat; transition: opacity .3s ease-in; }
.cph-next { transform: scaleX(-1); }
.cph-prev:hover, .cph-next:hover, .cph-prev:focus-visible, .cph-next:focus-visible { opacity: 1; }

/* Lightbox (FooBox "rounded light" look) */
.cph-lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.cph-lb:focus { outline: none; }
.cph-lb[open] { display: flex; align-items: center; justify-content: center; }
.cph-lb::backdrop { background: rgba(0, 0, 0, .7); }
.cph-lb-frame { position: relative; margin: 0; padding: 8px; background: #fff; border-radius: 6px; box-shadow: 0 0 12px rgba(0, 0, 0, .4); }
.cph-lb-stage { position: relative; overflow: hidden; border-radius: 3px; }
.cph-lb-stage img { display: block; max-width: min(calc(100vw - 96px), 1200px); max-height: calc(100vh - 106px); width: auto; height: auto; }
.cph-lb-caption { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 15px; background: rgba(0, 0, 0, .7); color: #fff; text-align: center; font: 18px/normal 'Patua One', serif; letter-spacing: .5px; border-radius: 0 0 3px 3px; visibility: hidden; opacity: 0; transform: translateY(100%); transition: visibility .3s ease, opacity .3s ease, transform .3s ease, color .25s ease-out; }
.cph-lb-ready .cph-lb-caption { visibility: visible; opacity: 1; transform: translateY(0); }
/* Next/prev: the JS sets the arrival offset inline and releases it to transition here; .cph-lb-ghost is the outgoing image. */
.cph-lb-stage img { transition: opacity .25s ease-out, transform .25s ease-out; }
.cph-lb-stage .cph-lb-ghost { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; pointer-events: none; transition: opacity .25s ease-out, transform .25s ease-out; }
.cph-lb-caption:empty { display: none; }
.cph-lb-count { position: absolute; left: 0; right: 0; bottom: -25px; text-align: center; color: #888; font: 10px/normal 'Segoe UI', Helvetica, Arial, sans-serif; }
.cph-lb button { position: absolute; z-index: 2; padding: 0; margin: 0; cursor: pointer; color: #666; background: #fff; box-sizing: content-box; transition: color .2s ease, box-shadow .2s ease; }
.cph-lb button svg { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; fill: currentColor; transform: translate(-50%, -50%); }
.cph-lb .cph-lb-prev, .cph-lb .cph-lb-next { top: 50%; width: 30px; height: 100px; margin-top: -53px; border: 3px solid transparent; }
.cph-lb-prev { left: -32px; border-radius: 6px 0 0 6px; box-shadow: -2px 0 2px rgba(0, 0, 0, .4); }
.cph-lb-next { right: -32px; border-radius: 0 6px 6px 0; box-shadow: 2px 0 2px rgba(0, 0, 0, .4); }
.cph-lb-close { top: -13px; right: -13px; width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 12px rgba(0, 0, 0, .4); }
@media (hover: hover) {
	.cph-lb button:hover { color: rgba(102, 102, 102, .7); }
	.cph-lb-close:hover { box-shadow: 0 0 6px rgba(0, 0, 0, .4); }
}
.cph-lb.cph-lb-single .cph-lb-prev, .cph-lb.cph-lb-single .cph-lb-next, .cph-lb.cph-lb-single .cph-lb-count { display: none; }
/* Phones: FooBox's top bar of prev / next / close, near full-width image, caption pinned to the bottom */
@media (max-width: 600px) {
	.cph-lb[open] { padding-top: 40px; box-sizing: border-box; }
	.cph-lb-frame { padding: 0; }
	.cph-lb-stage img { max-width: calc(100vw - 10px); max-height: calc(100vh - 50px); }
	.cph-lb button, .cph-lb .cph-lb-prev, .cph-lb .cph-lb-next { position: fixed; top: 0; width: auto; height: 40px; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
	.cph-lb-prev { left: 0; right: 66.67%; }
	.cph-lb-next { left: 33.33%; right: 33.33%; }
	.cph-lb-close { left: 66.67%; right: 0; }
	.cph-lb.cph-lb-single .cph-lb-close { left: 0; }
	.cph-lb-caption { position: fixed; min-height: 20px; padding: 10px 10px 40px; font-size: 13px; line-height: 20px; border-radius: 0; }
	.cph-lb-count { display: none; }
}
