/* ============================================================
   Public Gallery — Al-Ghathbar Family Site
   Professional masonry gallery for portrait + landscape images
   ============================================================ */

.gh-gallery-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.gh-gallery-hero {
  text-align: center;
  margin-bottom: 34px;
}

.gh-gallery-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(216, 95, 26, 0.18);
  border-radius: 999px;
  background: rgba(255, 244, 227, 0.9);
  color: #9a4b18;
  font-size: 0.86rem;
  font-weight: 700;
}

.gh-gallery-hero h1 {
  margin: 0;
  color: #063b67;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.25;
  font-weight: 900;
}

.gh-gallery-hero p {
  max-width: 680px;
  margin: 12px auto 0;
  color: #5f6f7e;
  line-height: 1.95;
  font-size: 1rem;
}

.gh-gallery-status {
  margin: 0 auto 22px;
  padding: 14px 18px;
  max-width: 680px;
  border-radius: 16px;
  text-align: center;
  line-height: 1.8;
  font-weight: 700;
  background: #fff7ec;
  color: #8a4b16;
  border: 1px solid #efd1b1;
}

.gh-gallery-status.is-error {
  background: #fff1f1;
  color: #a11f1f;
  border-color: #f2b8b8;
}

/* Masonry layout: يحافظ على أبعاد الصور بدون قص */
.gh-gallery-grid {
  column-count: 3;
  column-gap: 22px;
}

@media (min-width: 1280px) {
  .gh-gallery-grid {
    column-count: 4;
  }
}

@media (max-width: 900px) {
  .gh-gallery-grid {
    column-count: 2;
    column-gap: 16px;
  }
}

@media (max-width: 560px) {
  .gh-gallery-page {
    width: min(100% - 22px, 1180px);
    padding-top: 36px;
  }

  .gh-gallery-grid {
    column-count: 1;
  }
}

.gh-gallery-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  break-inside: avoid;
  border: 1px solid rgba(6, 59, 103, 0.12);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 30px rgba(6, 59, 103, 0.09);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gh-gallery-card:hover,
.gh-gallery-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(6, 59, 103, 0.16);
  border-color: rgba(216, 95, 26, 0.34);
  outline: none;
}

.gh-gallery-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
  background: #f8fafc;
}

.gh-gallery-card::after {
  content: "عرض الصورة";
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  opacity: 0;
  transform: translateY(8px);
  padding: 9px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(3, 31, 54, 0.72);
  backdrop-filter: blur(8px);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.gh-gallery-card:hover::after,
.gh-gallery-card:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.gh-gallery-empty {
  display: block;
  padding: 42px 22px;
  border-radius: 22px;
  background: #fff7ec;
  border: 1px dashed #efd1b1;
  color: #7b5b44;
  text-align: center;
  font-weight: 800;
}

/* Lightbox */
.gh-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 12, 24, 0.92);
}

.gh-lightbox.is-open {
  display: flex;
}

.gh-lightbox-frame {
  margin: 0;
  width: min(1120px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gh-lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
}

.gh-lightbox-frame figcaption {
  min-height: 28px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.94rem;
  font-weight: 700;
  text-align: center;
}

.gh-lightbox-close,
.gh-lightbox-nav {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.gh-lightbox-close:hover,
.gh-lightbox-nav:hover {
  background: rgba(216, 95, 26, 0.9);
  transform: scale(1.04);
}

.gh-lightbox-close {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}

.gh-lightbox-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 72px;
  border-radius: 999px;
  font-size: 3rem;
  line-height: 1;
}

.gh-lightbox-prev {
  inset-inline-start: 24px;
}

.gh-lightbox-next {
  inset-inline-end: 24px;
}

@media (max-width: 720px) {
  .gh-lightbox {
    padding: 18px;
  }

  .gh-lightbox-nav {
    top: auto;
    bottom: 24px;
    width: 44px;
    height: 52px;
    font-size: 2.4rem;
  }

  .gh-lightbox-prev {
    inset-inline-start: 34%;
  }

  .gh-lightbox-next {
    inset-inline-end: 34%;
  }

  .gh-lightbox-frame img {
    max-height: 72vh;
  }
}