/* ==========================================================================
   Hero, diagonal photo (the client's final pick, al_hadbaa_diagonal_photo).
   From 768px: a navy panel cut on a diagonal (60% across at the top, 45% at
   the bottom on desktop, further right on tablets; mirrored in RTL), and the photo in its own panel that matches
   the visible area beside it (the same diagonal, via clip-path), so the image
   scales to what people actually see. A glowing cyan line runs along the
   cut. The navy panel carries the hero mouse effect (overlay reveal and
   particles, css/base.css); the particles stay clear of the copy. Each
   slide's data-focus keeps its subject in frame. The bottom is one
   straight edge onto the navy brands band, whose top hairline is the seam.
   Below 768px: one full-bleed scene. The portrait product photo fills the
   hero, under a navy gradient that is strongest behind the copy; the copy
   sits in the upper part and the products keep the lower part. No diagonal
   and no cut line. A larger headline, the eyebrow with a short
   cyan rule, the cyan pill as the one primary action and the secondary
   action as a text link. Heights use svh, so a phone's address bar never
   cuts the hero off.
   ========================================================================== */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy-900); }

/* --- Photo ----------------------------------------------------------------- */
.hero__media { position: relative; overflow: hidden; inline-size: 100%; block-size: clamp(240px, 45svh, 430px); }
/* Slideshow (js/hero-slideshow.js): the slides stack and crossfade; the
   active one settles from a slight zoom while it shows */
.hero__slides { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.hero__slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-slide) var(--ease-in-out); }
.hero__slide.is-active { z-index: 1; opacity: 1; }
.hero__slide figure { position: absolute; inset: 0; margin: 0; }
/* Zoom capped at 1.03: any more crops the subject */
.hero__slide img { transform: scale(1.03); transition: transform var(--dur-settle) var(--ease-out); }
.hero__slide.is-active img { transform: none; }
.motion-paused .hero__slide img { transform: none; transition: none; }
.hero__photo img {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%;
  /* --focus comes from the image's data-focus (js/hero-slideshow.js) */
  object-fit: cover; object-position: var(--focus, center);
  filter: saturate(.83) contrast(1.08);
}
/* A light shade from the cut side and from the bottom */
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--to-end, to right), color-mix(in oklch, var(--navy-800) 8%, transparent), transparent 38%),
    linear-gradient(to top, color-mix(in oklch, var(--navy-900) 62%, transparent), transparent 34%);
}
[dir="rtl"] .hero__media::after { --to-end: to left; }

/* --- Navy panel: photo, fade and particles --------------------------------- */
.hero__navy, .hero__edge { display: none; }
/* The panel's photo, under a see-through navy fade (::before) so the copy
   still reads; the fade is the overlay the mouse effect clears */
.hero__navy {
  --navy-photo: none;
  --fade-from: color-mix(in oklch, var(--navy-700) 78%, transparent);
  --fade-to: color-mix(in oklch, var(--navy-800) 90%, transparent);
  --fade: radial-gradient(90% 70% at 20% 20%, var(--fade-from), var(--fade-to));
}
[dir="rtl"] .hero__navy { --fade: radial-gradient(90% 70% at 80% 20%, var(--fade-from), var(--fade-to)); }
.hero__navy::before {
  content: ""; position: absolute; inset: 0; background: var(--fade);
  -webkit-mask-image: var(--spot-mask); mask-image: var(--spot-mask);
}

/* --- Copy ------------------------------------------------------------------ */
/* The grid lets the pointer through to the photo (hover pauses the slideshow) */
.hero__grid { position: relative; z-index: 3; pointer-events: none; }
.hero__copy { position: relative; pointer-events: auto; }
.hero h1 { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.3rem); line-height: 1.06; letter-spacing: -.04em; color: var(--fg); }
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero h1:lang(ar) { line-height: var(--lh-ar-display); }
.hero__sub { margin-block-start: 1.4rem; max-inline-size: 44ch; font-size: clamp(1rem, .95rem + .3vw, 1.14rem); color: var(--muted); text-wrap: pretty; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .85rem; margin-block-start: 2.2rem; }

/* Entrance: eyebrow, lede and CTAs only. The H1 and the photo are never hidden. */
.js .hero-in { opacity: 0; transform: translateY(var(--reveal-rise)); }
.is-ready .hero-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger) + 100ms);
}

.hero__chev { display: none; }

/* --- Diagonal split, from 768px --------------------------------------------
   The cut runs from --cut-top (% across at the top) to --cut-foot (% across
   at the bottom): 60 to 45 on desktop. The photo panel is exactly the
   visible area beside it: from the cut's foot to the edge, its top corner
   cut from (top - foot) / (100 - foot) across, so the image scales to what
   people actually see. The navy panel and the cyan line follow the same two
   numbers. Tablets (below 1200px) move the cut to the right and let the
   height follow the content; see the tablet block below. */
@media (min-width: 768px) {
  .hero { --cut-top: 60; --cut-foot: 45; }
  .hero__media {
    position: absolute; z-index: 0; inset-block: 0; inset-inline-end: 0;
    inline-size: calc((100 - var(--cut-foot)) * 1%); block-size: auto; margin: 0;
    clip-path: polygon(calc((var(--cut-top) - var(--cut-foot)) / (100 - var(--cut-foot)) * 100%) 0, 100% 0, 100% 100%, 0 100%);
  }
  [dir="rtl"] .hero__media { clip-path: polygon(0 0, calc(100% - (var(--cut-top) - var(--cut-foot)) / (100 - var(--cut-foot)) * 100%) 0, 100% 100%, 0 100%); }

  .hero__navy {
    display: block; position: absolute; inset: 0; z-index: 1;
    --fade: radial-gradient(70% 60% at 20% 30%, var(--fade-from), var(--fade-to) 70%);
    background: var(--navy-photo) left center / cover no-repeat, var(--navy-800);
    clip-path: polygon(0 0, calc(var(--cut-top) * 1%) 0, calc(var(--cut-foot) * 1%) 100%, 0 100%);
  }
  [dir="rtl"] .hero__navy {
    clip-path: polygon(100% 0, calc((100 - var(--cut-top)) * 1%) 0, calc((100 - var(--cut-foot)) * 1%) 100%, 100% 100%);
    --fade: radial-gradient(70% 60% at 80% 30%, var(--fade-from), var(--fade-to) 70%);
    background: var(--navy-photo) right center / cover no-repeat, var(--navy-800);
  }

  /* The cut, drawn as a 2px cyan line with a glow */
  .hero__edge {
    display: block; position: absolute; inset: 0; z-index: 4; pointer-events: none;
    filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 18px color-mix(in oklch, var(--cyan) 50%, transparent));
  }
  .hero__edge::before {
    content: ""; position: absolute; inset: 0; background: var(--cyan);
    clip-path: polygon(calc(var(--cut-top) * 1%) 0, calc(var(--cut-top) * 1% + 2px) 0, calc(var(--cut-foot) * 1% + 2px) 100%, calc(var(--cut-foot) * 1%) 100%);
  }
  [dir="rtl"] .hero__edge::before {
    clip-path: polygon(calc((100 - var(--cut-top)) * 1%) 0, calc((100 - var(--cut-top)) * 1% - 2px) 0, calc((100 - var(--cut-foot)) * 1% - 2px) 100%, calc((100 - var(--cut-foot)) * 1%) 100%);
  }

  /* Exactly one viewport tall (620px floor for short screens), copy centred */
  .hero__grid {
    display: grid; align-items: center;
    block-size: 100svh; min-block-size: 620px;
    padding-block: calc(var(--nav-h) + 1.5rem) 2.5rem;
  }
  .hero__copy { max-inline-size: 600px; }
}

/* --- Tablet, 768px to 1199px: the desktop composition, scaled ---------------
   The cut sits further right so the copy keeps a readable width and both
   buttons stay on one row; the photo keeps the right-hand side. The height
   follows the content (with a floor), so there is no empty band. */
@media (min-width: 768px) and (max-width: 1279px) {
  .hero { --cut-top: 70; --cut-foot: 55; }
  /* A lower floor on tall portrait tablets keeps the narrow photo panel from
     zooming in so far that the products are cut */
  .hero__grid { block-size: auto; min-block-size: clamp(540px, 62svh, 700px); padding-block: calc(var(--nav-h) + 2.5rem) 3.5rem; }
  .hero__copy { max-inline-size: min(460px, 54vw); }
  /* About 48px at 768 wide, meeting the desktop size (52.8px) by 1200 */
  .hero h1 { font-size: clamp(3rem, 1.9rem + 2.1vw, 3.3rem); }
  .hero__sub { max-inline-size: 38ch; font-size: 1.02rem; }
  .hero__ctas { gap: .7rem; margin-block-start: 1.9rem; }
  .hero__ctas .btn--lg { --pad: .95rem 1.45rem; font-size: .95rem; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .hero { --cut-top: 65; --cut-foot: 50; } }


@media (prefers-reduced-motion: reduce) {
  .js .hero-in { opacity: 1; transform: none; transition: none; }
  .hero__slide, .hero__slide img { transition: none; transform: none; }
}
/* --- 1. Brand hero: the homepage hero (diagonal photo), 75vh ---------------- */
/* About 75vh on desktop; on tablets the height follows the content (the chips) */
@media (min-width: 1280px) { .bd-hero .hero__grid { block-size: auto; min-block-size: max(600px, 75svh); } }
/* The logo in white, no tile */
.bd-logo { display: block; block-size: 48px; inline-size: auto; margin-block-end: 1.4rem; }
.bd-hero h1 { max-inline-size: 17ch; }
.bd-hero .badge-ex { margin-block-start: 1.2rem; }
.bd-hero__ctas { display: flex; flex-wrap: wrap; gap: .85rem; margin-block-start: 1.8rem; }

/* --- Inner-page heroes, shared look (.inner-hero, components.css) ---------- */
.inner-hero .eyebrow { color: var(--cyan-soft); }
.inner-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.3vw, 4.1rem); line-height: 1.04; letter-spacing: -.04em; }
.inner-hero h1:lang(ar) { line-height: var(--lh-ar-display); }
.hero.inner-hero .eyebrow { display: inline-flex; font-size: .84rem; letter-spacing: .12em; }
.hero.inner-hero .eyebrow::before { display: block; }
.hero.inner-hero .eyebrow::after { content: none; }
.hero h1 mark.hl { display: block; }
.bd-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.3vw, 4.1rem); }

/* --- Inner and compact (the About, Contact, Partner and Our Brands heroes) ---
   A full-bleed photo under a navy fade (the overlay the mouse effect clears),
   optional dot grid, cyan glow, slow zoom and a foot that fades into the next
   section. --ihero-h is the height: 75% of the screen (inner), 55% (compact). */
.ihero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-items: center;
  min-block-size: var(--ihero-h, max(560px, 75svh));
  padding-block: calc(var(--nav-h) + 3rem) 5rem;
  background: var(--navy-900);
}
.ihero--compact { padding-block: calc(var(--nav-h) + 2.5rem) 4rem; }
.ihero__media { position: absolute; inset: 0; z-index: -3; background: var(--navy-800); transform-origin: 70% 50%; }
.ihero__img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
/* The video (desktop only, added by the script) shows once it is actually playing */
.ihero__media video {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover;
  opacity: 0; transition: opacity var(--dur-reveal) ease;
}
.ihero__media video.is-playing { opacity: 1; }
.js:not(.motion-paused) .ihero--slow-zoom .ihero__media { animation: ken-burns var(--dur-kenburns) var(--ease-out) forwards; }
/* The slow zoom holds while the hero is hovered or has keyboard focus */
.ihero--slow-zoom:hover .ihero__media, .ihero--slow-zoom:focus-within .ihero__media { animation-play-state: paused; }
@keyframes ken-burns { from { transform: scale(1); } to { transform: scale(1.06); } }
.ihero::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  -webkit-mask-image: var(--spot-mask); mask-image: var(--spot-mask);
  background: linear-gradient(var(--fade-dir, 90deg),
    color-mix(in oklch, var(--navy-900) 90%, transparent) 0%,
    color-mix(in oklch, var(--navy-900) 84%, transparent) 42%,
    color-mix(in oklch, var(--navy-900) 28%, transparent) 100%);
}
[dir="rtl"] .ihero { --fade-dir: 270deg; }
.ihero--dots::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, var(--line-dark-soft) 1px, transparent 1.5px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(var(--fade-dir, 90deg), #000, transparent 70%); mask-image: linear-gradient(var(--fade-dir, 90deg), #000, transparent 70%);
}
.ihero__glow {
  position: absolute; z-index: -1; inset-block-start: 22%; inset-inline-start: -8%;
  inline-size: min(720px, 90vw); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--cyan-a25), transparent 62%);
  opacity: .7;
}
/* The foot fades into the section below, so the two read as one */
.ihero__foot {
  position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 35%; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, var(--navy-900), transparent);
}
.ihero .fx-net { z-index: -1; }
/* A fixed shape (brand pages: 16:9) from tablets up: as tall as the photo's shape
   (--ihero-ratio is height ÷ width), taller only when the copy needs the room. */
@media (min-width: 768px) {
  .ihero--ratio { min-block-size: max(420px, calc(100vw * var(--ihero-ratio))); }
}
/* No navy fade: the photo shows as it is (brand pages) */
.ihero--no-fade::before, [dir="rtl"] .ihero--no-fade::before { display: none; }
.ihero .bd-logo { margin-block-end: 1.4rem; }
.ihero .badge-ex { margin-block-start: 1.2rem; }
.ihero__copy { max-inline-size: 720px; }
.ihero--compact .ihero__copy { max-inline-size: 660px; }
.ihero__sub { margin-block-start: 1.3rem; max-inline-size: 46ch; font-size: clamp(1rem, .95rem + .3vw, 1.14rem); color: var(--silver); }
.ihero__ctas { display: flex; flex-wrap: wrap; gap: .85rem; margin-block-start: 2.2rem; }
@media (min-width: 768px) and (max-width: 1023px) {
  .ihero, [dir="rtl"] .ihero { --fade-dir: 180deg; align-items: end; padding-block: calc(var(--nav-h) + 6rem) 3rem; }
  .ihero--compact { padding-block: calc(var(--nav-h) + 5rem) 3rem; }
  .ihero::before {
    background: linear-gradient(180deg,
      color-mix(in oklch, var(--navy-900) 55%, transparent) 0%,
      color-mix(in oklch, var(--navy-900) 86%, transparent) 42%,
      color-mix(in oklch, var(--navy-900) 94%, transparent) 100%);
  }
}
@media (max-width: 1023px) { .ihero__img { object-position: 70% center !important; } }
@media (prefers-reduced-motion: reduce) {
  .ihero__media { animation: none !important; transform: none; }
}

/* --- Phones (below 768px): one hero for every page ----------------------------
   Matches the homepage: the photo starts at the very top, behind the header,
   under a navy gradient that keeps the copy readable; the copy starts right
   under the header with the same spacing on every page. Eyebrow 10px with the
   diamond, a 36px headline, 15px text, the cyan pill at its own width and
   the second action as a text link with a chevron. */
@media (max-width: 767px) {
  .hero, .ihero {
    --phone-shade: linear-gradient(180deg,
      color-mix(in oklch, var(--navy-900) 86%, transparent) 0%,
      color-mix(in oklch, var(--navy-900) 80%, transparent) 45%,
      color-mix(in oklch, var(--navy-900) 45%, transparent) 72%,
      color-mix(in oklch, var(--navy-900) 15%, transparent) 100%);
  }
  .hero { display: grid; grid-template-columns: 100%; align-content: start; min-block-size: 100svh; }
  .bd-hero.hero { min-block-size: max(560px, 85svh); }
  .hero__media { position: absolute; inset: 0; z-index: 0; block-size: auto; }
  .hero__media::after, [dir="rtl"] .hero__media::after { z-index: 2; background: var(--phone-shade); }
  /* Home: the 9:16 phone photo fills the screen from its top edge */
  .hero:not(.bd-hero) .hero__photo img { object-position: 50% 0; }
  .hero__navy { display: block; position: absolute; inset: 0; z-index: 1; background: none; }
  .hero__navy::before { display: none; }
  .hero__grid { inline-size: 100%; }

  .ihero, .ihero--compact { align-items: start; padding-block: 0; }
  .ihero::before, [dir="rtl"] .ihero::before { background: var(--phone-shade); }

  .hero__copy, .bd-hero .hero__copy { padding: calc(var(--nav-h) + 2.25rem) var(--gutter) 3rem; }
  .ihero__copy { padding: calc(var(--nav-h) + 2.25rem) 0 3rem; }
  .hero .crumbs, .ihero .crumbs { margin-block-end: 1rem; }

  .hero .eyebrow, .ihero .eyebrow, .hero.inner-hero .eyebrow {
    display: inline-flex; margin-block-end: 1rem;
    font-size: .625rem; letter-spacing: .16em;
  }
  .hero .eyebrow::before, .ihero .eyebrow::before { display: block; inline-size: 6px; block-size: 6px; }
  .hero .eyebrow::after { content: none; }
  .hero .eyebrow:lang(ar), .ihero .eyebrow:lang(ar) { font-size: .75rem; }

  .hero h1, .ihero h1, .inner-hero h1, .bd-hero h1 { font-size: 2.25rem; line-height: 1.1; letter-spacing: -.035em; }
  .hero h1:lang(ar), .ihero h1:lang(ar) { line-height: var(--lh-ar-display); }
  .hero__sub, .ihero__sub { margin-block-start: 1rem; font-size: .9375rem; }

  :is(.hero__ctas, .ihero__ctas, .bd-hero__ctas), :is(.hero, .ihero) .btn-pair:has(> .btn + .btn) {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem;
    inline-size: auto; margin-block-start: 1.75rem;
  }
  main :is(.hero, .ihero) :is(.hero__ctas, .ihero__ctas, .bd-hero__ctas) .btn { inline-size: auto; }
  :is(.hero, .ihero) .btn--cyan.btn--lg { --pad: .8rem 1.45rem; font-size: .9rem; }
  /* The second action: a text link with a chevron */
  :is(.hero, .ihero) .btn--ghost {
    --pad: 0 0 .3rem; align-items: center; min-block-size: 44px; gap: .45rem;
    border: 0; border-block-end: 1.5px solid currentColor; border-radius: 0;
    font-size: .95rem; color: var(--white);
  }
  .hero__chev { display: block; inline-size: 1em; block-size: 1em; }
  [dir="rtl"] .hero__chev { transform: scaleX(-1); }
}
/* Landscape phones: a shorter top */
@media (max-width: 767px) and (max-height: 500px) {
  .hero__copy, .ihero__copy, .bd-hero .hero__copy { padding-block-start: calc(var(--nav-h) + 1.25rem); }
}

/* Editor preview: no full-screen heights inside the canvas */
.alh-editor-block .hero__grid { block-size: auto; min-block-size: 560px; }
