:root {
  --gallery-border-color: #FED349;
  --lightbox-overlay-color: rgba(0, 0, 0, 0.85);
  --lightbox-btn-bg-color: rgba(30, 30, 30, 0.5);
  --lightbox-btn-hover-bg-color: rgba(0, 0, 0, 0.7);
  --lightbox-icon-color: #fff;
  --gallery-gap: 15px;
  --border-radius-main: 10px;
}

/* --- گالری اصلی --- */
.wg-poost-gallery {
  margin: 30px auto;
  padding: var(--gallery-gap);
  border: 2px solid var(--gallery-border-color);
  border-radius: var(--border-radius-main);
  max-width: 95%;
}

.shortcode-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gallery-gap);
  justify-content: center;
}

.shortcode-gallery a {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.shortcode-gallery a:hover {
  transform: scale(1.05);
}

.shortcode-gallery img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  box-shadow: none;
  cursor: pointer;
  display: block;
}

/* استایل برای تامبنیل ویدیو */
.video-thumbnail {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.video-thumbnail .play-icon {
    position: absolute;
    color: white;
    font-size: 30px;
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(0,0,0,0.7);
    pointer-events: none;
}


/* --- لایت‌باکس --- */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--lightbox-overlay-color);
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.gallery-lightbox--show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
}

.gallery-lightbox__content img,
.gallery-lightbox__content video {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--border-radius-main);
}

/* --- دکمه‌های لایت‌باکس --- */
.gallery-lightbox__btn {
  position: absolute;
  background-color: var(--lightbox-btn-bg-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease; /* فقط برای تغییر رنگ انیمیشن وجود دارد */
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
}

.gallery-lightbox__btn:hover {
  background-color: var(--lightbox-btn-hover-bg-color); /* انیمیشن بزرگنمایی حذف شد */
}

.gallery-lightbox__btn svg {
  width: 28px;
  height: 28px;
  stroke: var(--lightbox-icon-color);
}

.gallery-lightbox__btn--prev {
  top: 50%;
  transform: translateY(-50%);
  left: 20px;
}

.gallery-lightbox__btn--next {
  top: 50%;
  transform: translateY(-50%);
  right: 20px;
}

.gallery-lightbox__btn--close {
  top: 20px;
  right: 20px;
}

.wg-poost-gallery.single-post-lightbox-wrapper{
    border: 0;
}

.shortcode-gallery.featured-image{
    display: block;
}

#featured-image{
    width: 450px;
    margin: 0 auto;
}

/* --- واکنش‌گرایی برای موبایل --- */
@media (max-width: 768px) {
  .shortcode-gallery img {
    width: 90px;
    height: 90px;
  }
  .gallery-lightbox__btn {
    width: 44px;
    height: 44px;
  }
  .gallery-lightbox__btn--prev { left: 10px; }
  .gallery-lightbox__btn--next { right: 10px; }
  .gallery-lightbox__btn--close { top: 10px; right: 10px; }
}

