/* styles-news.css (به‌روزرسانی: شبکه 6 ستونه برای news-grid و responsive breakpoints) */

/* شبکه محتوا */

/* مهم: تغییر به 6 ستون */
.news-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:14px;
}

.card-news{
  background:var(--card);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 6px 18px rgba(0,0,0,0.03);
  transition:transform var(--transition), box-shadow var(--transition);
  display:flex;
  flex-direction:column;
  text-decoration:none;
  color:inherit;
  min-height: 280px;
}
.card-news:hover{transform:translateY(-6px); box-shadow:0 12px 26px rgba(0,0,0,0.06)}
.card-news img{width:100%; height:140px; object-fit:cover; display:block}
.card-body{padding:12px 10px; display:flex; flex-direction:column; gap:8px; flex:1}
.card-title{margin:0; font-weight:700; font-size:0.95rem}
.card-excerpt{margin:0; color:var(--muted); font-size:0.85rem; line-height:1.2; max-height:2.6em; overflow:hidden}
.card-meta{display:flex; justify-content:space-between; align-items:center; margin-top:auto; color:var(--muted); font-size:0.85rem}

.card-link{display:flex; flex-direction:column; height:100%; text-decoration:none; color:inherit}

.sidebar .card{background:var(--card); padding:12px; border-radius:12px; margin-bottom:12px}
.popular-list{
    padding-left: 12px;
    margin-right: 20px
}
.popular-list li{margin-bottom:8px}
.category-list{padding:0; margin:0; list-style:none}
.category-list li a{color:var(--muted); text-decoration:none}

.btn{
  display:inline-block;
  background:var(--accent);
  color:white;
  border:0;
  padding:10px 16px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}

@media (max-width:1400px){
  .news-grid{grid-template-columns: repeat(4, 1fr); }
  .content-grid{grid-template-columns:1fr 300px;}
}
@media (max-width:1000px){
  .content-grid{grid-template-columns:1fr 260px}
  .news-grid{grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:780px){
  .content-grid{grid-template-columns:1fr}
  .news-grid{grid-template-columns: repeat(2, 1fr); }
  .sidebar{order:2}
}
@media (max-width:420px){
  .news-grid{grid-template-columns: 1fr; }
  .card-news img{height:160px}
}

/* ==================== استایل‌های گالری مجلات ==================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.gallery-item {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.03);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.06);
}

.gallery-image-container {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

.gallery-body {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.gallery-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 600;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: white;
}

.gallery-category-badge {
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.gallery-magazine-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gallery-magazine-date {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 5px;
}

.gallery-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 30px;
}

.empty-gallery {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 1.1rem;
}

@media (max-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-image-container {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-image-container {
    height: 160px;
  }
  .gallery-image {
    object-fit: contain; /* در موبایل‌های کوچک contain بهتر است */
  }
  .gallery-filters {
    gap: 6px;
  }
  .filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* ==================== لایت‌باکس برای نمایش تمام صفحه ==================== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 20px;
  max-width: 80%;
  font-family: 'Vazirmatn', sans-serif;
}

/* واکنش‌گرایی برای موبایل */
@media (max-width: 768px) {
  .lightbox {
    padding: 10px;
  }
  
  .lightbox-img {
    max-width: 95%;
    max-height: 95%;
  }
  
  .lightbox-close {
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
  
  .lightbox-caption {
    bottom: 15px;
    font-size: 14px;
    padding: 8px 16px;
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .lightbox {
    padding: 5px;
  }
  
  .lightbox-img {
    max-width: 98%;
    max-height: 98%;
  }
  
  .lightbox-close {
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  
  .lightbox-caption {
    bottom: 10px;
    font-size: 12px;
    padding: 6px 12px;
    max-width: 95%;
  }
}

/* پشتیبانی از حالت landscape در موبایل */
@media (max-height: 500px) and (orientation: landscape) {
  .lightbox-img {
    max-height: 85%;
  }
  
  .lightbox-caption {
    bottom: 5px;
    font-size: 12px;
  }
}
