/* ====================================================================
   articles.css - تنسيقات قسم المقالات
   ==================================================================== */

/* ============== Breadcrumb ============== */
.breadcrumb {
  background: var(--bg-secondary, #faf8f3);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color, #e8e4d8);
  font-size: 14px;
}
.breadcrumb .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.breadcrumb a {
  color: var(--accent-color, #8b6f00);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .separator {
  margin: 0 8px;
  color: var(--text-mid, #888);
}
.breadcrumb .current {
  color: var(--text-mid, #555);
  font-weight: 500;
}

/* ============== Article Main ============== */
.article-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.article-content {
  background: white;
  border-radius: 16px;
  padding: 40px 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* ============== Article Header ============== */
.article-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 2px solid var(--border-color, #e8e4d8);
}

.article-category {
  display: inline-block;
  background: var(--accent-bg, #fef7e0);
  color: var(--accent-color, #8b6f00);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.article-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--primary-color, #2d4a3e);
  line-height: 1.4;
  margin: 0 0 16px;
  font-family: 'Tajawal', sans-serif;
}

.article-description {
  font-size: 18px;
  color: var(--text-mid, #555);
  line-height: 1.7;
  margin: 0 0 20px;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-mid, #777);
}
.article-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============== Article Cover Image ============== */
.article-cover {
  margin: -10px -30px 30px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 450px;
}
.article-cover img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

@media (max-width: 700px) {
  .article-cover { margin: -10px -18px 24px; }
}

/* ============== Article Layout (TOC + Body) ============== */
.article-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 40px;
  margin: 30px 0;
}

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

/* ============== TOC (Sidebar) ============== */
.article-toc {
  background: var(--bg-secondary, #faf8f3);
  border: 1px solid var(--border-color, #e8e4d8);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.article-toc h3 {
  font-size: 16px;
  margin: 0 0 14px;
  color: var(--primary-color, #2d4a3e);
}

.article-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc li {
  margin-bottom: 8px;
}
.article-toc li.toc-level-3 {
  padding-right: 16px;
  font-size: 13px;
}

.article-toc a {
  color: var(--text-dark, #333);
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
}
.article-toc a:hover,
.article-toc a.active {
  color: var(--accent-color, #8b6f00);
  font-weight: 700;
}

@media (max-width: 900px) {
  .article-toc {
    position: static;
    max-height: 300px;
    margin-bottom: 20px;
  }
}

/* ============== Article Body ============== */
.article-body {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-dark, #2a2a2a);
}

.article-body h1 {
  font-size: 28px;
  margin: 32px 0 16px;
  color: var(--primary-color, #2d4a3e);
}
.article-body h2 {
  font-size: 26px;
  margin: 36px 0 16px;
  color: var(--primary-color, #2d4a3e);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-bg, #fef7e0);
}
.article-body h3 {
  font-size: 21px;
  margin: 28px 0 14px;
  color: var(--primary-color, #2d4a3e);
}
.article-body h4 { font-size: 18px; margin: 22px 0 12px; }

.article-body p { margin: 0 0 18px; }

.article-body strong { color: var(--primary-color, #2d4a3e); }

.article-body a {
  color: var(--accent-color, #8b6f00);
  text-decoration: underline;
  text-decoration-color: rgba(139, 111, 0, 0.3);
  text-underline-offset: 3px;
}
.article-body a:hover {
  text-decoration-color: var(--accent-color, #8b6f00);
}

.article-body ul,
.article-body ol {
  margin: 16px 0;
  padding-right: 24px;
}
.article-body li {
  margin-bottom: 10px;
  line-height: 1.8;
}

.article-body blockquote {
  background: var(--accent-bg, #fef7e0);
  border-right: 4px solid var(--accent-color, #8b6f00);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 8px;
  font-style: italic;
  color: var(--text-dark, #444);
}

.article-body code {
  background: #f4f4f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.article-body pre {
  background: #f4f4f4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 20px auto;
  display: block;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-color, #e8e4d8);
  margin: 36px 0;
}

/* ============== FAQ Section ============== */
.article-faq {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color, #e8e4d8);
}

.article-faq h2 {
  font-size: 24px;
  color: var(--primary-color, #2d4a3e);
  margin-bottom: 20px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-secondary, #faf8f3);
  border: 1px solid var(--border-color, #e8e4d8);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  color: var(--primary-color, #2d4a3e);
  font-size: 16px;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  color: var(--accent-color, #8b6f00);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-dark, #444);
  line-height: 1.8;
  font-size: 15px;
}

/* ============== Share Buttons ============== */
.article-share {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-secondary, #faf8f3);
  border-radius: 12px;
  text-align: center;
}

.article-share h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--primary-color, #2d4a3e);
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.share-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.15s;
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.9; }

.share-wa { background: #25D366; }
.share-tw { background: #1DA1F2; }
.share-fb { background: #1877F2; }
.share-copy { background: var(--primary-color, #2d4a3e); }

/* ============== Related Articles ============== */
.article-related {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color, #e8e4d8);
}

.article-related h2 {
  font-size: 24px;
  color: var(--primary-color, #2d4a3e);
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.related-card {
  background: white;
  border: 1px solid var(--border-color, #e8e4d8);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: var(--accent-color, #8b6f00);
}

.related-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--primary-color, #2d4a3e);
  line-height: 1.5;
}
.related-card p {
  font-size: 14px;
  color: var(--text-mid, #666);
  margin: 0 0 10px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card .related-meta {
  font-size: 12px;
  color: var(--text-mid, #888);
}

/* ============== Disclaimer ============== */
.article-disclaimer {
  margin-top: 40px;
  padding: 20px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  font-size: 14px;
  color: #5d4e00;
  line-height: 1.7;
}

/* ============== Articles List Page ============== */
.articles-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.articles-hero {
  text-align: center;
  margin-bottom: 40px;
}
.articles-hero h1 {
  font-size: 36px;
  color: var(--primary-color, #2d4a3e);
  margin: 0 0 12px;
}
.articles-hero p {
  font-size: 18px;
  color: var(--text-mid, #555);
}

/* Featured */
.featured-section {
  margin-bottom: 50px;
}
.featured-section h2 {
  font-size: 22px;
  color: var(--primary-color, #2d4a3e);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  background: linear-gradient(135deg, var(--accent-bg, #fef7e0), white);
  border-radius: 16px;
  padding: 30px;
  border: 1px solid var(--border-color, #e8e4d8);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.featured-card-image {
  background: var(--accent-color, #8b6f00);
  border-radius: 12px;
  min-height: 250px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-card-image img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  display: block;
}
.featured-card-content h3 {
  font-size: 26px;
  color: var(--primary-color, #2d4a3e);
  margin: 0 0 14px;
  line-height: 1.4;
}
.featured-card-content p {
  font-size: 16px;
  color: var(--text-mid, #555);
  line-height: 1.7;
  margin: 0 0 16px;
}
.featured-card-meta {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--text-mid, #777);
}
@media (max-width: 700px) {
  .featured-card { grid-template-columns: 1fr; }
}

/* All Articles */
.all-section h2 {
  font-size: 22px;
  color: var(--primary-color, #2d4a3e);
  margin-bottom: 20px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  background: white;
  border: 1px solid var(--border-color, #e8e4d8);
  border-radius: 12px;
  padding: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: var(--accent-color, #8b6f00);
}
.article-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg-secondary, #faf8f3);
}
.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.article-card:hover .article-card-image img {
  transform: scale(1.05);
}
.article-card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.article-card-category {
  display: inline-block;
  background: var(--accent-bg, #fef7e0);
  color: var(--accent-color, #8b6f00);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  align-self: flex-start;
}
.article-card h3 {
  font-size: 18px;
  margin: 0;
  color: var(--primary-color, #2d4a3e);
  line-height: 1.5;
}
.article-card p {
  font-size: 14px;
  color: var(--text-mid, #666);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.article-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-mid, #888);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-color, #f0ece0);
}

.articles-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mid, #777);
}
.articles-empty .icon {
  font-size: 60px;
  margin-bottom: 16px;
}

/* ============== Mobile ============== */
@media (max-width: 700px) {
  .article-content { padding: 24px 18px; }
  .article-title { font-size: 26px; }
  .article-description { font-size: 16px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 18px; }
}
