/* Case-study hero inspired by the supplied reference artwork. */
.case-study-reference-hero {
  position: relative;
  display: grid;
  min-height: max(760px, 100svh);
  align-items: center;
  overflow: hidden;
  padding: 140px 0 76px;
  color: #fff;
  background:
    radial-gradient(circle at 86% 18%, rgba(173, 196, 112, 0.56), transparent 35%),
    linear-gradient(90deg, #174a46 0%, #285c4e 54%, #789963 100%);
}

.case-study-reference-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(191, 181, 80, 0.2) 2px, transparent 2px),
    linear-gradient(90deg, rgba(191, 181, 80, 0.2) 2px, transparent 2px),
    radial-gradient(circle at 25% 44%, transparent 0 235px, rgba(191, 181, 80, 0.21) 237px 239px, transparent 241px 410px, rgba(191, 181, 80, 0.17) 412px 414px, transparent 416px),
    radial-gradient(circle at 81% 57%, transparent 0 220px, rgba(191, 181, 80, 0.18) 222px 224px, transparent 226px);
  background-size: 320px 320px, 320px 320px, 100% 100%, 100% 100%;
  opacity: 0.82;
}

.case-study-reference-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 45, 43, 0.24), transparent 38%, rgba(214, 210, 122, 0.06));
}

.case-study-reference-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1480px, calc(100% - 64px));
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  gap: clamp(54px, 7vw, 112px);
  align-items: center;
}

.case-study-reference-copy {
  display: grid;
  min-width: 0;
  gap: 1.8rem;
  text-align: right;
}

.case-study-reference-copy h1 {
  max-width: 720px;
  margin: 0;
  color: var(--lm-heading-teal, #42a6a6) !important;
  -webkit-text-fill-color: var(--lm-heading-teal, #42a6a6) !important;
  font-family: var(--font-display, "IBM Plex Sans Arabic", sans-serif);
  font-size: clamp(4.2rem, 8vw, 8.1rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-shadow: 0 10px 28px rgba(19, 64, 58, 0.16);
}

.case-study-reference-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 3rem);
  max-width: 790px;
  margin: 0;
}

.case-study-reference-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 500;
  line-height: 2;
  text-wrap: pretty;
}

.case-study-reference-copy .hero-related-actions {
  margin-top: 0.4rem;
}

.case-study-reference-copy .hero-related-link {
  color: #174a46;
  background: #fbbb3f;
  border-color: #fbbb3f;
}

.case-study-reference-copy .hero-related-link:hover {
  color: #fff;
  background: #ef7358;
  border-color: #ef7358;
}

.case-study-reference-mark {
  display: grid;
  width: min(100%, 590px);
  aspect-ratio: 1 / 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.5vw, 22px);
  justify-self: center;
  direction: ltr;
  filter: drop-shadow(0 30px 48px rgba(15, 78, 74, 0.28));
}

.case-study-reference-piece {
  display: block;
  min-width: 0;
  min-height: 0;
  background: #20b8ab;
  background: linear-gradient(135deg, #1aa59a 0%, #3dd5c8 100%);
}

.case-study-reference-piece-1 {
  border-radius: 0 0 100% 0;
}

.case-study-reference-piece-2 {
  border-radius: 0 100% 0 0;
}

.case-study-reference-piece-3 {
  border-radius: 0 0 0 100%;
}

.case-study-reference-piece-4 {
  border-radius: 100% 0 0 0;
}

body.dark-theme .case-study-reference-hero,
[data-theme="dark"] .case-study-reference-hero {
  background:
    radial-gradient(circle at 86% 18%, rgba(145, 170, 91, 0.38), transparent 35%),
    linear-gradient(90deg, #0d3331 0%, #17463e 54%, #536e4d 100%);
}

@media (max-width: 980px) {
  .case-study-reference-hero {
    min-height: 0;
    padding: 128px 0 72px;
  }

  .case-study-reference-grid {
    width: min(100% - 40px, 760px);
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .case-study-reference-copy h1 {
    font-size: clamp(4rem, 13vw, 7rem);
  }

  .case-study-reference-mark {
    width: min(82vw, 520px);
  }
}

@media (max-width: 620px) {
  .case-study-reference-hero {
    padding: 112px 0 54px;
  }

  .case-study-reference-grid {
    width: min(100% - 28px, 520px);
    gap: 2.4rem;
  }

  .case-study-reference-copy {
    gap: 1.35rem;
  }

  .case-study-reference-copy h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
    line-height: 1.05;
  }

  .case-study-reference-intro {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .case-study-reference-intro p {
    font-size: 1rem;
    line-height: 1.85;
  }

  .case-study-reference-mark {
    width: min(88vw, 410px);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-study-reference-copy .hero-related-link {
    transition: none;
  }
}

/* SLOGAN VISIBILITY OVERRIDE */
.site-header.premium-header .logo-slogan,
.premium-header .logo-slogan,
.logo-slogan {
    display: block !important;
    font-size: 11px !important;
    color: #7c9494 !important;
    font-weight: 500 !important;
    white-space: normal !important;
    margin-top: 2px !important;
}

.footer-slogan {
    display: block !important;
    font-weight: 700 !important;
    color: #faba3d !important;
    margin: 0.35rem 0 0.55rem !important;
}


/* ==========================================================================
   GLOBAL MOBILE HERO TEXT REDUCTION (ALL PAGES)
   ========================================================================== */
@media (max-width: 991px) {
  body .hero h1,
  body .hero-copy h1,
  body .page-hero-copy h1,
  body .hero-showcase .hero-copy h1,
  body .hero-homepage .hero-copy h1,
  body .course-header h1,
  body .post-header h1,
  body .page-header h1,
  body .hero-content h1,
  body .section-hero h1,
  body h1.hero-title,
  body h1.page-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    line-height: 1.25 !important;
    margin-bottom: 0.75rem !important;
    max-width: 100% !important;
  }
  
  body .hero p,
  body .hero-copy p,
  body .page-hero-copy p,
  body .hero-showcase .hero-copy p,
  body .hero-homepage .hero-copy p,
  body .page-header p,
  body .hero-content p,
  body .section-hero p,
  body p.hero-subtitle {
    font-size: clamp(0.9rem, 4.5vw, 1.1rem) !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
    max-width: 100% !important;
  }
}



/* ==========================================================================
   CENTERED MOBILE HEADER SLOGAN - V4 (ABSOLUTE CENTERING)
   ========================================================================== */
@media (max-width: 991px) {
  /* 1. Ensure header-shell is the relative parent */
  body .site-header .header-shell,
  body .site-header.premium-header .header-shell {
    position: relative !important;
  }
  
  /* 2. Remove any relative positioning from brand link and its wrappers */
  body .site-header .brand,
  body .site-header.premium-header .brand,
  html[dir="rtl"] body .site-header.premium-header .brand,
  body a.brand,
  body a.brand-saas {
    position: static !important;
  }

  /* 3. Absolute position the slogan in the exact center of header-shell */
  body .site-header .brand .logo-slogan,
  body .site-header.premium-header .brand .logo-slogan,
  body .site-header.premium-header .brand-saas .logo-slogan,
  body a.brand span.logo-slogan,
  html[dir="rtl"] body .site-header.premium-header a.brand span.logo-slogan,
  html[dir="rtl"] body .site-header a.brand span.logo-slogan {

    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    
    /* 4. Formatting */
    width: 125px !important;
    max-width: 130px !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    font-size: 8.5px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    color: var(--color-text-muted, rgba(255, 255, 255, 0.7)) !important;
    direction: rtl !important;
  }
}


/* ==========================================================================
   MOBILE MENU CONTAINER OVERFLOW FIX - V7 (ALLOW FULL TEXT)
   ========================================================================== */
@media (max-width: 991px) {
  /* Remove overflow-x: hidden from parent containers that clip the text */
  body .premium-header .site-nav.site-nav-saas .drawer-content,
  body .premium-header .site-nav.site-nav-saas .navigation-container,
  body .site-nav .drawer-content,
  body .site-nav .navigation-container {
    overflow-x: visible !important;
    overflow: visible !important;
  }

  /* nav-panel must allow overflow too */
  body .premium-header .site-nav.site-nav-saas .nav-panel {
    overflow-x: visible !important;
  }

  /* nav-list items should not clip */  
  body .premium-header .site-nav.site-nav-saas .nav-list,
  body .nav-list {
    overflow: visible !important;
  }

  /* nav-item-dropdown should not clip */
  body .nav-item-dropdown,
  body .premium-header .nav-item-dropdown {
    overflow: visible !important;
  }

  /* open dropdown menu must show all content */
  body .premium-header .site-nav.site-nav-saas .nav-item-dropdown.open .nav-dropdown-menu,
  body .nav-item-dropdown.open .nav-dropdown-menu {
    overflow: visible !important;
    max-height: 2500px !important;
  }

  /* Force dropdown links to wrap text */
  body .nav-dropdown-link,
  body .premium-header .nav-dropdown-link,
  body .site-nav .nav-dropdown-link {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-overflow: unset !important;
    overflow: visible !important;
    display: block !important;
    height: auto !important;
    line-height: 1.5 !important;
  }
}



/* ==========================================================================
   MOBILE MENU DROPDOWN FIX - V8 (ACCORDION STYLE FOR MOBILE)
   ========================================================================== */
@media (max-width: 991px) {
  body .premium-header .nav-dropdown-menu,
  body .site-header .nav-dropdown-menu,
  body .site-nav-saas .nav-dropdown-menu,
  body .site-header.premium-header .nav-dropdown-menu {
    position: static !important;
    transform: none !important;
    inset-inline-start: 0 !important;
    left: 0 !important;
    right: auto !important;
    margin-top: 0.5rem !important;
    min-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Success Stories — intro in a single column like the other pages (change request #17) */
main .case-study-intro.case-study-reference-intro{grid-template-columns:minmax(0,1fr) !important;column-count:auto !important;gap:.9rem !important}
