/* ══════════════════════════════════════════════════════════════════════════
   RESEARCH EGYPT ACADEMY — /blog and /blog/{slug}
   (resources/views/site/blog/index + show). On top of content.css.

   The list is the home page's article section at full size: typographic
   tiles on sky / warm / white grounds, meta on top, a big title at the
   foot, the cover (when an article has one) framed at the top. The article
   is a reading page: a measured column of long-form Arabic (RTL) with the
   contents rail beside it, code read left-to-right, the keywords as chips,
   the related course as the home page's statement band.

   The class names `bl-card`, `bl-cta`, `bl-related` are test contracts
   (tests/Feature/Articles/PublicBlogTest) — restyled here, never renamed.
   ══════════════════════════════════════════════════════════════════════════ */

/* ---------------------------------------------------------------- the list */
.bl__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 20px); }
.bl-card { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: clamp(340px, 27vw, 480px); padding: clamp(18px, 1.8vw, 30px); border-radius: var(--r-lg); background: var(--sky); color: var(--c-text); overflow: hidden; transition: transform .5s var(--ease); }
/* step 12 (AC-11): article cards are all white (the card colour) with a hairline, no sky / peach rotation */
.bl__grid > .bl-card, .bl__grid > .bl-card:nth-child(n) { background: var(--c-card); border: 1px solid var(--c-line); }
/* (0,3,2): beats the entrance's settled state (content.css) */
html .bl__grid > a.bl-card:hover { transform: translateY(-6px); transition: transform .5s var(--ease); }
.bl-card:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 4px; }
.bl-card__cover { position: relative; display: block; aspect-ratio: 1200 / 630; border-radius: calc(var(--r-lg) - 10px); overflow: hidden; background: color-mix(in srgb, var(--c-card) 60%, transparent); }
.bl-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.bl-card:hover .bl-card__cover img { transform: scale(1.04); }
.bl-card__gen { position: absolute; inset: 0; display: grid; place-items: center; }
.bl-card__gen .rmark { width: 22%; height: auto; opacity: .9; }
.bl-card__body { display: flex; flex-direction: column; flex: 1; gap: 12px; min-width: 0; }
.bl-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; font-weight: 600; color: var(--c-text-2); }
.bl-card__dot { opacity: .5; }
.bl-card__title { margin-top: auto; font-family: var(--f-display); font-size: clamp(21px, 1.9vw, 34px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.bl-card__title:dir(rtl), .bl-card__title[dir="auto"]:lang(ar) { letter-spacing: 0; line-height: 1.5; }
.bl-card__excerpt { color: var(--c-text-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card__more { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-weight: 700; color: var(--c-hi-text); border-bottom: 2px solid color-mix(in srgb, var(--orange) 70%, transparent); padding-bottom: 3px; }
/* page one leads with the newest piece, across two columns, cover beside the words */
.bl__grid--feat > .bl-card:first-child { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; gap: clamp(16px, 2vw, 34px); }
.bl__grid--feat > .bl-card:first-child .bl-card__cover { align-self: center; }
.bl__grid--feat > .bl-card:first-child .bl-card__title { font-size: clamp(24px, 2.6vw, 46px); }
.bl__grid--feat > .bl-card:first-child:not(:has(.bl-card__cover)) { grid-template-columns: minmax(0, 1fr); }
.bl__empty { padding: clamp(28px, 4vw, 60px); text-align: center; color: var(--c-muted); font-size: 17px; }
.bl__feed { margin-top: clamp(24px, 3vw, 44px); }

/* the shared paginator (resources/views/vendor/pagination/tailwind.blade.php) */
.pgn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: clamp(28px, 3.4vw, 52px); }
.pgn__link, .pgn__gap { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 46px; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--c-card); border: 1px solid var(--c-line); font-weight: 700; font-size: 14.5px; color: var(--c-text); transition: background .25s, color .25s, border-color .25s; }
.pgn__link:hover { border-color: var(--c-line-2); background: var(--c-hi-a); }
.pgn__link:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.pgn__link.is-current { background: var(--btn); border-color: transparent; color: #fff; }
.pgn__link.is-disabled { opacity: .45; pointer-events: none; }
.pgn__gap { background: none; border: 0; min-width: 0; padding: 0 4px; }
.pgn__ico { width: 16px; height: 16px; flex: none; }
[dir="rtl"] .pgn__ico { transform: scaleX(-1); }

/* ---------------------------------------------------------------- the article */
.rp-readbar { position: fixed; inset-inline: 0; top: calc(var(--header-h) + 8px); z-index: 70; height: 3px; pointer-events: none; }
.rp-readbar i { display: block; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: left; }
[dir="rtl"] .rp-readbar i { transform-origin: right; }
.bl-article .rp-h1 { max-width: 20em; font-size: clamp(34px, 4.6vw, 84px); }
html[lang="ar"] .bl-article .rp-h1 { font-size: clamp(30px, 4vw, 72px); line-height: 1.32; }
.bl-cover { margin: 0 0 clamp(28px, 3.4vw, 56px); border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface); }
.bl-cover img { width: 100%; max-height: min(72vh, 760px); object-fit: cover; }
.bl-read { display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 19vw, 320px); gap: clamp(24px, 4vw, 80px); align-items: start; }
.bl-read > aside { align-self: stretch; }
.bl-read:not(:has(.rp-toc.is-ready)) { grid-template-columns: minmax(0, 1fr); }
.bl-read:not(:has(.rp-toc.is-ready)) > aside { display: none; }
.bl-read__main { min-width: 0; width: 100%; max-width: 78ch; }
.bl-read:not(:has(.rp-toc.is-ready)) .bl-read__main { margin-inline: auto; }

/* long-form prose — App\Support\MaterialMarkdown's output (h2–h4, p, lists,
   strong/em, links, inline code, pre.prose__code, img.prose__img) */
/* step 14 (AC-20): a reading column of at most 68ch and 1.8 line height. The 27em cap keeps it at 75 characters or fewer: the Arabic face here has a wide «0», so 68ch alone is about 860px, which is 110+ characters a line. */
.bl-prose { max-width: min(68ch, 27em); font-size: clamp(17px, 1.2vw, 19.5px); line-height: 1.8; color: var(--c-text-2); overflow-wrap: break-word; }
html[lang="en"] .bl-prose { line-height: 1.8; }
.bl-prose > :first-child { margin-top: 0; }
.bl-prose p { margin: 0 0 1.15em; }
.bl-prose :is(h2, h3, h4) { font-family: var(--f-display); color: var(--c-text); font-weight: 700; line-height: 1.4; margin: 1.8em 0 .6em; scroll-margin-top: calc(var(--header-h) + 28px); }
.bl-prose h2 { font-size: clamp(24px, 2.2vw, 36px); letter-spacing: -.02em; }
.bl-prose h3 { font-size: clamp(20px, 1.6vw, 27px); }
.bl-prose h4 { font-size: 1.08em; }
.bl-prose h2::before { content: ''; display: block; width: 34px; height: 3px; margin-bottom: 14px; border-radius: 3px; background: var(--orange); }
.bl-prose :is(ul, ol) { margin: 0 0 1.2em; padding-inline-start: 1.4em; list-style: revert; }
.bl-prose li { margin-top: .35em; padding-inline-start: .2em; }
.bl-prose li::marker { color: var(--orange-ink); font-weight: 700; }
.bl-prose strong { color: var(--c-text); font-weight: 700; }
.bl-prose em { font-style: italic; }
.bl-prose a { color: var(--c-hi-text); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--orange) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bl-prose a:hover { color: var(--c-text); }
.bl-prose blockquote { margin: 0 0 1.2em; padding: 14px 20px; border-inline-start: 3px solid var(--orange); border-radius: 0 16px 16px 0; background: var(--c-bg-2); color: var(--c-text); }
[dir="rtl"] .bl-prose blockquote { border-radius: 16px 0 0 16px; }
/* code reads left-to-right whatever the page direction — it is Latin source */
.bl-prose code { font-family: ui-monospace, 'Cascadia Code', Consolas, Menlo, monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate; padding: .14em .45em; border-radius: 7px; background: var(--c-bg-2); color: var(--c-text); border: 1px solid var(--c-line); }
.bl-prose .prose__code { direction: ltr; text-align: left; margin: 0 0 1.4em; padding: 18px 22px; border-radius: 20px; background: var(--c-bg-2); border: 1px solid var(--c-line); color: var(--c-text); overflow-x: auto; line-height: 1.75; font-size: clamp(13px, .95vw, 15px); tab-size: 4; }
.bl-prose .prose__code code { padding: 0; border: 0; background: none; font-size: inherit; }
.bl-prose .prose__img { display: block; width: 100%; height: auto; margin: .4em 0 1.4em; border-radius: 22px; border: 1px solid var(--c-line); }
.bl-prose table { width: 100%; margin: 0 0 1.4em; border-collapse: collapse; font-size: .92em; display: block; overflow-x: auto; }
.bl-prose :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--c-line); text-align: start; }

/* the keywords, as content (plain chips: there is no tag archive to link to) */
.bl-kw { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: clamp(28px, 3vw, 44px); padding-top: clamp(22px, 2.4vw, 32px); border-top: 1px solid var(--c-line); }
.bl-kw__label { font-size: 14px; font-weight: 700; color: var(--c-muted); margin-inline-end: 6px; }
.bl-kw__chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 15px; border-radius: 999px; background: var(--c-card); border: 1px solid var(--c-line); font-size: 14px; font-weight: 700; color: var(--c-text-2); }

/* the related course: the home page's statement band */
.bl-cta { margin-top: clamp(30px, 3.4vw, 54px); }
.bl-cta .rp-band { padding: clamp(24px, 3vw, 48px); }
.bl-cta .rp-band__t { font-size: clamp(24px, 2.4vw, 42px); }
html[lang="ar"] .bl-cta .rp-band__t { font-size: clamp(22px, 2.1vw, 36px); }

.bl-related .bl__grid { margin-top: 0; }
.bl-related .bl-card { min-height: clamp(260px, 20vw, 360px); }
.bl-back { margin-top: clamp(24px, 3vw, 44px); }

@media (max-width: 1100px) {
  .bl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bl-read { grid-template-columns: minmax(0, 1fr); }
  .bl-read > aside { display: none; }
  .bl-read__main { margin-inline: auto; }
}
@media (max-width: 720px) {
  .bl__grid { grid-template-columns: minmax(0, 1fr); }
  .bl__grid--feat > .bl-card:first-child { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
  .bl-card { min-height: 0; }
  .bl-card__title { margin-top: 8px; }
  .bl-prose .prose__code { border-radius: 16px; padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .bl-card, .bl-card__cover img { transition: none; }
  html .bl__grid > a.bl-card:hover { transform: none; }
}
/* step 21 (F-mobile): 44px tap targets on phones — here because the layered fix/mobile.css loses to content.css */
@media (max-width: 900px) { a.rp-chip { min-height: 44px; } }
