/* Shared carousel geometry and photo treatment. Brand artwork stays in its theme. */

/* Keep the opaque photo surface beneath the shared action fill sweep. */
:is(.hero, .subpage-hero--carousel) .hero-content-copy .btn-ghost,
:is(.hero, .subpage-hero--carousel) .hero-content-copy .btn-ghost:is(:hover, :focus-visible) {
  color: var(--button-photo-ink);
  border-color: var(--button-photo-fill);
  background: var(--button-photo-fill);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* ---- The carousel hero: the group homepage hero's model ----------------
   One component for the four subsidiary homes. Copy top-aligned on the sky,
   dark brand ink, no box behind a line, no veil, the rail directly under the
   buttons, a scroll cue at the foot. Every value is a token (sdeira-tokens.css);
   a brand overrides a token, never a rule. Rules here are scoped to
   `.subpage-hero--carousel`: this sheet is also loaded by the two group
   homepages, whose `.hero` is hand-written and never shares these. */
.subpage-hero--carousel {
  min-block-size: var(--hero-carousel-height);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding-block: var(--hero-carousel-pad-top) 0;
  /* The marks use the carousel's own size tokens, same interface as the
     sub-page hero (--hero-mark-*). */
  --hero-mark-inline-size: var(--hero-carousel-mark-inline-size);
  --hero-mark-block-size: var(--hero-carousel-mark-block-size);
  --hero-mark-ratio: var(--hero-carousel-mark-ratio);
}

.subpage-hero--carousel > .wrap {
  position: relative;
  flex: 1 0 auto;
  padding-block-end: var(--hero-carousel-pad-bottom);
}

.subpage-hero--carousel .hero-content-copy {
  z-index: 2;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--hero-carousel-ink);
  padding: 0;
  border-radius: 0;
  max-width: var(--hero-carousel-copy-width);
}

/* No box, no fill, no padding behind a line of text on the photograph. */
.subpage-hero--carousel .hero-content-copy .hero-line-mark {
  display: inline;
  background: none;
  padding: 0;
}

.hero-content-copy h1:has(.hero-line-mark) {
  display: block;
  line-height: var(--hero-carousel-heading-leading);
  margin-block: 0;
  
  padding-bottom: var(--hero-carousel-heading-tail);
}

html[dir="rtl"] :is(.hero, .subpage-hero--carousel) .hero-content-copy h1:has(.hero-line-mark) {
  line-height: var(--hero-carousel-heading-leading-ar);
}

.hero-content-copy p:has(.hero-line-mark) {
  display: block;
  margin-block: 0;
  
  margin-block-start: var(--hero-carousel-lead-gap);
  
  line-height: var(--hero-carousel-lead-leading);
}

@media (min-width: 981px)  {
.subpage-hero--carousel .hero-content-copy {
    max-width: var(--hero-carousel-copy-width-wide);
  }
}

.subpage-hero--carousel .hero-content-copy :is(h1, p) {
  color: var(--hero-carousel-ink);
}

/* The group homepage's pair: a Medium heading with a Bold emphasised word,
   the word in the brand's deep accent. */
.subpage-hero--carousel .hero-content-copy h1 {
  font-weight: var(--hero-carousel-heading-weight);
  max-inline-size: var(--hero-carousel-heading-measure);
}
.subpage-hero--carousel .hero-content-copy p {
  max-inline-size: var(--hero-carousel-lead-measure);
  font-size: var(--hero-carousel-lead-size);
}

.subpage-hero--carousel .hero-content-copy .em {
  color: var(--hero-carousel-em);
  font-weight: 700;
}

.subpage-hero--carousel .subpage-hero-media::after {
  display: none;
}

.subpage-hero--carousel .subpage-hero-media img {
  filter: none;
  /* The sky is the upper band of the photograph: show the top. */
  object-position: var(--hero-carousel-object-position);
}

/* A slide that keeps clear of the sectors strip: the photograph ends where the
   strip begins, so the subject (a vehicle, a building) is never behind it and
   the sky stays at the top, behind the copy. */
.subpage-hero--carousel .subpage-hero-media .hero-carousel-slide--above-strip img {
  block-size: calc(100% - var(--hero-strip-h, 92px));
  object-position: center bottom;
}
/* Same, for a photograph whose sky must stay behind the copy: the crop starts at the top. */
.subpage-hero--carousel .subpage-hero-media .hero-carousel-slide:is(.hero-carousel-slide--above-strip-sky, .hero-carousel-slide--above-strip-sky-mirror) img {
  block-size: calc(100% - var(--hero-strip-h, 92px));
  object-position: center bottom;
}
/* The copy sits on one side (the left in English, the right in Arabic), so the
   panorama is wider than the band and anchored to the copy's edge: the subject
   lands on the opposite side, clear of the text. */
@media (min-width: 721px) {
  .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide:is(.hero-carousel-slide--above-strip-sky, .hero-carousel-slide--above-strip-sky-mirror) {
    overflow: hidden;
    container-type: size;
  }
  /* The panorama keeps its whole height (the sky is never cropped) and is as
     wide as that height needs, 2.5:1; a band narrower than that crops the
     sides, on the copy's far edge. */
  .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide:is(.hero-carousel-slide--above-strip-sky, .hero-carousel-slide--above-strip-sky-mirror) img {
    --hero-img-h: calc(100cqh - var(--hero-strip-h, 92px));
    block-size: var(--hero-img-h);
    inline-size: max(100cqw, calc(var(--hero-img-h) * 2.5));
    max-inline-size: none;
  }
}
@media (max-width: 720px) {
  .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide--above-strip img {
    --hero-strip-h: 190px;
    object-position: 42% bottom;
  }
  .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide:is(.hero-carousel-slide--above-strip-sky, .hero-carousel-slide--above-strip-sky-mirror) img {
    /* A tall phone band: the photograph fills it, so its sky sits behind the copy. */
    block-size: 100%;
    object-position: 50% top;
  }
}

/* A slide with its own phone frame (`mobile_src`): the <picture> adds no box,
   and on a phone the frame is anchored at its foot, which sits exactly where
   the sectors strip begins, so the subject lands between the copy and the
   strip and the sky above it takes the copy (owner, 16 Nov 2026). */
.hero-carousel-slide picture { display: contents; }
@media (max-width: 720px) {
  .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide picture img {
    block-size: calc(100% - var(--hero-strip-measured, 0px));
    object-position: 50% 100%;
  }
}

/* A photograph with no lettering in it is mirrored in Arabic, so its subject
   lands on the side away from the copy (the copy sits on the right in Arabic).
   Never used on a picture with a sign or a logo: the lettering would reverse. */
html[dir="rtl"] .subpage-hero--carousel .subpage-hero-media .hero-carousel-slide--above-strip-sky-mirror img {
  transform: scaleX(-1);
}

/* The actions: the group homepage's row, 28px under the lead, 10px apart,
   text-only buttons 48px high with 22px of padding (46px and 10px on a
   phone, 22px under the lead and 8px apart). */
.subpage-hero--carousel .cta-actions {
  gap: var(--hero-carousel-actions-gap);
  margin-block-start: var(--hero-carousel-actions-margin);
}
.subpage-hero--carousel .cta-actions .btn {
  min-block-size: var(--hero-carousel-button-min-block);
  padding-block: 0;
  font-size: var(--hero-carousel-button-size);
  padding-inline: var(--hero-carousel-button-padding-inline);
}
@media (max-width: 720px) {
  .subpage-hero--carousel .cta-actions {
    gap: var(--hero-carousel-actions-gap-mobile);
    margin-block-start: var(--hero-carousel-actions-margin-mobile);
  }
  .subpage-hero--carousel .cta-actions .btn {
    min-block-size: var(--hero-carousel-button-min-block-mobile);
    padding-inline: var(--hero-carousel-button-padding-inline-mobile);
  }
}

@media (max-width: 640px)  {
.hero .hero-content {
    min-block-size: var(--hero-carousel-height-mobile);
  }
.subpage-hero--carousel {
    min-block-size: var(--hero-carousel-height-mobile);
  }
}

/* Below 981px a column flex item with auto margins shrinks to its content;
   the wrap takes the section's width as the page column does. */
@media (max-width: 980px) {
  .subpage-hero--carousel > .wrap {
    inline-size: 100%;
  }
}

/* The inactive slide copy waits at the top, where the active one stands, so
   the cross-fade changes the words and nothing moves. */
.hero-carousel-copy {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.hero-carousel-copy.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}
@media (max-width: 560px) {
  .hero .hero-actions,
  .subpage-hero--carousel .cta-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .hero .hero-actions .btn,
  .subpage-hero--carousel .cta-actions .btn {
    flex: 0 0 auto;
    inline-size: 100%;
    white-space: nowrap;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
.hero-carousel-copy {
    transition: none;
  }
}
.hero-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.hero-carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
.hero-carousel-slide {
    transition: none;
  }
}

/* The rail, directly under the buttons: three lines in the brand's ink at the
   group homepage's width, 44px targets with a 3px visible line. */
.hero-carousel-ind {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--hero-carousel-rail-gap);
  margin-block-start: var(--hero-carousel-rail-margin);
  inline-size: var(--hero-carousel-rail-width);
}
.hero-carousel-dot {
  flex: 1 1 0;
  inline-size: auto;
  /* The documented 44px target is the layout height, as on the group
     homepage's rail; the visible line is 3px at its centre. */
  block-size: 44px;
  margin-block: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.hero-carousel-dot::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc((100% - var(--hero-carousel-rail-height)) / 2);
  block-size: var(--hero-carousel-rail-height);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--hero-carousel-ink) var(--hero-carousel-rail-rest), transparent);
}
.hero-carousel-dot::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc((100% - var(--hero-carousel-rail-height)) / 2);
  block-size: var(--hero-carousel-rail-height);
  border-radius: var(--r);
  z-index: 1;
  inline-size: 0;
  background: var(--hero-carousel-ink);
}
.hero-carousel-dot.is-active::before {
  inline-size: 100%;
  transition: inline-size var(--hero-carousel-interval) linear;
}
.hero-carousel-dot.is-done::before {
  inline-size: 100%;
  transition: none;
}
.hero-carousel .hero-carousel-dot:focus-visible,
.subpage-hero--carousel .hero-content-copy :focus-visible {
  outline: var(--hero-carousel-focus-width) solid var(--hero-carousel-focus);
  outline-offset: var(--hero-carousel-focus-offset);
}
@media (max-width: 720px) {
.hero-carousel-ind {
    inline-size: 100%;
    gap: var(--hero-carousel-rail-gap-mobile);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel-dot.is-active::before {
    transition: none;
  }
}

/* The scroll cue, at the foot of the hero on the physical left like the group
   homepage's: a track with a travelling highlight and the group's own words.
   It sits above the strip when the hero has one, and is hidden on a phone. */
.subpage-hero--carousel .hero-carousel-hint {
  position: relative;
  z-index: 2;
  /* Physical left in both languages, as on the group homepage. */
  align-self: stretch;
  inline-size: fit-content;
  margin-left: 24px;
  margin-right: auto;
  margin-block-end: var(--hero-carousel-hint-gap);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hero-carousel-hint-ink);
  font-size: var(--type-meta);
  letter-spacing: 0;
}
.subpage-hero--carousel .hero-carousel-hint-dot {
  inline-size: 2px;
  block-size: 34px;
  background: color-mix(in srgb, var(--hero-carousel-hint-ink) 28%, transparent);
  position: relative;
  overflow: hidden;
}
.subpage-hero--carousel .hero-carousel-hint-dot::after {
  content: "";
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  inline-size: 3px;
  block-size: 8px;
  background: var(--hero-carousel-hint-ink);
  border-radius: var(--r);
  animation: hero-carousel-hint-fall 2s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes hero-carousel-hint-fall {
  0% { opacity: 0; inset-block-start: 4px; }
  20% { opacity: 1; }
  72% { opacity: 1; inset-block-start: 24px; }
  100% { opacity: 0; inset-block-start: 24px; }
}
@media (max-width: 720px) {
  .subpage-hero--carousel .hero-carousel-hint {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .subpage-hero--carousel .hero-carousel-hint-dot::after {
    animation: none;
    inset-block-start: 11px;
    opacity: 1;
  }
}

/* SECTORS: the group homepage's businesses band at the foot of the hero
   (hero_carousel's `sectors`), authored from that band's computed values:
   full bleed on --surface-inverse, a label bar at 90%, the cards edge to
   edge with a 4px seam. Site owner, 24 Sep 2026, Eskan home: each card on
   a photograph of its own subject under the shared veil, and sized to its
   content rather than to the section grid's 210px floor. */
.subpage-hero--sectors {
  flex-direction: column;
  justify-content: space-between;
  row-gap: var(--hero-carousel-rail-margin);
  padding-block-end: 0;
}
/* From 981px the base .wrap rule gives every wrap its width (the page
   column); below it a stacked flex item would shrink to its content. */
@media (max-width: 980px) {
  .subpage-hero--sectors > .wrap {
    inline-size: 100%;
  }
}
.hero-carousel-sectors {
  position: relative;
  z-index: 2;
  inline-size: 100%;
  background: var(--surface-inverse);
}
.hero-carousel-sectors-head {
  display: grid;
  place-items: center;
  min-block-size: 42px;
  background: color-mix(in srgb, var(--surface-inverse) 90%, transparent);
}
.hero-carousel-sectors-label {
  color: var(--brand-white);
  font-size: var(--type-body);
  font-weight: 700;
}
.sector-grid--content.sector-grid--hero {
  grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr));
  gap: 4px;
}
.sector-grid--content.sector-grid--hero .sector-card {
  min-block-size: var(--hero-sector-card-min, 0);
}
.sector-grid--content.sector-grid--hero .sector-card-body {
  padding: 18px;
  gap: 6px;
}
.sector-grid--content.sector-grid--hero .sector-card-mark {
  inline-size: auto;
  block-size: auto;
  place-items: start;
  background: none;
}
/* The photograph shows through: no flat veil and no diagonal wipe, only a
   light gradient in the brand's black under the copy (site owner, 24 Sep
   2026: the full veil and the wipe read too dark). */
.sector-grid--content.sector-grid--hero .sector-card-veil,
.sector-grid--content.sector-grid--hero .sector-card-media::after {
  display: none;
}
.sector-grid--content.sector-grid--hero .sector-card-body {
  background: linear-gradient(180deg,
    transparent,
    color-mix(in srgb, var(--surface-inverse) 60%, transparent));
}
/* Hover, no empty space at rest: the card is icon and title only, with the
   action parked below them out of the flow's height (a negative end margin
   the size of the action and its gap). On hover the stack rises by that
   size: the icon fades out at the top and the action rises into view. The
   action keeps no reserved height and no underline bar. */
.sector-grid--content.sector-grid--hero .sector-card {
  --sector-reveal: calc(var(--type-action) * 1.5 + 6px);
}
.sector-grid--content.sector-grid--hero .sector-card-action {
  min-block-size: 0;
  padding: 0;
  margin: 0 0 calc(-1 * var(--sector-reveal));
  line-height: 1.5;
}
.sector-grid--content.sector-grid--hero .sector-card-action::after {
  content: none;
}
.sector-grid--content.sector-grid--hero .sector-card-body > * {
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.sector-grid--content.sector-grid--hero .sector-card:is(:hover, :focus-within) .sector-card-body > * {
  transform: translateY(calc(-1 * var(--sector-reveal)));
}
.sector-grid--content.sector-grid--hero .sector-card:is(:hover, :focus-within) .sector-card-mark {
  opacity: 0;
}
.sector-grid--content.sector-grid--hero .sector-card:is(:hover, :focus-within) .sector-card-action {
  opacity: 1;
}
/* Touch has no hover: the action rests visible there, in the flow. */
@media (hover: none), (pointer: coarse) {
  .sector-grid--content.sector-grid--hero .sector-card-action {
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sector-grid--content.sector-grid--hero .sector-card-body > * {
    transition: none;
  }
}

/* Two columns from tablet down: a phone keeps the four cards in two rows
   rather than a stack four cards tall under the first screen. */
@media (max-width: 980px) {
  .sector-grid--content.sector-grid--hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* On a phone the four cards stay in two rows and the copy fills the first
   screen: the band's label and the top of its first row sit at the fold and
   the rest comes with the scroll, as on the group homepage (owner, 18 Oct
   2026). 216px is the header (84), the band's label (42) and the strip of
   cards left in view (90). */
@media (max-width: 640px) {
  .subpage-hero--sectors > .wrap {
    min-block-size: calc(100svh - 216px);
  }
}
/* Site owner, 24 Sep 2026: a darker veil so the title reads on every
   photograph, the title one role down (lead, not card), and each photograph
   centred in its card. */
.sector-grid--content.sector-grid--hero .sector-card-body {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface-inverse) 45%, transparent),
    color-mix(in srgb, var(--surface-inverse) 80%, transparent));
}
.sector-grid--content.sector-grid--hero :is(.sector-card-title, .sector-card-title a) {
  font-size: var(--type-lead);
}
.sector-grid--content.sector-grid--hero .sector-card-img {
  object-position: var(--hero-sector-img-position, center);
}
/* The band runs into the page edge, so the cards carry no rounding (it
   showed on the top corners only), and the band's label steps down to the
   meta role. */
.sector-grid--content.sector-grid--hero .sector-card {
  border-radius: 0;
}
.hero-carousel-sectors-label {
  font-size: var(--type-meta);
  font-weight: 500;
}

/* THE TITLE ALWAYS TAKES TWO LINES OF SPACE, one line or two, in both
   languages (owner, 12 Oct 2026). The cards are as tall as an icon and two
   title lines need and no taller, so the strip does not climb up the
   photograph, and a one-line title no longer leaves a card at a different
   height from the one beside it. */
.sector-grid--content.sector-grid--hero .sector-card {
  min-block-size: var(--hero-sector-card-min, 0);
}
.sector-grid--content.sector-grid--hero .sector-card-title {
  min-block-size: 2lh;
}
/* THE SHADE MUST SIT OVER THE PHOTOGRAPH. The photograph is absolutely
   positioned, and the body, being static, painted UNDER it: the shade the body
   carried never reached the picture, so the picture showed through the card
   and the copy read poorly on it. The body is positioned and stacked above the
   photograph, and carries one even, plain shade (50% at the top, 72% at the
   foot) so the white title and link read on any photograph. */
.sector-grid--content.sector-grid--hero .sector-card-body {
  position: relative;
  z-index: 1;
  padding-block: 28px 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface-inverse) var(--hero-sector-shade-top), transparent) 0%,
    color-mix(in srgb, var(--surface-inverse) var(--hero-sector-shade-mid), transparent) 45%,
    color-mix(in srgb, var(--surface-inverse) var(--hero-sector-shade-foot), transparent) 100%);
}

/* Phone: the same three-line title space on every site, so the strip is one height. */
@media (max-width: 640px) {
  .sector-grid--content.sector-grid--hero :is(.sector-card-title, .sector-card-title a) {
    font-size: .92rem;
    line-height: 1.3;
    min-block-size: 3lh;
  }
}

/* The action link keeps one fixed height on every site, so a wider face (Zoad,
   Arial) cannot wrap it and make its cards taller than the others. */
.sector-grid--content.sector-grid--hero .sector-card-action {
  block-size: var(--sector-reveal);
  overflow: hidden;
  white-space: nowrap;
}
