/* ============================================
   v2/css/gallery.css
   استایل لیست آلبوم‌ها + جزئیات آلبوم (RTL-aware)
   سایت اخبار استقلال — نسخه ۲
   ============================================ */

/* ============================================
   1) Gallery List
   ============================================ */
.gallery-page {
  padding: 12px 12px 20px;
}

.gallery-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gallery-item-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .3s, border-color .3s;
  touch-action: manipulation;
}

.gallery-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.gallery-item-card .gallery-img {
  width: 100%;
  height: 130px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
}

.gallery-item-card .gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-card .gallery-img .img-count-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-item-card .gallery-img .img-count-badge i {
  color: var(--gold);
  font-size: .65rem;
}

.gallery-item-card .gallery-info {
  padding: 10px 12px;
}

.gallery-item-card .gallery-info .gallery-title {
  font-weight: 700;
  color: var(--primary);
  font-size: .85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.gallery-item-card .gallery-info .gallery-date {
  font-size: .65rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   2) Gallery Detail
   ============================================ */
.gallery-detail-page {
  display: block;
  padding: 0 0 20px;
}

.gallery-slider-full {
  position: relative;
  width: 100%;
  height: 400px;
  background: #000;
  overflow: hidden;
  touch-action: pan-y;
}

.gallery-slider-full .gs-track {
  display: flex;
  flex-wrap: nowrap;
  height: 100%;
  width: 100%;
  transition: transform 0.4s ease;
  will-change: transform;
  direction: ltr; /* 🎯 RTL-aware: transform استاندارد */
}

.gallery-slider-full .gs-track.dragging { transition: none; }

.gallery-slider-full .gs-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gallery-slider-full .gs-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-slider-full .gs-slide .gs-icon-fallback {
  font-size: 3rem;
  color: var(--gold);
}

.gallery-slider-full .gs-counter {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  z-index: 3;
}

.gallery-slider-full .gs-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
  padding: 6px 12px;
  background: rgba(0,0,0,.4);
  border-radius: 20px;
  max-width: 90%;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-slider-full .gs-dots::-webkit-scrollbar { display: none; }

.gallery-slider-full .gs-dots .gs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: all .3s;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.gallery-slider-full .gs-dots .gs-dot.active {
  background: var(--gold);
  width: 18px;
  border-radius: 4px;
}

.gallery-slider-full .gs-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.4);
  border: none;
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  backdrop-filter: blur(4px);
  transition: background .3s;
  touch-action: manipulation;
}

.gallery-slider-full .gs-nav:hover { background: rgba(0,0,0,.6); }

.gallery-slider-full .gs-nav.gs-prev { right: 10px; }
.gallery-slider-full .gs-nav.gs-next { left: 10px; }

.gallery-detail-content {
  padding: 16px 12px 0;
}

.gallery-detail-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.5;
  padding: 0 4px;
}

.gallery-detail-meta {
  display: flex;
  gap: 16px;
  padding: 12px 4px;
  border-top: 1px solid var(--bg);
  border-bottom: 1px solid var(--bg);
  margin-bottom: 16px;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.gallery-detail-meta .time-ago {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================
   3) Responsive
   ============================================ */
@media (max-width: 380px) {
  .gallery-item-card .gallery-img { height: 110px; }
  .gallery-slider-full { height: 320px; }
  .gallery-detail-title { font-size: 1.05rem; }
}