/* =====================================================
   GALLERY HERO
===================================================== */

.gallery-hero {
  padding: 210px 0 110px;

  background: var(--bg);
}

.gallery-hero-content {
  max-width: 1000px;
}

.gallery-hero h1 {
  max-width: 850px;

  font-family: var(--heading-font);

  font-size: clamp(85px, 13vw, 165px);

  font-weight: 400;

  line-height: 0.78;

  letter-spacing: -5px;
}

.gallery-hero h1 em {
  display: block;

  font-style: italic;
}

.gallery-hero-content > p:last-child {
  max-width: 500px;

  margin-top: 45px;

  margin-left: 25%;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.9;
}
/* =====================================================
   GALLERY HERO CAROUSEL
===================================================== */

.gallery-hero-carousel {
  position: relative;

  width: 100%;

  margin-top: 85px;

  overflow: hidden;
}

/* =====================================================
   CAROUSEL TRACK
===================================================== */

.gallery-hero-track {
  position: relative;

  width: 100%;

  height: min(62vh, 680px);

  overflow: hidden;
}

/* =====================================================
   SLIDE
===================================================== */

.gallery-hero-slide {
  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

  opacity: 0;

  visibility: hidden;

  transform: scale(1.025);

  transition:
    opacity 0.9s ease,
    visibility 0.9s ease,
    transform 1.2s ease;
}

.gallery-hero-slide.active {
  opacity: 1;

  visibility: visible;

  transform: scale(1);
}

/* =====================================================
   IMAGE
===================================================== */

.gallery-hero-slide img {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;

  object-position: center;

  user-select: none;
}

/* =====================================================
   SUBTLE IMAGE OVERLAY
===================================================== */

.gallery-hero-slide::after {
  position: absolute;

  inset: 0;

  content: '';

  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.02),
    rgba(0, 0, 0, 0.16)
  );

  pointer-events: none;
}

/* =====================================================
   PREVIOUS / NEXT
===================================================== */

.gallery-hero-prev,
.gallery-hero-next {
  position: absolute;

  top: 50%;

  z-index: 5;

  display: flex;

  align-items: center;

  justify-content: center;

  width: 48px;

  height: 48px;

  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.65);

  border-radius: 50%;

  background: rgba(20, 20, 19, 0.08);

  color: white;

  cursor: pointer;

  transform: translateY(-50%);

  backdrop-filter: blur(5px);

  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.gallery-hero-prev {
  left: 25px;
}

.gallery-hero-next {
  right: 25px;
}

.gallery-hero-prev:hover,
.gallery-hero-next:hover {
  background: rgba(20, 20, 19, 0.3);

  transform: translateY(-50%) scale(1.05);
}

/* =====================================================
   COUNTER
===================================================== */

.gallery-hero-counter {
  position: absolute;

  right: 25px;

  bottom: 25px;

  z-index: 5;

  display: flex;

  align-items: center;

  gap: 8px;

  color: white;

  font-size: 9px;

  letter-spacing: 2px;

  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.gallery-hero-divider {
  opacity: 0.55;
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {
  .gallery-hero-carousel {
    margin-top: 65px;
  }

  .gallery-hero-track {
    height: 58vh;
  }

  .gallery-hero-prev {
    left: 18px;
  }

  .gallery-hero-next {
    right: 18px;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {
  .gallery-hero-carousel {
    margin-top: 50px;
  }

  .gallery-hero-track {
    height: 68vh;
  }

  .gallery-hero-slide img {
    object-position: center;
  }

  .gallery-hero-prev,
  .gallery-hero-next {
    width: 42px;

    height: 42px;
  }

  .gallery-hero-prev {
    left: 12px;
  }

  .gallery-hero-next {
    right: 12px;
  }

  .gallery-hero-counter {
    right: 15px;

    bottom: 15px;
  }
}

/* =====================================================
   INTRO
===================================================== */

.gallery-intro {
  padding: 90px 0;

  background: var(--beige);
}

.gallery-intro-inner {
  display: flex;

  flex-direction: column;

  align-items: center;

  text-align: center;
}

.gallery-intro-inner p {
  max-width: 720px;

  margin: 30px 0;

  font-family: var(--heading-font);

  font-size: clamp(30px, 4vw, 52px);

  line-height: 1.05;
}

.gallery-line {
  width: 1px;

  height: 55px;

  background: #bbb2a9;
}

/* =====================================================
   GALLERY SECTION
===================================================== */

.gallery-section {
  padding: 120px 0 150px;

  background: var(--bg);
}

/* =====================================================
   TOOLBAR
===================================================== */

.gallery-toolbar {
  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 55px;
}

.gallery-filter {
  display: flex;

  align-items: center;

  gap: 35px;
}

.gallery-filter-btn {
  position: relative;

  padding: 0;

  border: 0;

  background: transparent;

  color: var(--muted);

  font-family: var(--body-font);

  font-size: 9px;

  text-transform: uppercase;

  letter-spacing: 1.5px;

  cursor: pointer;
}

.gallery-filter-btn::after {
  position: absolute;

  right: 0;

  bottom: -8px;

  left: 0;

  height: 1px;

  background: var(--text);

  content: '';

  transform: scaleX(0);

  transform-origin: left;

  transition: transform 0.3s ease;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
  color: var(--text);
}

.gallery-filter-btn.active::after {
  transform: scaleX(1);
}

.gallery-count {
  color: var(--muted);

  font-size: 8px;

  letter-spacing: 1.5px;
}

/* =====================================================
   MASONRY GRID
===================================================== */

.gallery-grid {
  column-count: 2;

  column-gap: 22px;
}

.gallery-item {
  position: relative;

  display: block;

  width: 100%;

  margin-bottom: 22px;

  break-inside: avoid;
}
.gallery-image-btn {
  position: relative;

  display: block;

  width: 100%;

  height: auto;

  padding: 0;

  margin: 0;

  border: 0;

  background: transparent;

  overflow: hidden;

  cursor: pointer;
}

.gallery-image-btn img {
  position: relative;

  z-index: 1;

  display: block;

  width: 100% !important;

  height: auto !important;

  max-width: 100%;

  object-fit: contain;

  object-position: center;

  margin: 0;
}

.gallery-overlay {
  position: absolute;

  inset: 0;

  z-index: 2;

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  padding: 25px;

  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%);

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.45s ease;
}

.gallery-image-btn:hover .gallery-overlay {
  opacity: 1;
}
.gallery-image-btn img {
  display: block;

  width: 100%;

  height: 100%;

  aspect-ratio: 4 / 3;

  object-fit: cover;

  object-position: center;

  margin: 0;

  transition: transform 0.7s ease;
}

.gallery-image-btn:hover img {
  transform: scale(1.035);
}

/* =====================================================
   GALLERY OVERLAY
===================================================== */

.gallery-overlay {
  position: absolute;

  inset: 0;

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  padding: 25px;

  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%);

  opacity: 0;

  transition: opacity 0.45s ease;
}

.gallery-image-btn:hover .gallery-overlay {
  opacity: 1;
}

.gallery-meta {
  display: flex;

  flex-direction: column;

  gap: 6px;

  color: white;
}

.gallery-meta small {
  font-size: 8px;

  text-transform: uppercase;

  letter-spacing: 1.5px;
}

.gallery-meta strong {
  font-family: var(--heading-font);

  font-size: 34px;

  font-weight: 400;
}

.gallery-open {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 38px;

  height: 38px;

  border: 1px solid rgba(255, 255, 255, 0.6);

  border-radius: 50%;

  color: white;

  font-size: 10px;
}

/* =====================================================
   FILTER ANIMATION
===================================================== */

.gallery-item.is-hidden {
  display: none;
}

.gallery-item.is-visible {
  animation: galleryFadeIn 0.5s ease both;
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;

    transform: translateY(15px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* =====================================================
   GALLERY STATEMENT
===================================================== */

.gallery-statement {
  padding: 150px 0;

  background: var(--dark);

  color: white;

  text-align: center;
}

.gallery-statement-inner {
  display: flex;

  flex-direction: column;

  align-items: center;
}

.gallery-statement h2 {
  margin-top: 10px;

  font-family: var(--heading-font);

  font-size: clamp(75px, 10vw, 135px);

  font-weight: 400;

  line-height: 0.8;

  letter-spacing: -4px;
}

.gallery-statement h2 em {
  display: block;

  font-style: italic;
}

.gallery-statement-text {
  max-width: 420px;

  margin-top: 40px;

  color: rgba(255, 255, 255, 0.58);

  font-size: 12px;

  line-height: 1.8;
}

/* =====================================================
   FINAL CTA
===================================================== */

.gallery-final-cta {
  padding: 150px 0;

  background: #f0ebe5;

  text-align: center;
}

.gallery-final-content {
  display: flex;

  flex-direction: column;

  align-items: center;
}

.gallery-final-content h2 {
  max-width: 1000px;

  font-family: var(--heading-font);

  font-size: clamp(75px, 10vw, 140px);

  font-weight: 400;

  line-height: 0.8;

  letter-spacing: -4px;
}

.gallery-final-content h2 em {
  display: block;

  font-style: italic;
}

.gallery-final-content .btn-primary {
  margin-top: 50px;
}

/* =====================================================
   LIGHTBOX
===================================================== */

.gallery-lightbox {
  position: fixed;

  inset: 0;

  z-index: 9999;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 50px;

  background: rgba(15, 15, 14, 0.96);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.gallery-lightbox.active {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;
}

.lightbox-content {
  position: relative;

  max-width: 1100px;

  max-height: 90vh;
}

.lightbox-content img {
  display: block;

  max-width: 100%;

  max-height: 78vh;

  object-fit: contain;
}

.lightbox-caption {
  display: flex;

  justify-content: space-between;

  margin-top: 18px;

  color: rgba(255, 255, 255, 0.7);

  font-size: 8px;

  text-transform: uppercase;

  letter-spacing: 1.5px;
}

/* =====================================================
   LIGHTBOX BUTTONS
===================================================== */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;

  z-index: 2;

  display: flex;

  align-items: center;

  justify-content: center;

  width: 45px;

  height: 45px;

  border: 1px solid rgba(255, 255, 255, 0.35);

  border-radius: 50%;

  background: transparent;

  color: white;

  cursor: pointer;

  transition: background 0.3s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  top: 30px;

  right: 35px;
}

.lightbox-prev {
  left: 35px;

  top: 50%;

  transform: translateY(-50%);
}

.lightbox-next {
  right: 35px;

  top: 50%;

  transform: translateY(-50%);
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 900px) {
  .gallery-hero {
    padding: 165px 0 85px;
  }

  .gallery-hero h1 {
    font-size: clamp(70px, 15vw, 110px);

    letter-spacing: -3px;
  }

  .gallery-hero-content > p:last-child {
    margin-left: 0;
  }

  .gallery-intro {
    padding: 75px 0;
  }

  .gallery-section {
    padding: 90px 0 110px;
  }

  .gallery-grid {
    column-gap: 15px;
  }

  .gallery-item {
    margin-bottom: 15px;
  }

  .gallery-overlay {
    padding: 18px;
  }

  .gallery-statement {
    padding: 100px 0;
  }

  .gallery-final-cta {
    padding: 100px 0;
  }

  .lightbox-prev {
    left: 15px;
  }

  .lightbox-next {
    right: 15px;
  }
}

@media (max-width: 600px) {
  .gallery-hero {
    padding: 145px 0 70px;
  }

  .gallery-hero h1 {
    font-size: 68px;
  }

  .gallery-intro-inner p {
    font-size: 30px;
  }

  .gallery-section {
    padding: 75px 0 90px;
  }

  .gallery-toolbar {
    align-items: flex-start;

    flex-direction: column;

    gap: 25px;
  }

  .gallery-filter {
    flex-wrap: wrap;

    gap: 20px;
  }

  .gallery-grid {
    column-count: 1 !important ;
  }

  .gallery-item {
    margin-bottom: 15px;
  }

  .gallery-overlay {
    opacity: 1;

    padding: 15px;
  }

  .gallery-meta strong {
    font-size: 28px;
  }

  .gallery-statement h2 {
    font-size: 68px;
  }

  .gallery-final-content h2 {
    font-size: 65px;
  }

  .gallery-lightbox {
    padding: 20px;
  }

  .lightbox-close {
    top: 15px;

    right: 15px;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;

    bottom: 25px;

    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 55px);
  }

  .lightbox-next {
    right: calc(50% - 55px);
  }

  .lightbox-content img {
    max-height: 72vh;
  }
  .gallery-image-btn {
    aspect-ratio: 4 / 3;
  }

  .gallery-image-btn img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }
}
