/* blog-header.css - استایل‌های هدر بلاگ | شهبازیون */
/* هماهنگ با پالت طلایی و روشن + هدر شناور حرفه‌ای */

/* ===== هدر بلاگ (حالت عادی) ===== */
.blog-header {
  position: relative;
  background: var(--header-bg);
  color: var(--text-color);
  padding: clamp(2.5rem, 6vw, 4rem) 2rem;
  text-align: center;
  overflow: hidden;
  margin-bottom: 3rem;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  transition: all 0.35s ease; /* نرمی تغییرات */
}

.blog-header .header-text {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.blog-header h1 {
  color: var(--text-color);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  font-weight: 700;
}

.blog-header .subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto 2rem;
  font-weight: 400;
  line-height: 1.6;
}

.header-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.stat-item {
  background: rgba(201,168,76,0.08);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-color);
  border: 1px solid rgba(201,168,76,0.15);
}

.header-video-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 1;
}

.header-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;          /* بسیار محو */
  filter: brightness(1.1);
}

.header-link {
  position: relative;
  z-index: 2;
  margin-top: 2rem;
}

.site-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(201,168,76,0.25);
}

.site-link:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(201,168,76,0.3);
}

/* ===== هدر شناور (زمانی که کلاس scrolled اضافه شود) ===== */
.blog-header.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.6rem 1.5rem;
  margin-bottom: 0;
  border-radius: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* مخفی کردن محتوای اصلی در حالت شناور */
.blog-header.scrolled .header-text,
.blog-header.scrolled .header-link,
.blog-header.scrolled .header-video-wrapper {
  display: none;
}

/* محتوای جدید مخصوص حالت شناور (در حالت عادی مخفی) */
.scrolled-content {
  display: none;
}

.blog-header.scrolled .scrolled-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ----- عناصر داخل scrolled-content ----- */

/* ایموجی چرخان */
.rotating-emoji {
  display: inline-block;
  font-size: 1.8rem;
  animation: rotate-emoji 3s linear infinite;
  filter: drop-shadow(0 0 4px rgba(201,168,76,0.5));
}

@keyframes rotate-emoji {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* لینک سایت اصلی */
.scrolled-site-link {
  background: var(--primary-color);
  color: #fff;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scrolled-site-link:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* متن چشمک‌زن (fade in/out) */
.blinking-text {
  font-size: 0.95rem;
  color: var(--text-color);
  animation: blink 2s ease-in-out infinite;
  white-space: nowrap;
  font-weight: 500;
}

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* متن متحرک (رفت و برگشت چپ به راست) */
.marquee-container {
  overflow: hidden;
  width: 220px; /* عرض محدود برای حرکت */
  position: relative;
  height: 1.6rem;
}

.marquee-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--text-light);
  animation: marquee 8s ease-in-out infinite alternate;
  position: absolute;
  will-change: transform;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ===== حالت تاریک برای هدر ===== */
body.dark-mode .blog-header {
  background: #2b2b2b;
  border-bottom-color: rgba(201,168,76,0.3);
}

body.dark-mode .blog-header h1,
body.dark-mode .blog-header .subtitle {
  color: #e0d6c2;
}

body.dark-mode .stat-item {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.2);
  color: #e0d6c2;
}

body.dark-mode .blog-header.scrolled {
  background: rgba(30,30,30,0.92);
  border-bottom-color: rgba(201,168,76,0.4);
}

body.dark-mode .blinking-text,
body.dark-mode .marquee-text {
  color: #e0d6c2;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
  .blog-header {
    padding: 2.5rem 1.5rem;
  }
  
  .blog-header h1 {
    font-size: 2.2rem;
  }
  
  .header-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .blog-header.scrolled .scrolled-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }
  .marquee-container {
    width: 160px;
  }
}

@media (max-width: 480px) {
  .blog-header {
    padding: 2rem 1rem;
  }
  
  .blog-header h1 {
    font-size: 1.6rem;
  }
  
  .header-stats .stat-item {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}