/* FM-1688 BETA-FIX 5 (Fady's home review). Hand-written, scoped under .v3. */

/* a) the portrait: the cut-out ended in a hard straight edge at the knees; it now dissolves into the slab/page over its last fifth,
      so no image box and no cut line show (EN + AR, every width). The mask comes after the drop-shadow filter, so the shadow fades too. */
.v3 .hero .portrait{-webkit-mask-image:linear-gradient(to bottom,#000 0,#000 76%,transparent 99%);mask-image:linear-gradient(to bottom,#000 0,#000 76%,transparent 99%)}

/* b) the orange question ticker: lighter weight, a little smaller, calm separators; the motion stays (reduced motion already stops it) */
.v3 .ticker li{font-weight:600;font-size:clamp(1rem,1.6vw,1.4rem);gap:22px;padding-inline-end:22px;height:clamp(46px,4.4vw,64px);letter-spacing:0}
.v3 .ticker li::after{width:6px;height:6px;opacity:.5}

/* c) reels: a play badge on every cover, and the lightbox (reels.js) */
.v3 .reel-cover{position:relative}
.v3 .reel-play{position:absolute;inset-inline-end:10px;bottom:10px;width:40px;height:40px;display:grid;place-items:center;background:var(--orange);color:#0B1429;transition:transform var(--t-fast) var(--ease)}
.v3 .reel-play svg{width:18px;height:18px}
.v3 .reel:hover .reel-play,.v3 .reel:focus-visible .reel-play{transform:scale(1.12)}
.v3 .reel-lb{position:fixed;inset:0;z-index:2147483100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:16px;background:rgba(11,20,41,.92);animation:lb-in .22s var(--ease-io) both}
.v3 .reel-lb-frame{width:min(92vw,calc((100dvh - 120px) * 9 / 16));aspect-ratio:9/16;background:#000;box-shadow:0 0 0 2px #F4F2EC,10px 10px 0 var(--orange)}
.v3 .reel-lb-frame iframe{display:block;width:100%;height:100%;border:0}
.v3 .reel-lb-x{position:absolute;top:12px;inset-inline-end:12px;width:48px;height:48px;display:grid;place-items:center;background:var(--orange);color:#0B1429;border:0;cursor:pointer}
.v3 .reel-lb-x svg{width:22px;height:22px}
.v3 .reel-lb-yt{color:#F4F2EC;font-weight:700;text-decoration:underline;text-decoration-color:var(--orange);text-decoration-thickness:2px;text-underline-offset:5px}
@keyframes lb-in{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.v3 .reel-lb{animation:none}}

/* Shared imagery and playback controls for the home, gallery and watch page. */
.v3 .media-cover { position: relative; overflow: clip; background: var(--paper-2); aspect-ratio: 16 / 9; }
.v3 .media-cover--vertical { aspect-ratio: 9 / 16; }
.v3 .media-cover > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v3 .media-cover .reel-play { position: absolute; inset-inline-end: 10px; inset-block-end: 10px; display: grid; place-items: center; width: 38px; height: 38px; background: var(--orange); color: var(--paper); }
.v3 .media-cover .reel-play svg { width: 18px; height: 18px; }
.v3 .reel-lb--wide .reel-lb-frame { width: min(90vw, 960px, calc((100dvh - 168px) * 16 / 9)); aspect-ratio: 16 / 9; }
.v3 .reel-lb-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.v3 .reel-lb-actions button { min-height: 44px; padding-inline: 8px; background: var(--orange); color: var(--paper); border: 0; font-weight: 700; }
.v3 .reel-lb-actions button:disabled { opacity: .5; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  .v3 .media-cover > img { transition: transform 500ms var(--ease-io); }
  .v3 a:hover .media-cover > img { transform: scale(1.055); }
}
.v3 .media-cover .reel-play { color: var(--media-play-ink, var(--ink)); }
.v3[data-theme="dark"] .media-cover .reel-play, .v3 .on-ink .media-cover .reel-play { --media-play-ink: var(--paper); }
.v3 .reel-lb-frame { position: relative; }
.v3 .reel-lb:not(.reel-lb--wide) .reel-lb-frame { width: min(88vw, calc((100dvh - 174px) * 9 / 16)); }
.v3 .reel-lb-swipe { position: absolute; inset-block: 0; inset-inline-end: 0; width: 20px; touch-action: none; }
.v3 .reel-lb { background: color-mix(in srgb, var(--paper) 92%, transparent); }

/* FM-1688 BETA-FIX BUG 4 (dark mode): v3's article / legal / docs bodies use the class .prose, which is ALSO Tailwind Typography's. Its colours come from --tw-prose-* (dark greys,
   « .prose :where(h2) { color: var(--tw-prose-headings) } »), which never flip with the v3 theme: near-black h2/h3 on navy (1.03:1), black code chips, links, quotes, table rules.
   Map every one of them to the v3 tokens, which DO flip (.v3[data-theme=dark] and prefers-color-scheme), so one place fixes every page type. */
.v3 .prose{
  --tw-prose-body:var(--ink);--tw-prose-headings:var(--ink);--tw-prose-lead:var(--ink-2);--tw-prose-links:var(--ink);--tw-prose-bold:var(--ink);
  --tw-prose-counters:var(--ink-3);--tw-prose-bullets:var(--orange);--tw-prose-hr:var(--line);--tw-prose-quotes:var(--ink-2);--tw-prose-quote-borders:var(--orange);
  --tw-prose-captions:var(--ink-3);--tw-prose-kbd:var(--ink);--tw-prose-kbd-shadows:var(--ink);--tw-prose-code:var(--ink);
  --tw-prose-pre-code:var(--ink);--tw-prose-pre-bg:var(--paper-2);--tw-prose-th-borders:var(--ink);--tw-prose-td-borders:var(--line);
}

/* BUG 4, same root cause for the app's shadcn widgets inside article bodies (the comments box: text-foreground / text-muted-foreground / text-destructive read the APP theme on <html>, which does not follow the
   v3 theme switch that lives on .v3). Only the three text colours, only inside .prose: the rest of the bridge already exists (article.css, .legacy in pages2.css). */
.v3 .prose{--foreground:var(--ink);--muted-foreground:var(--ink-3);--destructive:#B3261E}
.v3[data-theme="dark"] .prose{--destructive:#FF8F86}
@media (prefers-color-scheme:dark){.v3:not([data-theme="light"]) .prose{--destructive:#FF8F86}}
/* BUG 4: product «connected to» chips and tier rows were a white 14% wash on the product colour (white text 4.17:1 on Zekra purple). A 6% wash keeps the look; the text keeps the colour's full contrast */
.v3 .pvis .conn span,.v3 .pvis .tiers div{background:rgba(255,255,255,.06)}
/* BUG 4: the two product colours whose best text colour was still under 4.5:1 (TomatoPHP 4.43, ToGO 4.50) nudged 4% so text on them passes everywhere (home cards, hero, tiles) */
.v3{--p-togo:#288F9D;--p-tomatophp:#CD4223}
/* BUG 4: the newsletter form (/subscribe, orange band) set its button to « background: var(--ink); color: var(--paper) » (!important): both flip with the theme, so in dark it was navy text on a navy
   fill (1.0:1). The band is orange in both themes, so the button is navy with an ivory label in both. */
.v3 section.sub .legacy button[type=submit],.v3 section.sub .legacy [data-slot=button]{background:#0B1429!important;color:#F4F2EC!important}

/* FM-1688 BETA-FIX BUG 1 leftover: a service page's hero «back» button carries its parent's title (AI Chatbots for Business and Customer Service) and was nowrap: it widened the whole page at 390px (/ai/chatbots/guide, EN+AR). It wraps. */
.v3 .hero-act{flex-wrap:wrap;min-width:0;max-width:100%}
.v3 .hero-act .btn{white-space:normal;max-width:100%;text-align:start;min-width:0}

/* ===== FM-1688-VISUALS ===== */
/* Layla's line icons (lib/v3/icons.ts): inline SVG, currentColor, 24px grid, follow light / dark. --ic-a colours the accent cell. */
.v3 .ico{width:1.5em;height:1.5em;flex:none;display:inline-block;vertical-align:-.3em;--ic-a:var(--orange)}
.v3 .card4 i:has(.ico){--ic-a:var(--orange);color:var(--ink);background:transparent;display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--line)}
.v3 .card4 i .ico{width:24px;height:24px;vertical-align:0}
.v3 .sico{display:inline-flex;width:44px;height:44px;align-items:center;justify-content:center;border:1px solid var(--line);margin-bottom:6px;--ic-a:var(--orange)}
.v3 .hico{display:inline-flex;vertical-align:middle;margin-inline-end:.5em;color:var(--orange-ink);--ic-a:currentColor}
.v3 .hico .ico{width:1.1em;height:1.1em;vertical-align:0}
.v3 .dico{display:inline-flex;color:var(--orange);margin-inline-end:10px;--ic-a:currentColor}
.v3 .dlink{grid-template-columns:44px auto minmax(0,1fr) 26px}
.v3 .dico .ico{width:clamp(1.5rem,5vw,2rem);height:clamp(1.5rem,5vw,2rem)}
.v3 .fico{width:1.05em;height:1.05em;margin-inline-end:.6em;vertical-align:-.15em;--ic-a:currentColor;opacity:.9}
.v3 .foot-contact a{display:inline-flex;align-items:center}
.v3 .fico-row{display:inline-flex;align-items:center}
.v3 .tico{display:inline-flex;width:44px;height:44px;align-items:center;justify-content:center;border:1px solid var(--line);margin-bottom:12px;--ic-a:var(--orange)}
.v3 .cico{width:1.05em;height:1.05em;margin-inline-end:.5em;vertical-align:-.15em;--ic-a:currentColor}
/* post covers (public/v3/covers): the card fills the cover box; the live category chip + reading time sit on it; the post hero shows the 3:2 card at its own size, centred */
.v3 .cv--img img[src^="/v3/covers/"]{object-fit:cover;width:100%;height:100%}
.v3 .cover-frame img[src^="/v3/covers/"]{width:100%;max-width:640px;height:auto;margin-inline:auto}

/* ---- art slots (lib/v3/art.ts) ---- */
.v3 .art{margin:0;width:var(--art);max-width:100%;aspect-ratio:1;display:grid;place-items:center;justify-self:end;filter:drop-shadow(0 18px 16px rgba(11,20,41,.35));pointer-events:none}
@media (max-width:999px){.v3 .art{width:var(--art-s)}}
.v3 .art img{width:100%;height:100%;object-fit:contain;display:block}
/* fallback until Layla's PNG lands: the line icon on a tinted tile of the same size */
.v3 .art--fb{filter:none;background:linear-gradient(135deg,var(--paper-2),var(--paper-3));border:1px solid var(--line);color:var(--ink);--ic-a:var(--orange);position:relative}
.v3 .art--fb::after{content:"";position:absolute;inset-inline-end:14px;top:14px;width:14px;height:14px;background:var(--orange)}
.v3 .art-ico{width:42%;height:42%;stroke-width:1.6}
.v3 .ph-grid.has-art{align-items:center}
@media (min-width:1000px){.v3 .ph-grid.has-art{grid-template-columns:minmax(0,1fr) auto}}
.v3 .art--corner{position:absolute;inset-inline-end:var(--gutter,24px);top:50%;transform:translateY(-50%);display:none}
.v3 .live-grid,.v3 .news-grid{position:relative}
@media (min-width:1280px){.v3 .art--corner{display:grid}}
.v3 .news .art--fb{background:rgba(11,20,41,.08);border-color:rgba(11,20,41,.3);color:#0B1429}
.v3 .live .art--fb{background:rgba(244,242,236,.06);border-color:rgba(244,242,236,.2);color:#F4F2EC}
/* a slow float on the art; the whole block sits inside the no-preference media query, so reduced motion turns it off */
@media (prefers-reduced-motion:no-preference){.v3 .art--hero{animation:art-float 7s ease-in-out infinite alternate}.v3 .art--corner{animation:art-float-c 8s ease-in-out infinite alternate}}
@keyframes art-float{from{translate:0 0}to{translate:0 -10px}}
@keyframes art-float-c{from{translate:0 -4px}to{translate:0 6px}}
/* hover lift + glow on cards */
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .v3 .pc,.v3 .pfeat2,.v3 .sp-tier,.v3 .ch2,.v3 .card4,.v3 .step4{transition:transform .28s var(--ease),box-shadow .28s var(--ease)}
  .v3 .pc:hover,.v3 .pfeat2:hover,.v3 .sp-tier:hover,.v3 .ch2:hover{transform:translateY(-5px);box-shadow:0 14px 30px -12px rgba(226,102,28,.45)}
  .v3 .card4:hover,.v3 .step4:hover{transform:translateY(-3px);box-shadow:0 10px 26px -14px rgba(226,102,28,.55)}
  .v3 .pc .cv img{transition:transform .5s var(--ease)}
  .v3 .pc:hover .cv img{transform:scale(1.04)}
}
/* smooth page + nav transition: cross-document View Transitions (Chromium); other browsers navigate as before */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation:vt-out .16s ease both}
  ::view-transition-new(root){animation:vt-in .26s ease both}
  html{scroll-behavior:smooth}
}
@keyframes vt-out{to{opacity:0}}
@keyframes vt-in{from{opacity:0}}
.v3 .nav{view-transition-name:v3nav}
