.grl-gallery {
  --grl-gal-olive: #7d8354;
  --grl-gal-olive-dark: #5d6138;
  --grl-gal-surface: #f7f7f4;
  --grl-gal-border: #e5e7eb;
  --grl-gal-text: #1f2937;
  --grl-gal-muted: #4b5563;
  padding: 4.5rem 0 5.5rem;
  background: #fff;
  overflow-x: clip;
}

.grl-gallery__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .grl-gallery__inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .grl-gallery__inner {
    padding: 0 2rem;
  }
}

.grl-gallery__header {
  margin: 0 0 2rem;
  text-align: center;
}

.grl-gallery__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grl-gal-olive);
}

.grl-gallery__accent {
  display: block;
  width: 5.25rem;
  height: 3px;
  margin: 0 auto 0.875rem;
  border-radius: 999px;
  background: var(--grl-gal-olive);
}

.grl-gallery__subtitle {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--grl-gal-muted);
}

.grl-gallery__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin: 0 0 2rem;
}

.grl-gallery__tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--grl-gal-muted);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.22s ease;
}

.grl-gallery__tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 1.75rem;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
  transition: background 0.22s ease;
}

.grl-gallery__tab:hover {
  color: var(--grl-gal-text);
}

.grl-gallery__tab--active,
.grl-gallery__tab[aria-selected="true"] {
  color: var(--grl-gal-olive);
  font-weight: 600;
}

.grl-gallery__tab--active::after,
.grl-gallery__tab[aria-selected="true"]::after {
  background: var(--grl-gal-olive);
}

.grl-gallery__tab:focus-visible {
  outline: 3px solid var(--grl-gal-olive);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 1023px) {
  .grl-gallery__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-inline: 1rem;
  }

  .grl-gallery__tabs::-webkit-scrollbar {
    display: none;
  }
}

.grl-gallery__empty {
  margin: 0;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--grl-gal-muted);
}

.grl-gallery__viewport {
  --grl-gal-cols: 2;
  --grl-gal-gap: 1rem;
  container-type: inline-size;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.grl-gallery__viewport[hidden] {
  display: none;
}

.grl-gallery__viewport:focus-visible {
  outline: 3px solid var(--grl-gal-olive);
  outline-offset: 3px;
}

@media (min-width: 768px) {
  .grl-gallery__viewport {
    --grl-gal-gap: 1.125rem;
  }
}

@media (min-width: 1024px) {
  .grl-gallery__viewport {
    --grl-gal-cols: 4;
    --grl-gal-gap: 1.25rem;
  }
}

.grl-gallery__track {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: calc((100cqw - (var(--grl-gal-cols) - 1) * var(--grl-gal-gap)) / var(--grl-gal-cols));
  gap: var(--grl-gal-gap);
  width: max-content;
  min-width: 100%;
}

.grl-gallery__item {
  margin: 0;
  min-width: 0;
}

.grl-gallery__item[hidden] {
  display: none;
}

.grl-gallery__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--grl-gal-surface);
}

.grl-gallery__fallback {
  display: none;
  position: absolute;
  inset: 0;
  border: 1px solid var(--grl-gal-border);
  border-radius: 12px;
  background: var(--grl-gal-surface);
}

.grl-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.grl-gallery__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.grl-gallery__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 63, 28, 0.28);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.grl-gallery__image:hover img,
.grl-gallery__image:focus-visible img {
  transform: scale(1.03);
}

.grl-gallery__image:hover .grl-gallery__overlay,
.grl-gallery__image:focus-visible .grl-gallery__overlay {
  opacity: 1;
}

.grl-gallery__image:focus-visible {
  outline: 3px solid var(--grl-gal-olive);
  outline-offset: 3px;
}

.grl-gallery__item.is-broken .grl-gallery__fallback {
  display: block;
}

.grl-gallery__item.is-broken .grl-gallery__image {
  cursor: default;
  pointer-events: none;
}

.grl-gallery__item.is-broken img,
.grl-gallery__item.is-broken .grl-gallery__overlay {
  display: none;
}

.grl-gallery__lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.grl-gallery__lightbox.is-open {
  display: flex;
}

.grl-gallery__lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 15, 0.88);
}

.grl-gallery__lightbox-figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.grl-gallery__lightbox-image {
  display: block;
  max-width: 90vw;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 12px;
}

.grl-gallery__lightbox-caption {
  margin-top: 0.75rem;
  min-height: 1.2em;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.grl-gallery__lightbox-close,
.grl-gallery__lightbox-prev,
.grl-gallery__lightbox-next {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.grl-gallery__lightbox-close {
  top: 1rem;
  right: 1rem;
}

.grl-gallery__lightbox-prev {
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.grl-gallery__lightbox-next {
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.grl-gallery__lightbox-close:hover,
.grl-gallery__lightbox-prev:hover,
.grl-gallery__lightbox-next:hover {
  color: var(--grl-gal-olive);
}

.grl-gallery__lightbox-close:focus-visible,
.grl-gallery__lightbox-prev:focus-visible,
.grl-gallery__lightbox-next:focus-visible {
  outline: 3px solid var(--grl-gal-olive);
  outline-offset: 3px;
}

.grl-gallery__lightbox-prev:disabled,
.grl-gallery__lightbox-next:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 767px) {
  .grl-gallery__lightbox-prev {
    left: 0.15rem;
  }

  .grl-gallery__lightbox-next {
    right: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grl-gallery__tab,
  .grl-gallery__tab::after,
  .grl-gallery__image img,
  .grl-gallery__overlay {
    transition: none !important;
  }

  .grl-gallery__image:hover img,
  .grl-gallery__image:focus-visible img {
    transform: none !important;
  }

  .grl-gallery__image:hover .grl-gallery__overlay,
  .grl-gallery__image:focus-visible .grl-gallery__overlay {
    opacity: 0;
  }
}
