/* La Ferme gallery — travel diary filter grid */

.st-gal {
  --st-gal-ink: #f6f3ee;
  --st-gal-muted: rgba(246, 243, 238, 0.68);
  --st-gal-accent: #9fd5cb;
  --st-gal-line: rgba(246, 243, 238, 0.16);
  --st-gal-bg: #0f1f1c;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--st-gal-ink);
  background: var(--st-gal-bg);
  font-family: "Libre Franklin", system-ui, sans-serif;
}

.st-gal__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(0, 100, 89, 0.28), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(0, 65, 57, 0.22), transparent 50%),
    linear-gradient(180deg, #122925 0%, #0f1f1c 45%, #0c1916 100%);
}

.st-gal__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.st-gal__inner {
  position: relative;
  z-index: 2;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 2.5rem) clamp(4rem, 8vw, 6.5rem);
}

.st-gal__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.st-gal__kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-gal-accent);
}

.st-gal__title {
  margin: 0;
  font-family: Prata, Georgia, serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.st-gal__active {
  margin: 0;
  font-size: 0.9rem;
  color: var(--st-gal-muted);
  text-align: right;
}

.st-gal__active strong {
  color: var(--st-gal-ink);
  font-weight: 600;
}

.st-gal__tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0 1.1rem;
  margin: 0 0 1.35rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--st-gal-line);
}

.st-gal__tabs::-webkit-scrollbar {
  display: none;
}

.st-gal__tab {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(246, 243, 238, 0.62);
  border-radius: 0;
  padding: 0.55rem 0.85rem 0.7rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.st-gal__tab:hover {
  color: #fff;
}

.st-gal__tab.is-active {
  color: #fff;
  border-bottom-color: var(--st-gal-accent);
}

.st-gal__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.65rem, 1.5vw, 1rem);
}

.st-gal__cell {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  grid-column: span 4;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: var(--st-gal-delay, 0ms);
}

.st-gal__cell.is-in {
  opacity: 1;
  transform: translateY(0);
}

.st-gal__cell--hero {
  grid-column: span 8;
  grid-row: span 2;
}

.st-gal__frame {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 0.85rem;
  background: #16312c;
  aspect-ratio: 4 / 3;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.65);
}

.st-gal__cell--hero .st-gal__frame {
  aspect-ratio: auto;
  height: 100%;
  min-height: 22rem;
}

.st-gal__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s ease;
}

.st-gal__cell:hover .st-gal__frame img {
  transform: scale(1.05);
}

.st-gal__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.28));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.st-gal__cell:hover .st-gal__frame::after {
  opacity: 1;
}

/* Lightbox */
.st-gal-lock {
  overflow: hidden;
}

.st-gal__lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 18, 16, 0.92);
  backdrop-filter: blur(10px);
}

.st-gal__lightbox[hidden] {
  display: none !important;
}

.st-gal__lightbox-stage {
  position: relative;
  width: min(1100px, 100%);
  max-height: min(86vh, 900px);
}

.st-gal__lightbox-stage img {
  display: block;
  width: 100%;
  max-height: min(78vh, 820px);
  object-fit: contain;
  border-radius: 0.75rem;
  background: #000;
}

.st-gal__lightbox-cap {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(246, 243, 238, 0.75);
}

.st-gal__lightbox-close,
.st-gal__lightbox-nav {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.st-gal__lightbox-close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.35rem;
  line-height: 1;
  z-index: 2;
}

.st-gal__lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.25rem;
}

.st-gal__lightbox-nav.prev {
  left: -0.35rem;
}

.st-gal__lightbox-nav.next {
  right: -0.35rem;
}

.st-gal__lightbox-close:hover,
.st-gal__lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .st-gal__cell,
  .st-gal__frame img {
    transition: none;
  }
}

@media screen and (max-width: 991px) {
  .st-gal__cell {
    grid-column: span 6;
  }

  .st-gal__cell--hero {
    grid-column: span 12;
    grid-row: span 1;
  }

  .st-gal__cell--hero .st-gal__frame {
    min-height: 16rem;
    aspect-ratio: 16 / 10;
    height: auto;
  }
}

@media screen and (max-width: 600px) {
  .st-gal__cell,
  .st-gal__cell--hero {
    grid-column: span 12;
  }

  .st-gal__lightbox-nav.prev {
    left: 0.25rem;
  }

  .st-gal__lightbox-nav.next {
    right: 0.25rem;
  }
}
