/* Gallery — Biver Royalty Homes */
*,
*::before,
*::after { box-sizing: border-box; }

body.page-gallery {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--dark-jungle-green, #2c2418);
  background:
    radial-gradient(1100px 480px at 90% -10%, rgba(212, 175, 55, 0.08), transparent 55%),
    linear-gradient(180deg, #faf7f1 0%, #ffffff 45%, #f7f2e9 100%);
  overflow-x: clip;
}

.page-gallery .container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.gallery-hero {
  position: relative;
  min-height: min(52vh, 420px);
  display: flex;
  align-items: flex-end;
  padding: clamp(120px, 16vh, 150px) 0 clamp(36px, 6vh, 56px);
  overflow: hidden;
  color: #f7f0e4;
}
.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #2a1505 0%, #371801 55%, #1a0c02 100%);
}
.gallery-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.gallery-brand {
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 8px;
}
.gallery-hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 12px 0;
  line-height: 1.12;
}
.gallery-hero h1 em {
  font-style: italic;
  background: linear-gradient(90deg, #D4AF37, #F0D78C);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gallery-hero-lead {
  margin: 0 auto;
  max-width: 42ch;
  color: rgba(255, 247, 232, 0.75);
  line-height: 1.7;
}

.gallery-filters { padding: 24px 0 8px; }
.gallery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.gallery-chip {
  text-decoration: none;
  color: #371801;
  border: 1px solid rgba(55, 24, 1, 0.12);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.gallery-chip.is-active,
.gallery-chip:hover {
  background: linear-gradient(135deg, #d4af37, #f0d78c);
  border-color: transparent;
}

.gallery-grid-section { padding: 24px 0 80px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  background: #fff;
  border: 1px solid rgba(55, 24, 1, 0.06);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(55, 24, 1, 0.04);
}
.gallery-item-trigger {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: #1a0f06;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-item-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.gallery-item-trigger:hover img { transform: scale(1.04); }
.gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 12, 2, 0.28);
  color: #f0d78c;
  font-size: 3rem;
}
.gallery-item-copy {
  padding: 14px 16px 18px;
}
.gallery-item-copy h3 {
  margin: 0 0 6px;
  font-family: var(--ff-display);
  font-size: 1.15rem;
  color: #371801;
}
.gallery-item-copy p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #6c5e4e;
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
}
.gallery-empty h2 {
  font-family: var(--ff-display);
  color: #371801;
  margin: 0 0 10px;
}
.gallery-empty-link {
  display: inline-block;
  margin-top: 16px;
  color: #371801;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid #D4AF37;
}

body.gallery-lightbox-open { overflow: hidden; }
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(10, 6, 2, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gallery-lightbox[hidden] { display: none !important; }
.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.4rem;
  cursor: pointer;
}
.gallery-lightbox-body {
  width: min(960px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gallery-lightbox-body img,
.gallery-lightbox-body video {
  max-width: 100%;
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #1a0f06;
}
.gallery-lightbox-caption {
  color: rgba(255, 247, 232, 0.85);
  text-align: center;
  max-width: 640px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
