/**
 * @file
 * CEO message (Figma: CEO Message, 1440 × 880).
 *
 * Rests full bleed. When the section scrolls into view the panel shrinks
 * into a rounded 1280 × 720 card with 80px margins and the portrait and brand
 * shape scale down (0.9s, smooth ease-out). It stays a card until the next
 * page load (js/ceo.js adds .is-card once). Both states are 880px tall, so
 * nothing below moves.
 */

.sra-ceo {
  position: relative;
  overflow: hidden;
  height: 880px;
  background: var(--sra-taupe-50);
}

.sra-ceo__card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(168.37deg, var(--sra-secondary-400) 12.6%, var(--sra-secondary-100) 101.01%);
  transition: inset 0.9s var(--sra-ease-out), border-radius 0.9s var(--sra-ease-out);
}

.sra-ceo__shape {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 806px;
  max-width: none;
  height: 729px;
  transform-origin: right bottom;
  transition: transform 0.9s var(--sra-ease-out), right 0.9s var(--sra-ease-out), bottom 0.9s var(--sra-ease-out);
}

.sra-ceo__photo {
  position: absolute;
  right: 0;
  bottom: 0;
  overflow: hidden;
  width: 609px;
  height: 608px;
  transform-origin: right bottom;
  transition: transform 0.9s var(--sra-ease-out), right 0.9s var(--sra-ease-out), left 0.9s var(--sra-ease-out);
}

/* The portrait is aligned to the bottom of its box (top is cropped). */
.sra-ceo__photo img {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

.sra-ceo__copy {
  position: absolute;
  top: 155px;
  left: 70px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 34px;
  width: 858px;
  height: 666px;
  transition: top 0.9s var(--sra-ease-out), left 0.9s var(--sra-ease-out), height 0.9s var(--sra-ease-out);
}

.sra-ceo__quote-mark {
  position: absolute;
  top: -85px;
  left: 0.43px;
  width: 72.64px;
  height: 48px;
}

.sra-ceo__message {
  width: 100%;
  color: var(--sra-white);
  font-size: 22px;
  line-height: 30px;
  transition: font-size 0.9s var(--sra-ease-out);
}

.sra-ceo__message p + p {
  margin-top: 30px;
}

.sra-ceo__divider {
  display: block;
  flex: 1 1 auto;
  width: 32px;
  min-height: 1px;
  max-width: none;
}

.sra-ceo__signature {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sra-ceo__name {
  color: var(--sra-text-01);
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
}

.sra-ceo__designation {
  color: var(--sra-text-02);
  font-size: 18px;
  line-height: 26px;
}

/* English (Figma: CEO Message, updated), desktop only (the absolute
   layout from 1280px): 825px copy, 20/30 message, 24px gaps, a 47px divider
   (24px in the card) and a 16/24 role. Tablet and mobile keep their own
   stacked layout. */
@media (min-width: 1280px) {
  [dir="ltr"] .sra-ceo__copy {
    gap: 24px;
    width: 825px;
    height: auto;
  }

  [dir="ltr"] .sra-ceo__message {
    font-size: 20px;
  }

  [dir="ltr"] .sra-ceo__divider {
    flex: none;
    height: 47px;
    transition: height 0.9s var(--sra-ease-out);
  }

  [dir="ltr"] .sra-ceo__designation {
    font-size: 16px;
    line-height: 24px;
  }
}

/* Card state (.is-card, added once by js/ceo.js on scroll). */
@media (min-width: 1280px) {
  .sra-ceo.is-card .sra-ceo__card {
    inset: 80px max(80px, calc((100% - 1280px) / 2));
    border-radius: var(--sra-radius-lg);
  }

  .sra-ceo.is-card .sra-ceo__shape {
    right: 7.09px;
    bottom: 7.09px;
    transform: scale(0.709);
  }

  .sra-ceo.is-card .sra-ceo__photo {
    right: 0;
    transform: scale(0.7553);
  }

  .sra-ceo.is-card .sra-ceo__copy {
    top: 165px;
    left: 80px;
    height: 475px;
  }

  .sra-ceo.is-card .sra-ceo__quote-mark {
    top: -85px;
  }

  .sra-ceo.is-card .sra-ceo__message {
    font-size: 20px;
  }
  /* English card: 36px from the top and bottom (1280 x 809), room for the
     longer message. */
  [dir="ltr"] .sra-ceo.is-card .sra-ceo__card {
    inset: 36px max(80px, calc((100% - 1280px) / 2));
  }

  [dir="ltr"] .sra-ceo.is-card .sra-ceo__copy {
    gap: 16px;
    height: auto;
  }

  [dir="ltr"] .sra-ceo.is-card .sra-ceo__divider {
    height: 24px;
  }
}

/* Wide screens: keep the content aligned with the 1440px frame. */
@media (min-width: 1441px) {
  .sra-ceo__copy {
    left: calc((100% - 1440px) / 2 + 70px);
  }

  .sra-ceo__shape {
    right: calc((100% - 1440px) / 2 + 10px);
  }

  .sra-ceo__photo {
    right: calc((100% - 1440px) / 2);
  }
}

/* RTL: mirror horizontally. */
[dir="rtl"] .sra-ceo__card {
  background: linear-gradient(-168.37deg, var(--sra-secondary-400) 12.6%, var(--sra-secondary-100) 101.01%);
}

/* Mirrored in place: flipping around the left edge would move the shape off
   the section, so it is shifted back by its own width. */
[dir="rtl"] .sra-ceo__shape {
  right: auto;
  left: 10px;
  transform: translateX(100%) scaleX(-1);
  transform-origin: left bottom;
}

[dir="rtl"] .sra-ceo__photo {
  right: auto;
  left: 0;
  transform-origin: left bottom;
}

[dir="rtl"] .sra-ceo__copy {
  right: 70px;
  left: auto;
  transition: top 0.9s var(--sra-ease-out), right 0.9s var(--sra-ease-out), height 0.9s var(--sra-ease-out);
}

/* Arabic Figma (AR / CEO Message): message 20/30 in both states (desktop;
   tablet and mobile use their own sizes). */
@media (min-width: 1024px) {
  [dir="rtl"] .sra-ceo__message {
    font-size: 20px;
  }
}

[dir="rtl"] .sra-ceo__quote-mark {
  right: 0.43px;
  left: auto;
}

@media (min-width: 1280px) {
  [dir="rtl"] .sra-ceo.is-card .sra-ceo__shape {
    right: auto;
    left: 7.09px;
    transform: translateX(70.9%) scaleX(-1) scale(0.709);
  }

  [dir="rtl"] .sra-ceo.is-card .sra-ceo__photo {
    right: auto;
    left: 0;
  }

  /* Arabic Figma (AR / CEO Message, Card): the longer message needs 510px
     with 12px gaps, leaving a 34px divider above the name. */
  [dir="rtl"] .sra-ceo.is-card .sra-ceo__copy {
    right: 80px;
    left: auto;
    gap: 12px;
    height: 510px;
  }
}

@media (min-width: 1441px) {
  [dir="rtl"] .sra-ceo__copy {
    right: calc((100% - 1440px) / 2 + 70px);
    left: auto;
  }

  [dir="rtl"] .sra-ceo__shape {
    right: auto;
    left: calc((100% - 1440px) / 2 + 10px);
  }

  [dir="rtl"] .sra-ceo__photo {
    right: auto;
    left: calc((100% - 1440px) / 2);
  }
}

/* Below 1280px: no hover animation, copy narrows. */
/* Small desktops and tablets in landscape (1024-1279px): the copy is
   narrower, so the long message would run past the fixed 880px height. The
   copy stays in the flow and the section grows with it (at least 880px);
   the portrait and shape stay on the bottom corner. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .sra-ceo {
    height: auto;
    min-height: 880px;
  }

  .sra-ceo__card {
    position: relative;
    min-height: 880px;
  }

  .sra-ceo__copy,
  [dir="rtl"] .sra-ceo__copy {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    gap: 24px;
    height: auto;
    margin-inline-start: 70px;
    padding: 155px 0 80px;
  }

  .sra-ceo__message {
    font-size: 18px;
    line-height: 28px;
  }

  .sra-ceo__divider {
    flex: none;
    height: 47px;
  }

  /* The copy now starts at the top of the section (with padding). */
  .sra-ceo__quote-mark {
    top: 70px;
  }
}

/* Tablets in portrait: space under the name (the portrait is above). */
/* Tablets in portrait: the text first, the portrait below it (as on
   mobile), sitting on the bottom edge. */
@media (min-width: 768px) and (max-width: 1023px) {
  .sra-ceo .sra-ceo__copy,
  [dir="rtl"] .sra-ceo .sra-ceo__copy {
    order: 1;
    margin-top: 0;
  }

  .sra-ceo .sra-ceo__quote-mark {
    position: static;
    margin-bottom: 8px;
  }

  .sra-ceo .sra-ceo__photo {
    z-index: 1;
    order: 2;
    margin-top: 40px;
  }

  /* Arabic: portrait on the left, in front of the (mirrored) shape. */
  [dir="rtl"] .sra-ceo .sra-ceo__photo {
    align-self: flex-end;
  }

  [dir="rtl"] .sra-ceo .sra-ceo__shape {
    right: auto;
    left: -6px;
    transform: scaleX(-1);
    transform-origin: center;
  }
}

@media (max-width: 1279px) {
  .sra-ceo__copy {
    width: calc(100% - 140px - 380px);
  }

  .sra-ceo__photo {
    width: 460px;
    height: 459px;
  }

  .sra-ceo__shape {
    width: 571.5px;
    height: 516.9px;
  }
}

/* Tablet and mobile: stacked, portrait below the text. */
@media (max-width: 1023px) {
  .sra-ceo {
    height: auto;
  }

  .sra-ceo__card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 72px var(--sra-gutter) 0;
  }

  .sra-ceo__copy,
  [dir="rtl"] .sra-ceo__copy {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    height: auto;
    margin-top: 96px;
  }

  .sra-ceo__quote-mark {
    top: -64px;
    width: 54px;
    height: 36px;
  }

  .sra-ceo__message {
    font-size: 18px;
    line-height: 28px;
  }

  .sra-ceo__divider {
    flex: none;
    height: 64px;
  }

  .sra-ceo__photo,
  [dir="rtl"] .sra-ceo__photo {
    position: relative;
    right: auto;
    left: auto;
    align-self: flex-end;
    width: min(100%, 360px);
    height: auto;
    aspect-ratio: 1;
    margin-top: 24px;
  }

  [dir="rtl"] .sra-ceo__photo {
    align-self: flex-start;
  }

  .sra-ceo__shape {
    width: 420px;
    height: auto;
  }
}
