.roots-gallery {
  --rg-teal: #2bb5af;
  --rg-teal-deep: #0f4c5c;
  --rg-accent: #e1618c;
  --rg-ink: #102226;
  --rg-font-display: "Syne", "Segoe UI", sans-serif;
  --rg-font-body: "Figtree", "Segoe UI", sans-serif;
  position: relative;
  color: inherit;
  font-family: var(--rg-font-body);
}

.roots-gallery *,
.roots-gallery *::before,
.roots-gallery *::after {
  box-sizing: border-box;
}

.roots-gallery__toolbar,
.roots-gallery__slideshow-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.roots-gallery__btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.roots-gallery__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.roots-gallery__btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.roots-gallery__btn--accent {
  background: var(--rg-accent);
}

.roots-gallery__btn--accent:not(:disabled):hover {
  background: #d44f7c;
}

.roots-gallery__btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.roots-gallery__body {
  padding: clamp(1rem, 3vw, 1.75rem);
}

.roots-gallery__toolbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.roots-gallery__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.roots-gallery__tab {
  appearance: none;
  border: 1px solid rgba(16, 34, 38, 0.18);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.roots-gallery__tab:hover {
  background: rgba(16, 34, 38, 0.06);
}

.roots-gallery__tab.is-active {
  background: var(--rg-teal);
  border-color: var(--rg-teal);
  color: #fff;
}

.roots-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.roots-gallery__grid.is-mobile-carousel {
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
}

.roots-gallery__grid.is-mobile-carousel .roots-gallery__item {
  aspect-ratio: 4 / 3;
  width: 100%;
}

.roots-gallery__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.roots-gallery__dots[hidden] {
  display: none !important;
}

.roots-gallery__dot {
  appearance: none;
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 34, 38, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.roots-gallery__dot:hover {
  background: rgba(16, 34, 38, 0.45);
}

.roots-gallery__dot.is-active {
  background: var(--rg-accent);
  transform: scale(1.2);
}

.roots-gallery__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.2);
  animation: roots-gallery-fade-up 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.roots-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.roots-gallery__item:hover {
  transform: scale(1.015);
}

.roots-gallery__empty {
  margin: 0;
  padding: 2rem 1rem;
  border: 1px dashed rgba(16, 34, 38, 0.25);
  border-radius: 1rem;
  text-align: center;
  color: inherit;
  opacity: 0.75;
  background: transparent;
  grid-column: 1 / -1;
}

.roots-gallery__status[hidden] {
  display: none !important;
}

.roots-gallery__status.is-error {
  border-color: rgba(225, 97, 140, 0.7);
}

.roots-gallery__credit {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  opacity: 0.72;
  text-align: center;
}

.roots-gallery__lightbox,
.roots-gallery__slideshow {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  z-index: 2147483000 !important;
  transform: none !important;
  filter: none !important;
  perspective: none !important;
}

.roots-gallery__lightbox {
  display: grid;
  place-items: center;
  animation: roots-gallery-fade-in 180ms ease both;
}

.roots-gallery__lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 18, 22, 0.88);
  cursor: zoom-out;
}

.roots-gallery__lightbox-frame {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  animation: roots-gallery-zoom-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.roots-gallery__lightbox-image {
  display: block;
  max-width: 96vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.roots-gallery__lightbox-frame .roots-gallery__lightbox-credit {
  margin-top: 0.65rem;
  text-align: center;
}

.roots-gallery__lightbox-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.roots-gallery__lightbox-meta {
  margin: 0;
}

.roots-gallery__lightbox-credit,
.roots-gallery__slideshow-credit {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
}

.roots-gallery__lightbox-close,
.roots-gallery__lightbox-nav {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.roots-gallery__lightbox-close {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.8rem;
  line-height: 1;
}

.roots-gallery__lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  line-height: 1;
}

.roots-gallery__lightbox-nav--prev {
  left: 1rem;
}

.roots-gallery__lightbox-nav--next {
  right: 1rem;
}

.roots-gallery__slideshow {
  background: #061216;
  animation: roots-gallery-fade-in 220ms ease both;
}

.roots-gallery__slideshow-stage {
  position: absolute;
  inset: 0;
}

.roots-gallery__slideshow-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  animation: roots-gallery-kenburns 4s ease-out both;
}

.roots-gallery__slideshow-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6, 18, 22, 0.85) 0%, transparent 40%),
    linear-gradient(to bottom, rgba(6, 18, 22, 0.55) 0%, transparent 30%);
  pointer-events: none;
}

.roots-gallery__slideshow-ui {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.roots-gallery__slideshow-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.roots-gallery__slideshow-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.roots-gallery__slideshow-title {
  margin: 0.35rem 0 0;
  font-family: var(--rg-font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -0.03em;
}

.roots-gallery__slideshow-footer {
  display: grid;
  gap: 0.9rem;
}

.roots-gallery__slideshow-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.roots-gallery__slideshow-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rg-accent);
}

.roots-gallery__slideshow-progress-bar.is-playing {
  animation: roots-gallery-progress 4s linear forwards;
}

.roots-gallery__slideshow-count {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.roots-gallery__slideshow-credit {
  margin-top: 0.15rem;
}

body.roots-gallery-lock {
  overflow: hidden;
}

@keyframes roots-gallery-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes roots-gallery-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes roots-gallery-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes roots-gallery-kenburns {
  from {
    transform: scale(1.04);
  }
  to {
    transform: scale(1);
  }
}

@keyframes roots-gallery-progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .roots-gallery__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .roots-gallery__tabs {
    width: 100%;
  }

  .roots-gallery__grid,
  .roots-gallery__grid.is-mobile-carousel {
    grid-template-columns: minmax(0, 1fr);
  }

  .roots-gallery__dots {
    gap: 0.4rem;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0.15rem 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .roots-gallery__dot {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
  }

  .roots-gallery__lightbox-nav {
    top: auto;
    bottom: 1.25rem;
    transform: none;
  }

  .roots-gallery__lightbox-nav--prev {
    left: calc(50% - 3.5rem);
  }

  .roots-gallery__lightbox-nav--next {
    right: calc(50% - 3.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roots-gallery *,
  .roots-gallery *::before,
  .roots-gallery *::after {
    animation: none !important;
    transition: none !important;
  }
}
