/* ============================================================
   Aqaris · Arabic blog listing (ar/blog.html)
   No Figma frame for this page: it follows the redesigned Arabic
   pages (hero like about/pricing, cards like the feature pages).
   Loaded after home.css and home-ar.css; body is
   "home home-ar blog". Cards are rendered by assets/js/blog.js from
   /blog/posts/index.json with the markup the English blog uses
   (.card.blog-card …), restyled here. English posts arrive as
   lang="en" dir="ltr" cards.
   Breakpoints: desktop > 1024 · tablet 641–1024 · mobile ≤ 640
   ============================================================ */

.blog .nav-links a[aria-current="page"] { color: var(--hp-indigo); font-weight: 600; }

/* ---------- Hero ---------- */
.bl-hero { background: var(--hp-slate); padding: 96px 0 88px; }
.bl-pill {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  background: var(--hp-lav);
  font-size: 14px; font-weight: 600; line-height: 22px;
  color: var(--hp-indigo);
}
.bl-hero h1 { max-width: 860px; margin-top: 20px; font-size: 64px; line-height: 1.3; }
.bl-hero-lead { max-width: 640px; margin-top: 22px !important; font-size: 20px; line-height: 1.5; }
.bl-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px !important;
  font-size: 15px; font-weight: 500; line-height: 24px;
  color: var(--hp-body);
}

/* ---------- Posts ---------- */
.bl-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  align-items: stretch;
}
.bl-grid .blog-card {
  display: flex; flex-direction: column;
  padding: 0 0 26px;
  border: 1px solid var(--hp-line);
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: none;
  overflow: hidden;
  transition: transform .45s var(--hp-smooth), box-shadow .45s var(--hp-smooth), border-color .3s var(--ease);
}
.bl-grid .blog-card > :not(a:first-child) { margin-left: 26px; margin-right: 26px; }
.bl-grid .blog-card-img {
  display: block; width: 100%; margin: 0 0 22px;
  aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 0;
}
.bl-grid .blog-card .eyebrow {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--hp-lav);
  font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none;
  color: var(--hp-indigo);
}
.bl-grid .blog-card:not(:has(.blog-card-img)) .eyebrow { margin-top: 26px; }
.bl-grid .eyebrow::before { display: none; }
.bl-grid .blog-card h3 { margin-top: 14px; margin-bottom: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.bl-grid .blog-card h3 a { color: var(--hp-ink); }
.bl-grid .blog-card h3 a:hover { color: var(--hp-indigo); }
.bl-grid .blog-card p { margin-top: 10px; font-size: 16px; line-height: 1.6; color: var(--hp-body); }
.bl-grid .blog-card .post-meta {
  justify-content: flex-start; gap: 8px;
  margin-top: 16px; margin-bottom: 0;
  font-size: 14px; color: var(--hp-muted);
}
.bl-grid .blog-card .card-link {
  margin-top: auto; padding-top: 16px;
  font-size: 15.5px; font-weight: 600; line-height: 24px;
  color: var(--hp-indigo);
}

@media (hover: hover) {
  .bl-grid .blog-card:hover {
    transform: translateY(-4px);
    border-color: #C7C2F7;
    box-shadow: 0 22px 44px -26px rgba(15,23,42,.28);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bl-grid .blog-card { transition-duration: .3s !important; }
  .bl-grid .blog-card:hover { transform: none; }
}

/* ============================================================
   Post page (ar/blog/<slug>.html, shell ar/blog/post.html)
   ============================================================ */
.bl-post-hero { background: var(--hp-slate); padding: 72px 0 120px; }
.bl-post-head { max-width: 900px; text-align: center; }
.bl-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; line-height: 24px;
  color: var(--hp-body);
}
.bl-back:hover { color: var(--hp-indigo); }
.bl-post-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.bl-post-tags:empty { display: none; }
.home-ar .bl-post-tags .tag-pill {
  display: inline-flex; align-items: center;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  background: var(--hp-lav);
  font-size: 13px; font-weight: 600; line-height: 1; text-transform: none;
  color: var(--hp-indigo);
}
.bl-post-head h1 { margin-top: 18px; font-size: 48px; line-height: 1.35; }
.bl-post-lead { max-width: 720px; margin: 20px auto 0 !important; font-size: 19px; line-height: 1.6; }
.bl-post-head .bl-post-meta { justify-content: center; gap: 8px; margin-top: 20px; font-size: 15px; color: var(--hp-muted); }

.bl-post-figure { max-width: 1000px; margin: -88px auto 0; padding: 0 32px; }
.bl-post-figure img { display: block; width: 100%; border-radius: 20px; box-shadow: 0 30px 60px -24px rgba(15,23,42,.3); }

.bl-post { padding-top: 64px; }
.bl-post-body { max-width: 760px; margin: 0 auto; }
.bl-post-body > :first-child { margin-top: 0; }
.home-ar .bl-post-body p,
.home-ar .bl-post-body li { font-size: 18px; line-height: 1.85; color: var(--hp-body); }
.bl-post-body p { margin: 0 0 1.1em; }
.home-ar .bl-post-body h2 { margin: 2em 0 .6em; font-size: 30px; line-height: 1.4; }
.home-ar .bl-post-body h3 { margin: 1.6em 0 .5em; font-size: 22px; font-weight: 600; line-height: 1.45; }
.bl-post-body strong { color: var(--hp-ink); }
.bl-post-body a { color: var(--hp-indigo); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.bl-post-body ul, .bl-post-body ol { margin: 0 0 1.2em; padding: 0 1.4em 0 0; }
.bl-post-body li { margin-bottom: .5em; }
.bl-post-body img { display: block; width: 100%; margin: 1.6em 0; border-radius: 16px; }
/* RTL: style.css draws these on the left */
.home-ar .bl-post-body blockquote {
  margin: 1.6em 0; padding: 14px 22px;
  border-left: 0; border-right: 3px solid var(--hp-indigo);
  border-radius: 12px 0 0 12px;
  background: var(--hp-slate);
}
.home-ar .bl-post-body table { width: 100%; margin: 1.6em 0; border-collapse: collapse; font-size: 15.5px; }
.home-ar .bl-post-body th,
.home-ar .bl-post-body td { padding: 12px 14px; border: 1px solid var(--hp-line); text-align: right; vertical-align: top; line-height: 1.6; }
.home-ar .bl-post-body th { background: var(--hp-slate); font-weight: 600; color: var(--hp-ink); }
/* Formulas stay left-to-right */
.bl-post-body code { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ============================================================
   Small desktop (1025–1240)
   ============================================================ */
@media (max-width: 1240px) {
  .bl-hero h1 { font-size: clamp(52px, 5vw, 64px); }
  .bl-grid { gap: 20px; }
}

/* ============================================================
   Tablet (≤ 1024)
   ============================================================ */
@media (max-width: 1024px) {
  .bl-hero { padding: 72px 0 64px; }
  .bl-hero h1 { font-size: 52px; }
  .bl-hero-lead { max-width: none; font-size: 18px; }
  .bl-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

  .bl-post-hero { padding: 56px 0 104px; }
  .bl-post-head h1 { font-size: 40px; }
  .bl-post-lead { font-size: 18px; }
  .bl-post-figure { margin-top: -72px; }
  .bl-post { padding-top: 48px; }
  /* wide tables scroll inside the column instead of the page */
  .home-ar .bl-post-body table { display: block; overflow-x: auto; }
}

/* ============================================================
   Mobile (≤ 640)
   ============================================================ */
@media (max-width: 640px) {
  .bl-hero { padding: 56px 0 48px; }
  .bl-hero h1 { font-size: 36px; }
  .bl-hero-lead { font-size: 17px; }
  .bl-grid { grid-template-columns: 1fr; gap: 14px; }
  .bl-grid .blog-card > :not(a:first-child) { margin-left: 22px; margin-right: 22px; }

  .bl-post-hero { padding: 40px 0 72px; }
  .bl-post-head h1 { font-size: 30px; line-height: 1.4; }
  .bl-post-lead { font-size: 17px; }
  .bl-post-figure { margin-top: -48px; padding: 0 20px; }
  .bl-post-figure img { border-radius: 14px; }
  .bl-post { padding-top: 36px; }
  .home-ar .bl-post-body p, .home-ar .bl-post-body li { font-size: 17px; }
  .home-ar .bl-post-body h2 { font-size: 24px; }
  .home-ar .bl-post-body h3 { font-size: 20px; }
}
