* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  box-sizing: border-box;
  width: 100%;
  overflow-x: clip;
}

body.subpage-with-hero {
  font-family: "Bricolage Grotesque", sans-serif;
  color: #385035;
  background: #fff6dc;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 1400px;
  padding: 0 24px;
  margin: 0 auto;
}

.section.bg-light {
  background: #fff6dc;
  width: 100%;
}

.gallery-hero-banner {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: clamp(420px, 60vh, 680px);
  height: clamp(420px, 60vh, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow-x: clip;
  text-align: center;
}

.gallery-hero-banner .hero-bg-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  z-index: 1;
}

.gallery-hero-banner .hero-bg-img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 60%;
}

.gallery-hero-banner .hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 32, 22, 0.42) 0%,
    rgba(14, 32, 22, 0.68) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.gallery-hero-content {
  position: relative;
  z-index: 3;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
}

.gallery-hero-content h1 {
  font-family: "The Seasons", "Cinzel", serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.12;
  color: #ffffff;
  margin: 0 0 14px;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  animation: heroTextFadeUp 1.4s ease-out both;
}

.gallery-hero-content p {
  font-family: "Bricolage Grotesque", "Montserrat", sans-serif;
  font-size: clamp(0.95rem, 1.5vw, 1.12rem);
  font-weight: 400;
  color: rgba(255, 246, 220, 0.92);
  line-height: 1.65;
  max-width: 900px;
  margin: 0 auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  animation: heroTextFadeUp 1.4s ease-out 0.4s both;
}

@keyframes heroTextFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero-content h1,
  .gallery-hero-content p {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 1024px) {
  .gallery-hero-banner {
    min-height: clamp(380px, 55vh, 560px);
    height: clamp(380px, 55vh, 560px);
  }

  .gallery-hero-content {
    padding: 32px 20px;
  }
}

@media (max-width: 991px) {
  .gallery-hero-content p {
    white-space: normal;
    text-wrap: balance;
  }
}

@media (max-width: 768px) {
  .gallery-hero-banner {
    min-height: clamp(340px, 52vh, 440px);
    height: clamp(340px, 52vh, 440px);
    padding: 0;
  }

  .gallery-hero-content {
    padding: clamp(88px, 14vh, 112px) 16px 24px;
  }

  .gallery-hero-content h1 {
    font-size: clamp(2rem, 6.5vw, 2.6rem);
    margin-bottom: 10px;
  }

  .gallery-hero-content p {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 18px;
  }
}

@media (max-width: 480px) {
  .gallery-hero-banner {
    min-height: 340px;
    height: 340px;
  }

  .gallery-hero-content {
    padding: clamp(88px, 14vh, 104px) 14px 20px;
  }

  .gallery-hero-content h1 {
    font-size: 1.85rem;
  }

  .gallery-hero-content p {
    font-size: 0.86rem;
  }
}

.section.bg-light > .container {
  max-width: 100%;
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 220px;
  gap: 12px;
  grid-auto-flow: dense;
  width: calc(100% - 100px);
  max-width: 100%;
  margin: 0 auto;
}

.gallery-item {
  display: block;
  min-height: 180px;
  border-radius: 5px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--item-index, 0) * 0.08s);
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item.tall {
  grid-row: span 2;
}

.gallery-item:nth-child(3),
.gallery-item:nth-child(9) {
  grid-row: span 2;
}

.gallery-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: none;
  cursor: pointer;
  background: #385035;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 5px;
}

.gallery-card:hover img {
  filter: brightness(0.95);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: linear-gradient(
    180deg,
    rgba(14, 32, 22, 0) 55%,
    rgba(14, 32, 22, 0.58) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  color: #fff6dc;
  font-family: "The Seasons", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

@media (max-width: 1024px) {
  .gallery {
    width: 100%;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 210px;
    gap: 10px;
  }
}

@media (max-width: 768px), (hover: none) {
  .gallery-overlay {
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(
      180deg,
      rgba(14, 32, 22, 0) 50%,
      rgba(14, 32, 22, 0.55) 100%
    );
    padding: 12px 10px 8px;
    pointer-events: none;
  }

  .gallery-overlay span {
    font-size: clamp(0.78rem, 2.8vw, 0.95rem);
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    display: inline-block;
    transform: translateY(4px);
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .gallery-item.is-visible .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
  }

  .gallery-item.is-visible .gallery-overlay span {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: 8px;
  }
}

@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#gallery-grid {
  padding-top: 56px !important;
  padding-bottom: 60px !important;
}
#gallery-grid .section-title {
  display: none !important;
}

@media (max-width: 768px) {
  #gallery-grid {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
}

/* =========================================================
   GALLERY FULLSCREEN LIGHTBOX
   ========================================================= */

body.lightbox-open,
html.lightbox-open {
  overflow: hidden !important;
}

.gallery-lightbox {
  touch-action: pan-y;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(8, 14, 10, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 246, 220, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff6dc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.06);
  outline: none;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 246, 220, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff6dc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  user-select: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-lightbox-prev {
  left: 28px;
}

.gallery-lightbox-next {
  right: 28px;
}

.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  border-color: rgba(255, 246, 220, 0.55);
  transform: translateY(-50%) scale(1.08);
  outline: none;
}

.gallery-lightbox-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.gallery-lightbox-img {
  user-select: none;
  -webkit-user-drag: none;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox.is-open .gallery-lightbox-img {
  transform: scale(1);
}

@media (max-width: 768px) {
  .gallery-lightbox {
    padding: 16px;
  }

  .gallery-lightbox-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-prev {
    left: 12px;
  }

  .gallery-lightbox-next {
    right: 12px;
  }

  .gallery-lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
  }
}
