/* Additions to the original WordPress theme styles (theme.css) for the static htmx site. */

/* loading bar shown while htmx fetches the next page */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100001;
  width: 100%;
  height: 3px;
  background: #FFED00;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
}

#progress.htmx-request {
  opacity: 1;
  animation: progress 2s ease-out forwards;
}

@keyframes progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(0.85); }
}

/* Swiper 14 arrows -> the Swiper 8 icon-font arrows the theme styles (swiper8-icons.css) */
.swiper-button-next .swiper-navigation-icon,
.swiper-button-prev .swiper-navigation-icon {
  display: none;
}

/* galleries: two columns laid out at build time (templates.mjs) instead of the Masonry script.
   Widths match the theme: 50% / 49% columns whose 15px / 45px right border was the gap. */
.s-gallery .grid {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  width: calc(100% - 15px);
}

.s-gallery .grid::after {
  content: none;
}

.s-gallery .grid-col {
  flex: 1 1 0;
  min-width: 0;
}

.s-gallery .grid-item {
  float: none;
  width: 100%;
  border-right: 0;
}

.s-gallery .grid-item img {
  height: auto;
}

@media (min-width: 768px) {
  .s-gallery .grid {
    gap: 45px;
    width: calc(98% - 45px);
  }

  .s-gallery .grid-item {
    width: 100%;
    border-right: 0;
  }
}

/* image lightbox (replaces the featherlight plugin) */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #3C3C3B;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox figure {
  margin: 0;
  text-align: center;
}

.lightbox img {
  display: block;
  max-width: 88vw;
  max-height: 84vh;
  margin: 0 auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.lightbox figcaption {
  margin-top: 15px;
  font-weight: 700;
  text-transform: uppercase;
}

.lightbox button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  background: #3C3C3B;
  color: #fff;
  font: 700 28px/1 Montserrat, sans-serif;
  cursor: pointer;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  background: #FFED00;
  color: #3C3C3B;
}

.lightbox__close {
  top: 20px;
  right: 20px;
}

.lightbox__prev {
  left: 20px;
  top: calc(50% - 24px);
}

.lightbox__next {
  right: 20px;
  top: calc(50% - 24px);
}

.lightbox--single .lightbox__prev,
.lightbox--single .lightbox__next {
  display: none;
}
