/* ============================================
   Blog Styles - Homepage Section + Public Pages
   ============================================ */

/* -- Homepage Blog Section -- */
.blog-section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.blog-card {
  display: block;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #cbd5e1;
}

.blog-card-category {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--gold, #d4a84b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.blog-card-body {
  padding: 20px;
  text-align: right;
}

.blog-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a2332;
  line-height: 1.6;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.blog-card-date {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.blog-view-more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* -- Blog Page Hero -- */
.blog-page-hero {
  padding: 140px 24px 60px;
  text-align: center;
  background: linear-gradient(135deg, #0f1521 0%, #1a2332 50%, #0c1222 100%);
  color: #fff;
}

.blog-page-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}

.blog-page-hero p {
  font-size: 16px;
  color: #94a3b8;
  max-width: 500px;
  margin: 0 auto;
}

/* -- Category Filters -- */
.blog-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-filter-btn {
  padding: 8px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: #fff;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-filter-btn:hover {
  border-color: var(--gold, #d4a84b);
  color: var(--gold, #d4a84b);
}

.blog-filter-btn.active {
  background: var(--gold, #d4a84b);
  color: #fff;
  border-color: var(--gold, #d4a84b);
}

/* -- All Blogs Grid -- */
.blog-all-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.blog-all-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* -- Pagination -- */
.blog-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
}

.blog-page-btn {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-page-btn:hover {
  border-color: var(--gold, #d4a84b);
  color: var(--gold, #d4a84b);
}

.blog-page-btn.active {
  background: var(--gold, #d4a84b);
  color: #fff;
  border-color: var(--gold, #d4a84b);
}

/* -- Blog Detail -- */
.blog-detail {
  padding-top: 80px;
  min-height: 60vh;
}

.blog-detail-hero {
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-detail-hero img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.blog-detail-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.blog-breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.blog-breadcrumb a {
  color: var(--gold, #d4a84b);
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-detail-header {
  margin-bottom: 32px;
}

.blog-detail-header h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: #1a2332;
  line-height: 1.5;
  margin-bottom: 16px;
}

.blog-detail-category {
  display: inline-block;
  background: var(--gold, #d4a84b);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.blog-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #64748b;
  flex-wrap: wrap;
}

.blog-detail-meta span,
.blog-detail-meta time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blog-detail-body {
  font-size: 16px;
  line-height: 2;
  color: #334155;
  direction: rtl;
  text-align: right;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.blog-detail-body p {
  margin-bottom: 20px;
}

.blog-detail-body h1 {
  font-size: 28px;
  font-weight: 800;
  color: #1a2332;
  margin: 36px 0 16px;
}

.blog-detail-body h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a2332;
  margin: 32px 0 16px;
}

.blog-detail-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1a2332;
  margin: 24px 0 12px;
}

/* RTL Lists — proper rendering for Quill output */
.blog-detail-body ul,
.blog-detail-body ol {
  margin: 16px 0;
  padding-right: 32px;
  padding-left: 0;
  direction: rtl;
}

.blog-detail-body ol {
  list-style-type: decimal;
}

.blog-detail-body ul {
  list-style-type: disc;
}

.blog-detail-body li {
  margin-bottom: 8px;
  padding-right: 4px;
}

/* Quill alignment classes */
.blog-detail-body .ql-align-center {
  text-align: center;
}

.blog-detail-body .ql-align-right {
  text-align: right;
}

.blog-detail-body .ql-align-left {
  text-align: left;
}

.blog-detail-body .ql-align-justify {
  text-align: justify;
}

/* Quill indentation */
.blog-detail-body .ql-indent-1 { padding-right: 3em; }
.blog-detail-body .ql-indent-2 { padding-right: 6em; }
.blog-detail-body .ql-indent-3 { padding-right: 9em; }

/* Links */
.blog-detail-body a {
  color: var(--gold, #d4a84b);
  text-decoration: underline;
  transition: color 0.2s;
}

.blog-detail-body a:hover {
  color: #b8862e;
}

/* Strong / Bold / Italic */
.blog-detail-body strong {
  font-weight: 700;
  color: #1a2332;
}

.blog-detail-body em {
  font-style: italic;
}

.blog-detail-body s {
  text-decoration: line-through;
  color: #94a3b8;
}

.blog-detail-body u {
  text-decoration: underline;
}

.blog-detail-body blockquote {
  border-right: 4px solid var(--gold, #d4a84b);
  padding: 16px 24px;
  margin: 24px 0;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #475569;
}

.blog-detail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
  display: block;
}

/* Quill video embed (iframe) */
.blog-detail-body iframe,
.blog-detail-body .ql-video {
  max-width: 100%;
  width: 100%;
  min-height: 360px;
  border-radius: 12px;
  margin: 24px 0;
  border: none;
}

/* -- Share Buttons -- */
.blog-detail-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  background: var(--gold, #d4a84b);
  color: #fff;
}

/* -- Related Posts -- */
.blog-related {
  background: #f8fafc;
  padding: 60px 24px;
}

.blog-related-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.blog-related h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a2332;
  text-align: center;
  margin-bottom: 32px;
}

/* -- Spinner -- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--gold, #d4a84b);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Responsive
   ============================================ */

/* Large screens: 4 cards */
@media (min-width: 1400px) {
  .blog-all-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet: 2 cards */
@media (max-width: 900px) {
  .blog-grid,
  .blog-all-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-section {
    padding: 60px 20px;
  }
}

/* Mobile: 1 card */
@media (max-width: 600px) {
  .blog-grid,
  .blog-all-grid {
    grid-template-columns: 1fr;
  }

  .blog-section {
    padding: 48px 16px;
  }

  .blog-page-hero {
    padding: 120px 16px 48px;
  }

  .blog-detail-hero img {
    height: 240px;
  }

  .blog-detail-content {
    padding: 24px 16px 60px;
  }

  .blog-detail-body {
    font-size: 15px;
    line-height: 1.9;
  }

  .blog-filters {
    padding: 16px;
    gap: 6px;
  }

  .blog-filter-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .blog-detail-share {
    flex-wrap: wrap;
  }
}
