/* fix/perf.css — step 24 (AC-13), agent I-perf.
   Loaded after v3.css on every page (ReaPage::cssFiles globs css/fix/*.css).

   content-visibility: auto on the home sections that sit at the end of the page,
   so the browser skips their layout/paint until they come near the viewport.
   Only the tail sections get it, never the pinned ones (#experience, #pipeline)
   or anything that can sit before them: a skipped section is laid out at its
   placeholder height, and a wrong height above a pin would move where the pin
   starts. `auto` in contain-intrinsic-size makes the browser remember the real
   height once a section has rendered, so scrolling back up does not jump.
   1000px is the middle of the measured heights (articles 1,024 / faq 1,007 /
   banha 923 / cta 900 / apply 1,245 at 1440; 715–1,951 at 375). */
@supports (content-visibility: auto) {
  .v3 main > #instructors,
  .v3 main > #voices,
  .v3 main > #pricing,
  .v3 main > #articles,
  .v3 main > #faq,
  .v3 main > #banha,
  .v3 main > section.cta,
  .v3 main > #apply {
    content-visibility: auto;
    contain-intrinsic-size: auto 1000px;
  }
  /* after the first in-page jump (main.js jumpTo) every section is laid out for real, so anchors land exactly */
  html.rea-all-rendered.v3 main > section { content-visibility: visible; }
}

/* step 25 (AC-16): «مين إحنا» falls back to bc-banha.webp — a 16:9 shot whose middle
   54% is the "Research Egypt | Academy" lettering — inside a portrait 4:4.6 box.
   object-fit: cover showed only the middle 48% of its width (measured at 375, 768,
   1024 and 1440), so "Re…Academ" was cut at every width; no object-position can
   fit 54% into 48%. contain shows the whole picture, and the box takes the shot's
   own edge colours (top rows #0b0e10, bottom rows #192128, sampled from the file)
   so the bands read as part of the stage; the colour switch sits behind the
   picture. A real classroom photo (D.aboutPhoto / D.photos.hall) has no lettering
   and keeps cover. */
.amedia__photo:has(> img[src*="bc-banha"]) {
  background: linear-gradient(180deg, #0b0e10 50%, #192128 50%);
}
.amedia__photo > img[src*="bc-banha"] {
  object-fit: contain;
}
