/* Scroll reveal, parallax shell, and global motion helpers */

:root {
  --site-teal: #04706b;
  --site-teal-light: #0a8a83;
  --reveal-duration: 0.75s;
  --reveal-distance: 36px;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .hero-parallax__bg,
  .site-page-bg__layer {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .site-body--home-hero .carousel-item.active .hero-split__frame,
  .site-body--home-hero .hero-split__frame {
    animation: none !important;
    transform: none !important;
  }

  .site-body--home-hero .hero-split__frame:hover {
    transform: none !important;
  }
}

/* Full-page parallax backdrop (all templates extending base.html) */
.site-body.site-body--parallax {
  position: relative;
  min-height: 100vh;
  /* Reset any base body gradients so the moving layer reads clearly */
  background: #eef2f1;
}

.site-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.site-page-bg__layer {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 122%;
  height: 122%;
  margin-left: -61%;
  margin-top: -61%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0) scale(1.06);
  will-change: transform;
  filter: saturate(1.05) contrast(1.02);
}

.site-page-bg__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    175deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(241, 247, 246, 0.55) 40%,
    rgba(255, 255, 255, 0.72) 100%
  );
}

.site-body--blog .site-page-bg__scrim {
  background: linear-gradient(
    185deg,
    rgba(4, 32, 30, 0.55) 0%,
    rgba(241, 247, 246, 0.72) 38%,
    rgba(255, 255, 255, 0.88) 100%
  );
}

/* Home: do not repeat hero art in the fixed backdrop (was oversized + scaled → looked zoomed/blurred behind slides) */
.site-body--home-hero .site-page-bg__layer {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background-image: none !important;
  background: linear-gradient(168deg, #d5e8ea 0%, #eef6f5 42%, #f8fbfc 100%);
  background-size: auto;
  transform: none !important;
  filter: none;
  will-change: auto;
}

.site-body--home-hero .site-page-bg__scrim {
  background: linear-gradient(
    175deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(241, 247, 246, 0.28) 45%,
    rgba(255, 255, 255, 0.5) 100%
  );
}

/* Keep main + footer above the fixed parallax layer (Django); do not lower .site-navbar z-index */
.site-main,
.footer {
  position: relative;
  z-index: 2;
}

/* Static export: sections + footer above page backdrop; header keeps its own stacking */
.site-body.site-body--parallax > section,
.site-body.site-body--parallax > footer.site-footer {
  position: relative;
  z-index: 1;
}

.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  transition:
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-left {
  transform: translate3d(calc(var(--reveal-distance) * -1), 0, 0);
}

.reveal-right {
  transform: translate3d(var(--reveal-distance), 0, 0);
}

.reveal-scale {
  transform: translate3d(0, calc(var(--reveal-distance) * 0.5), 0) scale(0.96);
}

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Parallax hero (KSA / flagship band) */
.hero-parallax {
  position: relative;
  min-height: clamp(420px, 72vh, 720px);
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 0;
}

.hero-parallax__bg {
  position: absolute;
  inset: -12% 0 -8% 0;
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0) scale(1.06);
  will-change: transform;
  z-index: 0;
}

.hero-parallax__map-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../images/ksa-map-watermark.svg");
  background-repeat: no-repeat;
  background-position: 76% 42%;
  background-size: min(92vmin, 980px) auto;
  opacity: 0.36;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.hero-parallax__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    120deg,
    rgba(4, 48, 46, 0.86) 0%,
    rgba(4, 112, 107, 0.5) 45%,
    rgba(10, 30, 28, 0.28) 100%
  );
}

.hero-parallax__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2rem 1rem;
}

.hero-parallax__map {
  position: absolute;
  right: -4%;
  bottom: -6%;
  width: min(58vw, 620px);
  max-height: 85%;
  opacity: 0.22;
  z-index: 1;
  pointer-events: none;
}

.hero-parallax__map svg {
  width: 100%;
  height: auto;
  fill: #fff;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.hero-card {
  max-width: 560px;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f4fffe;
  text-align: left;
}

.hero-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.75rem;
}

.hero-card__title {
  font-family: "Outfit", "Noto Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 4.2vw, 2.35rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-card__lead {
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  line-height: 1.6;
  color: rgba(244, 255, 254, 0.92);
  margin-bottom: 1.25rem;
}

.hero-card .icon-link {
  color: #fff !important;
  font-weight: 600;
}

.hero-card .icon-link:hover {
  color: #b8f0ea !important;
}

/* Section heading with icon */
.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: "Outfit", "Noto Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  color: #1a2a28;
  margin-bottom: 0.75rem;
}

.section-heading i {
  color: var(--site-teal);
  font-size: 0.95em;
}

/* Navbar refinements */
.site-navbar .navbar-brand img.site-navbar__logo,
.site-navbar .navbar-brand .site-navbar__logo {
  max-height: clamp(52px, 12vw, 76px);
  width: auto;
  height: auto;
}

/* Home: logo “floats” on the seam between the fixed bar and the carousel */
.site-body--home-hero .site-navbar {
  --home-logo-h: clamp(108px, 15vw, 168px);
  --home-nav-anchor: 4.5rem;
  overflow: visible;
}

.site-body--home-hero .site-navbar > .container-fluid {
  position: relative;
  overflow: visible;
  min-height: 3.35rem;
}

.site-body--home-hero .site-navbar .navbar-brand {
  position: absolute;
  left: max(0.65rem, env(safe-area-inset-left));
  /* Keep top of logo inside the bar so it is never clipped under the viewport */
  top: max(0.35rem, calc(var(--home-nav-anchor) - var(--home-logo-h) / 2));
  z-index: 1046;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.site-body--home-hero .site-navbar .navbar-brand img.site-navbar__logo {
  height: var(--home-logo-h);
  max-height: none;
  max-width: min(220px, 62vw);
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.38));
}

@media (min-width: 992px) {
  .site-body--home-hero .site-navbar .navbar-collapse {
    margin-left: clamp(9rem, 26vw, 17rem);
  }
}

@media (max-width: 991.98px) {
  .site-body--home-hero .site-navbar {
    --home-logo-h: clamp(88px, 26vw, 128px);
    --home-nav-anchor: 4.15rem;
  }

  .site-body--home-hero .site-navbar .navbar-toggler {
    position: relative;
    z-index: 1048;
  }
}

/* Home hero: Bootstrap carousel under fixed nav */
.hero-carousel.carousel {
  position: relative;
  overflow: hidden;
  background: #0d2833;
}

/* Carousel sits under the fixed bar; home logo overlaps the first band of slides */
.carousel-hero {
  margin-top: 4.75rem;
}

.site-body--home-hero .carousel-hero {
  margin-top: 4.35rem;
  position: relative;
  z-index: 1;
}

/* Static site (alhazmi-static-site): same floating logo + carousel seam as Django home */
.site-body--home-hero .site-nav {
  --home-logo-h: clamp(108px, 15vw, 168px);
  --home-nav-anchor: 4.5rem;
  overflow: visible;
}

.site-body--home-hero .site-nav__inner {
  position: relative;
  overflow: visible;
  min-height: 3.35rem;
}

.site-body--home-hero .site-nav__brand {
  position: absolute;
  left: max(0.65rem, env(safe-area-inset-left));
  top: max(0.35rem, calc(var(--home-nav-anchor) - var(--home-logo-h) / 2));
  z-index: 1046;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.site-body--home-hero .site-nav__brand img.site-nav__logo {
  height: var(--home-logo-h);
  max-height: none;
  max-width: min(220px, 62vw);
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.38));
}

@media (min-width: 992px) {
  .site-body--home-hero .site-nav__links {
    margin-left: clamp(9rem, 26vw, 17rem);
  }
}

@media (max-width: 991.98px) {
  .site-body--home-hero .site-nav {
    --home-logo-h: clamp(88px, 26vw, 128px);
    --home-nav-anchor: 4.15rem;
  }

  .site-body--home-hero .site-nav__toggle {
    position: relative;
    z-index: 1048;
  }
}

.site-body--home-hero .hero-carousel {
  margin-top: 4.35rem;
  position: relative;
  z-index: 1;
}

.site-navbar .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.65rem !important;
}

.site-navbar .nav-link i {
  font-size: 0.95rem;
  color: var(--site-teal);
  opacity: 0.85;
}

@media (max-width: 991.98px) {
  .site-navbar .navbar-collapse {
    padding: 0.75rem 0 0.5rem;
  }

  .site-navbar .nav-link {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
}

/* Home hero: split layout — copy left, framed image right */
.site-body--home-hero .carousel-hero .carousel-inner {
  background: linear-gradient(125deg, #071a22 0%, #0d2833 38%, #0f3a42 72%, #0a252c 100%);
  min-height: clamp(400px, 82vh, 1020px);
  padding-bottom: 3rem;
}

.site-body--home-hero .carousel-hero .carousel-item {
  padding: clamp(1.25rem, 3vw, 2.25rem) 0;
}

.site-body--home-hero .hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .site-body--home-hero .hero-split {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.42fr);
    gap: clamp(1.5rem, 4vw, 3rem);
  }
}

.site-body--home-hero .hero-split__copy {
  color: #e8f4f3;
  text-align: left;
}

.site-body--home-hero .hero-split__eyebrow {
  font-family: "Outfit", "Noto Sans", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5ed4cc;
  margin: 0 0 0.65rem;
}

.site-body--home-hero .hero-split__title {
  font-family: "Outfit", "Noto Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 0.85rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.site-body--home-hero .hero-split__lead {
  font-size: clamp(0.95rem, 1.9vw, 1.08rem);
  line-height: 1.55;
  color: rgba(232, 244, 243, 0.88);
  margin: 0;
  max-width: 36rem;
}

.site-body--home-hero .hero-split__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (min-width: 768px) {
  .site-body--home-hero .hero-split__visual {
    justify-content: flex-end;
  }
}

.site-body--home-hero .hero-split__frame {
  margin: 0;
  width: 100%;
  max-width: min(100%, 880px);
  padding: clamp(12px, 1.7vw, 20px);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 45%, rgba(4, 112, 107, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.12),
    0 22px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(4, 112, 107, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-6px);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}

.site-body--home-hero .carousel-item.active .hero-split__frame {
  animation: hero-float-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-float-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(-6px) scale(1);
  }
}

.site-body--home-hero .hero-split__frame:hover {
  transform: translateY(-10px);
  box-shadow:
    0 6px 10px rgba(0, 0, 0, 0.15),
    0 28px 56px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(94, 212, 204, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.site-body--home-hero .hero-split__frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(78vh, 760px);
  object-fit: contain;
  object-position: center center;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
}

.site-body--home-hero .carousel-hero .carousel-control-prev,
.site-body--home-hero .carousel-hero .carousel-control-next {
  width: 3rem;
  opacity: 0.88;
  z-index: 4;
}

.site-body--home-hero .carousel-hero .carousel-indicators {
  margin-bottom: 0.5rem;
  z-index: 4;
}

.site-body--home-hero .carousel-hero .carousel-indicators [data-bs-target] {
  width: 2.25rem;
  height: 4px;
  border-radius: 2px;
  border: none;
  background-color: rgba(255, 255, 255, 0.28);
}

.site-body--home-hero .carousel-hero .carousel-indicators .active {
  background-color: #5ed4cc;
}

/* Other carousels: direct image child only */
.carousel-hero .carousel-item > img {
  width: 100%;
  height: clamp(280px, 58vh, 780px);
  object-fit: cover;
  object-position: center center;
}

/* Brand strip */
.brand-strip {
  padding: clamp(2rem, 5vw, 3.5rem) 1rem;
}

.brand-strip__title {
  font-family: "Outfit", "Noto Sans", system-ui, sans-serif;
  font-weight: 700;
  text-align: center;
  color: #0b3d3a;
  margin-bottom: 1.5rem;
}

.brand-strip__title i {
  color: var(--site-teal);
  margin-right: 0.35rem;
}

@media (max-width: 767.98px) {
  .hero-parallax__map {
    width: min(78vw, 380px);
    opacity: 0.14;
    right: -18%;
  }

  .hero-parallax__map-watermark {
    background-position: 52% 48%;
    background-size: min(110vmin, 720px) auto;
    opacity: 0.28;
  }
}
