/* ==========================================================================
   Blog — list + single article
   ========================================================================== */
body.is-rtl .flip-rtl { transform: scaleX(-1); }

/* ── Hero + search ─────────────────────────────────────────── */
.blog-hero { padding-bottom: 96px; }
.blog-search {
  position: relative; max-width: 520px; margin: 26px auto 0;
}
.blog-search i { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.blog-search input {
  width: 100%; height: 54px; padding-inline: 48px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; font-size: 15.5px; outline: 0;
  transition: border-color .2s;
}
.blog-search input:focus { border-color: var(--red); }

.blog-page { padding-bottom: 88px; }
.blog-wrap { margin-top: -56px; position: relative; }

/* ── Categories ────────────────────────────────────────────── */
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.blog-cats a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; color: var(--navy);
  transition: all .2s;
}
.blog-cats a span { font-size: 12px; color: var(--muted-2); font-weight: 700; }
.blog-cats a:hover { border-color: var(--red); color: var(--red); }
.blog-cats a.active { background: var(--red); border-color: var(--red); color: #fff; }
.blog-cats a.active span { color: rgba(255,255,255,.8); }

/* ── Featured ──────────────────────────────────────────────── */
.blog-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin-bottom: 32px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.blog-featured:hover { border-color: var(--line-2); transform: translateY(-2px); }
.bf-media { position: relative; min-height: 300px; background: var(--bg-soft); }
.bf-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bf-body { padding: 36px 38px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.bf-body h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -0.03em; }
.bf-body p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.bc-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: #FFF4D6; color: #9A6700; font-size: 12.5px; font-weight: 700;
}

/* ── Grid + cards ──────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; transition: border-color .2s, transform .2s;
}
.blog-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.bc-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.bc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.blog-card:hover .bc-media img { transform: scale(1.04); }
.bc-ph {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; color: #fff;
  background: linear-gradient(135deg, #ff6b81, var(--red));
}
.bc-cat {
  align-self: flex-start; display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: var(--red-50); color: var(--red); font-size: 12.5px; font-weight: 700;
}
.bc-cat--float { position: absolute; top: 14px; inset-inline-start: 14px; background: #fff; }
.bc-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bc-body h3 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.bc-body h3 a:hover { color: var(--red); }
.bc-body p { color: var(--muted); font-size: 14.5px; line-height: 1.65; flex: 1; }
.bc-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted-2); font-size: 13px; }
.bc-meta i { margin-inline-end: 4px; }
.bc-more { display: inline-flex; align-items: center; gap: 8px; color: var(--red); font-weight: 700; margin-top: 4px; }

.blog-empty { text-align: center; padding: 70px 20px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.blog-empty i { font-size: 46px; color: var(--muted-2); margin-bottom: 14px; }
.blog-empty p { color: var(--muted); font-size: 16px; margin-bottom: 18px; }

/* ── Pager ─────────────────────────────────────────────────── */
.blog-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; }
.blog-pager a {
  min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; color: var(--navy);
}
.blog-pager a:hover { border-color: var(--red); color: var(--red); }
.blog-pager a.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ══ Single article ═══════════════════════════════════════════ */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .1s linear; }
body.is-rtl .read-progress span { margin-inline-start: auto; }

.post-hero {
  padding: 46px 0 40px;
  background: radial-gradient(700px 300px at 50% -20%, rgba(230,0,35,.10), transparent 70%), linear-gradient(180deg, #fff, var(--bg-warm));
}
.post-draft-note { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; margin-bottom: 16px; border-radius: 10px; background: #FFF4D6; color: #9A6700; font-weight: 600; font-size: 14px; }
.post-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.post-crumbs a:hover { color: var(--red); }
.crumb-sep { font-size: 10px; color: var(--muted-2); }
body.is-rtl .crumb-sep { transform: scaleX(-1); }
.post-title { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; margin-bottom: 14px; }
.post-lead { font-size: 19px; color: var(--muted); line-height: 1.65; margin-bottom: 20px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; color: var(--muted); font-size: 14.5px; }
.post-meta i { margin-inline-end: 5px; color: var(--muted-2); }
.post-author { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); }
.post-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 14px; }

.post-cover { margin: 30px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft); }
.post-cover img { width: 100%; height: auto; }

.post-toc { margin-top: 30px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.post-toc summary { cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; gap: 10px; align-items: center; }
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc summary i { color: var(--red); }
.post-toc ol { margin-top: 12px; display: grid; gap: 6px; counter-reset: toc; }
.post-toc li a { color: var(--ink-2); font-size: 15px; }
.post-toc li a:hover { color: var(--red); }
.post-toc .toc-l3 { padding-inline-start: 18px; font-size: 14px; }

/* Article typography */
.post-content { margin-top: 34px; font-size: 18px; line-height: 1.85; color: var(--ink-2); overflow-wrap: break-word; }
.post-content > * + * { margin-top: 1.1em; }
.post-content h2 { font-size: 28px; font-weight: 800; margin-top: 1.8em; scroll-margin-top: calc(var(--header-h) + 20px); }
.post-content h3 { font-size: 22px; font-weight: 700; margin-top: 1.5em; scroll-margin-top: calc(var(--header-h) + 20px); }
.post-content h4 { font-size: 19px; font-weight: 700; margin-top: 1.4em; }
.post-content a { color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { padding-inline-start: 1.4em; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li + li { margin-top: .4em; }
.post-content li::marker { color: var(--red); }
.post-content img { border-radius: 14px; height: auto; margin-inline: auto; }
.post-content figure { margin-inline: 0; }
.post-content figcaption { text-align: center; color: var(--muted-2); font-size: 14px; margin-top: 8px; }
.post-content blockquote {
  margin-inline: 0; padding: 18px 24px; border-inline-start: 4px solid var(--red);
  background: var(--bg-warm); border-radius: 0 14px 14px 0; font-size: 19px; color: var(--navy); font-style: italic;
}
body.is-rtl .post-content blockquote { border-radius: 14px 0 0 14px; }
.post-content code { background: var(--bg-soft); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.post-content pre { background: #0F172A; color: #E2E8F0; padding: 18px 20px; border-radius: 14px; overflow-x: auto; font-size: 14.5px; line-height: 1.6; direction: ltr; text-align: left; }
.post-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid var(--line-2); padding: 10px 14px; text-align: start; }
.post-content th { background: var(--bg-soft); font-weight: 700; color: var(--navy); }
.post-content hr { border: 0; height: 1px; background: var(--line-2); margin: 2em 0; }
.post-content iframe, .post-content video { max-width: 100%; border-radius: 14px; }
.post-content iframe[src*="youtube"], .post-content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.post-tags a { padding: 6px 13px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.post-tags a:hover { color: var(--red); border-color: var(--red); }

.post-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-share strong { color: var(--navy); }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btns a, .share-btns button {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer;
  color: #fff; font-size: 16px; transition: transform .15s, opacity .15s;
}
.share-btns a:hover, .share-btns button:hover { transform: translateY(-2px); opacity: .9; }
.share-facebook { background: #1877F2; } .share-x { background: #000; } .share-pinterest { background: #E60023; }
.share-whatsapp { background: #25D366; } .share-telegram { background: #229ED9; } .share-linkedin { background: #0A66C2; }
.share-copy { background: var(--navy); }
.share-copy.done { background: var(--success); }

.post-cta {
  display: flex; align-items: center; gap: 18px; margin-top: 36px; padding: 24px 26px;
  border-radius: var(--radius-lg); background: var(--navy); color: #fff;
}
.post-cta-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--red); font-size: 26px; flex-shrink: 0; }
.post-cta strong { display: block; font-family: var(--font-head); font-size: 19px; margin-bottom: 4px; }
.post-cta p { color: rgba(255,255,255,.75); font-size: 14.5px; }
.post-cta .btn { margin-inline-start: auto; flex-shrink: 0; }

.related { margin-top: 70px; padding: 56px 0; background: var(--bg-soft); }
.related-title { font-size: 28px; font-weight: 800; margin-bottom: 26px; text-align: center; }
.post-back { margin-top: 40px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .blog-featured { grid-template-columns: 1fr; }
  .bf-media { min-height: 0; aspect-ratio: 16 / 9; }
  .bf-body { padding: 24px 22px; }
  .post-cta { flex-direction: column; align-items: flex-start; }
  .post-cta .btn { margin-inline-start: 0; width: 100%; justify-content: center; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; gap: 18px; }
  .post-content { font-size: 17px; }
  .post-content h2 { font-size: 24px; }
  .post-lead { font-size: 17px; }
  .post-share { flex-direction: column; align-items: flex-start; }
}
