/* SCT localized site runtime: shared by every translated locale build.
   New rules live here so accepted vendored theme assets stay byte-identical. */

/* Homepage section eyebrows: a theme grid rule meant for split headings also
   matched heads whose first child is the dot + label row, stacking the dot
   above the label. Keep that row inline. */
body.home .sct-home-section-head > .rt-subtext-wrapper:first-child {
  display: flex;
  flex-direction: row;
  align-items: center;
}

body.home .sct-home-section-head--center > .rt-subtext-wrapper:first-child {
  justify-content: center;
}

/* Header: translated menu labels run longer than English. Never let an
   overflowing menu slide under the logo, trim the inline padding, and let
   site-runtime.js step the menu down (sct-nav-fit-1/2) when it still overflows. */
.sct-desktop-nav {
  justify-content: safe center;
  padding-inline: clamp(.35rem, .9vw, 1rem);
}

.sct-nav-link,
.sct-nav-trigger {
  letter-spacing: .005em;
}

/* On wide screens the compact header may grow a little past English's 1200px
   so longer labels keep their size instead of stepping down. */
@media (min-width: 1440px) {
  .rt-header-scrolled .sct-header-stage {
    width: min(1320px, 100% - 4rem);
  }
}

.sct-desktop-nav.sct-nav-fit-1 {
  gap: .1rem;
}

.sct-desktop-nav.sct-nav-fit-1 :is(.sct-nav-link, .sct-nav-trigger) {
  padding-inline: .5rem;
  letter-spacing: 0;
}

.sct-desktop-nav.sct-nav-fit-2 :is(.sct-nav-link, .sct-nav-trigger) {
  padding-inline: .38rem;
  font-size: .68rem;
}

/* Sidebar journey headings were one-line for short English copy; translated
   headings wrap inside the card instead of running past its edge. */
.sct-therapy-journey .sct-therapy-journey__section-head h2 {
  white-space: normal;
  overflow-wrap: break-word;
}

/* Article headings fill the line before wrapping (balance split longer
   translated headings into two short halves). */
body .sct-article-content :is(h2, h3, h4),
body .sct-article-after-rail > :is(h2, h3) {
  text-wrap: pretty;
}

/* Inert private-review forms: match the site's evaluation submit button
   instead of the browser's disabled button. */
.gform_wrapper.gravity-theme .gform_footer .gform_button {
  position: relative;
  width: 100%;
  min-height: 3.6rem;
  margin: 0;
  padding: .85rem 2rem;
  border: 1px solid #0b756c;
  border-radius: 1rem;
  background-color: #0b756c;
  background-image: linear-gradient(120deg, #075f59 0%, #0b8177 55%, #109388 100%);
  box-shadow: 0 .85rem 1.7rem rgba(7, 95, 89, .2), inset 0 1px rgba(255, 255, 255, .18);
  color: #f4fffb;
  font: 700 1rem/1.2 Inter, 'Tajawal', system-ui, sans-serif;
  letter-spacing: .01em;
  opacity: 1;
}

.gform_wrapper.gravity-theme .gform_footer .gform_button:disabled {
  cursor: not-allowed;
}

/* English embeds this form on an opaque frame that hides the journey rail's
   decorative line; give the inline inert form the same surface. */
.sct-therapy-journey__evaluation .sct-sidebar-form {
  position: relative;
  z-index: 1;
  border-radius: 1.25rem;
  background: #fffdf8;
}

/* Gravity Forms' anti-spam trap field must never be visible (its own
   stylesheet, which normally hides it, is not loaded on these builds). */
.gform_wrapper .gform_validation_container,
.gform_wrapper .gfield--type-honeypot {
  display: none !important;
}

.gform_wrapper.gravity-theme fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Arabic phone directory: the English micro-label style (tiny uppercase,
   tracked, tight leading) clips Arabic ascenders and breaks letter joining. */
[dir='rtl'] .sct-phone-directory__copy small {
  font-size: .72rem;
  line-height: 1.55;
  letter-spacing: 0;
  text-transform: none;
}

[dir='rtl'] .sct-phone-directory__item {
  align-items: center;
}

/* Where the shared runtime renders its reading line, it replaces the theme's
   article-only bar; release builds without it keep the theme bar. */
body:has([data-sct-scroll-line]) .sct-reading-progress {
  display: none !important;
}

/* Reading line docked beneath the compact header. */
.sct-scroll-line {
  position: fixed;
  z-index: 10000;
  top: var(--sct-scroll-line-top, 0);
  left: var(--sct-scroll-line-left, 0);
  width: var(--sct-scroll-line-width, 100%);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 119, 115, .12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.sct-scroll-line[hidden] {
  display: none;
}

.sct-scroll-line.is-docked {
  opacity: 1;
}

.sct-scroll-line > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7d79, #7cb7a8);
  transform: scaleX(var(--sct-scroll-progress, 0));
  transform-origin: left center;
}

[dir='rtl'] .sct-scroll-line > span {
  background: linear-gradient(270deg, #2f7d79, #7cb7a8);
  transform-origin: right center;
}

/* Percentage ring above the accessibility launcher; back to top at 100%. */
.sct-scroll-progress {
  --sct-scroll-ring-size: 52px;
  position: fixed;
  z-index: 2147479000;
  inset-inline-end: calc(max(20px, env(safe-area-inset-right)));
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 76px);
  display: grid;
  width: var(--sct-scroll-ring-size);
  height: var(--sct-scroll-ring-size);
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 2px rgba(21, 59, 57, .08), 0 8px 22px rgba(21, 59, 57, .16);
  color: #153b39;
  cursor: pointer;
  font: 600 12px/1 Inter, 'Tajawal', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, background-color .25s ease, color .25s ease;
}

.sct-scroll-progress[hidden] {
  display: none;
}

.sct-scroll-progress.is-docked {
  inset-inline-end: auto;
  left: var(--sct-scroll-ring-left);
  bottom: var(--sct-scroll-ring-bottom);
}

.sct-scroll-progress.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .25s ease, transform .25s ease, visibility 0s, background-color .25s ease, color .25s ease;
}

.sct-scroll-progress:hover,
.sct-scroll-progress:focus-visible {
  transform: translateY(-2px);
}

.sct-scroll-progress:focus-visible {
  outline: 3px solid #0b7773;
  outline-offset: 3px;
}

.sct-scroll-progress__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

[dir='rtl'] .sct-scroll-progress__ring {
  transform: rotate(-90deg) scaleY(-1);
}

.sct-scroll-progress__ring circle {
  fill: none;
  stroke-width: 3.5;
}

.sct-scroll-progress__track {
  stroke: rgba(11, 119, 115, .14);
}

.sct-scroll-progress__fill {
  stroke: #0b7773;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--sct-scroll-progress, 0));
  transition: stroke-dashoffset .12s linear;
}

.sct-scroll-progress__value,
.sct-scroll-progress__arrow {
  position: relative;
  grid-area: 1 / 1;
  transition: opacity .2s ease, transform .2s ease;
}

.sct-scroll-progress__arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.6);
}

.sct-scroll-progress.is-complete {
  background: #0b7773;
  color: #fff;
}

.sct-scroll-progress.is-complete .sct-scroll-progress__track {
  stroke: rgba(255, 255, 255, .25);
}

.sct-scroll-progress.is-complete .sct-scroll-progress__fill {
  stroke: #fff;
}

.sct-scroll-progress.is-complete .sct-scroll-progress__value {
  opacity: 0;
  transform: scale(.6);
}

.sct-scroll-progress.is-complete .sct-scroll-progress__arrow {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  .sct-scroll-progress {
    --sct-scroll-ring-size: 46px;
    font-size: 11px;
  }
}

@media print {
  .sct-scroll-line,
  .sct-scroll-progress {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sct-scroll-line,
  .sct-scroll-progress,
  .sct-scroll-progress__fill,
  .sct-scroll-progress__value,
  .sct-scroll-progress__arrow {
    transition: none;
  }
}
