/*
Theme Name: بلاگ فارسی | Persian Blog
Theme URI: https://example.com/persian-blog
Author: NoteGPT AI
Author URI: https://example.com
Description: قالب وبلاگ وردپرسی ساده و شیک با چیدمان راست‌به‌چپ (RTL) و فونت فارسی وزیرمتن. مناسب برای وبلاگ‌های شخصی، آموزشی و مجلات آنلاین. شامل صفحه اصلی، صفحه نوشته، آرشیو، جستجو، دیدگاه‌ها و ناحیه ویجت فوتر است.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: persian-blog
Tags: blog, news, rtl-language-support, one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   بلاگ فارسی — قالب ساده و شیک
   فونت: وزیرمتن (Vazirmatn) — چیدمان: راست‌به‌چپ (RTL)
   ============================================================ */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1f2933;
  --text-soft: #66707b;
  --border: #e9e4dc;
  --accent: #0e6b5c;
  --accent-strong: #0a5348;
  --accent-soft: #e9f3f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 41, 51, .04), 0 8px 24px rgba(31, 41, 51, .05);
  --shadow-hover: 0 2px 4px rgba(31, 41, 51, .05), 0 16px 40px rgba(31, 41, 51, .10);
  --font: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-strong); }

::selection { background: var(--accent); color: #fff; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- هدر ---------- */

.site-header {
  background: rgba(250, 248, 245, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #2fa88f);
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: .95rem;
  padding: 4px 0;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--accent);
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width .25s;
}

.main-nav a:hover::after,
.main-nav a.active::after,
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
  width: 100%;
}

/* ---------- نشان دسته / بج ---------- */

.cat-badge,
.cat-links a {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}

.cat-links a:hover { background: var(--accent); color: #fff; }

/* ---------- نوشته ویژه (صفحه اصلی) ---------- */

.hero-post {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 2.2rem 0 0;
}

.hero-thumb {
  min-height: 300px;
  background: var(--thumb-grad, linear-gradient(135deg, #0e6b5c, #35b89a));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.thumb-letter {
  font-size: 6rem;
  color: rgba(255, 255, 255, .85);
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.hero-body { padding: 2.4rem 0 2.4rem 2.4rem; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }

.hero-title { font-size: clamp(1.35rem, 2.6vw, 1.8rem); line-height: 1.7; font-weight: 800; }
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--accent); }

.hero-excerpt { color: var(--text-soft); font-size: .95rem; }

/* ---------- عنوان بخش ---------- */

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 2.8rem 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- شبکه نوشته‌ها ---------- */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}

.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.post-thumb {
  min-height: 190px;
  background: var(--thumb-grad, linear-gradient(135deg, #8a7bb5, #4b3f72));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.post-card .thumb-letter { font-size: 4rem; }

.post-body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .6rem;
}

.post-body .cat-badge,
.post-body .cat-links { align-self: flex-start; }

.post-title { font-size: 1.12rem; line-height: 1.8; font-weight: 800; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-excerpt { color: var(--text-soft); font-size: .92rem; line-height: 2; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-soft);
  font-size: .8rem;
  margin-top: auto;
  padding-top: .8rem;
}

.post-meta span + span::before { content: "•"; margin-left: 10px; color: var(--border); }

/* ---------- دکمه ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  transition: background .2s, transform .2s;
}

.btn:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }

/* ---------- نوشته ویژه درون حلقه (index) ---------- */

.post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.post-card--featured .post-thumb { min-height: 100%; }
.post-card--featured .post-title { font-size: 1.45rem; }
.post-card--featured .post-excerpt { font-size: .98rem; }

/* ---------- صفحه نوشته (single) ---------- */

.single-wrap { max-width: 820px; padding-top: 2.8rem; padding-bottom: 4rem; }

.single-header { text-align: center; margin-bottom: 2rem; }
.single-header .cat-links { margin-bottom: .8rem; display: inline-block; }

.single-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.7;
  font-weight: 800;
  margin: .5rem 0 .8rem;
}

.single-header .post-meta { justify-content: center; padding-top: 0; }

.single-thumb {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.2rem;
  box-shadow: var(--shadow);
  background: var(--thumb-grad, linear-gradient(135deg, #8a7bb5, #4b3f72));
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.single-thumb img { width: 100%; }

.entry-content { font-size: 1.02rem; }

.entry-content p { margin-bottom: 1.5rem; line-height: 2.2; }

.entry-content h2 { font-size: 1.45rem; margin: 2.4rem 0 1rem; font-weight: 800; line-height: 1.8; }
.entry-content h3 { font-size: 1.2rem; margin: 2rem 0 .9rem; font-weight: 800; line-height: 1.8; }

.entry-content ul,
.entry-content ol { margin: 0 1.5rem 1.5rem 0; }
.entry-content li { margin-bottom: .5rem; line-height: 2; }

.entry-content blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.6rem;
  border-right: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
}

.entry-content blockquote p { margin: 0; }

.entry-content code {
  background: #f1efe9;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .9em;
  direction: ltr;
  unicode-bidi: embed;
  font-family: "Consolas", "Monaco", monospace;
}

.entry-content pre {
  background: #22272e;
  color: #e6edf3;
  padding: 1.2rem 1.4rem;
  border-radius: 12px;
  overflow: auto;
  direction: ltr;
  text-align: left;
  margin: 1.5rem 0;
  line-height: 1.8;
}

.entry-content pre code { background: none; color: inherit; padding: 0; }

.entry-content img,
.entry-content figure { border-radius: 12px; margin: 1.5rem 0; max-width: 100%; }
.entry-content figcaption { text-align: center; color: var(--text-soft); font-size: .85rem; margin-top: .5rem; }

.entry-content a { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- برچسب‌ها ---------- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2.4rem;
}

.tag-list a {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}

.tag-list a:hover { background: var(--accent); color: #fff; }

/* ---------- باکس نویسنده ---------- */

.author-box {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-top: 2.5rem;
  box-shadow: var(--shadow);
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-soft);
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-name { font-weight: 800; margin-bottom: .3rem; }
.author-bio { color: var(--text-soft); font-size: .9rem; line-height: 2; }

/* ---------- ناوبری بین نوشته‌ها ---------- */

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.post-navigation .nav-links a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.9;
  transition: border-color .2s, color .2s;
}

.post-navigation .nav-links a:hover { border-color: var(--accent); color: var(--accent); }

.post-navigation .nav-label {
  display: block;
  font-size: .75rem;
  color: var(--text-soft);
  margin-bottom: .3rem;
  font-weight: 500;
}

.post-navigation .nav-next { text-align: left; }

/* ---------- نوشته‌های مرتبط ---------- */

.related-posts { margin-top: 2.5rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.related-grid .post-thumb { min-height: 130px; }

/* ---------- دیدگاه‌ها ---------- */

.comments-area { margin-top: 2.5rem; }

.comment-list { list-style: none; }
.comment-list .children { list-style: none; margin-right: 2rem; margin-top: 1rem; }

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
}

.comment-author { font-weight: 700; display: inline-block; }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-left: 6px; }
.comment-meta { color: var(--text-soft); font-size: .8rem; margin: .2rem 0 .8rem; }

.comment-reply-link { font-size: .8rem; font-weight: 600; }

.comment-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font);
  font-size: .92rem;
  margin-bottom: 1rem;
  transition: border-color .2s;
}

.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent); }

.comment-form .submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .7rem 1.8rem;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s;
}

.comment-form .submit:hover { background: var(--accent-strong); }

/* ---------- صفحه‌بندی ---------- */

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 1rem 0 3rem;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .2s, background .2s, color .2s;
}

.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- فرم جستجو ---------- */

.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input[type="search"] {
  flex: 1;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font);
  font-size: .92rem;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); }
.search-form button,
.search-form .search-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .7rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.search-form button:hover { background: var(--accent-strong); }

/* ---------- صفحه آرشیو / دسته ---------- */

.archive-header {
  margin: 2.4rem 0 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.archive-title { font-size: 1.5rem; font-weight: 800; }

.archive-description { color: var(--text-soft); font-size: .9rem; margin-top: .4rem; }

/* ---------- صفحه ۴۰۴ ---------- */

.error-404 { text-align: center; padding: 5rem 0; }
.error-404 .error-code { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.error-404 h1 { font-size: 1.4rem; margin: .5rem 0 1rem; }
.error-404 p { color: var(--text-soft); margin-bottom: 1.6rem; }

/* ---------- فوتر ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.widget-title { font-size: 1rem; font-weight: 800; margin-bottom: 1rem; }

.footer-widget ul { list-style: none; }
.footer-widget li { margin-bottom: .5rem; }
.footer-widget a { color: var(--text-soft); font-size: .9rem; }
.footer-widget a:hover { color: var(--accent); }
.footer-widget p { color: var(--text-soft); font-size: .9rem; line-height: 2; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.4rem 0;
  text-align: center;
  color: var(--text-soft);
  font-size: .85rem;
}

/* ---------- واکنش‌گرایی ---------- */

@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 14px; }
  .main-nav ul { justify-content: center; gap: 16px; }

  .hero-post { grid-template-columns: 1fr; }
  .hero-thumb { min-height: 200px; }
  .hero-body { padding: 1.6rem; }

  .post-card--featured { grid-template-columns: 1fr; }
  .post-card--featured .post-thumb { min-height: 180px; }

  .related-grid { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr; gap: 1.6rem; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .author-box { flex-direction: column; text-align: center; }
}
