/**
 * MATRIX MOBILE BNS — Dedicated Blogs & Articles Styles (المقالات والشروحات والمدونة)
 * Inspired by MobileMasr Blogs Architecture
 * Location: Beni Suef - Al-Abasiry St. (Since 2002)
 */

/* Breadcrumbs Bar */
.blogs-breadcrumb-bar {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.blogs-breadcrumb-bar a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}
.blogs-breadcrumb-bar a:hover {
  text-decoration: underline;
}
.blogs-breadcrumb-bar span.separator {
  margin: 0 8px;
  color: #94A3B8;
}

/* Hero Section */
.blogs-hero {
  background: linear-gradient(135deg, #0B1120 0%, #1E293B 55%, #0F172A 100%);
  color: #FFFFFF;
  padding: 50px 0 60px;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid #2563EB;
}
.blogs-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
  pointer-events: none;
}
.blogs-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto 35px;
}
.blogs-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.5);
  color: #60A5FA;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
}
.blogs-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}
.blogs-hero h1 span {
  color: #F97316;
}
.blogs-hero p {
  font-size: 1.05rem;
  color: #CBD5E1;
  line-height: 1.7;
}

/* Featured Article Card in Hero */
.featured-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.featured-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.6);
}
.featured-img-wrap {
  height: 320px;
  position: relative;
  overflow: hidden;
}
.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.featured-card:hover .featured-img-wrap img {
  transform: scale(1.05);
}
.featured-info {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
}
.featured-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.featured-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 12px;
  line-height: 1.4;
}
.featured-summary {
  font-size: 0.95rem;
  color: #CBD5E1;
  line-height: 1.7;
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-featured-read {
  align-self: flex-start;
  background: linear-gradient(135deg, #F97316, #EA580C);
  color: #FFFFFF;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-featured-read:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

/* Category Filter Bar */
.blogs-nav-section {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  padding: 18px 0;
  position: sticky;
  top: 75px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.blogs-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.category-pills-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.category-pill {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #475569;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.category-pill:hover,
.category-pill.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Search Box in Nav */
.blogs-search-box {
  display: flex;
  align-items: center;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 30px;
  padding: 6px 14px;
  min-width: 280px;
  transition: border-color 0.2s, background 0.2s;
}
.blogs-search-box:focus-within {
  border-color: #2563EB;
  background: #FFFFFF;
}
.blogs-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: #0F172A;
  flex: 1;
  padding: 4px 8px;
}

/* Main Articles Feed */
.blogs-feed-section {
  padding: 45px 0 80px;
  background: #F8FAFC;
}
.blogs-count-bar {
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: #64748B;
  font-weight: 600;
}
.blogs-count-bar strong {
  color: #0F172A;
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 28px;
}

/* Article Card */
.article-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: #93C5FD;
}
.article-img-wrap {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #E2E8F0;
}
.article-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-img-wrap img {
  transform: scale(1.06);
}

/* Category Badge on Card */
.badge-category {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
}
.badge-category[data-cat="نصائح"] { background: #2563EB; }
.badge-category[data-cat="آخر الأخبار"] { background: #EF4444; }
.badge-category[data-cat="شروحات"] { background: #8B5CF6; }
.badge-category[data-cat="أسعار ومواصفات"] { background: #10B981; }
.badge-category[data-cat="الأفضل"] { background: #F59E0B; }

/* Article Card Body */
.article-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: #64748B;
  margin-bottom: 10px;
}
.article-meta-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.article-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.45;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-summary {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.article-footer {
  margin-top: auto;
  border-top: 1px solid #F1F5F9;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-author {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}
.article-read-link {
  color: #2563EB;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s;
}
.article-card:hover .article-read-link {
  transform: translateX(-4px);
}

/* ==========================================================================
   READING MODAL (نافذة قراءة المقال الكاملة)
   ========================================================================== */
.article-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.article-modal-overlay.active {
  display: flex;
}
.article-modal-card {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  animation: articleModalIn 0.25s ease-out;
}
@keyframes articleModalIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-modal-header {
  padding: 16px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-modal-body {
  padding: 30px 36px;
  overflow-y: auto;
  line-height: 1.85;
  font-size: 1.02rem;
  color: #1E293B;
}

/* Modal Article Header */
.modal-art-category {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  color: #FFFFFF;
  margin-bottom: 14px;
}
.modal-art-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0F172A;
  line-height: 1.35;
  margin-bottom: 16px;
}
.modal-art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: #64748B;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #E2E8F0;
}
.modal-art-cover {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
}
.modal-art-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Formatted Content Typography */
.modal-art-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0F172A;
  margin: 28px 0 14px;
  border-right: 4px solid #2563EB;
  padding-right: 12px;
}
.modal-art-content h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E3A8A;
  margin: 22px 0 10px;
}
.modal-art-content p {
  margin-bottom: 18px;
  color: #334155;
}
.modal-art-content ul,
.modal-art-content ol {
  padding-right: 24px;
  margin-bottom: 20px;
  color: #334155;
}
.modal-art-content li {
  margin-bottom: 8px;
}

/* Connected Store / Guide Product Box */
.related-product-banner {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1.5px solid #93C5FD;
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.related-product-text h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #1E40AF;
  margin-bottom: 4px;
}
.related-product-text p {
  font-size: 0.88rem;
  color: #1E3A8A;
  margin: 0;
}
.btn-related-action {
  background: #2563EB;
  color: #FFFFFF;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.btn-related-action:hover {
  opacity: 0.92;
}

/* Social Share Bar */
.social-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #E2E8F0;
  padding-top: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
  gap: 14px;
}
.share-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
}
.share-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-share {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.2s;
}
.btn-share.wa { background: #10B981; color: #FFFFFF; }
.btn-share.fb { background: #1877F2; color: #FFFFFF; }
.btn-share.copy { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.btn-share:hover { opacity: 0.9; }

/* Responsive */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-img-wrap {
    height: 220px;
  }
  .featured-info {
    padding: 22px;
  }
}
@media (max-width: 768px) {
  .blogs-hero h1 { font-size: 1.6rem; }
  .blogs-hero p { font-size: 0.92rem; }
  .article-modal-body { padding: 20px; }
  .modal-art-title { font-size: 1.4rem; }
  .modal-art-cover { height: 220px; }
  .blogs-nav-wrapper { flex-direction: column; align-items: stretch; }
  .blogs-search-box { min-width: 100%; }
}
