/* =========================
   SECTION: Tiny utility replacements
   NOTE:
   - Ganti inline style kecil supaya markup lebih bersih
   ========================= */
.gallery-inline-flex {
  display: inline-flex;
}

.gallery-align-center {
  align-items: center;
}

.gallery-gap-10 {
  gap: 10px;
}

.gallery-hidden-inline {
  display: none;
}

.gallery-empty-wrap-hidden {
  display: none;
}

.gallery-empty-text {
  margin: 0;
  color: var(--muted);
}

.gallery-cta-section {
  background: #fffaf0;
}

.gallery-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================
   SECTION: Page background
   DEBUG-POINT:
   - Kalau hero atau section nampak terlalu sempit/lebar, semak grid di bawah
   ========================= */
.gallery-page {
  background:
    radial-gradient(circle at top left, rgba(255,248,221,.9), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, #fffdf8 0%, #ffffff 30%, #fffaf0 100%);
}

/* =========================
   SECTION: Hero
   ========================= */
.gallery-hero {
  padding-top: 40px;
  padding-bottom: 8px;
}

.gallery-hero-grid {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,.95fr);
  gap: 30px;
  align-items: center;
}

.gallery-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7db;
  color: #9a6a17;
  font-size: .82rem;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}

.gallery-title {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
}

.gallery-lead {
  max-width: 620px;
  margin: 0;
  color: #5f6368;
  line-height: 1.8;
}

.gallery-note {
  margin-top: 10px;
  color: var(--muted);
}

.gallery-hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.gallery-hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.04);
  color: #444;
}

.gallery-hero-points i {
  flex: 0 0 auto;
  margin-top: 3px;
  color: #d5a21c;
}

.gallery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.gallery-hero-card {
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 16px 42px rgba(0,0,0,.10);
}

.gallery-hero-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 4.4;
  object-fit: cover;
}

.gallery-hero-card .pad {
  background: #fff;
}

.gallery-hero-caption-title {
  margin: 0 0 4px;
  color: #333;
  font-weight: 700;
}

.gallery-hero-caption-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* =========================
   SECTION: Filter shell
   DEPENDENCY:
   - page-gallery.js baca #gallerySearch, #categoryFilter, #resetGalleryFilters
   DEBUG-POINT:
   - Kalau reset/filter tak jalan, semak id field dan listener JS
   ========================= */
.filter-shell {
  background: #fffaf0;
}

.filter-card {
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.04);
  border-radius: 24px;
  background: radial-gradient(circle at top left, #fff7dd, #fffdf7 40%, #ffffff 80%);
  box-shadow: 0 14px 40px rgba(0,0,0,.06);
}

.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.filter-head-title {
  margin: 0 0 4px;
  color: #3f2f0a;
  font-size: 1.05rem;
}

.filter-head-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  color: #94601b;
  font-size: .78rem;
  font-weight: 700;
}

.filter-badge i {
  font-size: .85rem;
}

.filter-body {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(0,1.1fr) auto;
  gap: 16px;
  align-items: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  color: #9a7b3b;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-input-wrap i {
  position: absolute;
  left: 12px;
  color: #c6a56b;
  font-size: .9rem;
  pointer-events: none;
}

.filter-input,
.filter-select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 12px 36px;
  border: 1px solid #f1e2c4;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  appearance: none;
}

.filter-select {
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #d0a34a 50%),
    linear-gradient(135deg, #d0a34a 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.filter-input:focus,
.filter-select:focus {
  border-color: #f1b632;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(241,182,50,0.24);
}

.btn.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid #f1d18a;
  border-radius: 999px;
  background: #fffdf5;
  font-size: .9rem;
}

.btn.btn-ghost:hover {
  background: #ffeec1;
}

.filter-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.filter-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff7dc;
  color: #8a5a11;
  font-size: .82rem;
  font-weight: 700;
}

/* =========================
   SECTION: Gallery list
   DEBUG-POINT:
   - Kalau card terlalu tinggi/rendah, semak image height di sini
   ========================= */
.gallery-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.gallery-section-title {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  line-height: 1.1;
}

.gallery-section-desc {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 18px;
}

.gallery-card {
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
  transition: transform .22s ease, box-shadow .22s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0,0,0,.10);
}

.gallery-card .gallery-image-link {
  display: block;
  cursor: zoom-in;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.gallery-card .pad {
  padding: 14px 14px 12px;
}

.gallery-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gallery-card-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.gallery-name {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #2f2f2f;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gallery-code {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 999px;
  background: #fafafa;
  color: #8b8b8b;
  font-size: .78rem;
}

.badge-cat {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge-cat.tunang { background: #ffe8ef; color: #8a2449; }
.badge-cat.kahwin { background: #f1e0ff; color: #4a236f; }
.badge-cat.event { background: #e0f0ff; color: #174a7a; }
.badge-cat.edible { background: #fff7dd; color: #94601b; }
.badge-cat.topper { background: #e3e6ff; color: #29337a; }

.gallery-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.gallery-card-hint {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

.gallery-card .btn {
  white-space: nowrap;
}

.gallery-hidden {
  display: none !important;
}

#infiniteStatus {
  margin-top: 18px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

/* =========================
   SECTION: Lightbox
   DEPENDENCY:
   - JS create/open/close lightbox
   DEBUG-POINT:
   - Kalau lightbox buka tapi image kosong, semak src/img click handler di JS
   ========================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(4px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  width: 100%;
  max-width: 980px;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}

.lightbox-inner img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #111;
}

.lightbox-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  color: #fff;
  font-size: .88rem;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  cursor: pointer;
}

/* =========================
   SECTION: CTA
   ========================= */
.gallery-cta-wrap {
  text-align: center;
}

.gallery-cta-title {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  line-height: 1.1;
}

.gallery-cta-text {
  max-width: 560px;
  margin: 0 auto 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* =========================
   SECTION: Responsive
   DEBUG-POINT:
   - Kalau mobile card button tak full width, semak .gallery-card-bottom
   ========================= */
@media (max-width: 992px) {
  .gallery-hero-grid {
    grid-template-columns: 1fr;
  }

  .gallery-hero-points {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding-top: 26px;
  }

  .gallery-hero-points {
    grid-template-columns: 1fr;
  }

  .filter-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-body {
    grid-template-columns: minmax(0,1fr);
  }

  .filter-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-card img {
    height: 240px;
  }

  .gallery-card-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-card-bottom .btn {
    width: 100%;
    text-align: center;
  }
}