/* Arabic homepage editorial spacing for the longer acquisition headline. */
@media (min-width: 721px) {
  html[dir="rtl"] .motion-gallery {
    min-height: 1080px;
  }

  html[dir="rtl"] .motion-gallery-heading {
    grid-template-columns: minmax(520px, 650px) minmax(300px, 400px);
    gap: 0.85rem clamp(1.5rem, 4vw, 4.5rem);
  }

  html[dir="rtl"] .motion-gallery-heading h1 {
    max-width: 650px;
    font-size: clamp(3.15rem, 4.75vw, 4.75rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  html[dir="rtl"] .motion-gallery-heading > span {
    align-self: center;
    max-width: 400px;
    padding: 0.85rem 1rem;
    border-inline-start: 3px solid var(--yellow);
    border-radius: 2px;
    color: rgba(255, 249, 239, 0.94);
    background: rgba(6, 28, 35, 0.58);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
  }

  html[dir="rtl"] .motion-gallery-stage {
    top: 27rem;
  }

  html[dir="rtl"] .motion-gallery-detail {
    top: 54.8rem;
  }
}

@media (max-width: 720px) {
  html[dir="rtl"] .motion-gallery {
    min-height: 1230px;
  }

  html[dir="rtl"] .motion-gallery-heading h1 {
    max-width: 340px;
    font-size: clamp(2.65rem, 11.5vw, 3.35rem);
    line-height: 1.01;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }

  html[dir="rtl"] .motion-gallery-heading > span {
    max-width: 340px;
    margin-top: 0.7rem;
    padding: 0.7rem 0.8rem;
    border-inline-start: 3px solid var(--yellow);
    border-radius: 2px;
    color: rgba(255, 249, 239, 0.94);
    background: rgba(6, 28, 35, 0.64);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(9px);
  }

  html[dir="rtl"] .motion-gallery-heading > div {
    margin-top: 0.7rem;
  }

  html[dir="rtl"] .motion-gallery-heading a {
    min-height: 58px;
  }

  html[dir="rtl"] .motion-gallery-stage {
    top: 32.5rem;
  }

  html[dir="rtl"] .motion-gallery-detail {
    top: 59rem;
  }
}

/* Real links for the three acquisition panels; mirrors the original button treatment. */
html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 239, 0.2);
  color: var(--paper);
  background: #071d24;
  text-align: start;
  text-decoration: none;
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.32);
  transform: rotateY(-2deg) translateY(4px);
  transform-origin: center;
  transition: flex 0.72s cubic-bezier(0.16, 0.72, 0.18, 1), transform 0.55s cubic-bezier(0.16, 0.72, 0.18, 1), filter 0.5s, box-shadow 0.5s;
  cursor: pointer;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link:nth-child(even) {
  clip-path: polygon(0 0, 96% 0, 100% 100%, 4% 100%);
  transform: rotateY(2deg) translateY(8px);
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active {
  flex: 3.65 1 0;
  clip-path: polygon(1.5% 0, 100% 0, 98.5% 100%, 0 100%);
  border-color: rgba(255, 249, 239, 0.55);
  box-shadow: 0 38px 95px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--gallery-accent);
  transform: translateY(-10px) rotateY(0);
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active img {
  filter: saturate(1.08) contrast(1.035) brightness(1.04);
  opacity: 1;
  transform: scale(1.01);
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active .motion-gallery-shade {
  opacity: 0.32;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > small {
  position: absolute;
  inset: 0.8rem auto auto 0.8rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 900;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > strong {
  position: absolute;
  inset: auto auto 1rem 50%;
  z-index: 2;
  font: 800 0.78rem/1 var(--display);
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  transition: all 0.5s;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > em {
  position: absolute;
  inset: auto auto 0.95rem 0.95rem;
  z-index: 2;
  max-width: 210px;
  opacity: 0;
  font: 500 1.35rem/1 Georgia, "Times New Roman", serif;
  transform: translateY(12px);
  transition: opacity 0.4s 0.18s, transform 0.45s 0.15s;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active > strong {
  inset: auto auto 3.1rem 1rem;
  writing-mode: horizontal-tb;
  transform: none;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active > em {
  opacity: 1;
  transform: none;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active .motion-gallery-badge {
  padding: 0.38rem 0.48rem;
  writing-mode: horizontal-tb;
}

html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link {
    clip-path: none !important;
    transform: none !important;
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active {
    flex: 4.4 1 0;
    box-shadow: 0 24px 50px rgba(20, 33, 38, 0.28);
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > small {
    inset: 0.55rem auto auto 0.5rem;
    width: 24px;
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > strong {
    font-size: 0.61rem;
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active > strong {
    inset: auto auto 2.8rem 0.7rem;
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link > em {
    font-size: 1rem;
  }

  html[dir="rtl"] .motion-gallery-stage > a.motion-gallery-panel-link.active > em {
    inset: auto auto 0.7rem 0.7rem;
  }
}
