/* هدر تیره‌ی سراسری */
#tf-site-header{background:var(--tf-c-navy);position:relative;z-index:100;}

/* نوار تزئینی «لبه‌ی صفحه» — یه‌بار، سراسری، زیر هدر، رو کل سایت.
   دقیقاً همون تکنیک فوتر (دنده‌ریز + خط نارنجی)؛ جایگزین همه‌ی
   نسخه‌های تکراری «filmstrip» که قبلاً هر قالب صفحه جدا داشت. */
.tf-page-edge{
  height:14px;background:#111a26;
  border-top:1px solid #687383;border-bottom:2px solid var(--tf-c-orange);
  position:relative;overflow:hidden;
}
.tf-page-edge:before{
  content:"";position:absolute;inset:2px 0;
  background:repeating-linear-gradient(90deg,transparent 0 18px,#7d8794 18px 22px,transparent 22px 42px);
  opacity:.9;
}
.tf-header-inner{
  max-width:1180px;margin:0 auto;padding:16px 24px;
  display:flex;align-items:center;justify-content:space-between;gap:24px;
  font-family:'Vazirmatn','Tahoma',sans-serif;
}
/* order به‌جای row-reverse: خودکار با dir="rtl"/"ltr" هماهنگ می‌شه.
   لوگو همیشه اول (سمت شروع خط: راست تو فارسی، چپ تو انگلیسی)،
   بعد منو وسط، بعد دکمه (اگه باشه) آخر خط. */
.tf-header-logo{order:1;}
.tf-header-nav{order:2;}
.tf-header-search{order:3;}
.tf-header-cta{order:4;}
.tf-header-toggle{order:0;}

.tf-header-logo{display:flex;align-items:center;flex-shrink:0;}
.tf-header-logo img{height:var(--tf-logo-h,58px);width:auto;display:block;transition:height .2s;} /* اندازه از «لوگو و زبان» */
/* هاله‌ی سفید دور شکل لوگو (drop-shadow از شفافیت PNG/SVG پیروی می‌کند) — هدر، فوتر و پیش‌نمایش پیشخوان */
.has-logo-glow img{filter:drop-shadow(0 0 var(--tf-glow-r,12px) rgba(var(--tf-glow-rgb,255,255,255),var(--tf-glow-a,.55))) drop-shadow(0 0 calc(var(--tf-glow-r,12px) / 3) rgba(var(--tf-glow-rgb,255,255,255),var(--tf-glow-a,.55)));}

.tf-header-nav{flex:1;display:flex;justify-content:center;}
.tf-header-menu{display:flex;align-items:center;gap:28px;list-style:none;margin:0;padding:0;}
.tf-header-menu a{
  color:var(--tf-c-mist);text-decoration:none;font-size:14.5px;font-weight:500;transition:.2s;white-space:nowrap;
}
.tf-header-menu a:hover{color:var(--tf-c-orange-light);}
.tf-header-menu ul{list-style:none;margin:0;padding:8px 0;position:absolute;background:var(--tf-c-navy-2);border:1px solid rgba(255,255,255,0.1);min-width:180px;display:none;}
.tf-header-menu li{position:relative;}
.tf-header-menu li:hover > ul{display:block;}
.tf-header-menu ul li a{display:block;padding:8px 18px;}

.tf-header-cta{
  flex-shrink:0;height:44px;box-sizing:border-box;padding:0 22px;display:inline-flex;align-items:center;
  border:1px solid rgba(255,255,255,0.2);border-radius:2px;
  color:#ffe071;text-decoration:none;font-size:14px;font-weight:600;transition:.2s;
}
.tf-header-cta:hover{background:var(--tf-c-orange);border-color:var(--tf-c-orange);color:var(--tf-c-ink);}

.tf-header-toggle{display:none;flex-direction:column;gap:5px;background:none;border:none;cursor:pointer;padding:6px;flex-shrink:0;}
.tf-header-toggle span{width:22px;height:2px;background:#fff;display:block;}

@media(max-width:860px){
  .tf-header-toggle{display:flex;}
  .tf-header-nav{
    position:absolute;top:100%;right:0;left:0;background:var(--tf-c-navy);
    border-top:1px solid rgba(255,255,255,0.1);display:none;
  }
  .tf-header-nav.open{display:block;}
  .tf-header-menu{flex-direction:column;align-items:flex-start;gap:0;padding:10px 24px;}
  .tf-header-menu li{width:100%;}
  .tf-header-menu a{display:block;padding:12px 0;border-bottom:1px solid rgba(255,255,255,0.06);}
  .tf-header-menu ul{position:static;border:none;padding:0 0 0 16px;}
}

/* ---------- جستجو: دکمه‌ی هدر + پنل کشویی زیر هدر (inc/search.php، assets/js/header.js) ---------- */
.tf-header-search{
  flex-shrink:0;width:44px;height:44px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center; /* هم‌قد دکمه‌ی «ورود به آوید» */
  border:1px solid rgba(255,255,255,0.2);border-radius:2px;color:var(--tf-c-mist);transition:.2s;
}
.tf-header-search svg{width:20px;height:20px;display:block;}
.tf-header-search:hover,
.tf-header-search[aria-expanded="true"]{border-color:var(--tf-c-orange);color:var(--tf-c-orange-light);}

.tf-search-panel{
  display:none;position:absolute;top:100%;left:0;right:0;z-index:5;
  background:var(--tf-c-navy-2);border-top:1px solid rgba(255,255,255,0.1);border-bottom:2px solid var(--tf-c-orange);
  box-shadow:0 18px 40px rgba(0,0,0,.45);
}
.tf-search-panel:target,
.tf-search-panel.is-open{display:block;}
/* وقتی JS فعاله، فقط کلاس is-open پنل رو باز نگه می‌داره (:target فقط فال‌بک بدون JS است) */
.tf-js .tf-search-panel:not(.is-open){display:none;}
.tf-search-panel-inner{max-width:1180px;margin:0 auto;padding:18px 24px;display:flex;align-items:center;gap:14px;}
.tf-search-panel .tf-search-form{flex:1;}
.tf-search-close{
  flex-shrink:0;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;
  color:var(--tf-c-slate);font-size:30px;line-height:1;text-decoration:none;transition:.2s;
}
.tf-search-close:hover{color:#fff;}

/* خود فرم — مشترک بین پنل هدر و صفحه‌ی نتایج */
.tf-search-form{display:flex;align-items:stretch;font-family:'Vazirmatn','Tahoma',sans-serif;}
.tf-search-form input[type="search"]{
  flex:1;min-width:0;height:50px;margin:0;padding:0 18px;
  background:var(--tf-c-navy);color:#fff;border:1px solid rgba(255,255,255,0.15);border-inline-end:0;border-radius:0;
  font-size:16px;-webkit-appearance:none;appearance:none;outline:none;transition:border-color .2s;
}
.tf-search-form input[type="search"]::placeholder{color:var(--tf-c-slate);opacity:1;}
.tf-search-form input[type="search"]:focus{border-color:var(--tf-c-orange);}
.tf-search-form button{
  flex:0 0 56px;height:50px;margin:0;padding:0;display:flex;align-items:center;justify-content:center;
  background:var(--tf-c-orange);color:var(--tf-c-ink);border:0;border-radius:0;cursor:pointer;transition:background .2s;
}
.tf-search-form button:hover{background:var(--tf-c-orange-light);}
.tf-search-form button svg{width:21px;height:21px;display:block;}

@media(max-width:860px){
  .tf-header-inner{gap:14px;}
  .tf-header-logo img{height:min(var(--tf-logo-h,58px), 46px);}
  .tf-search-panel-inner{padding:14px 16px;gap:8px;}
}

/* مناطق تبلیغاتی و ویجت‌ها */
.tf-ad-zone,
.tf-zone{
  max-width:1180px;margin:20px auto;padding:0 24px;text-align:center;
}
.tf-ad-zone .tf-ad-label,
.tf-zone .tf-ad-label{
  display:block;font-size:11px;color:var(--tf-c-slate);margin-bottom:8px;
  font-family:'Vazirmatn','Tahoma',sans-serif;letter-spacing:0.5px;
}
.tf-ad-zone img{max-width:100%;height:auto;display:inline-block;}
.tf-ad-zone > a{display:inline-block;} /* فقط لینکِ تصویر تبلیغ، نه اسپاتلایت */

/* اسپاتلایت — بنرِ معرفیِ ویژه‌ی یه فیلم/مستند؛ هم عکس هم ویدیو */
.tf-spotlight{
  position:relative;overflow:hidden;border-radius:14px;
  display:flex;align-items:flex-end;text-align:right;
  min-height:340px;background:var(--tf-c-navy) no-repeat center/cover;
  text-decoration:none;color:#fff;
}
.tf-spotlight video,
.tf-spotlight iframe{
  position:absolute;inset:0;width:100%;height:100%;border:0;object-fit:cover;
}
/* یه گرادیانِ ملایم فقط زیرِ متن — نه یه باکسِ جدا، فقط برای خواناتر شدنِ
   نوشته؛ عکس/ویدیوی پشتش کاملاً دیده می‌مونه */
.tf-spotlight::before{
  content:'';position:absolute;inset:0;
  background:linear-gradient(0deg, rgba(3,7,15,.68) 0%, rgba(3,7,15,.28) 42%, rgba(3,7,15,0) 68%);
  pointer-events:none;
}
.tf-spotlight-body{
  position:relative;z-index:1;
  padding:26px 28px;
  max-width:600px;
}
.tf-spotlight-eyebrow{font-size:12px;color:var(--tf-c-orange-light);margin-bottom:10px;letter-spacing:.04em;font-family:Consolas,Monaco,monospace;text-shadow:0 1px 6px rgba(0,0,0,.6);}
.tf-spotlight-body h3{font-size:clamp(20px,3vw,30px);font-weight:900;margin:0 0 10px;color:#fff;text-shadow:0 2px 10px rgba(0,0,0,.65);}
.tf-spotlight-body p{font-size:14px;color:var(--tf-c-mist);margin:0;line-height:1.8;text-shadow:0 1px 8px rgba(0,0,0,.6);}
/* دکمه از متن جدا شده و گوشه‌ی چپِ پایینِ کل بنر می‌شینه — یه CTA
   مستقل، نه بخشی از متنِ اصلی */
.tf-spotlight-btn{
  position:absolute;
  left:28px;bottom:26px;z-index:2;
  display:inline-flex;align-items:center;gap:8px;padding:11px 24px;border-radius:2px;
  background:var(--tf-c-orange);color:var(--tf-c-ink);font-weight:700;font-size:13px;
}
/* تیره‌شدن ملایم بالای بنر، زیر عنوان و توضیحات — تا متن سفید روی عکس/ویدیوی روشن خوانا بماند */
.tf-spotlight::after{
  content:'';position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(180deg, rgba(3,7,15,.62) 0%, rgba(3,7,15,.25) 30%, rgba(3,7,15,0) 55%);
}

/* اسپاتلایت تمام‌عرض داخل جایگاه تبلیغ */
.tf-ad-zone .tf-spotlight,
.tf-zone .tf-spotlight{width:100%;}

/* اسپاتلایت ویدیویی: ویدیو پس‌زمینه‌ی کل کادر (cover)، متن و دکمه روی آن.
   لایه‌ها: ویدیو (0) ← گرادیان ::before (1) ← متن (2) ← دکمه (3) */
.tf-spotlight.has-video{aspect-ratio:21/9;min-height:300px;background:#000;}
.tf-spotlight-bg{position:absolute;z-index:0;pointer-events:none;border:0;}
video.tf-spotlight-bg{inset:0;width:100%;height:100%;object-fit:cover;}
/* iframe را نمی‌شود object-fit کرد: یک قاب ۱۶:۹ که همیشه از کادر بزرگ‌تر است، وسط‌چین */
iframe.tf-spotlight-bg{
  inset:auto;top:50%;left:50%; /* inset:auto: قاعده‌ی کلی .tf-spotlight iframe (inset:0) را خنثی می‌کند؛ وگرنه در RTL، left نادیده گرفته می‌شود */transform:translate(-50%,-50%);
  width:max(100%, calc(100cqh * 16 / 9));height:max(100%, calc(100cqw * 9 / 16));
}
.tf-spotlight.has-video{container-type:size;}
.tf-spotlight.has-video::before{z-index:1;}
.tf-spotlight.has-video::after{z-index:1;}
.tf-spotlight.has-video .tf-spotlight-body{z-index:2;}
.tf-spotlight.has-video .tf-spotlight-btn{z-index:3;}
@media(max-width:860px){
  .tf-spotlight.has-video{aspect-ratio:16/9;min-height:0;}
}
@media(prefers-reduced-motion:reduce){
  video.tf-spotlight-bg{display:none;} /* فقط پوستر/پس‌زمینه */
}

@media(max-width:640px){
  .tf-spotlight{min-height:260px;}
  .tf-spotlight-body{padding:18px 20px 76px;}
  .tf-spotlight-btn{left:16px;bottom:16px;padding:9px 18px;font-size:12px;}
}

/* ===================== آیکونِ دسته‌بندی (inc/category-icons.php) =====================
   یک آیکون برای هر دسته، همه‌جای سایت: برچسب‌ها، کارت‌ها، صفحه‌ی دسته، درباره ما، فعالیت‌های ما */
.tf-cat-ico{
  display:inline-flex;align-items:center;justify-content:center;
  width:1.15em;height:1.15em;flex:0 0 auto;
  margin-inline-end:.4em;vertical-align:-.18em;
  color:inherit;line-height:1;
}
.tf-cat-ico svg,.tf-cat-ico img{width:100%;height:100%;display:block;object-fit:contain;}
/* سربرگِ صفحه‌ی دسته: آیکون در دایره‌ی نارنجی کنارِ عنوان */
.tf-cat-ico--hero{
  width:1.3em;height:1.3em;border-radius:50%;
  margin-inline-end:.35em;vertical-align:-.22em;
  color:var(--tf-gold,#d98a3d);background:rgba(217,138,61,.1);border:1px solid rgba(217,138,61,.4);
}
.tf-cat-ico--hero svg,.tf-cat-ico--hero img{width:52%;height:52%;}
/* آیکونِ آپلودیِ غیر SVG داخلِ دایره‌های «فعالیت‌های ما» و آکاردئونِ «درباره ما» */
.tf-acc-icon svg{display:block;}
