/**
 * Photography albums.
 *
 * Four ways to present a set of photographs: an even grid, a masonry column
 * flow that keeps original proportions, a swipeable carousel, and a mosaic
 * that leads with one large plate. All four share the same lightbox.
 */

.sv-album-head {
  max-width: 820px;
  margin: 0 0 30px;
}

.sv-album-head.is-centred {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.sv-album-head h2 {
  margin: 0;
  color: var(--sv-light, #F6F2E9);
  font-family: zuume, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 32px;
  line-height: 1em;
}

@media (min-width: 768px) {
  .sv-album-head h2 {
    font-size: 48px;
  }
}

.sv-band.is-light .sv-album-head h2 {
  color: var(--sv-ink, #0E0D0B);
}

.sv-album-count {
  display: inline-block;
  margin-left: 10px;
  color: var(--sv-accent, #D9A441);
  font-family: paralucent, sans-serif;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.14em;
  vertical-align: middle;
}

/* ---------- Plates ---------- */

.sv-plate {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background-color: var(--sv-muted, #2A251B);
  border: solid 1px var(--sv-line, #3A3327);
  cursor: zoom-in;
}

.sv-plate img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.sv-plate.is-natural img {
  height: auto;
}

@media (min-width: 992px) {
  .sv-plate:hover img {
    transform: scale(1.04);
  }
}

.sv-plate-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  color: var(--sv-light, #F6F2E9);
  font-family: paralucent, sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.4;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 100%);
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/**
 * Captions used to appear on hover only.
 *
 * They now carry the story of each frame rather than just repeating the alt
 * text, and a caption nobody sees is a caption nobody writes — so they stay on
 * the plate. The scrim is transparent for the top two-thirds of its box, which
 * keeps it off the subject in all but the bottom strip of the photograph.
 */
.sv-plate:hover .sv-plate-caption,
.sv-plate:focus-visible .sv-plate-caption {
  opacity: 1;
}

/* ---------- Grid ---------- */

.sv-album-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .sv-album-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .sv-album-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sv-album-grid .sv-plate {
  aspect-ratio: 1 / 1;
}

.sv-album-grid.ratio-43 .sv-plate {
  aspect-ratio: 4 / 3;
}

.sv-album-grid.ratio-32 .sv-plate {
  aspect-ratio: 3 / 2;
}

.sv-album-grid.ratio-portrait .sv-plate {
  aspect-ratio: 3 / 4;
}

/* ---------- Masonry ---------- */

.sv-album-masonry {
  -webkit-column-count: 2;
     -moz-column-count: 2;
          column-count: 2;
  -webkit-column-gap: 16px;
     -moz-column-gap: 16px;
          column-gap: 16px;
}

@media (min-width: 768px) {
  .sv-album-masonry.cols-3 {
    -webkit-column-count: 3;
       -moz-column-count: 3;
            column-count: 3;
  }

  .sv-album-masonry.cols-4 {
    -webkit-column-count: 4;
       -moz-column-count: 4;
            column-count: 4;
  }
}

.sv-album-masonry .sv-plate {
  margin-bottom: 16px;
  -webkit-column-break-inside: avoid;
     -moz-column-break-inside: avoid;
          break-inside: avoid;
}

/* ---------- Mosaic ---------- */

.sv-album-mosaic {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .sv-album-mosaic {
    grid-template-columns: repeat(4, 1fr);
  }

  .sv-album-mosaic .sv-plate:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.sv-album-mosaic .sv-plate {
  aspect-ratio: 1 / 1;
}

/* ---------- Carousel ---------- */

.sv-album-carousel {
  position: relative;
}

.sv-album-carousel .swiper {
  overflow: hidden;
  border-radius: 14px;
}

.sv-album-carousel .swiper-slide {
  height: auto;
}

.sv-album-carousel .sv-plate {
  height: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
}

.sv-album-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.sv-album-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: solid 2px var(--sv-accent, #D9A441);
  background: transparent;
  color: var(--sv-accent, #D9A441);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
}

.sv-album-nav button:hover {
  background-color: var(--sv-accent, #D9A441);
  color: var(--sv-ink, #0E0D0B);
}

.sv-album-nav button[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* ---------- Lightbox ---------- */

.sv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(8, 7, 5, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease-in-out, visibility 0.25s;
}

.sv-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.sv-lightbox-figure {
  margin: 0;
  max-width: min(1400px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.sv-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  -o-object-fit: contain;
     object-fit: contain;
  border-radius: 8px;
}

.sv-lightbox figcaption {
  color: var(--sv-light-2, #C9C2B4);
  font-family: paralucent, sans-serif;
  font-weight: 300;
  font-size: 14px;
  text-align: center;
}

.sv-lightbox-count {
  color: var(--sv-accent, #D9A441);
  font-family: paralucent, sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.sv-lightbox button {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--sv-light, #F6F2E9);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  padding: 12px 18px;
  transition: color 0.2s ease-in-out;
}

.sv-lightbox button:hover {
  color: var(--sv-accent, #D9A441);
}

.sv-lightbox .sv-lb-close {
  top: 10px;
  right: 14px;
  font-size: 40px;
}

.sv-lightbox .sv-lb-prev {
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.sv-lightbox .sv-lb-next {
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 767px) {
  .sv-lightbox .sv-lb-prev,
  .sv-lightbox .sv-lb-next {
    top: auto;
    bottom: 8px;
    transform: none;
  }
}

/* ---------- Meta-field gallery ---------- */

/* The carousel arrangement scrolls natively; .doac-rail is the scroller so the
   arrows can sit outside it. */
.doac-work-gallery .sv-album-carousel .doac-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--sv-line, #3A3327) transparent;
}

.doac-work-gallery .sv-album-carousel .doac-rail::-webkit-scrollbar {
  height: 6px;
}

.doac-work-gallery .sv-album-carousel .doac-rail::-webkit-scrollbar-thumb {
  background-color: var(--sv-line, #3A3327);
  border-radius: 10px;
}

.doac-work-gallery .sv-album-carousel .doac-rail .sv-plate {
  flex: 0 0 82%;
  max-width: 82%;
  aspect-ratio: 3 / 2;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .doac-work-gallery .sv-album-carousel .doac-rail .sv-plate {
    flex-basis: 46%;
    max-width: 46%;
  }
}

@media (min-width: 1200px) {
  .doac-work-gallery .sv-album-carousel .doac-rail .sv-plate {
    flex-basis: 32%;
    max-width: 32%;
  }
}

.doac-carousel-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.doac-carousel-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: solid 2px var(--sv-accent, #D9A441);
  background: transparent;
  color: var(--sv-accent, #D9A441);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
}

.doac-carousel-nav button:hover:not([disabled]) {
  background-color: var(--sv-accent, #D9A441);
  color: var(--sv-ink, #0E0D0B);
}

.doac-carousel-nav button[disabled] {
  opacity: 0.3;
  cursor: default;
}

/* Plates are <button> elements here, so reset the UA styling. */
.doac-work-gallery .sv-plate {
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}
