/* Sterling Custom Fields – front-end display */

/* Gallery: grid */
.scf-gallery { position: relative; }
.scf-gallery__track { list-style: none; margin: 0; padding: 0; }
.scf-gallery--grid .scf-gallery__track { display: grid; gap: var(--scf-gap, 10px); grid-template-columns: repeat(var(--scf-cols-m, 2), minmax(0, 1fr)); }
@media (min-width: 576px) { .scf-gallery--grid .scf-gallery__track { grid-template-columns: repeat(var(--scf-cols-t, 3), minmax(0, 1fr)); } }
@media (min-width: 992px) { .scf-gallery--grid .scf-gallery__track { grid-template-columns: repeat(var(--scf-cols-d, 4), minmax(0, 1fr)); } }
.scf-gallery figure { margin: 0; }
.scf-gallery img { display: block; width: 100%; height: auto; }
.scf-gallery--grid img { aspect-ratio: 1 / 1; object-fit: cover; }
.scf-gallery figcaption { font-size: .875rem; padding-top: .25rem; }

/* Gallery: slideshow */
.scf-gallery--slideshow .scf-gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: var(--scf-gap, 0); scrollbar-width: none; }
.scf-gallery--slideshow .scf-gallery__track::-webkit-scrollbar { display: none; }
.scf-gallery--slideshow .scf-gallery__item { flex: 0 0 100%; scroll-snap-align: start; }
.scf-gallery--slideshow img { max-height: 70vh; object-fit: contain; }
.scf-gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; border: 0; border-radius: 50%; width: 2.5rem; height: 2.5rem; background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.scf-gallery__nav--prev { left: .5rem; }
.scf-gallery__nav--next { right: .5rem; }
.scf-gallery__nav:focus-visible { outline: 3px solid #fff; }

/* Lightbox */
.scf-lightbox { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; background: transparent; overflow: visible; }
.scf-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.scf-lightbox__figure { margin: 0; text-align: center; }
.scf-lightbox__img { max-width: 92vw; max-height: 85vh; display: block; margin: 0 auto; }
.scf-lightbox__caption { color: #fff; padding: .5rem; }
.scf-lightbox__close, .scf-lightbox__nav { position: fixed; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 2rem; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; }
.scf-lightbox__close { top: 1rem; right: 1rem; }
.scf-lightbox__nav--prev { left: 1rem; top: 50%; }
.scf-lightbox__nav--next { right: 1rem; top: 50%; }

/* Map */
.scf-map__canvas { width: 100%; height: var(--height, 350px); z-index: 0; }
.scf-map__list { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .875rem; }
.scf-map__desc { display: block; color: #555; }
.scf-map .leaflet-container ~ .scf-map__list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.scf-map { position: relative; width: 100%; max-width: var(--width, 100%); }
.scf-map-pin { background: #d63333; border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

/* Video */
/* Same sizing as ACF: a fixed width that never exceeds the container, so the player also
   keeps its size inside flex layouts (for example the site's video list layout). */
.scf-video { width: var(--video-width, 100%); max-width: 100%; }
.scf-video__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.scf-video__frame--4x3 { aspect-ratio: 4 / 3; }
.scf-video__frame--1x1 { aspect-ratio: 1 / 1; }
.scf-video__frame--9x16 { aspect-ratio: 9 / 16; }
.scf-video__frame--21x9 { aspect-ratio: 21 / 9; }
.scf-video__frame iframe, .scf-video__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
