/*
Theme Name: Eqbal Minimal 2027
Description: قالب مینیمال و یکدست برای زیرسایت‌های واحدهای دانشگاه اقبال لاهوری. بدون هیچ اسکریپت یا فونت خارجی.
Author: Eqbal Lahoori Higher Education Institute
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: eqbal-minimal
*/

/* ---------- Font: IRANYekan (local, variable) ---------- */
@font-face{
  font-family:"IRANYekan";
  src:url("assets/fonts/IRANYekanXVF.woff2") format("woff2"),
      url("assets/fonts/IRANYekanXVF.woff") format("woff");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}

:root{
  --navy:#1a2a4f;
  --blue:#2b6cb0;
  --bg:#ffffff;
  --soft:#f5f7fb;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e9f2;
  --radius:12px;
  --max:1180px;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:"IRANYekan",Tahoma,"Segoe UI",system-ui,sans-serif;
  font-size:1rem;line-height:1.9;
}
img,video,iframe{max-width:100%;height:auto}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3,h4{color:var(--navy);line-height:1.5;margin:.6em 0 .4em;font-weight:700}
h1{font-size:2rem}
h2{font-size:1.5rem}
h3{font-size:1.25rem}
p{margin:0 0 1.1em}
:focus-visible{outline:3px solid #9cc3ec;outline-offset:2px}

.container{width:min(100% - 2.5rem,var(--max));margin-inline:auto}
.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);width:1px;height:1px;overflow:hidden;word-wrap:normal}
.skip-link:focus{position:fixed;top:.5rem;inset-inline-start:.5rem;width:auto;height:auto;clip:auto;background:#fff;color:var(--navy);padding:.5rem 1rem;border-radius:8px;z-index:100}

/* ---------- Header ---------- */
.site-header{background:var(--navy);color:#fff;position:sticky;top:0;z-index:50}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;flex-wrap:wrap}
.site-branding{display:flex;flex-direction:column}
.site-title{color:#fff;font-weight:700;font-size:1.2rem}
.site-title:hover{text-decoration:none;opacity:.9}
.site-desc{margin:0;font-size:.85rem;opacity:.75}
.custom-logo{max-height:56px;width:auto}

.main-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:1.25rem;flex-wrap:wrap}
.main-nav li{position:relative}
.main-nav a{color:#fff;opacity:.9;display:inline-block;padding:.25rem 0;border-bottom:2px solid transparent}
.main-nav a:hover{opacity:1;text-decoration:none}
.main-nav .current-menu-item>a,.main-nav .current_page_item>a,.main-nav .current-menu-ancestor>a{opacity:1;border-color:#9cc3ec}
.main-nav .sub-menu{display:none;position:absolute;top:100%;inset-inline-start:0;background:var(--navy);flex-direction:column;gap:0;min-width:220px;padding:.5rem 0;border-radius:8px;box-shadow:0 12px 30px rgba(0,0,0,.2)}
.main-nav li:hover>.sub-menu,.main-nav li:focus-within>.sub-menu{display:flex}
.main-nav .sub-menu a{display:block;padding:.5rem 1rem;border:0}

.menu-toggle{display:none;background:none;border:0;cursor:pointer;width:44px;height:44px;padding:0;position:relative}
.menu-toggle .bars{position:absolute;top:50%;inset-inline-start:11px;width:22px;height:2px;background:#fff;margin-top:-1px}
.menu-toggle .bars::before,.menu-toggle .bars::after{content:"";position:absolute;inset-inline-start:0;width:22px;height:2px;background:#fff}
.menu-toggle .bars::before{top:-7px}
.menu-toggle .bars::after{top:7px}

@media (max-width:820px){
  .menu-toggle{display:block}
  .main-nav{display:none;width:100%}
  .main-nav.is-open{display:block}
  .main-nav ul{flex-direction:column;gap:0;padding:.5rem 0}
  .main-nav a{display:block;padding:.65rem 0;border-bottom:1px solid rgba(255,255,255,.08)}
  .main-nav .sub-menu{display:flex;position:static;background:none;box-shadow:none;padding-inline-start:1rem;min-width:0}
  .main-nav .sub-menu a{padding:.4rem 0}
}

/* ---------- Layout ---------- */
.site-main{min-height:60vh;padding:2.5rem 0 3rem}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:2.5rem;align-items:start}
.layout.no-sidebar{grid-template-columns:minmax(0,1fr)}
@media (max-width:900px){.layout{grid-template-columns:minmax(0,1fr)}}

.archive-header{margin-bottom:2rem;padding:1.5rem;background:var(--soft);border-radius:var(--radius);border-inline-start:4px solid var(--navy)}
.archive-header h1{margin:0 0 .3rem;font-size:1.6rem}
.archive-header .description{color:var(--muted);margin:0}

.section-title{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;margin:3rem 0 1.25rem;border-bottom:1px solid var(--line);padding-bottom:.6rem}
.section-title h2{margin:0;font-size:1.3rem}

/* ---------- Cards ---------- */
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1.5rem}
.post-card{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .2s,transform .2s}
.post-card:hover{box-shadow:0 10px 30px rgba(26,42,79,.08);transform:translateY(-2px)}
.post-card img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover}
.post-card .body{padding:1.1rem 1.25rem 1.4rem}
.post-card h2{font-size:1.1rem;margin:.3rem 0 .5rem}
.post-card h2 a{color:var(--navy)}
.post-card p{color:var(--muted);font-size:.93rem;margin:0}

.meta{font-size:.85rem;color:var(--muted);display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}
.meta a{color:var(--muted)}

/* ---------- Single / Page ---------- */
.entry-header{margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid var(--line)}
.entry-header h1{margin:.4rem 0 0}
.entry-thumb{margin:0 0 1.5rem}
.entry-thumb img{border-radius:var(--radius);width:100%}
.entry-content{font-size:1.02rem}
.entry-content .alignwide{max-width:var(--max);margin-inline:auto}
.entry-content .alignfull{width:100vw;max-width:100vw;margin-inline:calc(50% - 50vw)}
.entry-content blockquote{border-inline-start:4px solid var(--blue);margin:1.5rem 0;padding:.6rem 1.25rem;background:var(--soft);border-radius:8px}
.entry-content table{width:100%;border-collapse:collapse;margin:1rem 0}
.entry-content th,.entry-content td{border:1px solid var(--line);padding:.6rem .8rem;text-align:start}
.entry-content th{background:var(--soft);color:var(--navy)}
.entry-content hr,.wp-block-separator{border:0;border-top:1px solid var(--line);margin:2rem 0}
.entry-content .wp-block-button__link{background:var(--navy);color:#fff;border-radius:999px;padding:.6rem 1.4rem;text-decoration:none}
.entry-content .wp-block-button__link:hover{background:var(--blue)}
.entry-content .wp-block-cover{border-radius:var(--radius);overflow:hidden}
.entry-content .wp-block-image figcaption,.entry-content figcaption{color:var(--muted);font-size:.88rem;text-align:center}
.entry-content .wp-block-pullquote{border-top:3px solid var(--navy);border-bottom:3px solid var(--navy)}
.entry-footer{margin-top:2.5rem;padding-top:1.25rem;border-top:1px solid var(--line);font-size:.92rem}
.tag-cloud a,.post-tags a{display:inline-block;border:1px solid var(--line);padding:.2rem .75rem;border-radius:999px;margin:.2rem .2rem .2rem 0;font-size:.85rem;color:var(--text)}
.tag-cloud a:hover,.post-tags a:hover{border-color:var(--blue);color:var(--blue);text-decoration:none}

.post-navigation{margin-top:2.5rem}
.nav-links{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.nav-links a{display:block;padding:1rem 1.25rem;border:1px solid var(--line);border-radius:var(--radius);color:var(--navy);max-width:48%}
.nav-links a:hover{border-color:var(--blue);text-decoration:none}
.nav-subtitle{display:block;font-size:.8rem;color:var(--muted)}

/* ---------- Section nav (pages with parents) ---------- */
.section-nav ul{list-style:none;margin:0;padding:0}
.section-nav ul ul{padding-inline-start:1rem}
.section-nav li a{display:block;padding:.45rem 0;color:var(--text);border-bottom:1px solid var(--line)}
.section-nav li.current_page_item>a,.section-nav li.current-menu-item>a{color:var(--blue);font-weight:700}
.section-nav .widget-title a{color:var(--navy)}

/* ---------- Pagination ---------- */
.pagination{margin-top:2.5rem}
.nav-links-pages{display:flex;gap:.4rem;justify-content:center;flex-wrap:wrap}
.page-numbers{padding:.4rem .9rem;border:1px solid var(--line);border-radius:8px;color:var(--navy);display:inline-block}
.page-numbers:hover{text-decoration:none;border-color:var(--blue)}
.page-numbers.current{background:var(--navy);color:#fff;border-color:var(--navy)}

/* ---------- Forms ---------- */
.search-form{display:flex;gap:.5rem}
.search-field,input[type="text"],input[type="email"],input[type="url"],input[type="search"],textarea{
  flex:1;width:100%;padding:.6rem .9rem;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff;color:var(--text)
}
.search-field:focus,input:focus,textarea:focus{border-color:var(--blue);outline:none}
.search-submit,input[type="submit"],button{
  background:var(--navy);color:#fff;border:0;padding:.6rem 1.2rem;border-radius:8px;cursor:pointer;font:inherit
}
.search-submit:hover,input[type="submit"]:hover{background:var(--blue)}

/* ---------- Comments ---------- */
.comments-area{margin-top:3rem;border-top:1px solid var(--line);padding-top:2rem}
.comment-list{list-style:none;padding:0}
.comment-body{padding:1rem 0;border-bottom:1px solid var(--line)}
.comment-meta{font-size:.85rem;color:var(--muted)}
.comment-form label{display:block;margin-bottom:.3rem;font-size:.9rem}
.comment-form p{margin-bottom:1rem}

/* ---------- Widgets ---------- */
.widget{margin-bottom:2rem}
.widget-title{font-size:1.05rem;color:var(--navy);border-bottom:2px solid var(--blue);padding-bottom:.4rem;margin:0 0 1rem}
.widget ul{list-style:none;padding:0;margin:0}
.widget li{padding:.45rem 0;border-bottom:1px solid var(--line)}
.widget .search-form{flex-direction:column}

/* ---------- Front page ---------- */
.front-hero{background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff;padding:4.5rem 0}
.front-hero .container{width:min(100% - 2.5rem,var(--max))}
.front-hero h1{color:#fff;font-size:2.4rem;margin-top:0}
.front-hero p{opacity:.9;max-width:44rem;margin:0}
.front-content{margin-bottom:1rem}

/* ---------- 404 ---------- */
.not-found{text-align:center;padding:4rem 0}

/* ---------- Footer ---------- */
.site-footer{background:var(--soft);border-top:1px solid var(--line);margin-top:3rem;padding-top:2.5rem;font-size:.92rem;color:var(--muted)}
.footer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:2rem}
.footer-menu ul{list-style:none;padding:0;margin:0}
.footer-menu a{color:var(--navy);display:block;padding:.25rem 0}
.footer-bottom{border-top:1px solid var(--line);margin-top:2rem;padding:1.25rem 0 2rem;text-align:center}
.footer-bottom p{margin:0}
.footer-bottom a{color:var(--navy)}

/* ---------- Blocks ---------- */
.wp-block-button__link{background:var(--navy);color:#fff}
.has-navy-background-color{background-color:var(--navy)!important;color:#fff}

@media print{
  .site-header,.site-footer,.sidebar,.menu-toggle,.post-navigation,.comments-area{display:none}
  .layout{display:block}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* =========================================================
   صفحه اصلی — طراحی اختصاصی
   ========================================================= */
.home-hero{
  position:relative;color:#fff;padding:4.5rem 0 8rem;overflow:hidden;background:var(--navy);
  background-image:
    radial-gradient(circle at 88% 15%,rgba(43,108,176,.55),transparent 42%),
    radial-gradient(circle at 8% 100%,rgba(43,108,176,.35),transparent 38%),
    linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);
  background-size:auto,auto,44px 44px,44px 44px;
}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:3rem;align-items:center}
.hero-kicker{display:inline-block;font-size:.9rem;color:#bcd8f3;border:1px solid rgba(156,195,236,.4);padding:.25rem .9rem;border-radius:999px;margin-bottom:1.1rem}
.home-hero h1{color:#fff;font-size:2.9rem;line-height:1.35;margin:0 0 .75rem}
.hero-desc{font-size:1.08rem;opacity:.85;max-width:36rem;margin:0 0 1.75rem}
.hero-search .search-field{background:rgba(255,255,255,.97);border:0;padding:.8rem 1rem}
.hero-search .search-submit{background:var(--blue);padding:.8rem 1.4rem}
.hero-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.9rem}
.stat{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);border-radius:var(--radius);padding:1.2rem 1rem;backdrop-filter:blur(2px)}
.stat strong{display:block;font-size:1.9rem;line-height:1.2;color:#fff;font-weight:800}
.stat span{font-size:.92rem;opacity:.8}

.quick-links{position:relative;z-index:2;margin-top:-4.5rem}
.quick-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem}
.quick-item{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:1.3rem 1.2rem;display:flex;flex-direction:column;gap:.7rem;color:var(--navy);box-shadow:0 14px 34px rgba(26,42,79,.10);transition:transform .2s,border-color .2s,box-shadow .2s}
.quick-item:hover{transform:translateY(-3px);border-color:var(--blue);box-shadow:0 18px 40px rgba(26,42,79,.16);text-decoration:none}
.quick-item svg{width:30px;height:30px;stroke:var(--blue);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.quick-item b{font-size:.98rem;line-height:1.6}

.home-section{padding-top:4rem}
.section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap}
.section-head h2{margin:0;font-size:1.65rem}
.eyebrow{display:block;color:var(--blue);font-size:.84rem;font-weight:700;margin-bottom:.2rem;letter-spacing:.01em}
.more-link{font-weight:700;white-space:nowrap;padding-bottom:.2rem}

.ann-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:1.5rem;align-items:stretch}
.ann-feature{position:relative;border-radius:var(--radius);overflow:hidden;background:var(--navy);color:#fff;min-height:380px;display:flex;align-items:flex-end;margin:0}
.ann-feature img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.35}
.ann-feature::after{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgba(26,42,79,.95) 20%,rgba(26,42,79,.2) 80%)}
.ann-body{position:relative;z-index:1;padding:2rem}
.ann-feature h3{color:#fff;font-size:1.6rem;line-height:1.6;margin:.4rem 0 .6rem}
.ann-feature h3 a{color:#fff}
.ann-feature h3 a:hover{text-decoration:underline}
.ann-feature p{opacity:.85;margin:0;max-width:40rem}
.ann-list{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:var(--radius);background:#fff;overflow:hidden}
.ann-list li{display:flex;gap:1rem;padding:1rem 1.2rem;border-bottom:1px solid var(--line);align-items:center;transition:background .15s}
.ann-list li:last-child{border-bottom:0}
.ann-list li:hover{background:var(--soft)}
.date-box{flex:0 0 58px;height:58px;border-radius:10px;background:var(--soft);color:var(--navy);display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1;border:1px solid var(--line)}
.date-box b{font-size:1.25rem}
.date-box small{font-size:.72rem;color:var(--muted)}
.ann-list a{color:var(--text);font-weight:700;font-size:.97rem;line-height:1.7}
.ann-list a:hover{color:var(--blue);text-decoration:none}

.front-content{margin-top:3.5rem}


@media (max-width:900px){
  .hero-grid{grid-template-columns:1fr}
  .home-hero{padding:3rem 0 7rem}
  .home-hero h1{font-size:2.2rem}
  .ann-grid{grid-template-columns:1fr}
  .ann-feature{min-height:300px}
}
@media (max-width:520px){
  .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
  .stat strong{font-size:1.6rem}
}

/* =========================================================
   اصلاح فاصله بالای صفحه اصلی + جلوه‌های طراحی
   ========================================================= */

/* حذف فاصله‌ی بالای main در صفحه اصلی تا هیرو به هدر بچسبد */
.home .site-main{padding:0}

/* هیرو با لبه‌ی گرد پایین */
.home-hero{
  border-radius:0 0 56px 56px;
  padding:5rem 0 9rem;
  box-shadow:0 20px 40px rgba(26,42,79,.18);
}
.home-hero::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.04),transparent 40%);
}
.home-hero h1{font-size:3.1rem;font-weight:800;letter-spacing:-.01em}
.hero-kicker{background:rgba(255,255,255,.06);backdrop-filter:blur(4px)}
.hero-search .search-field{border-radius:999px;padding-inline:1.2rem}
.hero-search .search-submit{border-radius:999px}

/* آمار: کارت‌های شیشه‌ای با نوار تأکیدی */
.stat{
  position:relative;overflow:hidden;
  background:linear-gradient(160deg,rgba(255,255,255,.14),rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.18);
  text-align:start;
}
.stat::before{
  content:"";position:absolute;top:0;inset-inline:0;height:3px;
  background:linear-gradient(90deg,#9cc3ec,#2b6cb0);
}
.stat strong{font-variant-numeric:lining-nums}

/* دسترسی سریع: کاشی‌های آیکون‌دار */
.quick-links{margin-top:-5.5rem}
.quick-item{
  border-radius:20px;padding:1.4rem 1.25rem;
  border:1px solid rgba(26,42,79,.06);
  box-shadow:0 18px 40px rgba(26,42,79,.12);
}
.quick-item svg{
  width:24px;height:24px;padding:12px;box-sizing:content-box;
  background:linear-gradient(135deg,#e8f1fb,#d6e6f7);
  border-radius:14px;stroke:var(--navy);
}
.quick-item:hover svg{background:var(--navy);stroke:#fff}
.quick-item:hover{border-color:rgba(43,108,176,.35)}

/* عنوان بخش‌ها: برچسب و خط تزئینی */
.eyebrow{
  display:inline-block;background:#e8f1fb;color:var(--blue);
  padding:.2rem .75rem;border-radius:999px;margin-bottom:.5rem;
}
.section-head h2{position:relative;padding-bottom:.45rem}
.section-head h2::after{
  content:"";position:absolute;bottom:0;inset-inline-start:0;
  width:56px;height:4px;border-radius:4px;
  background:linear-gradient(90deg,var(--blue),#9cc3ec);
}

/* اطلاعیه‌ها */
.ann-feature{border-radius:24px;box-shadow:0 22px 50px rgba(26,42,79,.22)}
.ann-feature .eyebrow{background:rgba(156,195,236,.18);color:#cfe3f7}
.ann-list{border-radius:24px;box-shadow:0 10px 30px rgba(26,42,79,.06)}
.ann-list li{padding:1.1rem 1.4rem}
.date-box{border-radius:14px;background:linear-gradient(160deg,#eef5fd,#dfeaf7);border:0}
.date-box b{color:var(--navy)}

/* کارت‌های آخرین مطالب */
.post-card{border-radius:20px;border:1px solid rgba(26,42,79,.07);box-shadow:0 6px 20px rgba(26,42,79,.04)}
.post-card img{transition:transform .4s}
.post-card:hover img{transform:scale(1.04)}
.post-card .body{padding:1.25rem 1.4rem 1.5rem}

@media (max-width:900px){
  .home-hero{padding:3.5rem 0 8rem;border-radius:0 0 36px 36px}
  .home-hero h1{font-size:2.3rem}
  .quick-links{margin-top:-4.5rem}
}

/* ---------- دکمه روز/شب ---------- */
.header-actions{display:flex;align-items:center;gap:.5rem}
.theme-toggle{background:rgba(255,255,255,.1);border:0;color:#fff;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.theme-toggle:hover{background:rgba(255,255,255,.2)}
.theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .icon-sun{display:none}
html[data-theme="dark"] .theme-toggle .icon-sun{display:block}
html[data-theme="dark"] .theme-toggle .icon-moon{display:none}
@media (min-width:821px){
  .header-actions{order:3}
  .main-nav{order:2}
}
@media (max-width:820px){
  .header-actions{order:2;margin-inline-start:auto}
  .main-nav{order:3}
}

/* ---------- کارت‌ها: بدون تصویر و کارت بزرگ ---------- */
.card-media{display:block;overflow:hidden}
.card-media img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover}
.card-placeholder{
  aspect-ratio:16/10;
  background:
    radial-gradient(circle at 85% 15%,rgba(255,255,255,.22),transparent 38%),
    radial-gradient(circle at 10% 95%,rgba(156,195,236,.35),transparent 42%),
    linear-gradient(135deg,var(--navy) 0%,var(--blue) 100%);
}
.card-placeholder span{font-size:1.15rem;font-weight:700;opacity:.95;position:relative;padding:.5rem 1rem;border:1px solid rgba(255,255,255,.35);border-radius:999px}
.cat-pill{background:#e8f1fb;color:var(--blue);padding:.1rem .6rem;border-radius:999px;font-weight:700;font-size:.8rem}
.meta time::before{content:"";}
.post-card .meta{margin-bottom:.45rem}
.post-card h2{line-height:1.7}
.post-card.is-featured{grid-column:1/-1;flex-direction:row}
.post-card.is-featured .card-media{flex:0 0 46%;max-width:46%}
.post-card.is-featured .card-media img,.post-card.is-featured .card-placeholder{height:100%;aspect-ratio:auto;min-height:260px}
.post-card.is-featured .body{padding:1.8rem 2rem;display:flex;flex-direction:column;justify-content:center}
.post-card.is-featured h2{font-size:1.6rem}
.post-card.is-featured p{font-size:1rem}
@media (max-width:700px){
  .post-card.is-featured{flex-direction:column}
  .post-card.is-featured .card-media{max-width:none;flex:none}
  .post-card.is-featured .card-media img,.post-card.is-featured .card-placeholder{min-height:0;aspect-ratio:16/10}
}

/* ---------- فوتر هم‌رنگ با هدر ---------- */
.site-footer{background:var(--navy);color:#c9d6ea;border-top:0}
.site-footer .widget-title{color:#fff;border-bottom-color:#9cc3ec}
.site-footer a,.footer-menu a{color:#fff}
.site-footer a:hover{color:#cfe3f7}
.site-footer .widget li{border-bottom-color:rgba(255,255,255,.12)}
.footer-bottom{border-top-color:rgba(255,255,255,.14)}
.footer-bottom a{color:#fff}

/* =========================================================
   حالت شب (dark)
   ========================================================= */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0c1424;--soft:#132038;--text:#e2e8f0;--muted:#94a3b8;--line:#22314f;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#f1f5f9}
html[data-theme="dark"] a{color:#9cc3ec}
html[data-theme="dark"] .site-header,html[data-theme="dark"] .site-footer{background:#0a1224}
html[data-theme="dark"] .site-header{border-bottom:1px solid #1d2b47}
html[data-theme="dark"] .home-hero{background:#0f1b33}
html[data-theme="dark"] .post-card,html[data-theme="dark"] .quick-item{background:#101b30;border-color:var(--line)}
html[data-theme="dark"] .post-card h2 a,html[data-theme="dark"] .quick-item{color:#f1f5f9}
html[data-theme="dark"] .quick-item svg{background:#1a2a4a;stroke:#9cc3ec}
html[data-theme="dark"] .quick-item:hover svg{background:#2b6cb0;stroke:#fff}
html[data-theme="dark"] .cat-pill,html[data-theme="dark"] .eyebrow{background:#1a2a4a;color:#9cc3ec}
html[data-theme="dark"] .ann-list{background:#101b30}
html[data-theme="dark"] .ann-list a{color:#e2e8f0}
html[data-theme="dark"] .date-box{background:#1a2a4a}
html[data-theme="dark"] .date-box b{color:#f1f5f9}
html[data-theme="dark"] .date-box small{color:#94a3b8}
html[data-theme="dark"] .archive-header{background:var(--soft)}
html[data-theme="dark"] .entry-content th{background:var(--soft);color:#f1f5f9}
html[data-theme="dark"] .entry-content blockquote{background:var(--soft)}
html[data-theme="dark"] .page-numbers{color:#cbd5e1;border-color:var(--line)}
html[data-theme="dark"] .page-numbers.current{color:#fff}
html[data-theme="dark"] .nav-links a{color:#f1f5f9;border-color:var(--line)}
html[data-theme="dark"] .section-nav li a{color:var(--text)}
html[data-theme="dark"] .tag-cloud a,html[data-theme="dark"] .post-tags a{color:var(--text)}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] .search-field{background:#0c1424;color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .hero-search .search-field{background:#fff;color:#1f2937}
html[data-theme="dark"] .card-placeholder{background:linear-gradient(135deg,#1a2a4a 0%,#1f4f85 100%)}

/* ---------- دکمه و نوار جستجوی هدر ---------- */
.search-toggle{background:rgba(255,255,255,.1);border:0;color:#fff;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.search-toggle:hover{background:rgba(255,255,255,.2)}
.search-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
.header-search{display:none;border-top:1px solid rgba(255,255,255,.12);padding:.8rem 0;background:var(--navy)}
.header-search.is-open{display:block}
.header-search .search-form{max-width:460px;margin-inline:auto;gap:.4rem}
.header-search .search-field{padding:.5rem .8rem;font-size:.92rem;border-radius:999px;border:0}
.header-search .search-submit{padding:.5rem 1rem;border-radius:999px;font-size:.9rem;background:var(--blue)}
html[data-theme="dark"] .header-search{background:#0a1224}

/* =========================================================
   هدر بازطراحی‌شده: یک ردیف ثابت، دکمه‌ها در یک کپسول
   ========================================================= */

/* ردیف اصلی هدر در دسکتاپ: برند | منو | ابزارها — هرگز به خط بعد نمی‌افتد */
.header-inner{flex-wrap:nowrap;gap:1.25rem;padding:.85rem 0}
.site-branding{flex:0 0 auto;min-width:0}
.site-title{font-size:1.15rem;letter-spacing:-.01em;white-space:nowrap}
.site-desc{max-width:240px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.8rem}

.main-nav{flex:1 1 auto;min-width:0;display:block}
.main-nav ul{flex-wrap:nowrap;justify-content:flex-end;gap:clamp(.55rem,1vw,1.1rem);min-width:0}
.main-nav li{min-width:0;flex:0 1 auto}
.main-nav a{
  font-size:clamp(.82rem,.8vw + .5rem,.95rem);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:11em;
  padding:.3rem 0;border-bottom:2px solid transparent;
}
.main-nav .sub-menu a{max-width:none}

/* کپسول ابزارها: جستجو، روز/شب، منوی موبایل */
.header-actions{
  flex:0 0 auto;display:flex;align-items:center;gap:.2rem;
  background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);
  border-radius:999px;padding:.2rem;
}
.header-actions button{width:36px;height:36px;background:transparent}
.header-actions button:hover{background:rgba(255,255,255,.14)}
.header-actions .menu-toggle{display:none}

/* ---- زیر ۱۱۸۰px: منوی همبرگری، ابزارها کنار برند ---- */
@media (max-width:1180px){
  .header-inner{flex-wrap:wrap;gap:.9rem}
  .header-actions{order:2;margin-inline-start:auto}
  .header-actions .menu-toggle{display:inline-block}
  .main-nav{order:3;display:none;width:100%;flex:0 0 100%}
  .main-nav.is-open{display:block}
  .main-nav ul{flex-direction:column;justify-content:flex-start;gap:0;padding:.4rem 0}
  .main-nav li{width:100%}
  .main-nav a{display:block;max-width:none;font-size:.98rem;padding:.7rem .2rem;border-bottom:1px solid rgba(255,255,255,.08)}
  .main-nav .sub-menu{display:flex;position:static;background:none;box-shadow:none;padding-inline-start:1rem;min-width:0}
  .main-nav .sub-menu a{font-size:.9rem;padding:.45rem .2rem;opacity:.85}
  .site-desc{max-width:none}
}
@media (min-width:1181px){
  .header-actions{order:3}
  .main-nav{order:2}
  .menu-toggle{display:none}
}


@media (min-width:1181px){
  .main-nav{min-width:0}
  .main-nav ul{width:100%;min-width:0}
}

/* =========================================================
   منوی اصلی دسکتاپ: نوار افقی با فلش‌های ظریف برای منوهای بیشتر
   ========================================================= */
.menu-arrow{
  display:none;flex:0 0 auto;width:30px;height:30px;border-radius:50%;padding:0;
  border:0;background:rgba(255,255,255,.1);color:#fff;cursor:pointer;
  align-items:center;justify-content:center;
}
.menu-arrow:hover{background:rgba(255,255,255,.22)}
.menu-arrow svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.menu-arrow[hidden]{display:none!important}

@media (min-width:1181px){
  .main-nav{display:flex;align-items:center;gap:.3rem;min-width:0}
  .menu-arrow{display:inline-flex}
  .main-nav ul{
    flex:1 1 auto;min-width:0;width:auto;
    overflow-x:auto;overflow-y:visible;scrollbar-width:none;
    justify-content:flex-start;scroll-behavior:smooth;
    padding:.35rem 0;
  }
  .main-nav ul::-webkit-scrollbar{display:none}
  .main-nav li{flex:0 0 auto}
  .main-nav a{white-space:nowrap;max-width:none;overflow:visible}
  /* زیرمنوها از نوار جدا می‌شوند تا بریده نشوند */
  .main-nav .sub-menu{position:fixed;inset:auto;min-width:220px;z-index:80}
}

/* =========================================================
   نسخه اختصاصی موبایل و تبلت (زیر ۱۱۸۰px)
   ========================================================= */
@media (max-width:1180px){

  /* ---- هدر فشرده ---- */
  .header-inner{padding:.6rem 0;gap:.6rem}
  .site-title{font-size:1.05rem}
  .site-desc{display:none}
  .header-actions{padding:.15rem}
  .header-actions button{width:38px;height:38px}
  .header-actions .menu-toggle{display:inline-flex;align-items:center;justify-content:center}
  .header-search{padding:.6rem 0}

  /* ---- پنل منوی کناری ---- */
  .main-nav{
    position:fixed;top:0;bottom:0;width:min(88vw,360px);height:100vh;height:100dvh;
    left:auto;right:0;flex:none;order:initial;margin:0;
    display:flex;flex-direction:column;
    background:var(--navy);z-index:200;
    transform:translateX(105%);visibility:hidden;
    transition:transform .28s ease,visibility .28s;
    box-shadow:-18px 0 40px rgba(0,0,0,.28);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  html[dir="ltr"] .main-nav{left:0;right:auto;transform:translateX(-105%);box-shadow:18px 0 40px rgba(0,0,0,.28)}
  .main-nav.is-open{transform:none;visibility:visible}
  html.nav-open{overflow:hidden}
  .nav-backdrop{display:none;position:fixed;inset:0;background:rgba(7,14,30,.55);z-index:150}
  html.nav-open .nav-backdrop{display:block}

  .mnav-head{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.2rem;border-bottom:1px solid rgba(255,255,255,.12);color:#fff;flex:none}
  .mnav-title{font-weight:700;font-size:1.05rem}
  .nav-close{width:40px;height:40px;border-radius:50%;border:0;background:rgba(255,255,255,.1);color:#fff;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
  .nav-close svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

  .main-nav ul{
    flex:1 1 auto;min-height:0;width:auto;
    display:flex;flex-direction:column;justify-content:flex-start;gap:0;
    padding:.4rem 0 1.5rem;margin:0;
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  }
  .main-nav li{
    position:relative;width:100%;flex:none;
    display:flex;flex-wrap:wrap;align-items:stretch;
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  .main-nav li>a{
    flex:1 1 auto;display:block;padding:.95rem 1.3rem;
    font-size:1rem;color:#fff;opacity:1;border:0;white-space:normal;max-width:none;overflow:visible;
  }
  .main-nav li.current-menu-item>a,.main-nav li.current_page_item>a{color:#9cc3ec;font-weight:700}

  /* دکمه باز کردن زیرمنو */
  .submenu-toggle{
    flex:0 0 52px;display:inline-flex;align-items:center;justify-content:center;
    background:none;border:0;color:#fff;cursor:pointer;padding:0;
  }
  .submenu-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
  .main-nav li.is-open>.submenu-toggle svg{transform:rotate(180deg)}

  .main-nav .sub-menu{
    display:none;position:static;inset:auto;min-width:0;width:100%;flex-basis:100%;
    background:rgba(255,255,255,.04);box-shadow:none;border-radius:0;padding:0;margin:0;
    flex-direction:column;
  }
  .main-nav li:hover>.sub-menu{display:none}
  .main-nav li.is-open>.sub-menu{display:flex}
  .main-nav .sub-menu a{padding:.75rem 1.3rem .75rem 2rem;font-size:.95rem;opacity:.9}

  .menu-arrow{display:none!important}

  /* ---- بدنه صفحه ---- */
  .container{width:min(100% - 2rem,var(--max))}
  .site-main{padding:1.25rem 0 2rem}
  .layout{gap:1.5rem}
  .archive-header{padding:1.1rem}
  .archive-header h1{font-size:1.3rem}
  .entry-header h1{font-size:1.5rem}
  .entry-content{font-size:1rem}
  .entry-content table{display:block;overflow-x:auto}
  .nav-links{flex-direction:column}
  .nav-links a{max-width:none}

  /* ---- صفحه اصلی ---- */
  .home .site-main{padding:0}
  .home-hero{padding:2.5rem 0 6rem;border-radius:0 0 32px 32px}
  .home-hero h1{font-size:1.9rem;line-height:1.4}
  .hero-desc{font-size:.97rem;margin-bottom:0}
  .hero-kicker{font-size:.8rem}
  .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
  .stat{padding:.9rem .8rem;border-radius:14px}
  .stat strong{font-size:1.5rem}
  .stat span{font-size:.82rem}
  .quick-links{margin-top:-4rem}
  .quick-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
  .quick-item{padding:1rem .95rem;border-radius:16px;gap:.5rem}
  .quick-item b{font-size:.9rem}
  .quick-item svg{width:22px;height:22px;padding:10px}
  .home-section{padding-top:2.25rem}
  .section-head{margin-bottom:1rem}
  .section-head h2{font-size:1.3rem}
  .ann-grid{grid-template-columns:1fr;gap:1rem}
  .ann-feature{min-height:250px;border-radius:20px}
  .ann-body{padding:1.2rem}
  .ann-feature h3{font-size:1.2rem}
  .ann-list li{padding:.85rem 1rem}
  .ann-list a{font-size:.92rem}
  .card-grid{grid-template-columns:1fr;gap:1rem}
  .post-card.is-featured{flex-direction:column}
  .post-card.is-featured .card-media{max-width:none;flex:none}
  .post-card.is-featured .card-media img,.post-card.is-featured .card-placeholder{min-height:0;aspect-ratio:16/10}
  .post-card.is-featured .body{padding:1.2rem 1.2rem 1.4rem}
  .post-card.is-featured h2{font-size:1.25rem}

  /* ---- فوتر ---- */
  .footer-grid{grid-template-columns:1fr;gap:1.5rem}
  .site-footer{padding-top:2rem}
  .footer-bottom{padding:1rem 0 1.5rem}
}
@media (max-width:380px){
  .home-hero h1{font-size:1.7rem}
  .quick-grid{grid-template-columns:1fr}
}

/* لینک صفحه والد داخل زیرمنو (فقط در موبایل) */
.main-nav .mnav-parent{display:none}
@media (max-width:1180px){
  .main-nav .sub-menu .mnav-parent{display:flex;width:100%}
  .main-nav .sub-menu .mnav-parent a{font-weight:700;color:#9cc3ec;padding:.75rem 1.3rem .75rem 2rem}
}
