/* ============================================
   Terra Lanna TRAVEL — GALLERY PAGE CSS
   Masonry photo grid + lightbox (page-scoped,
   same pattern as .stay-lightbox/.farm-lightbox)

   Added 2026-09-12, คุณโอเชี่ยน: "เพิ่มหน้าแกลลอรี่"
   — real photos to follow; page ships first with
   an empty-state so it's ready the moment photos
   land in the `gallery` Firestore collection.
   ============================================ */

/* ---- Masonry grid: CSS columns, no JS layout math ---- */
.gallery-grid {
  column-count: 3;
  column-gap: 16px;
  padding: 24px 0 80px;
}

.gallery-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 16px;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface);
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.35) 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover img { transform: scale(1.06); }
.gallery-item:hover::after { opacity: 1; }

.gallery-item:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .gallery-grid { column-count: 2; }
}
@media (max-width: 560px) {
  .gallery-grid { column-count: 1; }
}

/* ---- Empty state (no photos yet) ---- */
.gallery-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-muted);
}
.gallery-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  color: var(--color-border);
}
.gallery-empty p {
  font-size: 1rem;
  font-family: var(--font-heading);
}

/* ---- Lightbox ---- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(6, 15, 37, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.28s;
}
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox.is-open { opacity: 1; }

.gallery-lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.75);
}

.gallery-lightbox-caption {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  max-width: 80vw;
  text-align: center;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--color-white);
  font-size: 1.4rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.22s, transform 0.22s;
}
.gallery-lightbox-close:hover {
  background: rgba(201, 168, 76, 0.22);
  transform: rotate(90deg);
}
.gallery-lightbox-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}
