/**
 * @file nd96-hero.css
 * National Day 96 homepage banner (HRSD nd96-hero treatment).
 */

@property --nd96-bg-from {
  syntax: "<color>";
  inherits: true;
  initial-value: #166a45;
}

@property --nd96-bg-to {
  syntax: "<color>";
  inherits: true;
  initial-value: #1b8354;
}

/* Hide the node-body hero and the generic page title hero on the homepage. */
.path-frontpage .hero-section,
.path-frontpage .page-hero {
  display: none !important;
}

.nd96-hero {
  --nd96-bg-from: #166a45;
  --nd96-bg-to: #1b8354;
  --nd96-bg-angle: 90deg;
  --nd96-accent: #fff;
  align-items: center;
  background-color: var(--nd96-bg-to);
  background-image: linear-gradient(var(--nd96-bg-angle), var(--nd96-bg-from), var(--nd96-bg-to));
  display: flex;
  justify-content: flex-start;
  min-height: 491px;
  overflow: hidden;
  position: relative;
  transition:
    --nd96-bg-from 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    --nd96-bg-to 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .nd96-hero {
  --nd96-bg-angle: 270deg;
}

.nd96-hero::before {
  background-image: url("../images/nd96/slider-pattern-n96.svg");
  background-repeat: repeat;
  content: "";
  inset: 0;
  opacity: 0.4;
  pointer-events: none;
  position: absolute;
}

.nd96-hero--heritage {
  --nd96-bg-from: #01572b;
  --nd96-bg-to: #5aba1c;
  --nd96-accent: #ebffe6;
}

.nd96-hero--courage {
  --nd96-bg-from: #1b2613;
  --nd96-bg-to: #607c4f;
  --nd96-accent: #c9e0bb;
}

.nd96-hero--ambition {
  --nd96-bg-from: #340117;
  --nd96-bg-to: #971a4d;
  --nd96-accent: #ff85c7;
}

.nd96-hero--generosity {
  --nd96-bg-from: #312d6e;
  --nd96-bg-to: #6565e0;
  --nd96-accent: #ded8f7;
}

.nd96-hero--kindness {
  --nd96-bg-from: #011d3a;
  --nd96-bg-to: #0050af;
  --nd96-accent: #07b9ff;
}

.nd96-hero--vision {
  --nd96-bg-from: #211501;
  --nd96-bg-to: #7c5d21;
  --nd96-accent: #d8b67a;
}

.nd96-hero > .container {
  padding-block: 40px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.nd96-hero__content {
  color: #fff;
  max-width: 640px;
  pointer-events: auto;
  text-align: start;
}

.nd96-hero__deck {
  height: 491px;
  max-width: 100%;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 720px;
  z-index: 0;
}

[dir="rtl"] .nd96-hero__deck {
  left: 0;
  right: auto;
}

.nd96-hero__slide {
  background-color: transparent;
  background-position: 0;
  background-repeat: no-repeat;
  background-size: auto 100%;
  border: 0;
  cursor: pointer;
  height: 100%;
  left: var(--nd96-x, 0);
  padding: 0;
  position: absolute;
  top: 0;
  transition:
    left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    right 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    background-position 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 45.8px;
  z-index: 2;
}

[dir="rtl"] .nd96-hero__slide {
  background-position: 100%;
  left: auto;
  right: var(--nd96-x, 0);
}

.nd96-hero__slide.is-active {
  background-position: 50%;
  cursor: default;
  width: 491px;
  z-index: 3;
}

.nd96-hero__slide.is-leaving {
  z-index: 1;
}

.nd96-hero__slide--heritage {
  background-image: url("../images/nd96/hero-heritage-n96.png");
}

.nd96-hero__slide--courage {
  background-image: url("../images/nd96/hero-courage-n96.png");
}

.nd96-hero__slide--ambition {
  background-image: url("../images/nd96/hero-ambition-n96.png");
}

.nd96-hero__slide--generosity {
  background-image: url("../images/nd96/hero-generosity-n96.png");
}

.nd96-hero__slide--kindness {
  background-image: url("../images/nd96/hero-kindness-n96.png");
}

.nd96-hero__slide--vision {
  background-image: url("../images/nd96/hero-vision-n96.png");
}

.nd96-hero__lockup {
  background: url("../images/nd96/logo-n96.svg") no-repeat 50% / contain;
  height: 80px;
  margin-bottom: 32px;
  width: 175px;
}

.nd96-hero__title {
  color: #fff;
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
  font-size: 74px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.973;
  margin: 0 0 24px;
  min-height: 0.973em;
  text-align: start;
  white-space: nowrap;
}

.nd96-hero__title:lang(en) {
  font-size: min(74px, 11.4vw - 88px);
  text-transform: capitalize;
}

.nd96-hero__title-typed {
  color: var(--nd96-accent);
}

.nd96-hero__caret {
  animation: nd96-caret 0.9s step-end infinite;
  background-color: currentColor;
  display: inline-block;
  height: 0.72em;
  margin-left: 2px;
  width: 2px;
}

[dir="rtl"] .nd96-hero__caret {
  margin-left: 0;
  margin-right: 2px;
}

.nd96-hero__body {
  color: #fff;
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  margin: 0 0 32px;
  opacity: 0;
  text-align: start;
  transform: translateY(20px);
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nd96-hero__body.is-in {
  opacity: 1;
  transform: none;
}

.nd96-hero__body--stacked {
  display: none;
}

.nd96-hero__controls {
  align-items: center;
  display: flex;
  gap: 24px;
}

.nd96-hero__arrow {
  align-items: center;
  background-color: #1b8354;
  border: 0;
  border-radius: 100%;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 48px;
  justify-content: center;
  padding: 0;
  transition: 0.4s;
  width: 48px;
}

.nd96-hero__arrow svg {
  height: 20px;
  width: 20px;
}

.nd96-hero__arrow:focus-visible,
.nd96-hero__arrow:hover {
  background-color: #166a45;
}

.nd96-hero__arrow--next svg,
[dir="rtl"] .nd96-hero__arrow--prev svg {
  transform: scaleX(-1);
}

[dir="rtl"] .nd96-hero__arrow--next svg {
  transform: none;
}

.nd96-hero__bullets {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nd96-hero__bullet {
  background-color: #e5e7eb;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 12px;
  padding: 0;
  transition: 0.3s;
  width: 12px;
}

.nd96-hero__bullet.is-active {
  background-color: #1b8354;
}

@media (max-width: 1310px) {
  .nd96-hero {
    align-items: center;
    flex-direction: column;
    gap: 32px;
    justify-content: flex-start;
    min-height: 0;
    padding: 40px 24px;
    text-align: center;
  }

  .nd96-hero,
  [dir="rtl"] .nd96-hero {
    --nd96-bg-angle: 180deg;
  }

  .nd96-hero > .container,
  .nd96-hero__content {
    display: contents;
  }

  .nd96-hero__lockup {
    margin-bottom: 0;
    order: 1;
  }

  .nd96-hero__title {
    order: 3;
  }

  .nd96-hero__body {
    order: 4;
  }

  .nd96-hero__controls {
    order: 5;
  }

  .nd96-hero__controls .nd96-hero__arrow {
    display: none;
  }

  .nd96-hero__deck {
    aspect-ratio: 430 / 324;
    height: auto;
    max-width: 651px;
    order: 2;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: calc(100% + 48px);
  }

  [dir="rtl"] .nd96-hero__deck {
    left: auto;
    right: auto;
  }

  .nd96-hero__slide {
    background-position: 50%;
    background-size: contain;
    height: 73.7%;
    left: calc(22.23% + var(--nd96-rel, 0) * 69.17%);
    opacity: 0;
    top: 13.15%;
    transition:
      top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      right 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 55.54%;
  }

  [dir="rtl"] .nd96-hero__slide {
    left: auto;
    right: calc(22.23% + var(--nd96-rel, 0) * 69.17%);
  }

  .nd96-hero__slide.is-near {
    opacity: 1;
  }

  .nd96-hero__slide.is-active {
    height: 100%;
    left: 12.33%;
    top: 0;
    width: 75.35%;
  }

  [dir="rtl"] .nd96-hero__slide.is-active {
    left: auto;
    right: 12.33%;
  }

  .nd96-hero__title,
  .nd96-hero__title:lang(en) {
    font-size: 40px;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0;
    min-height: 1em;
    text-align: center;
    white-space: normal;
  }

  .nd96-hero__body {
    font-size: 20px;
    line-height: 26px;
    margin-bottom: 0;
    text-align: center;
  }

  .nd96-hero__body--wide {
    display: none;
  }

  .nd96-hero__body--stacked {
    display: block;
  }
}

@media (max-width: 1310px) and (min-width: 768px) {
  .nd96-hero__deck {
    aspect-ratio: auto;
    height: 491px;
    max-width: 900px;
  }

  .nd96-hero__slide {
    height: 361.8px;
    left: calc(50% - 180.9px + var(--nd96-rel, 0) * 450.65px);
    top: 64.6px;
    width: 361.8px;
  }

  [dir="rtl"] .nd96-hero__slide {
    left: auto;
    right: calc(50% - 180.9px + var(--nd96-rel, 0) * 450.65px);
  }

  .nd96-hero__slide.is-active {
    height: 491px;
    left: calc(50% - 245.5px);
    top: 0;
    width: 491px;
  }

  [dir="rtl"] .nd96-hero__slide.is-active {
    left: auto;
    right: calc(50% - 245.5px);
  }
}

@keyframes nd96-caret {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd96-hero,
  .nd96-hero__slide {
    transition: none;
  }

  .nd96-hero__caret {
    animation: none;
  }

  .nd96-hero__body {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
