/* ===== RESET ===== */
.ba-gallery,
.ba-gallery *,
.ba-gallery *::before,
.ba-gallery *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  text-decoration: inherit;
  text-align: inherit;
  letter-spacing: normal;
  word-spacing: normal;
  background: transparent;
  border: 0;
  outline: none;
}

/* ===== FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* ===== WRAPPER ===== */
.ba-gallery {
  --ba-primary: #1e90ff;
  --ba-primary-rgb: 30, 144, 255;
  --ba-bg: #ffffff;
  --ba-text: #1e293b;

  display: block;
  isolation: isolate;
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ba-text);
  text-align: start;
  direction: rtl;
  background: var(--ba-bg);
  padding: 0 20px 24px;
  margin: 0;
}

.cz_single_fi:empty,
.cz_single_fi:empty + br {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
}
br:has(+ .ba-gallery),
br:has(+ section.ba-block) {
  display: none !important;
}

/* ===== HEADER ===== */
.ba-gallery .hg-head {
  text-align: center;
  margin-bottom: 48px;
}
.ba-gallery .hg-head h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--ba-text);
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
}
.ba-gallery .hg-head h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--ba-primary);
  border-radius: 10px;
}
.ba-gallery .hg-head p {
  margin-top: 12px;
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.8;
}
.ba-gallery .hg-head p a {
  color: var(--ba-primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(var(--ba-primary-rgb), 0.3);
  transition: border-color 0.2s, color 0.2s;
}
.ba-gallery .hg-head p a:hover {
  color: var(--ba-primary);
  border-bottom-color: var(--ba-primary);
  filter: brightness(0.7);
}

/* ===== STAGE ===== */
.ba-gallery .hg-stage {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 520px auto;
  gap: 16px;
}

/* ===== MAIN PANEL ===== */
.ba-gallery .hg-main {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0c1622;
  cursor: pointer;
}
.ba-gallery .hg-main-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, opacity 0.4s ease;
}
.ba-gallery .hg-main.switching .hg-main-media {
  transform: scale(1.04);
  opacity: 0.6;
}

/* number badge */
.ba-gallery .hg-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  background: rgba(var(--ba-primary-rgb), 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.3px;
  z-index: 2;
}

/* video type badge */
.ba-gallery .hg-type-badge {
  position: absolute;
  top: 22px;
  left: 22px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.ba-gallery .hg-type-badge svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

/* zoom button */
.ba-gallery .hg-cat-badge {
  position: absolute;
  top: 62px;
  left: 22px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  border: none;
  transition: background 0.25s, transform 0.25s;
}
.ba-gallery .hg-cat-badge:hover {
  background: rgba(var(--ba-primary-rgb), 0.85);
  transform: scale(1.08);
}
.ba-gallery .hg-cat-badge svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  display: block;
}

/* play overlay for main video */
.ba-gallery .hg-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(var(--ba-primary-rgb), 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.ba-gallery .hg-play-overlay svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  display: block;
}
.ba-gallery .hg-play-overlay.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

/* info bar */
.ba-gallery .hg-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 2;
}
.ba-gallery .hg-info-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.ba-gallery .hg-info-text .hg-label {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
}
.ba-gallery .hg-info-text .hg-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* arrows */
.ba-gallery .hg-arrows {
  display: flex;
  gap: 8px;
}
.ba-gallery .hg-arr {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  backdrop-filter: blur(4px);
  font-family: inherit;
}
.ba-gallery .hg-arr:hover {
  background: var(--ba-primary);
  border-color: var(--ba-primary);
}

/* progress bar */
.ba-gallery .hg-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 3;
}
.ba-gallery .hg-progress-fill {
  height: 100%;
  background: var(--ba-primary);
  border-radius: 2px;
  transition: width 0.12s linear;
}

/* ===== THUMBNAIL STRIP ===== */
.ba-gallery .hg-strip-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  overflow: hidden;
}
.ba-gallery .hg-strip {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 6px 0;
  flex-shrink: 1;
  min-width: 0;
}
.ba-gallery .hg-strip-arr {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  color: var(--ba-text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}
.ba-gallery .hg-strip-arr:hover {
  background: var(--ba-primary);
  border-color: var(--ba-primary);
  color: #fff;
}
.ba-gallery .hg-thumb {
  width: 120px;
  height: 82px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  background: #0c1622;
}
.ba-gallery .hg-thumb img,
.ba-gallery .hg-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.4;
  filter: brightness(0.65);
  transition: opacity 0.35s, filter 0.35s;
}
.ba-gallery .hg-thumb.active {
  border-color: var(--ba-primary);
  box-shadow: 0 0 0 3px rgba(var(--ba-primary-rgb), 0.25);
}
.ba-gallery .hg-thumb.active img,
.ba-gallery .hg-thumb.active video {
  opacity: 1;
  filter: brightness(1);
}
.ba-gallery .hg-thumb:hover img,
.ba-gallery .hg-thumb:hover video {
  opacity: 0.85;
  filter: brightness(0.9);
}
.ba-gallery .hg-thumb:hover {
  transform: translateY(-3px);
}
/* active dot */
.ba-gallery .hg-thumb.active::after {
  content: '';
  position: absolute;
  top: auto;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ba-primary);
}
/* play icon on video thumbs */
.ba-gallery .hg-thumb .hg-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(var(--ba-primary-rgb), 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ba-gallery .hg-thumb .hg-thumb-play svg {
  width: 10px;
  height: 10px;
  fill: #fff;
  margin-right: -1px;
}

/* ===== DOTS (mobile only) ===== */
.ba-gallery .hg-dots {
  display: none;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.ba-gallery .hg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.3s, width 0.3s;
}
.ba-gallery .hg-dot.on {
  background: var(--ba-primary);
  width: 22px;
  border-radius: 4px;
}

/* ===== LIGHTBOX ===== */
.ba-gallery .hg-lb {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 36, 0.93);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
}
.ba-gallery .hg-lb.open {
  display: flex;
}
.ba-gallery .hg-lb-inner {
  position: relative;
  max-width: 900px;
  width: 100%;
  text-align: center;
}
.ba-gallery .hg-lb-inner img,
.ba-gallery .hg-lb-inner video {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: block;
  margin: 0 auto;
}
.ba-gallery .hg-lb-cap {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-top: 14px;
}
.ba-gallery .hg-lb-close {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.ba-gallery .hg-lb-prev,
.ba-gallery .hg-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: inherit;
}
.ba-gallery .hg-lb-prev:hover,
.ba-gallery .hg-lb-next:hover {
  background: rgba(var(--ba-primary-rgb), 0.55);
}
.ba-gallery .hg-lb-prev {
  right: -58px;
}
.ba-gallery .hg-lb-next {
  left: -58px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .ba-gallery {
    padding-left: 0;
    padding-right: 0;
  }
  .ba-gallery .hg-stage {
    max-width: 100%;
    margin: 0;
    grid-template-rows: 320px auto;
  }
  .ba-gallery .hg-main {
    border-radius: 0;
  }
  .ba-gallery .hg-strip {
    gap: 8px;
  }
  .ba-gallery .hg-strip-arr {
    width: 28px;
    height: 28px;
    font-size: 17px;
  }
  .ba-gallery .hg-thumb {
    width: 80px;
    height: 55px;
    border-radius: 0;
  }
  .ba-gallery .hg-dots {
    display: flex;
  }
  .ba-gallery .hg-info-text .hg-label {
    font-size: 18px;
  }
  .ba-gallery .hg-lb-prev {
    right: -10px;
  }
  .ba-gallery .hg-lb-next {
    left: -10px;
  }
  .ba-gallery .hg-head h2 {
    font-size: 20px;
  }
  .ba-gallery .hg-head p {
    font-size: 13px;
  }
}

@media (max-width: 500px) {
  .ba-gallery {
    padding: 30px 0 35px;
  }
  .ba-gallery .hg-stage {
    max-width: 100%;
    margin: 0;
    grid-template-rows: 240px auto;
    gap: 8px;
  }
  .ba-gallery .hg-main {
    border-radius: 0;
  }
  .ba-gallery .hg-strip-wrap {
    padding: 0 8px;
  }
  .ba-gallery .hg-strip-wrap {
    gap: 6px;
  }
  .ba-gallery .hg-strip {
    gap: 6px;
  }
  .ba-gallery .hg-strip-arr {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  .ba-gallery .hg-thumb {
    width: 56px;
    height: 38px;
    border-width: 1.5px;
    border-radius: 0;
  }
  .ba-gallery .hg-info {
    padding: 10px 12px;
  }
  .ba-gallery .hg-info-text .hg-label {
    font-size: 15px;
  }
  .ba-gallery .hg-info-text .hg-sub {
    font-size: 11px;
  }
  .ba-gallery .hg-dots {
    gap: 5px;
    margin-top: 14px;
  }
  .ba-gallery .hg-dot {
    width: 6px;
    height: 6px;
  }
  .ba-gallery .hg-lb {
    padding: 12px;
  }
  .ba-gallery .hg-lb-close {
    top: -8px;
    left: -8px;
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .ba-gallery .hg-lb-prev,
  .ba-gallery .hg-lb-next {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }
  .ba-gallery .hg-lb-prev {
    right: -4px;
  }
  .ba-gallery .hg-lb-next {
    left: -4px;
  }
  .ba-gallery .hg-head {
    margin-bottom: 28px;
  }
  .ba-gallery .hg-head h2 {
    font-size: 18px;
  }
  .ba-gallery .hg-head p {
    font-size: 12px;
    margin-top: 8px;
  }
}
