/* Mobile nav + Cloudflare Pages site fixes */

/* Remove the original craft theme top border strip above the header */
html,
body {
  border-top: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@media (max-width: 900px) {
  .nav-handle {
    z-index: 1200 !important;
  }

  nav,
  nav.active,
  #nav,
  #nav.active {
    z-index: 1100 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open {
    overflow: hidden !important;
    touch-action: none;
  }
}

header {
  position: relative;
  z-index: 1000;
}

/* Header social icons (replace login/training icons) */
.secondary-nav .nav-social {
  display: inline-flex;
  align-items: center;
  list-style: none;
  margin: 0 0.15rem;
}
.secondary-nav .nav-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 3.6rem;
  height: 3.6rem;
  padding: 0.9rem;
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.secondary-nav .nav-social a:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.secondary-nav .nav-social img {
  width: 1.6rem;
  height: 1.6rem;
  display: block;
  object-fit: contain;
  padding: 0;
  box-sizing: content-box;
}
@media (max-width: 900px) {
  .secondary-nav .nav-social {
    display: inline-flex;
    margin: 0.35rem 0.25rem;
  }
  .secondary-nav .nav-social a {
    width: 4rem;
    height: 4rem;
    padding: 1rem;
  }
}

/* Home process: right image fills its column */
.home-process .process-right img,
.home-process .process-right .process-right-img {
  width: 100%;
  height: 100%;
  min-height: 32rem;
  max-height: 42rem;
  object-fit: cover;
  object-position: center;
  display: block;
}

/*
 * Failsafe: .appear must never stay invisible if JS/IntersectionObserver fails.
 * style.css starts sections at opacity:0 until .inview is added.
 */
.appear {
  opacity: 1;
  transform: none;
}
.appear.inview {
  opacity: 1;
  transform: none;
}

/* Scroll to top */
#azad-scroll-top {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  z-index: 9999;
  width: 4.4rem;
  height: 4.4rem;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a3a6b;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
}
#azad-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
#azad-scroll-top:hover {
  background: #254f8f;
}
#azad-scroll-top svg {
  width: 1.8rem;
  height: 1.8rem;
  display: block;
}
@media (max-width: 700px) {
  #azad-scroll-top {
    right: 1.2rem;
    bottom: 1.2rem;
    width: 4rem;
    height: 4rem;
  }
}

/* reCAPTCHA v3: left side, 100% size, full badge briefly then logo-only square */
.grecaptcha-badge {
  visibility: visible !important;
  opacity: 1 !important;
  left: 0 !important;
  right: auto !important;
  bottom: 14px !important;
  z-index: 9990 !important;
  height: 60px !important;
  max-height: 60px !important;
  overflow: hidden !important;
  /* Collapsed = logo chip only (standard ~70×60 at full pixel size, no scale) */
  width: 70px !important;
  max-width: 70px !important;
  transform: none !important;
  transform-origin: bottom left !important;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.22) !important;
  border-radius: 3px !important;
  margin: 0 !important;
  transition: width 0.45s ease !important;
}

/* Brief expanded “protected by reCAPTCHA” state at start, and on hover */
.grecaptcha-badge.azad-recaptcha-expanded,
.grecaptcha-badge:hover,
.grecaptcha-badge:focus-within {
  width: 256px !important;
  max-width: 256px !important;
}

.grecaptcha-badge iframe {
  width: 256px !important;
  height: 60px !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  position: relative !important;
  left: 0 !important;
  transition: left 0.45s ease !important;
}

/*
 * Google draws the recycle logo on the RIGHT of the 256px badge in most locales.
 * When collapsed, shift iframe so only that logo square remains in the 70px viewport.
 * Expanded/hover shows the full bar left-aligned.
 */
.grecaptcha-badge.azad-recaptcha-collapsed iframe {
  left: -186px !important;
}
.grecaptcha-badge.azad-recaptcha-expanded iframe,
.grecaptcha-badge:hover iframe,
.grecaptcha-badge:focus-within iframe {
  left: 0 !important;
}

/* If Formie injects a logo-left layout, this override keeps logo visible either way via hover expand */

@media (max-width: 700px) {
  .grecaptcha-badge {
    left: 0 !important;
    right: auto !important;
    bottom: 14px !important;
  }
}

.formie-recaptcha-placeholder,
.fui-captcha.formie-recaptcha-placeholder {
  min-height: 0;
  margin: 0.25rem 0;
  overflow: visible;
}

/* True circle for home profile masks (Yaser Nazir portrait) */
.home-about .about-left .profile-mask,
.home-process .process-left .profile-mask {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.home-about .about-left .profile-mask span.circle,
.home-process .process-left .profile-mask span.circle {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  bottom: auto;
  background: transparent;
}
.home-about .about-left .profile-mask img.profile,
.home-process .process-left .profile-mask img.profile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  background: transparent;
}

/* Home hero: enlarge Yaser Nazir circle photo 1.3x and shift it 30px down */
.home-process .process-left .profile-mask {
  width: 286px;
  height: 286px;
  top: calc(-12rem + 30px);
}

/* Standards pages: Why certify — person is a true circle (Yaser Nazir) */
body.standard .txt-img-block .images.w-circle:before {
  width: 22rem !important;
  height: 22rem !important;
  top: calc(50% - 11rem) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body.standard .txt-img-block .images.w-circle img:first-child {
  width: 22rem !important;
  height: 22rem !important;
  top: calc(50% - 11rem) !important;
  border-radius: 50% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent !important;
}
