/* ================================================================
   BLOG & EDITORIAL STYLES
   Extends style.css with reading-focused typography & RTL support
   Arabic Font: Cairo (or IBM Plex Sans Arabic)
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --far: 'Cairo', sans-serif;
}

/* RTL Support - Override for Arabic */
html[dir="rtl"] {
  font-family: var(--far);
}
html[dir="rtl"] body {
  font-family: var(--far);
  letter-spacing: 0; /* Arabic looks better without extra tracking */
}
html[dir="rtl"] .sh2, 
html[dir="rtl"] .hero-inner h1, 
html[dir="rtl"] .cta-h2,
html[dir="rtl"] .article-title {
  font-family: var(--far);
  letter-spacing: -0.02em;
}

/* ================================================================
   BLOG HUB (blog/index.html)
================================================================ */
.blog-header {
  padding: 160px 5% 80px;
  background: var(--surf);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(196,255,71,.04) 0%, transparent 60%);
  pointer-events: none;
}
.blog-title {
  font-family: var(--fh);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5rem);
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
}
html[dir="rtl"] .blog-title {
  font-family: var(--far);
}
.blog-title span { color: var(--lime); }
.blog-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Filters */
.blog-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}
.bfilter {
  background: rgba(242,238,232,0.03);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-family: var(--fm);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  transition: all 0.3s var(--ease);
}
html[dir="rtl"] .bfilter {
  font-family: var(--far);
  font-size: 0.8rem;
  font-weight: 600;
}
.bfilter:hover, .bfilter.active {
  background: rgba(196,255,71,0.08);
  border-color: rgba(196,255,71,0.2);
  color: var(--lime);
}

/* Grid */
.blog-grid-wrap {
  padding: 80px 5% 120px;
  max-width: 1340px;
  margin: 0 auto;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}
.bcard {
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s;
  display: flex;
  flex-direction: column;
}
.bcard:hover {
  transform: translateY(-6px);
  border-color: var(--bord2);
}
.bc-img {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--ink3);
  position: relative;
  overflow: hidden;
}
.bc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.bcard:hover .bc-img img {
  transform: scale(1.05);
}
.bc-cat {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--lime);
  color: #000;
  font-family: var(--fm);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  z-index: 2;
}
html[dir="rtl"] .bc-cat {
  right: 14px;
  left: auto;
  font-family: var(--far);
  font-size: 0.7rem;
}
.bc-body {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bc-meta {
  font-family: var(--fm);
  font-size: 0.6rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
html[dir="rtl"] .bc-meta { font-family: var(--far); font-size: 0.7rem; font-weight: 500; }
.bc-meta span { width: 4px; height: 4px; background: var(--border); border-radius: 50%; }
.bc-title {
  font-family: var(--fh);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
html[dir="rtl"] .bc-title { font-family: var(--far); }
.bc-exc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 24px;
}
.bc-read {
  font-family: var(--fm);
  font-size: 0.65rem;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s;
}
html[dir="rtl"] .bc-read { font-family: var(--far); font-size: 0.75rem; font-weight: 700; }
.bc-read::after { content: '→'; font-size: 0.8rem; }
html[dir="rtl"] .bc-read::after { content: '←'; }
.bcard:hover .bc-read { gap: 10px; }

/* Featured Post (spans 2 columns if space permits) */
.bcard.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.bcard.featured .bc-img {
  width: 55%;
  aspect-ratio: auto;
}
.bcard.featured .bc-body {
  width: 45%;
  padding: 50px;
  justify-content: center;
}
.bcard.featured .bc-title {
  font-size: 2.2rem;
  margin-bottom: 20px;
}
.bcard.featured .bc-exc {
  font-size: 1rem;
}
@media(max-width: 900px) {
  .bcard.featured { flex-direction: column; }
  .bcard.featured .bc-img { width: 100%; aspect-ratio: 16/10; }
  .bcard.featured .bc-body { width: 100%; padding: 28px; }
  .bcard.featured .bc-title { font-size: 1.6rem; }
}

/* ================================================================
   ARTICLE READING EXPERIENCE (post.html)
================================================================ */
.art-hero {
  padding: 160px 5% 80px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.art-cat {
  display: inline-block;
  font-family: var(--fm);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}
html[dir="rtl"] .art-cat { font-family: var(--far); font-size: 0.8rem; font-weight: 700; }
.art-title {
  font-family: var(--fh);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}
html[dir="rtl"] .art-title { font-family: var(--far); line-height: 1.25; }
.art-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--fm);
  font-size: 0.65rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
html[dir="rtl"] .art-meta { font-family: var(--far); font-size: 0.8rem; font-weight: 600; }
.art-meta img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.art-cover {
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 5%;
}
.art-cover-inner {
  width: 100%;
  aspect-ratio: 21/9;
  background: var(--ink3);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.art-cover-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media(max-width: 768px) { .art-cover-inner { aspect-ratio: 16/9; } }

/* Article Body */
.art-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 5% 120px;
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text);
}
html[dir="rtl"] .art-body { font-size: 1.2rem; line-height: 2; }

.art-body p { margin-bottom: 28px; }
.art-body h2 {
  font-family: var(--fh);
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--white);
  margin: 60px 0 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
html[dir="rtl"] .art-body h2 { font-family: var(--far); }
.art-body h3 {
  font-family: var(--fh);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  margin: 40px 0 16px;
}
html[dir="rtl"] .art-body h3 { font-family: var(--far); }

.art-body ul, .art-body ol {
  margin-bottom: 28px;
  padding-left: 24px;
}
html[dir="rtl"] .art-body ul, html[dir="rtl"] .art-body ol {
  padding-left: 0;
  padding-right: 24px;
}
.art-body li {
  margin-bottom: 12px;
}
.art-body li::marker {
  color: var(--lime);
}

/* Editorial Blockquote */
.art-body blockquote {
  margin: 48px 0;
  padding: 32px 40px;
  background: rgba(196,255,71,0.03);
  border-left: 2px solid var(--lime);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--white);
  line-height: 1.6;
}
html[dir="rtl"] .art-body blockquote {
  border-left: none;
  border-right: 2px solid var(--lime);
}

/* Images in body */
.art-body figure {
  margin: 48px -10%; /* Break out of column slightly */
}
.art-body figure img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.art-body figcaption {
  text-align: center;
  font-family: var(--fm);
  font-size: 0.65rem;
  color: var(--dim);
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
@media(max-width: 768px) { .art-body figure { margin: 32px 0; } }

/* Code Snippets (For AI Prompts) */
.art-body pre {
  background: #0d0d12;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  overflow-x: auto;
  margin: 40px 0;
  font-family: var(--fm);
  font-size: 0.85rem;
  color: var(--lime);
  position: relative;
}
.art-body pre::before {
  content: 'PROMPT / CODE';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--border);
  color: var(--dim);
  font-size: 0.55rem;
  padding: 4px 10px;
  border-radius: 0 0 0 4px;
  letter-spacing: 0.1em;
}
html[dir="rtl"] .art-body pre {
  text-align: left; /* Code is usually LTR */
  direction: ltr;
}

/* Author Box */
.art-author {
  margin-top: 80px;
  padding-top: 60px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 32px;
}
.art-author img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(196,255,71,0.2);
}
.art-auth-info h4 {
  font-family: var(--fh);
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 6px;
}
html[dir="rtl"] .art-auth-info h4 { font-family: var(--far); }
.art-auth-info p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}
@media(max-width: 600px) {
  .art-author { flex-direction: column; text-align: center; gap: 20px; }
}
