/* ============================================================
   Zhongxin Energy - about photo gallery styles
   Loaded after style.css / extras.css. Logical properties for RTL.
   ============================================================ */

.photo-gallery {
  position: relative;
  flex: 1 1 auto;
  min-height: 470px;
  display: flex;
  flex-direction: column;
}

/* tabs */
.gallery-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.gallery-tab {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--body);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.gallery-tab:hover { border-color: var(--gold-500); color: var(--gold-700); }
.gallery-tab.is-active {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
}
html[dir="rtl"] .gallery-tab { font-size: 12.5px; }

/* stage + slides */
.gallery-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--soft-2);
  box-shadow: var(--shadow);
}
.gallery-slides {
  position: absolute;
  inset: 0;
}
.gallery-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease;
}
.gallery-slide.is-active {
  opacity: 1;
  visibility: visible;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* arrows */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 23, 38, .55);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  transition: background .2s, transform .2s;
}
.gallery-nav:hover { background: rgba(6, 23, 38, .82); }
.gallery-prev { inset-inline-start: 14px; }
.gallery-next { inset-inline-end: 14px; }
html[dir="rtl"] .gallery-prev,
html[dir="rtl"] .gallery-next { transform: translateY(-50%) scaleX(-1); }

/* counter (top-right, keeps clear of the credentials badge at bottom-right) */
.gallery-counter {
  position: absolute;
  inset-inline-end: 14px;
  top: 14px;
  z-index: 3;
  background: rgba(6, 23, 38, .62);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* caption + dots */
.gallery-caption {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 22px;
}
.gallery-dots {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.gallery-dot {
  width: 26px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--line);
  cursor: pointer;
  transition: background .2s, width .2s;
}
.gallery-dot.is-active { background: var(--gold-600); width: 38px; }

/* ---------- lightbox ---------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
}
.gallery-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 28, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gallery-lb-figure {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 1200px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: lbIn .28s ease both;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: none; }
}
.gallery-lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.gallery-lb-figure figcaption {
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  letter-spacing: .02em;
}
.gallery-lb-close {
  position: absolute;
  inset-inline-end: 22px;
  top: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, transform .2s;
}
.gallery-lb-close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }
.gallery-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s;
}
.gallery-lb-nav:hover { background: rgba(255, 255, 255, .2); }
.gallery-lb-prev { inset-inline-start: 18px; }
.gallery-lb-next { inset-inline-end: 18px; }
html[dir="rtl"] .gallery-lb-prev,
html[dir="rtl"] .gallery-lb-next { transform: translateY(-50%) scaleX(-1); }
body.gallery-lb-open { overflow: hidden; }

@media (max-width: 900px) {
  .photo-gallery { min-height: 420px; }
  .gallery-stage { min-height: 350px; }
}
@media (max-width: 640px) {
  .photo-gallery { min-height: 360px; }
  .gallery-stage { min-height: 290px; }
  .gallery-nav { width: 36px; height: 36px; font-size: 24px; }
  .gallery-lightbox { padding: 60px 16px; }
  .gallery-lb-nav { width: 42px; height: 42px; font-size: 30px; }
  .gallery-lb-prev { inset-inline-start: 8px; }
  .gallery-lb-next { inset-inline-end: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-slide,
  .gallery-lb-figure { transition: none; animation: none; }
}
