/*
Theme Name: وبلاگ کارتی (Zento Style)
Theme URI: https://blog.teachernjt.ir
Author: Narjes N.
Author URI: https://blog.teachernjt.ir
Description: پوسته وبلاگی با طراحی کارتی، شبیه‌سازی‌شده بر اساس طرح Zento
Version: 2.0
Text Domain: zento
*/

/* ===============================
   FONT
================================= */
@font-face {
  font-family: Shabnam;
  src: url("https://blogix.ir/assets/font/shabnam/shabnam.woff2") format("woff2"),
       url("https://blogix.ir/assets/font/shabnam/shabnam.woff") format("woff"),
       url("https://blogix.ir/assets/font/shabnam/shabnam.ttf") format("truetype");
  font-weight: normal;
  font-display: swap;
}

/* ===============================
   ROOT VARIABLES
================================= */
:root {
  --bg: #FBEAEE;
  --surface: #FFFFFF;
  --primary: #FF6B7A;
  --primary-dark: #E8505F;
  --text: #23242b;
  --muted: #74798a;
  --border: #f0e2e5;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow: 0 12px 30px rgba(30, 20, 30, 0.08);

  --link-color: #2563eb;
  --link-hover-color: #d6336c;
}

/* ===============================
   RESET / GLOBAL
================================= */
* { box-sizing: border-box; }

body {
  font-family: Shabnam, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.8;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

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

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-pill { padding: 8px 20px; }

/* ===============================
   TOP BAR
================================= */
.topbar {
  padding: 18px 0 0;
}

.topbar-inner {
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  gap: 16px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 220px;
}
.topbar-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
}
.icon-search { opacity: 0.6; }

.topbar-logo a {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  white-space: nowrap;
}
.topbar-logo img { max-height: 34px; }

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

.menu-toggle {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  place-items: center;
  padding: 8px;
  cursor: pointer;
}
.menu-toggle span {
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 2px;
}

.primary-nav {
  padding: 10px 0 4px;
}
.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.primary-nav a {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.85rem;
}
.primary-nav a:hover { background: var(--primary); color: #fff; }

/* ===============================
   HERO
================================= */
.site-hero {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-top: 40px;
}

.hero-text { flex: 1; }
.hero-text h1 { font-size: 2.1rem; line-height: 1.5; margin: 0 0 14px; }
.hero-text .accent { color: var(--primary); }
.hero-bio { color: var(--muted); font-size: 0.95rem; max-width: 480px; margin: 0 0 24px; }

.hero-subscribe label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.9rem; }
.hero-subscribe form {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  padding: 6px;
  max-width: 380px;
}
.hero-subscribe input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.85rem;
}
#hero-newsletter-msg { margin-top: 10px; font-size: 0.85rem; }

.hero-image { flex: 1; }
.hero-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 1/1;
}

/* ===============================
   TRENDING TOPICS
================================= */
.trending-topics { margin: 50px auto; text-align: center; }
.trending-topics h4 { margin-bottom: 20px; font-size: 1rem; }

.topics-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  padding: 14px 22px;
  max-width: 720px;
  margin: 0 auto;
}

.topic-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text);
}
.topic-thumb {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}

.topic-count {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topics-explore { margin-right: 10px; }

/* ===============================
   MAIN LAYOUT
================================= */
.site-main { margin: 20px auto 60px; }
.content-layout {
  display: flex;
  gap: 26px;
  align-items: flex-start;
}
.post-list { flex: 1 1 68%; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.site-sidebar { flex: 0 0 30%; max-width: 320px; display: flex; flex-direction: column; gap: 20px; }

/* ===============================
   WIDGETS
================================= */
.widget {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.widget h3 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  text-align: center;
  background: var(--bg);
  padding: 8px;
  border-radius: 10px;
}

/* About widget */
.widget-about { text-align: center; }
.about-avatar img {
  width: 130px; height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid var(--primary);
}
.widget-about h3 { background: none; margin-bottom: 2px; }
.about-role { color: var(--muted); font-size: 0.8rem; margin-bottom: 10px; }
.about-text { font-size: 0.85rem; color: var(--muted); }

/* Tag cloud widget */
.widget-tags .tagcloud a {
  display: inline-block;
  margin: 4px;
  padding: 5px 14px;
  background: var(--bg);
  border-radius: var(--radius-pill);
  font-size: 0.8rem !important;
  color: var(--text);
  transition: 0.2s;
}
.widget-tags .tagcloud a:hover { background: var(--primary); color: #fff; }

/* Recent posts / recent comments / popular posts widgets */
.widget-recent ul li,
.widget-recent-comments ul li,
.widget-popular ul li {
  margin-bottom: 12px;
}
.widget-recent ul li:last-child,
.widget-recent-comments ul li:last-child,
.widget-popular ul li:last-child { margin-bottom: 0; }

.widget-recent ul li a,
.widget-popular ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-recent img,
.widget-popular img {
  width: 48px; height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.widget-recent-comments ul li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.widget-recent-comments img { border-radius: 50%; flex-shrink: 0; }

.widget-recent span,
.widget-popular span {
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-recent-comments span { font-size: 0.82rem; }
.widget-recent a:hover span,
.widget-recent-comments a:hover span,
.widget-popular a:hover span { color: var(--primary); }

/* Sidebar link menus */
.sidebar-links-menu li { margin-bottom: 10px; }
.sidebar-links-menu li:last-child { margin-bottom: 0; }
.sidebar-links-menu a {
  display: block;
  font-size: 0.85rem;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: 0.2s;
}
.sidebar-links-menu a:hover { background: var(--primary); color: #fff; }

/* ===============================
   POST CARD
================================= */
.post-card {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(30,20,30,0.12); }

.post-card-image {
  position: relative;
  flex: 0 0 36%;
  max-width: 36%;
  min-height: 200px;
  overflow: hidden;
}
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }

.cat-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  z-index: 2;
}

.post-card-body {
  flex: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.post-meta-row .rating { display: inline-flex; align-items: center; gap: 4px; }
.stars { direction: ltr; }
.star-filled { color: #f5b301; }
.star-empty { color: #ddd; }

/* ستاره‌های امتیازدهی تعاملی کاربران */
.rate-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  direction: ltr;
  cursor: pointer;
}
.rate-stars .star {
  color: #ddd;
  font-size: 1rem;
  transition: color 0.15s ease, transform 0.15s ease;
}
.rate-stars .star.active,
.rate-stars .star.hover-fill {
  color: #f5b301;
}
.rate-stars .star:hover { transform: scale(1.2); }
.rate-stars .rating-info {
  margin-right: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  direction: rtl;
}

.post-card-title { font-size: 1.2rem; margin: 4px 0 10px; line-height: 1.5; }
.post-card-title a:hover { color: var(--primary); }

.post-excerpt { font-size: 0.85rem; color: var(--muted); margin: 0 0 14px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.post-tags a {
  font-size: 0.72rem;
  background: var(--bg);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.post-tags a:hover { background: var(--primary); color: #fff; }

.post-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--muted);
}
.post-card-footer img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ===============================
   PAGINATION
================================= */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--primary); color: #fff; }

/* ===============================
   SINGLE POST
================================= */
.single-post-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
}
.single-post-image { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 24px; }
.single-post-image img { width: 100%; }
.single-title { font-size: 1.8rem; margin-bottom: 10px; text-align: center; }
.single-meta-row {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 26px;
}
.single-content { font-size: 0.95rem; line-height: 2; }
.single-content img { border-radius: var(--radius-md); margin: 16px 0; }
.single-tags { margin: 26px 0; padding-top: 16px; border-top: 1px solid var(--border); }

/* لینک‌های داخل محتوا رنگ متفاوتی نسبت به متن دارند (بدون زیرخط) */
.single-content a,
.comments-area .comment-content a,
.about-text a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}
.single-content a:hover,
.comments-area .comment-content a:hover,
.about-text a:hover {
  color: var(--link-hover-color);
}

.author-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border-radius: var(--radius-md);
  padding: 18px; margin-top: 20px;
}
.author-box img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-box strong { display: block; margin-bottom: 4px; }
.author-box span { font-size: 0.82rem; color: var(--muted); }

/* Comments (threaded/nested) */
.comments-wrap { margin-top: 34px; }
.comments-title { margin-bottom: 18px; font-size: 1.1rem; }

.comment-list,
.comment-list .children {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comment-list .children {
  padding-right: 28px;
  margin-top: 14px;
  border-right: 2px solid var(--border);
}

.comment-list > li { margin-bottom: 16px; }

.comment-body {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.comment-meta img { border-radius: 50%; }
.comment-author { font-size: 0.88rem; }
.comment-author a { color: var(--text); }
.comment-date { font-size: 0.72rem; color: var(--muted); }

.comment-content { font-size: 0.85rem; }
.comment-awaiting-moderation {
  font-size: 0.78rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.reply { margin-top: 8px; }
.reply a {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}
.reply a:hover { color: var(--primary-dark); }

#respond { margin-top: 24px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-family: inherit; margin-bottom: 12px;
}
.comment-form textarea { min-height: 110px; }
#respond #submit {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 22px; border-radius: var(--radius-pill); cursor: pointer;
}
#cancel-comment-reply-link {
  margin-right: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ===============================
   FOOTER
================================= */
.site-footer { text-align: center; padding: 30px 0; color: var(--muted); font-size: 0.85rem; }
.sidebar-backdrop { display: none; }

/* ===============================
   RESPONSIVE
================================= */
@media (max-width: 900px) {
  .site-hero { flex-direction: column; text-align: center; }
  .hero-subscribe form { margin: 0 auto; }
  .content-layout { flex-direction: column; }
  .post-card { flex-direction: column; }
  .post-card-image { max-width: 100%; width: 100%; height: 190px; min-height: 190px; }
  .topbar-search { display: none; }

  /* سایدبار کشویی (off-canvas) در موبایل - از سمت چپ باز می‌شود */
  .site-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    max-width: 85%;
    height: 100vh;
    margin: 0;
    background: var(--bg);
    z-index: 999;
    overflow-y: auto;
    padding: 70px 16px 30px;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.18);
    transition: left 0.3s ease;
  }
  .site-sidebar.sidebar-open { left: 0; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
  }
  .sidebar-backdrop.active { display: block; }

  /* منوی اصلی در نوار بالا در موبایل جا نمی‌شود، به‌جایش از سایدبار کشویی استفاده می‌شود */
  .topbar-inner > .topbar-actions > .primary-nav { display: none; }
}

.widget-mobile-nav { display: none; }
@media (max-width: 900px) {
  .widget-mobile-nav { display: block; }
}
