/* =========================================================
   مجله یارنیکو - استایل‌های اختصاصی
   ========================================================= */

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* دکمه‌های فیلتر */
.category-btn {
  border-color: rgb(23 52 60 / 12%);
  color: #607177;
  background: transparent;
}
.category-btn:hover {
  border-color: #b96835;
  color: #b96835;
}
.category-btn.active {
  border-color: #17343c;
  background: #17343c;
  color: #fff;
}

/* ===== اسلایدر آخرین مقالات ===== */
.featured-swiper {
  padding-bottom: 3rem;
  overflow: hidden;
}

.featured-slide {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  text-decoration: none;
  min-height: 400px;
  transition: box-shadow 0.3s ease;
}
.featured-slide:hover {
  box-shadow: 0 14px 40px rgb(12 31 38 / 10%);
}
.featured-slide-image {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  aspect-ratio: 16 / 10;
}
.featured-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.featured-slide:hover .featured-slide-image img {
  transform: scale(1.05);
}
.featured-slide-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 45%), transparent 50%);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.4rem 0.85rem;
  background: #b96835;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.featured-slide-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 900;
  color: #b96835;
  margin-bottom: 0.75rem;
}
.featured-title {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.65;
  color: #10272e;
  transition: color 0.25s ease;
}
.featured-slide:hover .featured-title {
  color: #b96835;
}
.featured-excerpt {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.9;
  color: #607177;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-meta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.25rem;
  font-size: 0.7rem;
  color: #748288;
  border-top: 1px solid rgb(23 52 60 / 8%);
  padding-top: 1rem;
}
.featured-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

@media (min-width: 768px) {
  .featured-slide {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .featured-slide-image {
    aspect-ratio: auto;
    min-height: 100%;
  }
  .featured-slide-body {
    padding: 2.5rem;
  }
  .featured-title {
    font-size: 1.7rem;
  }
}

.featured-swiper .swiper-pagination {
  bottom: 0 !important;
}
.featured-swiper .swiper-pagination-bullet {
  width: 30px;
  height: 4px;
  background: rgb(23 52 60 / 20%);
  border-radius: 0;
  opacity: 1;
  transition: background-color 0.3s ease;
}
.featured-swiper .swiper-pagination-bullet-active {
  background: #b96835;
}

/* ===== کارت مقاله ===== */
.article-card {
  display: block;
  text-decoration: none;
  border: 1px solid rgb(23 52 60 / 10%);
  background: #fff;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease,
    border-color 0.3s ease;
}
.article-card:hover {
  box-shadow: 0 12px 36px rgb(12 31 38 / 8%);
  transform: translateY(-3px);
  border-color: rgb(185 104 53 / 25%);
}
.article-card .card-image {
  overflow: hidden;
}
.article-card .card-image img {
  transition: transform 0.5s ease;
}
.article-card:hover .card-image img {
  transform: scale(1.06);
}
.article-card .card-title {
  transition: color 0.25s ease;
}
.article-card:hover .card-title {
  color: #b96835;
}
.article-card .card-arrow {
  transition: transform 0.25s ease;
}
.article-card:hover .card-arrow {
  transform: translateX(-4px);
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgb(185 104 53 / 10%);
  color: #b96835;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-animate {
  animation: cardFadeIn 0.45s ease-out both;
}
.line-clamp-2 {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================
   ===== سایدبار =====
   ========================================================== */
.sidebar-sticky {
  position: sticky;
  top: 160px;
}
.sidebar-widget {
  background: #fff;
  border: 1px solid rgb(23 52 60 / 10%);
  overflow: hidden;
}
.widget-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgb(23 52 60 / 8%);
  background: #f8f6f0;
}
.widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 900;
  color: #10272e;
}
.widget-title i {
  color: #b96835;
}

/* --- آخرین اخبار --- */
.latest-news-widget {
  background: #fff;
}
.latest-news-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.25rem;
  background: #10272e;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.live-dot {
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(239 68 68 / 60%);
  }
  50% {
    box-shadow: 0 0 0 6px rgb(239 68 68 / 0%);
  }
}
.latest-news-body {
  max-height: 320px;
  overflow: hidden;
  position: relative;
}
.latest-news-body::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, #fff, transparent);
  pointer-events: none;
  z-index: 2;
}
.latest-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  animation: newsScroll 30s linear infinite;
}
.latest-news-widget:hover .latest-news-list {
  animation-play-state: paused;
}
@keyframes newsScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}
.latest-news-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgb(23 52 60 / 6%);
  color: #17343c;
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.75;
  font-weight: 600;
  transition: background-color 0.2s ease;
}
.latest-news-item:hover {
  background: #f8f6f0;
  color: #b96835;
}
.latest-news-time {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #9da8ab;
  padding: 0.15rem 0.4rem;
  border: 1px solid rgb(23 52 60 / 10%);
  font-weight: 700;
  margin-top: 2px;
}

/* --- ویجت آرشیو مقالات --- */
.archive-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.archive-widget-count {
  font-size: 0.65rem;
  font-weight: 800;
  color: #9da8ab;
  background: rgb(23 52 60 / 6%);
  padding: 0.2rem 0.5rem;
}

.archive-widget-body {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(185 104 53 / 40%) transparent;
}

.archive-widget-body::-webkit-scrollbar {
  width: 6px;
}

.archive-widget-body::-webkit-scrollbar-track {
  background: transparent;
}

.archive-widget-body::-webkit-scrollbar-thumb {
  background: rgb(185 104 53 / 30%);
  border-radius: 3px;
}

.archive-widget-body::-webkit-scrollbar-thumb:hover {
  background: rgb(185 104 53 / 60%);
}

.archive-widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-widget-item {
  border-bottom: 1px solid rgb(23 52 60 / 5%);
}

.archive-widget-item:last-child {
  border-bottom: 0;
}

.archive-widget-link {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.85rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.archive-widget-link:hover {
  background: #f8f6f0;
}

.archive-widget-marker {
  flex-shrink: 0;
  margin-top: 6px;
  width: 5px;
  height: 5px;
  background: rgb(185 104 53 / 40%);
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.archive-widget-link:hover .archive-widget-marker {
  background: #b96835;
}

.archive-widget-content {
  flex: 1;
  min-width: 0;
}

.archive-widget-title {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.7;
  color: #17343c;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.archive-widget-link:hover .archive-widget-title {
  color: #b96835;
}

.archive-widget-meta {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.75rem;
  font-size: 0.6rem;
  color: #9da8ab;
  font-weight: 600;
}

.archive-widget-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.archive-widget-cat {
  color: #b96835 !important;
  font-weight: 800 !important;
}

/* --- تگ‌ها --- */
.tags-cloud {
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-item {
  padding: 0.4rem 0.75rem;
  background: #f8f6f0;
  border: 1px solid rgb(23 52 60 / 8%);
  color: #40575e;
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.tag-item:hover {
  background: #b96835;
  border-color: #b96835;
  color: #fff;
}

/* --- خبرنامه --- */
.newsletter-widget {
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, #17343c 0%, #10272e 100%);
  color: #fff;
}
.newsletter-icon {
  display: block;
  margin: 0 auto 0.75rem;
  font-size: 2rem;
  color: #e2a56f;
}
.newsletter-title {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}
.newsletter-desc {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgb(255 255 255 / 60%);
  line-height: 1.7;
}
.newsletter-form {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.newsletter-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s ease;
}
.newsletter-input::placeholder {
  color: rgb(255 255 255 / 35%);
}
.newsletter-input:focus {
  border-color: #e2a56f;
}
.newsletter-btn {
  padding: 0.75rem;
  background: #d58e55;
  color: #10272e;
  font-size: 0.75rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background-color 0.2s ease;
}
.newsletter-btn:hover {
  background: #e6aa73;
}

/* --- CTA --- */
.cta-widget {
  display: block;
  padding: 1.75rem 1.25rem;
  background: #fff;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgb(23 52 60 / 10%);
  transition: all 0.3s ease;
}
.cta-widget:hover {
  border-color: #b96835;
  background: #f8f6f0;
}
.cta-widget-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 0.85rem;
  background: rgb(185 104 53 / 10%);
  color: #b96835;
  font-size: 1.15rem;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}
.cta-widget:hover .cta-widget-icon {
  background: #b96835;
  color: #fff;
}
.cta-widget-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #10272e;
}
.cta-widget-desc {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #607177;
  line-height: 1.7;
}
.cta-widget-link {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: #b96835;
}

#scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 1023px) {
  .sidebar-sticky {
    position: static;
  }
}
@media (max-width: 639px) {
  .article-card .card-image {
    aspect-ratio: 16 / 10;
  }
  .featured-title {
    font-size: 1.15rem;
  }
  .featured-slide-body {
    padding: 1.25rem;
  }
  .featured-slide {
    min-height: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .article-card .card-image img,
  .card-animate,
  .latest-news-list,
  .live-dot,
  .archive-widget-link {
    transition: none;
    animation: none;
    transform: none;
  }
}
