/*
Theme Name: Adabi Modern RTL
Theme URI: https://example.com/adabi-modern-rtl
Author: Your Name
Description: قالب سبک، مدرن، فارسی و راست‌چین برای بلاگ ادبی و فرهنگی
Version: 2.0
Text Domain: adabi
Tags: blog, rtl-language-support, custom-colors, custom-logo
*/

/* فونت وزیر (چند وزن) */
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazir-Regular.woff2') format('woff2');
  font-weight: 400;
}
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazir-Bold.woff2') format('woff2');
  font-weight: 700;
}
@font-face {
  font-family: 'Vazir';
  src: url('fonts/Vazir-Light.woff2') format('woff2');
  font-weight: 300;
}

:root {
  --bg:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --primary:#005bbb;   
  --primary-600:#003f88; 
  --border:#e5e7eb;
  --card:#f9fafb;
  --radius:1rem;
  --shadow:0 10px 30px rgba(0,0,0,.06);
  --font:'Vazir', Tahoma, Arial, sans-serif;
}

/* عمومی */
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  line-height:1.9;
  font-size:16px;
}
a { color:var(--primary); text-decoration:none; transition:.3s }
a:hover { color:var(--primary-600) }

/* استایل متن عمومی */
.excerpt {
  line-height: 1.8;
  margin: 0;
  word-break: break-word;
}

/* استایل مخصوص شعر */
.poem-text {
  text-align: right;
  font-weight: 400;
  line-height: 2;
  white-space: pre-line;
  font-size: 1rem;
}

.poem-text p,
.poem-text br {
  margin: 0;
  padding: 0;
  line-height: inherit;
}
/* کانتینر فول‌ویدث */
.container { 
  width:100%; 
  max-width:100%; 
  margin:0 auto; 
  padding:0 0rem;
  box-sizing:border-box;
}

/* هدر */

.site-header {
  position: relative; /* یا static */
  top: auto;
}
.brand {
  font-weight: 900;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: .75rem;
  display: block;
  text-align: center; /* اضافه کردن این خط */
    width: 100%; /* اضافه کردن این خط */
}

/* نوار منو */
.nav-wrapper {
  width: 100%;
  background: #cce6ff;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
}
.primary-nav {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.5rem;
  align-items: center;
}
.primary-nav ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;   /* 👈 اینو اضافه کن */
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.primary-nav li { display: inline-block; }
.primary-nav a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  background: #0077cc;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  transition: 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.primary-nav a:hover {
  background: #005fa3;
  transform: translateY(-2px);
}

/* هیرو */
.hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  height: 220px;
  display: flex;
  margin-top: 2rem;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center; 
  gap: 2rem;
}
.hero h3 {
  font-size: 2.5rem;
  margin: 0;
  color: #fff;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}
/* شبکه‌های اجتماعی */
.socials {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  transition: 0.3s;
}
.social-link svg { width: 24px; height: 24px; }
.social-link.telegram  { background: #0088cc; }
.social-link.instagram { background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); }
.social-link.twitter {
  background: #000;
  color: #fff;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 20px;
  transition: 0.3s;
}
.social-link.twitter:hover { transform: translateY(-2px); opacity: 0.85; }
.social-link.rubika {
  background: #FF1B2D;
  color: white;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 14px;
  transition: 0.3s;
}
.social-link.rubika:hover,
.social-link:hover { transform: translateY(-2px); opacity: 0.85; }

/* لایوت کلی */
.layout {
  display:grid; 
  grid-template-columns:300px 1fr; 
  gap:1.5rem; 
  padding:2rem;
}
/* سایدبار اصلی */
.sidebar {
  position: sticky; 
  top: 90px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

/* کارت‌ها داخل سایدبار */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* بخش خانه */
.top-boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
.home-box {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.home-box .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.home-box h2 { margin-bottom: 1rem; }
.home-box .btn {
  margin-top: auto;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #0073e6;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}
.home-box .btn:hover { background: #005bb5; }

/* لیست شاعران */
.poets-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* دقیقا ۳ ستون */
  gap: 1.5rem;
}

/* کارت شاعر */
.poet-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}
.poet-card:hover {
  transform: translateY(-5px);
}

/* عکس شاعر */
.poet-photo img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
}

/* دکمه مشاهده */
.btn-view {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: #007bff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.btn-view:hover {
  background: #0056b3;
}
/* ریسپانسیو */
@media (max-width: 900px) { .poets-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .poets-list { grid-template-columns: 1fr; } }


.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* ۴ ستون مساوی */
  gap: 20px;
}
@media (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(4, 1fr); /* روی تبلت ۲ ستون */
  }
}
@media (max-width: 576px) {
  .grid {
    grid-template-columns: 1fr; /* روی موبایل ۱ ستون */
  }
}



/* فوتر */
.site-footer {
  border-top:1px solid var(--border);
  padding:2rem 0;
  color:var(--muted);
  font-size:.9rem;
  text-align:center;
  background:#f9fafb;
}

/* ریسپانسیو */
@media (max-width: 900px) {
  .layout { grid-template-columns:1fr; padding:1rem; }
  .sidebar { order:2 }
  .primary-nav ul {
    flex-direction: row; /* ✔ چیدمان درست می‌شود */
        align-items:center;
    justify-content: center;
    gap:.25rem;
  }
  .primary-nav li { display:block; }
}
@media (max-width: 768px) {
  .top-boxes { grid-template-columns: 1fr; }
}

/* 🎵 استایل نهایی بخش موزیک */
.music-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 0; /* جلوگیری از بیرون زدگی */
  padding: 0;
}

.music-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden; /* همه چیز داخل کارت بمونه */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.music-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.music-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.music-card .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.music-card h6 {
  font-size: 1rem;
  color: #1a202c;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.music-card .text-muted {
  font-size: 0.85rem;
  color: #718096;
  margin-bottom: 0.75rem;
}

/* پلیر موزیک */
.music-player audio {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: block;
}

/* دکمه‌های دانلود */
.download-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.download-buttons .btn {
  background: #0077cc;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  flex: unset; /* جلوگیری از کشیده شدن */
  width: auto;
  transition: 0.3s;
}

.download-buttons .btn:hover {
  background: #005fa3;
}

/* ریسپانسیو */
@media (max-width: 1200px) {
  .music-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .music-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 576px) {
  .music-grid {
    grid-template-columns: 1fr;
  }
}

/* 🎵 استایل جدیدترین آهنگ‌ها */
.music-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.music-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.music-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.music-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.music-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-image.no-image {
  font-size: 1.2rem;
  color: #777;
}

.music-card .card-body {
  flex: 1;
}

.music-card h6 {
  font-size: 1rem;
  line-height: 1.4;
}

.music-card a.btn {
  border-radius: 25px;
}

#breadcrumbs {
    font-size: 14px;
    margin: 10px 0;
    color: #555;
}
#breadcrumbs a {
    color: #0073aa;
    text-decoration: none;
}
#breadcrumbs a:hover {
    text-decoration: underline;
}  

.latest-posts-list {
  display: flex;
  flex-direction: column; /* نمایش عمودی */
  gap: 20px; /* فاصله بین پست‌ها */
}

.latest-posts-list article.card {
  width: 100%; /* هر پست کل عرض را می‌گیرد */
}

@media (max-width: 768px) {
  .latest-posts-list {
    gap: 15px;
  }
  .latest-posts-list article.card {
    padding: 10px;
  }
}

/* جلوگیری کامل از اسکرول افقی در موبایل */
html, body {
    overflow-x: hidden !important;
}

/* تصاویر داخل پست */
img, figure img {
    max-width: 100% !important;
    height: auto !important;
}

/* کنترل عرض گالری وردپرس */
.wp-block-gallery,
.wp-block-gallery.has-nested-images {
    max-width: 100% !important;
    flex-wrap: wrap !important;
    overflow: hidden !important;
}
.wp-block-gallery img {
    max-width: 100% !important;
}

/* جلوگیری از بیرون‌زدگی excerpt */
.excerpt {
    overflow-wrap: break-word;
}
.excerpt figure {
    max-width: 100%;
    overflow: hidden;
}

/* خود card هم بهتره */
.card {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* =========================
   ریسپانسیو پلیرهای صوتی و ویدیو
   ========================= */

/* کنترل figure پلیرها */
.wp-block-audio,
.wp-block-video,
.wp-video,
.wp-audio-shortcode {
    max-width: 100% !important;  /* عرض حداکثر 100٪ والد */
    overflow: hidden !important; /* جلوگیری از بیرون زدگی */
    margin: 0 auto;              /* مرکز چین شدن */
    box-sizing: border-box;
}

/* پلیر صوتی */
.wp-block-audio audio,
.wp-audio-shortcode audio {
    width: 100% !important;       /* عرض 100٪ والد */
    height: 40px !important;      /* ارتفاع استاندارد پلیر */
    display: inline-block !important;
    box-sizing: border-box;
}

/* پلیر ویدیویی */
.wp-block-video video,
.wp-video-shortcode video {
    width: 100% !important;       /* پلیر ویدیو فیت والد */
    max-width: 100% !important;
    height: auto !important;      /* نسبت تصویر حفظ شود */
    display: block !important;
    box-sizing: border-box;
}

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .wp-block-audio audio,
    .wp-audio-shortcode audio {
        height: 36px !important;  /* کمی کوچک‌تر برای موبایل */
    }
    .wp-block-video video,
    .wp-video-shortcode video {
        height: auto !important;
    }
}

/* جلوگیری از overflow در parent container */
figure.wp-block-audio,
figure.wp-block-video {
    width: 100% !important;
    max-width: 100% !important;
}


/* جلوگیری از اسکرول افقی */
html, body {
    overflow-x: hidden !important;
}

/* کنترل کامل روی عکس داخل پست‌ها */
.wp-block-image,
.wp-block-image img,
figure,
figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* جلوگیری از بیرون‌زدن figure که مقصر اصلی است */
figure {
    margin: 0 auto !important;
    overflow: hidden !important;
}

/* جلوگیری از کش آمدن container یا card */
.container, .card {
    overflow-x: hidden !important;
}

