/*
Theme Name: Negaresh
Theme URI: https://example.com/negaresh
Author: Custom for Writer
Author URI: 
Description: قالب وردپرس مدرن و مینیمال مخصوص نویسندگان. مناسب برای تحلیل‌واره، پاره‌نویسی و گفتگو با نویسندگان.
Version: 1.3.0
Requires at least: 6.0
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: negaresh
Tags: blog, custom-menu, featured-images, rtl-language-support, translation-ready, two-columns, custom-logo
*/

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
  line-height: 1.8;
  color: #1a1a1a;
  background-color: #faf9f6;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #555;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75em;
  color: #111;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.4em;
}

.entry-content p {
  font-size: 1.05rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-area {
  max-width: 720px;
  margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: #faf9f6;
  border-bottom: 1px solid #e8e6e1;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-branding .site-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.site-branding .site-title a {
  color: #111;
}

.site-branding .site-description {
  font-size: 0.85rem;
  color: #777;
  margin-top: 2px;
}

/* Navigation */
.main-navigation ul {
  display: flex;
  gap: 28px;
  align-items: center;
}

.main-navigation a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  position: relative;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: #111;
}

.main-navigation a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 1px;
  background: #111;
  transition: width 0.25s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
  width: 100%;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.4rem;
}

/* ==========================================================================
   Hero Section (Homepage)
   ========================================================================== */

.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #555;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-primary:hover {
  background: #333;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: #ccc;
  color: #333;
}

.btn-outline:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

/* ==========================================================================
   Sections on Homepage
   ========================================================================== */

.home-section {
  padding: 50px 0;
  border-top: 1px solid #e8e6e1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.5rem;
  margin: 0;
}

.section-link {
  font-size: 0.9rem;
  color: #666;
}

.section-link:hover {
  color: #111;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card .post-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-card .post-title a:hover {
  color: #555;
}

.post-card .post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 12px;
}

.post-card .post-excerpt {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.7;
  flex-grow: 1;
}

.post-card .read-more {
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.post-card .read-more:hover {
  color: #000;
}

/* Quote Section */
.quote-section {
  padding: 70px 0;
  text-align: center;
  background: #f3f1ec;
  margin: 40px 0;
}

.quote-text {
  font-size: 1.4rem;
  font-style: italic;
  max-width: 640px;
  margin: 0 auto 16px;
  line-height: 1.7;
  color: #222;
}

.quote-author {
  font-size: 0.95rem;
  color: #666;
}

/* ==========================================================================
   Archive & Single
   ========================================================================== */

.page-header {
  padding: 50px 0 30px;
  text-align: center;
  border-bottom: 1px solid #e8e6e1;
  margin-bottom: 40px;
}

.page-title {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.archive-description {
  color: #666;
  max-width: 500px;
  margin: 0 auto;
}

/* Post List */
.posts-list {
  max-width: 720px;
  margin: 0 auto;
}

.posts-list .post {
  padding: 32px 0;
  border-bottom: 1px solid #e8e6e1;
}

.posts-list .post:last-child {
  border-bottom: none;
}

.posts-list .entry-title {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.posts-list .entry-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 14px;
}

.posts-list .entry-summary {
  color: #444;
  margin-bottom: 12px;
}

/* Single Post */
.single .entry-header {
  text-align: center;
  padding: 40px 0 30px;
  margin-bottom: 30px;
  border-bottom: 1px solid #e8e6e1;
}

.single .entry-title {
  font-size: 2.2rem;
  max-width: 700px;
  margin: 0 auto 12px;
}

.single .entry-meta {
  font-size: 0.9rem;
  color: #888;
}

.entry-content {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 50px;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 2em;
}

.entry-content ul,
.entry-content ol {
  margin: 1.2em 0;
  padding-right: 1.5em;
}

.entry-content ul li {
  list-style: disc;
  margin-bottom: 0.4em;
}

.entry-content ol li {
  list-style: decimal;
  margin-bottom: 0.4em;
}

.entry-content blockquote {
  border-right: 3px solid #ccc;
  padding: 8px 20px;
  margin: 1.8em 0;
  color: #444;
  font-style: italic;
}

.entry-footer {
  max-width: 680px;
  margin: 0 auto 60px;
  padding-top: 30px;
  border-top: 1px solid #e8e6e1;
  font-size: 0.9rem;
  color: #666;
}

/* ==========================================================================
   About & Contact Pages
   ========================================================================== */

.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 0 60px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #f3f1ec;
  border-top: 1px solid #e8e6e1;
  padding: 40px 0 30px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer-nav ul {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.9rem;
  color: #555;
}

.footer-nav a:hover {
  color: #111;
}

.site-info {
  font-size: 0.85rem;
  color: #888;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}

.social-links a {
  color: #555;
  font-size: 1.1rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.9rem;
  color: #333;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  .main-navigation {
    display: none;
    width: 100%;
    margin-top: 16px;
  }

  .main-navigation.active {
    display: block;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .hero {
    padding: 50px 0 40px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .section-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .single .entry-title {
    font-size: 1.7rem;
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ==========================================================================
   About Page
   ========================================================================== */

.about-content .entry-content {
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-content .entry-content p {
  margin-bottom: 1.5em;
}

.about-photo img {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area .comment-list {
  margin-bottom: 40px;
}

.comments-area .comment {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.comments-area .comment-author {
  font-weight: 600;
  margin-bottom: 4px;
}

.comments-area .comment-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 10px;
}

.comments-area .comment-content p {
  margin-bottom: 0.8em;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.95rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #fff;
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #999;
}

.comment-form .form-submit input {
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}

.comment-form .form-submit input:hover {
  background: #333;
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */

.post-navigation {
  max-width: 680px;
  margin: 0 auto 50px;
  padding-top: 30px;
  border-top: 1px solid #e8e6e1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1;
}

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

.post-navigation .nav-subtitle {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 4px;
}

.post-navigation .nav-title {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ==========================================================================
   Hero with Photo
   ========================================================================== */

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.hero-inner.has-photo {
  flex-direction: row-reverse;
  text-align: right;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  border: 4px solid #fff;
}

.hero-text {
  flex: 1;
}

.hero-inner.has-photo .hero-title {
  font-size: 2.4rem;
}

.hero-inner.has-photo .hero-actions {
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .hero-inner.has-photo {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }

  .hero-inner.has-photo .hero-actions {
    justify-content: center;
  }
}
