/* Arabic-only HPC hero art: original product orientation, left-hand devices,
   right-hand copy. STATION uses the explicitly approved mirrored room photo. */
html[lang="ar"] #page-station > .pd-hero {
  background-image: var(--arabic-hpc-hero);
}

/* Blend the actual artwork edges, not the edges of a larger contain box.
   This keeps the devices intact while removing letterbox seams at any ratio. */
html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero {
  isolation: isolate;
  background-image: none;
}
html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero::after {
  content: "";
  display: block !important;
  position: absolute;
  inset: 50% auto auto 0;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  transform: translateY(-50%);
  background: var(--arabic-hpc-hero) left top / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 82%, transparent), linear-gradient(to right, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 82%, transparent), linear-gradient(to right, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  pointer-events: none;
  z-index: 0;
}
html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero::before {
  z-index: 1;
}
html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero > .shell {
  position: relative;
  z-index: 2;
}

/* Reverse the source artwork's directional shading, never the text or device. */
html[lang="ar"] :is(#page-station, #page-studio, #page-box, #page-tictalk) > .pd-hero::before {
  transform: scaleX(-1);
}

html[lang="ar"] #page-hpc .hpc-hero-grid > div:first-child {
  margin-left: 0;
  margin-right: max(24px, calc((100vw - 1280px) / 2));
  padding: 72px 0 64px 42px;
}
html[lang="ar"] #page-hpc .hpc-hero-grid > .hpc-banner-layer > .hpc-banner-image {
  inset: 50% auto auto 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
  -webkit-mask-image: linear-gradient(to right, #000 60%, transparent 95%), linear-gradient(to bottom, transparent, #000 10%, #000 95%, transparent);
  mask-image: linear-gradient(to right, #000 60%, transparent 95%), linear-gradient(to bottom, transparent, #000 10%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Keep the complete device in its half of the banner even when Arabic copy
   makes the hero taller. The facts belong with the copy, clear of the device. */
@media (min-width: 1001px) {
  html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero > .shell > :is(h1, .lead, .pd-facts, .v158-versions) {
    max-width: 56%;
    margin-left: auto;
    margin-right: 0;
  }
  html[lang="ar"] :is(#page-box, #page-mini, #page-tictalk) > .pd-hero .pd-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* At narrow widths use the source mini page's image-above-copy treatment.
   A tall cover crop would otherwise enlarge the device behind the text. */
@media (max-width: 1000px) {
  html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero {
    padding-top: 350px;
  }
  html[lang="ar"] :is(#page-studio, #page-box, #page-mini, #page-tictalk) > .pd-hero::after {
    inset: 0 auto auto 0;
    width: 660px;
    height: 330px;
    transform: none;
  }
  html[lang="ar"] :is(#page-studio, #page-box, #page-tictalk) > .pd-hero::before {
    display: none;
  }
}
@media (max-width: 980px) {
  html[lang="ar"] #page-hpc .hpc-hero-grid > div:first-child {
    margin: 0;
    padding: 88px 24px 42px;
  }
  html[lang="ar"] #page-hpc .hpc-hero-grid > .hpc-banner-layer > .hpc-banner-image {
    height: 100% !important;
    max-width: none !important;
  }
  html[lang="ar"] #page-hpc .hpc-hero-grid > .hpc-banner-layer {
    max-width: none !important;
  }
}
@media (max-width: 620px) {
  html[lang="ar"] #page-hpc .hpc-hero-grid > div:first-child { padding: 78px 20px 34px; }
}
