/* =========================
   Font
========================= */
@font-face{
  font-family:'Vazirmatn';
  src:url('font/Vazir.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* =========================
   Variables (Light Sky Theme)
========================= */
:root{
  --bg:#f6fbff;
  --card:#ffffff;
  --text:#0b1b2b;
  --muted:#4b647a;
  --line: rgba(11,27,43,.10);

  --brand:#38bdf8;     /* sky */
  --brand2:#0ea5e9;    /* deeper sky */
  --brandSoft: rgba(56,189,248,.16);

  --radius: 18px;
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --max: 1120px;
}

/* =========================
   Base
========================= */
*{ box-sizing: border-box; }

html{
  scroll-behavior: smooth;
}

body{
  margin:0;
  font-family:'Vazirmatn', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(56,189,248,.18), transparent 55%),
    radial-gradient(900px 500px at 10% 0%, rgba(14,165,233,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height:1.75;
}

a{
  color: inherit;
  text-decoration: none;
}

img{
  max-width:100%;
  display:block;
}

.container{
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

/* =========================
   Header / Topbar
========================= */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  background: rgba(246,251,255,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 0;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo-img{
  width:40px;
  height:40px;
  border-radius:20px;
  object-fit: contain;
  background: var(--card);
  border:1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-title{
  font-weight:900;
  display:block;
}

.brand-subtitle{
  font-size:13px;
  color: var(--muted);
}

/* =========================
   Buttons
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
  font-weight:800;
  border:0;
  box-shadow: var(--shadow);
}

.btn:hover{
  filter: brightness(1.05);
}

.btn-small{
  padding:10px 14px;
  font-size:14px;
}

.btn-ghost{
  background: transparent;
  color: var(--text);
  border:1px solid rgba(14,165,233,.35);
  box-shadow:none;
}

/* =========================
   Hero
========================= */
.hero{
  padding: 24px 0 12px;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}

.hero-media{
  border-radius: calc(var(--radius) + 8px);
  overflow:hidden;
  border:1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* تصویر افقی – بدون اجبار */
.hero-img{
  width:100%;
  height:auto;
  display:block;
  object-fit: contain;     /* مهم */
}


.hero-box{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  padding:16px;
  box-shadow: var(--shadow);
}

.eyebrow{
  color: var(--muted);
  font-size:14px;
  margin-bottom:6px;
}

h1{
  margin:0 0 8px;
  font-size:34px;
}

.lead{
  color: var(--muted);
  margin-bottom:14px;
}

.hero-cta{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

/* stats */
.stats{
  list-style:none;
  margin:14px 0 0;
  padding:0;
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.stats li{
  flex:1 1 110px;
  background: var(--brandSoft);
  border:1px solid rgba(56,189,248,.30);
  border-radius:16px;
  padding:10px 12px;
}

.stats strong{
  font-size:18px;
  display:block;
}

.stats span{
  font-size:13px;
  color: var(--muted);
}

/* =========================
   Sections
========================= */
.section{
  padding: 34px 0;
}

.section.alt{
  background: rgba(14,165,233,.04);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}

.section-head h2{
  margin:0 0 6px;
  font-size:24px;
}

.section-head p{
  margin:0 0 18px;
  color: var(--muted);
}

/* =========================
   Projects
========================= */
.projects-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

.project-card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

/* =========================
   Featured Course
========================= */
.section.featured{
  background: linear-gradient(135deg, rgba(56,189,248,.18), rgba(14,165,233,.12));
  border-top:1px solid rgba(14,165,233,.25);
  border-bottom:1px solid rgba(14,165,233,.25);
}

.featured-inner{
  display:flex;
  flex-direction: column;
  gap:14px;
}

.featured-cta{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

/* =========================
   Books Slider
========================= */
.books-slider{
  border:1px solid var(--line);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
  padding:12px;
}

.books-track{
  display:flex;
  gap:12px;
  overflow-x:auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.book-item{
  flex:0 0 auto;
  width:140px;
  scroll-snap-align: start;
  background: var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  box-shadow: 0 8px 20px rgba(2,6,23,.06);
}

.book-item img{
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius:12px;
  border:1px solid var(--line);
}

.book-title{
  margin-top:8px;
  font-size:13px;
  font-weight:800;
}

/* =========================
   Articles
========================= */
.posts-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

.post-card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

/* =========================
   CTA / Contact
========================= */
.cta{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding:18px;
  display:flex;
  flex-direction: column;
  gap:14px;
  box-shadow: var(--shadow);
}

.cta-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

/* =========================
   Footer
========================= */
.footer{
  border-top:1px solid var(--line);
  padding:20px 0 26px;
  background: #f0f8ff;
}

.footer-inner{
  display:flex;
  flex-direction: column;
  gap:10px;
  font-size:13px;
  color: var(--muted);
}

/* =========================
   Responsive (Desktop)
========================= */
@media (min-width: 980px){

  h1{ font-size:42px; }

  .hero-grid{
    grid-template-columns: 1.1fr .9fr;
    align-items: stretch;
  }

  .projects-grid{
    grid-template-columns: repeat(2, 1fr);
  }

  .posts-grid{
    grid-template-columns: repeat(3, 1fr);
  }

  .featured-inner{
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .footer-inner{
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
/* =========================
   Project Cards with Image
========================= */

.project-card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;                 /* مهم برای تصویر */
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.project-media{
  width:100%;
  background: #f1f7fb;
  border-bottom:1px solid var(--line);
}

.project-media img{
  width:100%;
  height:auto;
  display:block;
  aspect-ratio: 16 / 9;             /* افقی استاندارد */
  object-fit: cover;                /* اینجا مجاز است */
}

.project-body{
  padding: 16px;
}

.project-body h3{
  margin:0 0 6px;
  font-size:18px;
}

.project-body p{
  margin:0 0 12px;
}

/* دسکتاپ: کارت‌ها کمی نفس‌دارتر */
@media (min-width: 980px){
  .project-body{
    padding: 18px;
  }
}
/* =========================
   Project Thumbnails (Thumb)
========================= */

.project-card{
  display:flex;
  gap:14px;
  align-items:flex-start;
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}

/* باکس تصویر بندانگشتی */
.project-thumb{
  flex: 0 0 auto;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
  background:#f1f7fb;
}

/* تصویر افقی */
.project-thumb.landscape{
  width:96px;
  aspect-ratio: 16 / 9;
}

/* تصویر عمودی */
.project-thumb.portrait{
  width:72px;
  aspect-ratio: 3 / 4;
}

/* خود تصویر */
.project-thumb img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* متن کارت */
.project-body{
  flex:1;
}

.project-body h3{
  margin:0 0 6px;
  font-size:17px;
}

.project-body p{
  margin:0 0 10px;
}

/* موبایل خیلی کوچک */
@media (max-width: 420px){
  .project-thumb.landscape{ width:80px; }
  .project-thumb.portrait{ width:60px; }
}

/* دسکتاپ */
@media (min-width: 980px){
  .projects-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}
/* =========================
   Global Image Radius
========================= */

/* همه تصاویر سایت گوشه‌گرد */
img{
  border-radius: 16px;
}

/* =========================
   Featured Course Thumbnail
========================= */

.featured-inner{
  display:flex;
  flex-direction: column;
  gap:16px;
}

/* باکس تصویر */
.featured-thumb{
  flex: 0 0 auto;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#f1f7fb;
  box-shadow: var(--shadow);
}

/* تصویر افقی بندانگشتی */
.featured-thumb img{
  width:100%;
  display:block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* محتوای متنی */
.featured-content{
  flex:1;
}

/* دسکتاپ: تصویر کنار متن */
@media (min-width: 980px){
  .featured-inner{
    flex-direction: row;
    align-items: center;
  }

  .featured-thumb{
    width: 280px;          /* بندانگشتی واقعی */
    max-width: 280px;
  }
}
/* =========================
   Books – Vaziri Ratio Slider
========================= */

.books-slider{
  border:1px solid var(--line);
  background: var(--card);
  border-radius: calc(var(--radius) + 8px);
  padding: 14px;
}

.books-track{
  display:flex;
  gap:14px;
  overflow-x:auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.books-track::-webkit-scrollbar{
  height:8px;
}
.books-track::-webkit-scrollbar-thumb{
  background: rgba(14,165,233,.25);
  border-radius: 999px;
}

.book-item{
  flex:0 0 auto;
  width: 130px;                 /* اندازه بندانگشتی */
  scroll-snap-align: start;
  text-align:center;
}

.book-item img{
  width:100%;
  aspect-ratio: 2 / 3;          /* نسبت کتاب وزیری */
  object-fit: cover;
  border-radius: 16px;          /* گوشه‌گرد سراسری */
  border:1px solid var(--line);
  background:#f1f7fb;
  box-shadow: 0 8px 22px rgba(2,6,23,.10);
}

.book-title{
  display:block;
  margin-top:8px;
  font-size:13px;
  font-weight:700;
  color: var(--text);
  line-height:1.4;
}

.books-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}
/* =========================
   Hero Box – tidy + centered stats + mobile full width buttons
========================= */

.hero-name{
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 900;
}

.hero-lead{
  margin: 0 0 14px;
}

.hero-cred{
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.hero-subtitle{
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 900;
}

.hero-bullets{
  margin: 0;
  padding-right: 18px;
  color: var(--muted);
}

.hero-bullets li{
  margin: 6px 0;
}

/* Actions (buttons row) */
.hero-actions{
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* icon inside buttons */
.ico{
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ico svg{
  width: 18px;
  height: 18px;
  display: block;
}

/* Button variants */
.btn-resume{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
}

.btn-eitaa{
  background: linear-gradient(135deg, #fb923c, #f97316); /* orange */
  color:#fff;
}

.btn-instagram{
  background: linear-gradient(135deg, #a855f7, #7c3aed); /* purple */
  color:#fff;
}

/* Ensure icon and text spacing */
.hero-actions .btn{
  gap: 8px;
}

/* Stats centered + more elegant */
.stats-center{
  margin-top: 16px;
  justify-content: center;
  text-align: center;
}

.stats-center li{
  text-align: center;
}

.stats-center strong{
  font-size: 20px;
}

/* Mobile: buttons full width and stacked */
@media (max-width: 640px){
  .hero-actions{
    flex-direction: column;
  }
  .hero-actions .btn{
    width: 100%;
  }
}
/* Hero stats overlay */
.hero-media{
  position: relative;
}

.hero-stats{
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(14,165,233,.22);
  backdrop-filter: blur(8px);
}

/* کمی فشرده‌تر برای اینکه روی تصویر خوب بنشیند */
.hero-stats .stats{
  margin: 0;
}

.hero-stats .stats li{
  background: rgba(56,189,248,.10);
  border: 1px solid rgba(56,189,248,.22);
}
/* Hero stats overlay - default (mobile): زیر تصویر */
.hero-media{
  position: relative;
}

.hero-stats{
  position: static;            /* مهم: دیگر روی تصویر نیست */
  margin-top: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(14,165,233,.22);
}

/* موبایل: آمار دو ستونه/سه ستونه فشرده */
.stats-center{
  justify-content: center;
  text-align: center;
}

.stats{
  gap: 10px;
}

.stats li{
  flex: 1 1 calc(50% - 10px);  /* دو ستون در موبایل */
}

/* از 420px به پایین: تک ستونه برای جلوگیری از له شدن */
@media (max-width: 420px){
  .stats li{
    flex: 1 1 100%;
  }
}

/* دسکتاپ: آمار روی تصویر (overlay) */
@media (min-width: 980px){
  .hero-stats{
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin-top: 0;
    backdrop-filter: blur(8px);
  }
}
