/* ========================================
   GALLERY SECTION
   Tema: Toraja Elegant
======================================== */

.gallery-section {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background-image: url("../assets/images/Background 3.png");
  color: var(--color-text);
  background-position: top center;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

/* ========================================
   ORNAMEN SUDUT ATAS
======================================== */

.gallery-corner-ornament {
  position: absolute;
  top: 0;
  z-index: 3;
  width: clamp(90px, 14vw, 190px);
  height: auto;
  pointer-events: none;
}

.gallery-corner-ornament-left {
  left: -1px !important;
}

.gallery-corner-ornament-right {
  right: -1px !important;
  transform: scaleX(-1);
}

/* ========================================
   ORNAMEN SUDUT BAWAH
======================================== */

.gallery-bottom-ornament {
  position: absolute;
  bottom: 0;
  z-index: 3;
  width: clamp(90px, 14vw, 190px);
  height: auto;
  pointer-events: none;
}

.gallery-bottom-ornament-left {
  left: -1px !important;
  transform: scaleY(-1);
}

.gallery-bottom-ornament-right {
  right: -1px !important;
  transform: scale(-1, -1);
}

/* ========================================
   KONTEN UTAMA
======================================== */

.gallery-content {
  position: relative;
  z-index: 1;
  width: min(86%, 720px);
  margin: 0 auto;
  padding: 90px 0 70px;
  text-align: center;
}

/* ========================================
   JUDUL
======================================== */

.gallery-header {
  margin-bottom: 34px;
}

.gallery-eyebrow {
  margin: 0 auto !important;
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.gallery-title {
  margin: 0 !important;
  font-family: var(--font-primary) !important;
  font-size: 80px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  color: var(--color-primary);
}

.gallery-intro {
  max-width: 430px !important;
  margin: 24px auto 0 !important;
  font-family: var(--font-secondary) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.9;
  color: #80695b;
}

/* ========================================
   GRID FOTO
======================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0 auto 80px;
}

/* ========================================
   FRAME FOTO
   Tanpa stroke putih
======================================== */

.gallery-item {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Ukuran landscape */

.gallery-item-1,
.gallery-item-4,
.gallery-item-7,
.gallery-item-10 {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

/* Ukuran portrait */

.gallery-item-2,
.gallery-item-3,
.gallery-item-5,
.gallery-item-6,
.gallery-item-8,
.gallery-item-9 {
  grid-column: span 1;
  aspect-ratio: 4 / 5;
}

/* Foto memenuhi frame */

.gallery-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
}

/* ========================================
   GALLERY MODAL
======================================== */

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(20, 10, 6, 0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-modal-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(90vw, 900px);
  height: min(88vh, 800px);
}

.gallery-modal-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
}

.gallery-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.gallery-modal-close i {
  display: block;
}

.gallery-modal-close:hover {
  opacity: 0.7;
}

body.gallery-modal-open {
  overflow: hidden;
}

/* ========================================
   DESKTOP
======================================== */

@media (min-width: 1200px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -16px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -16px;
  }

  .gallery-content {
    padding-top: 120px;
  }

  .gallery-grid {
    gap: 10px;
  }
}

/* ========================================
   LAPTOP
======================================== */

@media (min-width: 1025px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -15px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -15px;
  }

  .gallery-content {
    padding-top: 110px;
  }
}

/* ========================================
   LAPTOP KECIL
======================================== */

@media (max-width: 1199px) {
  .gallery-content {
    width: min(88%, 680px);
    padding-top: 100px;
  }
}

/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -13px;
    width: 18%;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -13px;
    width: 18%;
  }

  .gallery-content {
    width: 84%;
    padding-top: 90px;
  }

  .gallery-grid {
    gap: 8px;
  }
}

/* ========================================
   TABLET PORTRAIT
======================================== */

@media (max-width: 768px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -12px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -12px;
  }

  .gallery-content {
    width: 82%;
    padding-top: 75px;
    padding-bottom: 60px;
  }

  .gallery-header {
    margin-bottom: 26px;
  }

  .gallery-title {
    font-size: clamp(28px, 5vw, 38px);
  }

  .gallery-intro {
    font-size: 12px !important;
  }

  .gallery-grid {
    gap: 7px;
  }

  .gallery-item {
    padding: 3px;
  }
}

/* ========================================
   HP
======================================== */

@media (max-width: 480px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -11px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -11px;
  }

  .gallery-content {
    width: 78%;
    padding-top: 65px;
    padding-bottom: 50px;
  }

  .gallery-eyebrow {
    font-size: 12px;
  }

  .gallery-title {
    margin-bottom: 12px;
    font-size: 40px !important;
  }

  .gallery-intro {
    font-size: 11px;
    line-height: 1.7;
  }

  .gallery-grid {
    gap: 6px;
  }

  .gallery-item {
    padding: 3px;
  }

  .gallery-modal {
    padding: 20px;
  }

  .gallery-modal-content {
    width: 92vw;
    height: 82vh;
  }

  .gallery-modal-close {
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

/* ========================================
   HP KECIL
======================================== */

@media (max-width: 420px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -10px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -10px;
  }

  .gallery-content {
    width: 76%;
    padding-top: 55px;
  }

  .gallery-title {
    font-size: 27px;
  }

  .gallery-grid {
    gap: 5px;
  }

  .gallery-item {
    padding: 2px;
  }
}

/* ========================================
   HP SANGAT KECIL
======================================== */

@media (max-width: 360px) {
  .gallery-corner-ornament-left,
  .gallery-bottom-ornament-left {
    left: -9px;
  }

  .gallery-corner-ornament-right,
  .gallery-bottom-ornament-right {
    right: -9px;
  }

  .gallery-content {
    width: 74%;
    padding-top: 50px;
    padding-bottom: 45px;
  }

  .gallery-title {
    font-size: 25px;
  }

  .gallery-intro {
    font-size: 8px;
  }

  .gallery-grid {
    gap: 4px;
  }

  .gallery-modal {
    padding: 15px;
  }

  .gallery-modal-content {
    width: 94vw;
    height: 80vh;
  }

  .gallery-modal-close {
    top: 12px;
    right: 12px;
    font-size: 18px;
  }
}

/* =========================================================
   SCROLL REVEAL - GALLERY
   ========================================================= */

.gallery-corner-ornament,
.gallery-bottom-ornament,
.gallery-header,
.gallery-item {
  opacity: 0;
  translate: 0 45px;
  transition:
    opacity 0.8s ease,
    translate 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-corner-ornament.is-visible,
.gallery-bottom-ornament.is-visible,
.gallery-header.is-visible,
.gallery-item.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Ornamen atas */
.gallery-corner-ornament-left.is-visible {
  transition-delay: 0s;
}

.gallery-corner-ornament-right.is-visible {
  transition-delay: 0.15s;
}

/* Header */
.gallery-header.is-visible {
  transition-delay: 0.2s;
}

/* Foto bertahap */
.gallery-item-1.is-visible {
  transition-delay: 0.05s;
}

.gallery-item-2.is-visible {
  transition-delay: 0.15s;
}

.gallery-item-3.is-visible {
  transition-delay: 0.25s;
}

.gallery-item-4.is-visible {
  transition-delay: 0.35s;
}

.gallery-item-5.is-visible {
  transition-delay: 0.45s;
}

.gallery-item-6.is-visible {
  transition-delay: 0.55s;
}

.gallery-item-7.is-visible {
  transition-delay: 0.65s;
}

.gallery-item-8.is-visible {
  transition-delay: 0.75s;
}

.gallery-item-9.is-visible {
  transition-delay: 0.85s;
}

.gallery-item-10.is-visible {
  transition-delay: 0.95s;
}

/* Ornamen bawah */
.gallery-bottom-ornament-left.is-visible {
  transition-delay: 0.1s;
}

.gallery-bottom-ornament-right.is-visible {
  transition-delay: 0.25s;
}