.galeria-bg main > .section {
  margin-top: 0;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 24px auto 8px;
}

.gallery-filter {
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid #001e61;
  border-radius: 24px;
  background: #fff;
  color: #001e61;
  font: inherit;
  cursor: pointer;
}

.gallery-filter:hover,
.gallery-filter:focus {
  background: #eaf8fb;
}

.gallery-filter[aria-pressed="true"] {
  background: #001e61;
  color: #fff;
}

.gallery-filter:focus-visible,
.b-gallery-carousel-arrow:focus-visible,
.b-gallery-carousel-container:focus-visible {
  outline: 3px solid #d7282f;
  outline-offset: 4px;
}

.b-gallery-carousel-wrapper {
  min-height: 0;
  padding: 32px 0;
  touch-action: pan-y pinch-zoom;
}

.b-gallery-carousel-slide.hidden {
  display: none;
}

.b-gallery-carousel-slide {
  /* Position changes are immediate; only the outgoing photo fades. */
  transition: none;
}

.b-gallery-carousel-slide.active {
  transform: none;
}

.b-gallery-carousel-slide img,
.gallery-transition-frame {
  width: min(60vw, 600px);
  height: auto;
}

.gallery-transition-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  border-radius: var(--content-radius);
}

.b-gallery-carousel-arrow {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.b-gallery-carousel-arrow:focus {
  background: transparent;
}

.b-gallery-carousel-arrow img {
  display: block;
  width: clamp(48px, 10vw, 120px);
  height: auto;
}

.gallery-status {
  margin: 0 16px 32px;
  color: #001e61;
  text-align: center;
}

@media only screen and (max-width: 600px) {
  .gallery-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 360px;
    gap: 8px;
  }

  .gallery-filter {
    padding: 8px 16px;
  }

  .b-gallery-carousel-slide img,
  .gallery-transition-frame {
    width: 76vw;
  }

  .b-gallery-carousel-wrapper {
    padding: 24px 0 72px;
  }

  .b-gallery-carousel-slide.prev,
  .b-gallery-carousel-slide.next {
    visibility: hidden;
  }

  .b-gallery-carousel-prev {
    left: calc(50% - 64px);
  }

  .b-gallery-carousel-next {
    right: calc(50% - 64px);
  }

  .b-gallery-carousel-arrow {
    top: auto;
    bottom: 12px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b-gallery-carousel-slide {
    transition: none;
  }
}
