/* ==========================================================
   مجله فقه هنر - قالب استاندارد
   زبان بصری: سرمه‌ای / کرم / طلایی
   فونت: وزیرمتن
   ========================================================== */

/* ---------- متغیرهای پایه (fallback در صورت نبود style.css) ---------- */
:root {
  --navy-900: #0b1e33;
  --navy-800: #102a44;
  --navy-700: #17385c;
  --gold-300: #e9cf9a;
  --gold-400: #d9b877;
  --gold-500: #c8a35a;
  --gold-600: #a9853f;
  --cream: #f7f3ea;
  --paper: #ffffff;
  --ink: #1c2b3a;
  --muted: #71808f;
  --title-red: #710e11;
  --trans: .35s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- اجبار فونت وزیرمتن ---------- */
.fh-page,
.fh-page *,
.fh-page *::before,
.fh-page *::after {
  font-family: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif !important;
}

.fh-page {
  background: var(--cream);
  padding-top: 90px;
  color: var(--ink);
  line-height: 1.8;
}

.fh-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================
   منوی چسبان (TOC)
   ========================================================== */
.fh-toc {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: rgba(247, 243, 234, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #ece4d2;
  padding: 14px 0;
  box-shadow: 0 4px 16px rgba(11, 30, 51, 0.05);
}
.fh-toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.fh-toc li a {
  display: inline-block;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-800);
  border: 1px solid rgba(200, 163, 90, 0.3);
  border-radius: 999px;
  background: var(--paper);
  transition: var(--trans);
  text-decoration: none;
  white-space: nowrap;
}
.fh-toc li a:hover,
.fh-toc li a.active {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #fff;
  border-color: var(--gold-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(200, 163, 90, 0.3);
}

/* ==========================================================
   تصویر اصلی مجله
   ========================================================== */
.fh-hero {
  padding: 30px 0 50px;
}
.fh-hero img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(11, 30, 51, 0.18);
  display: block;
}

/* ==========================================================
   بخش‌ها
   ========================================================== */
.fh-section {
  padding: 60px 0;
}
.fh-section-dark {
  background: linear-gradient(180deg, #1a2d47 0%, var(--navy-800) 100%);
  color: #f4eee1;
}
.fh-section-navy {
  background: linear-gradient(180deg, var(--navy-900) 0%, #0a1a2e 100%);
  color: #f4eee1;
}

/* ---------- هدر بخش ---------- */
.fh-section-head {
  text-align: center;
  margin-bottom: 45px;
  padding: 0 20px;
}
.fh-section-title {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 900;
  display: inline-block;
  padding: 0 24px;
  position: relative;
}
.fh-section-title span {
  color: var(--title-red);
  position: relative;
  z-index: 1;
}
.fh-section-dark .fh-section-title span,
.fh-section-navy .fh-section-title span {
  color: var(--gold-300);
}
.fh-section-title::before,
.fh-section-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 80px;
  height: 2px;
  transform: translateY(-50%);
}
.fh-section-title::before {
  right: 100%;
  margin-right: 18px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}
.fh-section-title::after {
  left: 100%;
  margin-left: 18px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
}

/* ==========================================================
   سرمقاله
   ========================================================== */
.fh-editorial-row {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 30px;
  align-items: start;
  background: var(--paper);
  padding: 32px;
  border-radius: 18px;
  border: 1px solid #ece4d2;
  box-shadow: 0 8px 24px rgba(11, 30, 51, 0.08);
  position: relative;
  overflow: hidden;
}
.fh-editorial-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, var(--gold-400), var(--gold-600));
}
.fh-editorial-img {
  background: linear-gradient(135deg, #f7f3ea, #ede4cc);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #ece4d2;
  text-align: center;
}
.fh-editorial-img img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 3px solid var(--gold-400);
  box-shadow: 0 8px 20px rgba(11, 30, 51, 0.12);
}
.fh-editorial-text p {
  font-size: 1.02rem;
  line-height: 2.2;
  color: var(--ink);
  text-align: justify;
  margin: 0;
}

/* ==========================================================
   بلوک استاد
   ========================================================== */
.fh-scholar-block {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px dashed #e5ddc9;
}
.fh-section-dark .fh-scholar-block,
.fh-section-navy .fh-scholar-block {
  border-bottom-color: rgba(233, 207, 154, 0.2);
}
.fh-scholar-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.fh-scholar-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy-800);
  padding: 10px 22px;
  background: linear-gradient(135deg, rgba(200, 163, 90, 0.15), rgba(200, 163, 90, 0.08));
  border: 1.5px solid rgba(200, 163, 90, 0.35);
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 20px;
  line-height: 1.6;
}
.fh-name-light {
  color: var(--gold-300);
  background: rgba(200, 163, 90, 0.1);
  border-color: rgba(233, 207, 154, 0.4);
}

.fh-block-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy-800);
  padding: 12px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(200, 163, 90, 0.15), rgba(200, 163, 90, 0.05));
  border-right: 4px solid var(--gold-500);
  border-radius: 8px;
}
.fh-section-navy .fh-block-title,
.fh-section-dark .fh-block-title {
  color: var(--gold-300);
  background: rgba(200, 163, 90, 0.1);
}

/* ==========================================================
   ردیف محتوا (Grid سیستم)
   ========================================================== */
.fh-content-row {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
.fh-content-row:last-child {
  margin-bottom: 0;
}
.fh-content-row.fh-reversed {
  grid-template-columns: 3fr 1fr;
}
.fh-col-1-4,
.fh-col-3-4 {
  min-width: 0;
}

/* ---------- تصویر استاد ---------- */
.fh-scholar-img {
  background: linear-gradient(135deg, #f7f3ea, #ede4cc);
  padding: 12px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid #ece4d2;
  position: sticky;
  top: 180px;
}
.fh-section-navy .fh-scholar-img,
.fh-section-dark .fh-scholar-img {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border-color: rgba(233, 207, 154, 0.25);
}
.fh-scholar-img img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 4px solid var(--gold-400);
  box-shadow: 0 8px 20px rgba(200, 163, 90, 0.35);
  transition: var(--trans);
  display: block;
  margin: 0 auto;
}
.fh-scholar-img:hover img {
  transform: scale(1.05);
  border-color: var(--gold-600);
}

/* ---------- کارت متن ---------- */
.fh-content-text {
  background: var(--paper);
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid #ece4d2;
  box-shadow: 0 4px 16px rgba(11, 30, 51, 0.05);
  transition: var(--trans);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fh-content-text:hover {
  box-shadow: 0 12px 32px rgba(11, 30, 51, 0.12);
  border-color: var(--gold-400);
  transform: translateY(-3px);
}

/* کارت تیره (روشن روی پس‌زمینه سرمه‌ای) */
.fh-text-light {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(233, 207, 154, 0.25);
  color: #f4eee1;
}
.fh-text-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold-400);
}

/* کارت سرمه‌ای */
.fh-navy-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border-color: rgba(233, 207, 154, 0.25);
  color: #f4eee1;
  backdrop-filter: blur(4px);
}
.fh-navy-card:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  border-color: var(--gold-400);
}

/* ---------- عنوان مقاله ---------- */
.fh-article-title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.9;
  margin: 0 0 16px 0;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold-400);
  color: var(--navy-800);
}
.fh-article-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--trans);
  display: block;
}
.fh-article-title a:hover {
  color: var(--gold-600);
}

/* عنوان روشن در کارت تیره */
.fh-text-light .fh-article-title,
.fh-navy-card .fh-article-title {
  color: var(--gold-300);
}
.fh-text-light .fh-article-title a:hover,
.fh-navy-card .fh-article-title a:hover {
  color: #fff;
}

/* ---------- پاراگراف ---------- */
.fh-content-text p {
  font-size: 0.98rem;
  line-height: 2.1;
  color: var(--ink);
  text-align: justify;
  margin: 0;
}
.fh-text-light p,
.fh-navy-card p {
  color: #e8e0c8;
}

/* ==========================================================
   تصویر پایانی
   ========================================================== */
.fh-footer-image {
  padding: 40px 0 70px;
}
.fh-footer-image img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(11, 30, 51, 0.15);
  display: block;
}

/* ==========================================================
   انیمیشن ورود - نسخه ایمن (هرگز صفحه را خالی نمی‌گذارد)
   ========================================================== */

/* اگر جاوااسکریپت به هر دلیلی اجرا نشد، هیچ چیزی مخفی نماند */
html:not(.js) .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* انیمیشن فقط وقتی JS فعال است */
html.js .fh-page .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js .fh-page .reveal.in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ==========================================================
   واکنش‌گرایی
   ========================================================== */
@media (max-width: 992px) {
  .fh-editorial-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .fh-editorial-img {
    max-width: 380px;
    margin: 0 auto;
  }
  .fh-content-row,
  .fh-content-row.fh-reversed {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .fh-scholar-img {
    position: relative;
    top: 0;
    max-width: 220px;
    margin: 0 auto;
  }
  .fh-toc {
    top: 70px;
  }
  .fh-toc ul {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .fh-toc li {
    flex-shrink: 0;
  }
  .fh-section-title::before,
  .fh-section-title::after {
    width: 50px;
  }
}

@media (max-width: 600px) {
  .fh-page {
    padding-top: 80px;
  }
  .fh-section {
    padding: 40px 0;
  }
  .fh-editorial-row,
  .fh-content-text {
    padding: 20px;
  }
  .fh-section-title {
    font-size: 1.3rem;
  }
  .fh-section-title::before,
  .fh-section-title::after {
    width: 30px;
    margin-right: 10px;
    margin-left: 10px;
  }
  .fh-scholar-name {
    font-size: 0.95rem;
    padding: 8px 16px;
  }
  .fh-block-title {
    font-size: 0.95rem;
    padding: 10px 16px;
  }
  .fh-article-title {
    font-size: 0.98rem;
  }
  .fh-content-text p {
    font-size: 0.92rem;
    line-height: 2;
  }
  .fh-toc li a {
    font-size: 0.78rem;
    padding: 6px 12px;
  }
  .fh-scholar-img {
    max-width: 180px;
  }
  .fh-scholar-img img {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fh-content-text,
  .fh-scholar-img img,
  .fh-toc li a,
  .fh-page .reveal {
    transition: none;
  }
  .fh-content-text:hover,
  .fh-toc li a:hover {
    transform: none;
  }
  .fh-page .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================
   اسکرول نرم
   ========================================================== */
html {
  scroll-behavior: smooth;
}