/* =============================================
   BLOG ARTICLE PAGE STYLES
   ============================================= */
:root {
  --primary:       #2d8a4e;
  --primary-light: #38b06a;
  --primary-dark:  #1a5e32;
  --accent:        #f5a623;
  --accent-light:  #fbbf24;
  --bg:            #f8faf7;
  --bg-card:       #ffffff;
  --dark-bg:       #0d1f15;
  --text:          #1a2e1e;
  --text-muted:    #5a7564;
  --text-light:    #c8e6d0;
  --border:        #d4e8dc;
  --shadow:        0 4px 24px rgba(45,138,78,0.10);
  --shadow-lg:     0 12px 48px rgba(45,138,78,0.18);
  --radius:        16px;
  --radius-sm:     8px;
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
  --font:          'Cairo', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

/* ===== NAVBAR ===== */
.blog-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13,31,21,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.blog-navbar .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.blog-navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.blog-navbar .logo-img {
  height: 42px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
}

.blog-navbar .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: var(--transition);
}

.blog-navbar .back-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

/* ===== ARTICLE HERO ===== */
.article-hero {
  background: linear-gradient(135deg, #0a1f12 0%, #142a1c 50%, #0d3020 100%);
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(45,138,78,0.12), transparent 70%);
  pointer-events: none;
}

.article-hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245,166,35,0.08), transparent 70%);
  pointer-events: none;
}

.article-hero .container {
  position: relative;
  z-index: 2;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45,138,78,0.2);
  border: 1px solid rgba(45,138,78,0.4);
  color: var(--text-light);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.article-date {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

.article-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 16px;
  max-width: 800px;
}

.article-hero .article-excerpt {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  max-width: 700px;
  line-height: 1.8;
}

/* ===== ARTICLE BODY ===== */
.article-body {
  padding: 60px 0 80px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 450px; /* Bigger sidebar */
  gap: 48px;
  align-items: flex-start;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* When inside the layout, we don't need the margin auto centering as grid handles it */
.article-layout .article-content {
  margin: 0;
}

.article-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-image-wrapper {
  background: #fff;
  padding: 8px; /* Reduced padding */
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.side-image-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.side-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius) - 8px);
}

.sidebar-info {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 24px;
  border-radius: var(--radius);
  color: #fff;
}

.sidebar-info h4 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.sidebar-info p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  line-height: 1.6;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 48px 0 16px;
  padding-right: 16px;
  border-right: 4px solid var(--primary);
  line-height: 1.4;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
  line-height: 1.4;
}

.article-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 28px 0 10px;
}

.article-content p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 2;
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  padding-right: 24px;
  margin-bottom: 18px;
}

.article-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 2;
  margin-bottom: 8px;
}

.article-content li strong {
  color: var(--text);
}

.article-content strong {
  color: var(--text);
  font-weight: 700;
}

/* Callout box */
.article-callout {
  background: linear-gradient(135deg, rgba(45,138,78,0.06), rgba(45,138,78,0.02));
  border: 1px solid rgba(45,138,78,0.2);
  border-right: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 32px 0;
}

.article-callout p {
  color: var(--text);
  font-weight: 500;
  margin: 0;
}

/* Conclusion box */
.article-conclusion {
  background: linear-gradient(135deg, var(--dark-bg), #0f2a1a);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin: 48px 0 0;
}

.article-conclusion h2 {
  color: #fff;
  border-right-color: var(--accent);
  margin-top: 0;
}

.article-conclusion p {
  color: rgba(255,255,255,0.7);
}

/* CTA section */
.article-cta {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 48px auto 0;
  max-width: 800px;
}

.article-cta h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.article-cta p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 16px rgba(45,138,78,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(45,138,78,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  margin-right: 12px;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== RELATED ARTICLES ===== */
.related-articles {
  padding: 60px 0 80px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 36px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.related-card .r-icon {
  font-size: 2rem;
}

.related-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.related-card .r-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: auto;
  transition: var(--transition);
}

.related-card .r-link:hover {
  color: var(--primary-light);
}

/* ===== FOOTER ===== */
.blog-footer {
  background: var(--dark-bg);
  padding: 32px 0;
  text-align: center;
}

.blog-footer p {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

.blog-footer a {
  color: var(--primary-light);
  transition: var(--transition);
}

.blog-footer a:hover {
  color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .article-hero {
    padding: 80px 0 40px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .article-sidebar {
    position: static;
    order: -1; /* Show image above content on mobile */
  }

  .article-content h2 {
    font-size: 1.3rem;
  }

  .article-cta {
    padding: 32px 20px;
  }

  .article-cta .btn {
    display: block;
    width: 100%;
    margin: 8px 0;
  }

  .btn-outline {
    margin-right: 0;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 4px;
}

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