/* Training page styles.  Markup: website/training.xml   Shared parts: home.css, service-ea-site.css, navbar.css, footer.css
   Sections (same order as the page):
     0. Base
     1. Hero
     2. Intro
     3. Programs (tabs + panels)
     4. Custom course band
     5. Registration form (modal)
     6. Shared buttons / fonts
*/

/* ============================================================ 0. BASE */
:root {
  --navy: #0A2540;
  --blue: #0066FF;
  --teal: #00C2FF;
  --dt: #00D1B2;
  --soft: #EEF4F9;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
iframe {
  max-width: 100%;
}

body {
  margin: 0;
  font-family: 'Montserrat','Cairo',system-ui,sans-serif;
  background: #fff;
  color: var(--navy);
}

body.page-training {
  background: var(--soft);
}

html[data-lang="ar"] body.page-training {
  font-family: 'Cairo','Montserrat',system-ui,sans-serif;
}

/* page sections: a centred column (.training-container) inside a full-width band */
.training-container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 70px 16px;
}

@media(max-width:991.98px) {
  .training-container {
    padding: 50px 16px;
  }
}

@media(max-width:575.98px) {
  .training-container {
    padding: 36px 16px;
  }
}

/* ============================================================ 1. HERO */

/* same layout as the EA page, with the training scene as background */
.pg-ea.page-training .hero__sky::before {
  background-image: url('/askwebsite/static/site/assets/src/opt/training-hero-bg.webp');
  background-position: 67% center;
}

@media(max-width:991.98px) {
  .pg-ea.page-training .hero__sky::before {
    background-image: url('/askwebsite/static/site/assets/src/opt/training-hero-bg-sm.webp');
    background-size: cover;
    background-position: 72% 100%;
  }
}

/* the picture contains English labels: never mirror it; in Arabic keep the hero on the left and read the text right-to-left inside it */
html[dir="rtl"] .page-training .hero__sky::before {
  transform: none;
  background-position: 67% center;
}

@media(max-width:991.98px) {
  html[dir="rtl"] .page-training .hero__sky::before {
    background-position: 72% 100%;
  }
}

.page-training .hero__content>.container {
  direction: ltr;
}

html[dir="rtl"] .page-training .hero__content .row>div {
  direction: rtl;
  text-align: start;
}

/* giant word sits right above the title, in the text column */
html[data-lang] .page-training .hero .training-giant {
  font-size: 13.2vw;
  margin: 0 0 .5rem -2vw;
  gap: 0;
  direction: ltr;
}

@media(max-width:991.98px) {
  html[data-lang] .page-training .hero .training-giant {
    font-size: 19vw;
    margin-inline: 0;
  }

  .page-training .hero__content {
    padding-top: 6rem;
  }
}

/* the giant word already says "Training"; keep the h1 for screen readers/SEO but hide the duplicate */
.page-training .hero-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page-training .hero-title .accent {
  display: block;
}

/* whole picture, never cropped: the hero takes the picture's own proportions (2048 x 768) */
.pg-ea.page-training .hero {
  min-height: 37.5vw;
  background: #05386a;
}

.pg-ea.page-training .hero__sky {
  inset: 0;
  background: linear-gradient(180deg,#002e5a,#05386a);
}

.pg-ea.page-training .hero__sky::before {
  background-size: 100% 100%;
  background-position: center;
}

.pg-ea.page-training .hero__content {
  min-height: calc(37.5vw - 81px);
}

html .pg-ea.page-training .hero__shade {
  background: linear-gradient(90deg,rgba(0,46,90,.6) 0%,rgba(0,46,90,.25) 35%,transparent 55%);
}

@media(max-width:991.98px) {
  /* phones and tablets: text on top, the full picture as a band along the bottom, fading into the page colour */
  .pg-ea.page-training .hero {
    min-height: 0;
  }

  .pg-ea.page-training .hero__sky::before {
    inset: auto 0 0 0;
    height: 37.5vw;
    background-size: 100% 100%;
    background-position: center;
    -webkit-mask-image: linear-gradient(180deg,transparent,#000 24%);
    mask-image: linear-gradient(180deg,transparent,#000 24%);
  }

  .pg-ea.page-training .hero__content {
    min-height: 0;
    padding-bottom: calc(37.5vw + 1.5rem);
  }

  html .pg-ea.page-training .hero__shade {
    background: none;
  }
}

@media(max-width:575.98px) {
  /* phones: a taller band so the picture isn't tiny (cropped at the sides, focused on the presenter) */
  .pg-ea.page-training .hero__sky::before {
    height: 75vw;
    background-size: cover;
    background-position: 70% 100%;
  }

  .pg-ea.page-training .hero__content {
    padding-bottom: calc(75vw + 1rem);
  }
}

/* fine tuning for every screen size */
@media(min-width:992px) {
  .pg-ea.page-training .hero__sky::before {
    background-size: cover;
    background-position: center;
  }

  .pg-ea.page-training .hero__content {
    padding-bottom: 2.5vh;
  }
}

@media(min-width:992px) and (max-width:1199.98px) {
  html[data-lang] .page-training .hero .training-giant {
    font-size: 11vw;
  }

  .page-training .hero-title {
    font-size: 2.3rem;
  }

  .page-training .hero-lead {
    font-size: .95rem;
    line-height: 1.7;
  }
}

@media(min-width:2200px) {
  .pg-ea.page-training .hero {
    min-height: min(37.5vw,950px);
  }

  .pg-ea.page-training .hero__content {
    min-height: calc(min(37.5vw,950px) - 81px);
  }
}

@media(max-width:575.98px) {
  html[data-lang] .page-training .hero .training-giant {
    font-size: 21vw;
  }

  .page-training .hero__content {
    padding-top: 5.5rem;
  }

  .page-training .hero-title {
    font-size: 2rem;
  }

  .page-training .hero-lead {
    font-size: .95rem;
  }
}

@media(max-height:520px) and (orientation:landscape) and (max-width:991.98px) {
  .page-training .hero__content {
    padding-top: 4.5rem;
  }
}

html[dir="rtl"] .page-training .hero__content .row>div {
  text-align: left;
}

@media(max-width:991.98px) {
  .pg-ea.page-training .hero__content,
  .page-training .hero__content {
    padding-top: 1.25rem;
  }
}

/* hero height identical to the Our Clients page (picture covers the hero; the crop is only a few percent) */
@media(min-width:992px) {
  .pg-ea.page-training .hero {
    min-height: clamp(520px,41vw,760px);
  }

  .pg-ea.page-training .hero__content {
    min-height: calc(clamp(520px,41vw,760px) - 81px);
  }
}

@media(min-width:2200px) {
  .pg-ea.page-training .hero {
    min-height: 760px;
  }

  .pg-ea.page-training .hero__content {
    min-height: 679px;
  }
}

/* Arabic hero: the picture is not mirrored, so the description sits on the left under the big word, away from the people */
@media(min-width:992px) {
  html[dir="rtl"] .page-training .hero-lead {
    width: min(100%,34rem);
    max-width: 34rem;
    margin-right: auto;
    margin-left: 0;
  }
}

/* Arabic hero word: "التدريب" replaces TRAINING (the condensed display font has no Arabic letters) */
.page-training .giant-ar {
  display: none;
}

html[data-lang="ar"] .page-training .giant-word:not(.giant-ar) {
  display: none;
}

html[data-lang="ar"] .page-training .giant-ar {
  display: inline-flex;
}

html[data-lang="ar"] .page-training .hero .training-giant {
  font-family: 'Cairo',sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

html[data-lang="ar"] .page-training .giant-ar {
  padding: .12em .06em .1em;
}

@media(min-width:992px) {
  html[data-lang="ar"] .page-training .hero .training-giant {
    font-size: 9.5vw;
  }
}

@media(min-width:992px) and (max-width:1199.98px) {
  html[data-lang="ar"] .page-training .hero .training-giant {
    font-size: 8.5vw;
  }
}

/* Arabic giant word: Cairo letters are taller than the line box, so give the clipped box room (alef / lam tops were cut) and pull the extra space back with a negative margin */
html[data-lang="ar"] .page-training .giant-ar {
  padding: .3em .08em .22em;
  margin-block: -.22em -.16em;
}

html[data-lang="ar"] .page-training .giant-ar .ch {
  line-height: 1.5;
  padding: .05em .02em;
}

/* Arabic hero: the description is exactly as wide as the big word and right-aligned with it, so both share the same left and right edges */
html[data-lang="ar"] .page-training .hero__content .row>div {
  width: max-content;
  max-width: 100%;
  text-align: right;
}

html[data-lang="ar"] .page-training .hero-lead {
  width: 0;
  min-width: 100%;
  max-width: none;
  margin: 0;
  text-align: right;
}

/* the big word has side bearing inside its box: pull the description in so the right edges of the glyphs line up */
html[data-lang="ar"] .page-training .hero-lead {
  padding-right: 3.2vw;
}

@media(min-width:992px) {
  html[data-lang="ar"] .page-training .hero-lead {
    padding-right: 1.8vw;
  }
}

/* keep the description off the bottom edge of the hero on desktop */
@media(min-width:992px) {
  .pg-ea.page-training .hero__content {
    padding-bottom: clamp(3rem,5vw,6rem);
  }
}

/* ============================================================ 2. INTRO */
.training-section--intro .training-container {
  padding-bottom: 0;
}

/* balanced lines, a little larger, with a short accent line above */
.training-intro {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(1.02rem,1.5vw,1.18rem);
  line-height: 2.05;
  font-weight: 500;
  color: #2c4258;
  text-wrap: balance;
}

.training-intro::before {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin: 0 auto 1.4rem;
  border-radius: 4px;
  background: var(--dt);
}

/* ============================================================ 3. PROGRAMS */
.training-section--programs .training-container {
  padding-top: 2.6rem;
}

@media(max-width:991.98px) {
  .training-section--programs .training-container {
    padding-top: 2rem;
  }
}

/* tabs: one field at a time */
.program-tabs {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .8rem;
  margin-bottom: 1.4rem;
}

.program-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .95rem 1rem;
  border: 1px solid #d6e1ec;
  border-radius: 18px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background .3s,color .3s,border-color .3s,transform .3s,box-shadow .3s;
}

.program-tab:hover {
  transform: translateY(-3px);
  border-color: var(--dt);
}

.program-tab:focus-visible {
  outline: 2px solid var(--dt);
  outline-offset: 2px;
}

.program-tab__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0,209,178,.12);
  color: var(--dt);
  transition: background .3s,color .3s;
}

.program-tab__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.program-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 18px 30px -18px rgba(10,37,64,.7);
}

.program-tab.is-active .program-tab__icon {
  background: rgba(255,255,255,.1);
}

@media(max-width:991.98px) {
  .program-tabs {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width:767.98px) {
  .program-tab {
    padding: .75rem;
    font-size: .9rem;
    gap: .5rem;
  }

  .program-tab__icon {
    width: 32px;
    height: 32px;
  }
}

/* panel: heading + bullet list + buttons */
.program-panel {
  padding: clamp(1.5rem,3vw,2.5rem);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 34px -22px rgba(10,37,64,.35);
  animation: program-panel-in .45s cubic-bezier(.22,1,.36,1);
}

.program-panel[hidden] {
  display: none;
}

@keyframes program-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.program-panel__head {
  padding-bottom: 1.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e3e7ec;
}

.program-panel__head h3 {
  margin: 0 0 .6rem;
  font-size: clamp(1.25rem,2.4vw,1.6rem);
  font-weight: 800;
}

.program-panel__head p {
  margin: 0;
  line-height: 1.9;
  color: #3b4f63;
}

.program-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 2.4rem;
}

.program-list li {
  position: relative;
  padding-inline-start: 1.3rem;
  font-size: .92rem;
  line-height: 1.85;
  color: #3b4f63;
}

.program-list li::before {
  content: "";
  position: absolute;
  top: .75em;
  inset-inline-start: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dt);
}

.program-list b {
  color: var(--navy);
  font-weight: 700;
}

@media(max-width:767.98px) {
  .program-list {
    grid-template-columns: 1fr;
  }
}

/* panel buttons */
.program-panel .training-actions {
  margin-top: 1.8rem;
}

.program-panel .btn-solid {
  background: #066d87;
}

.program-panel .btn-solid:hover {
  background: #087fae;
}

.program-panel .btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: #1c7c97;
  backdrop-filter: none;
}

.program-panel .btn-ghost:hover {
  background: #087fae;
  border-color: #0690c1;
  color: #fff;
}

/* ============================================================ 4. CUSTOM COURSE BAND */
.training-cta {
  background: linear-gradient(135deg,var(--navy),#124a7a);
  color: #fff;
  text-align: center;
  padding: 80px 16px;
}

.training-cta h2 {
  font-weight: 800;
  font-size: clamp(1.8rem,4vw,2.6rem);
  margin: 0 0 1rem;
}

.training-cta p {
  max-width: 680px;
  margin: 0 auto 1.6rem;
  line-height: 2;
  opacity: .9;
}

.training-cta .training-actions {
  justify-content: center;
}

@media(max-width:991.98px) {
  .training-cta {
    padding: 60px 16px;
  }
}

/* ============================================================ 5. REGISTRATION FORM (modal) */
body.is-modal-open {
  overflow: hidden;
}

.reg-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 4vh 16px;
  background: rgba(4,18,36,.72);
  backdrop-filter: blur(4px);
}

.reg-modal[hidden] {
  display: none;
}

.reg-modal__box {
  position: relative;
  width: min(100%,900px);
  margin: auto;
  padding: clamp(1.4rem,3.5vw,2.8rem);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg,#102a47,#14385c);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
}

.reg-modal__box h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.3rem,3vw,1.7rem);
  font-weight: 800;
  padding-inline-end: 2.5rem;
}

.reg-modal__program {
  margin: -.8rem 0 1.2rem;
  color: var(--dt);
  font-weight: 600;
}

.reg-modal__close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1.2rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background .25s;
}

.reg-modal__close:hover {
  background: rgba(255,255,255,.2);
}

/* fields */
.reg-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.4rem;
}

.reg-form__field--full {
  grid-column: 1/-1;
}

.reg-form__field label {
  display: block;
  margin-bottom: .45rem;
  font-size: .9rem;
  font-weight: 600;
}

.reg-form__field label b {
  color: var(--dt);
  margin-inline-start: 2px;
}

.reg-form__field input,
.reg-form__field select,
.reg-form__field textarea {
  display: block;
  width: 100%;
  padding: .85rem 1.05rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  color: #fff;
  font: inherit;
  font-size: .95rem;
  outline: 0;
  transition: border-color .25s,background .25s;
}

.reg-form__field input::placeholder,
.reg-form__field textarea::placeholder {
  color: rgba(255,255,255,.45);
}

.reg-form__field input:focus,
.reg-form__field select:focus,
.reg-form__field textarea:focus {
  border-color: var(--dt);
  background: rgba(255,255,255,.11);
}

.reg-form__field textarea {
  min-height: 150px;
  resize: vertical;
}

.reg-form__field select option {
  color: var(--navy);
  background: #fff;
}

.reg-form__field input:user-invalid,
.reg-form__field select:user-invalid {
  border-color: #ff7b7b;
}

.reg-form__field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: right 1.1rem center;
  padding-inline-end: 2.8rem;
  cursor: pointer;
}

html[dir="rtl"] .reg-form__field select {
  background-position: left 1.1rem center;
}

/* submit + messages */
.reg-form__submit {
  margin-top: 1.4rem;
}

.reg-form__submit svg {
  width: 18px;
  height: 18px;
  margin-inline-start: .5rem;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[dir="ltr"] .reg-form__submit svg {
  transform: scaleX(-1);
}

.reg-form__message {
  margin: 1.1rem 0 0;
  font-weight: 600;
}

.reg-form__message[hidden] {
  display: none;
}

.reg-form__message--error {
  color: #ff9b9b;
}

.reg-form__message--success {
  color: var(--dt);
}

@media(max-width:640px) {
  .reg-form__grid {
    grid-template-columns: 1fr;
  }

  .reg-modal {
    padding: 2vh 10px;
  }
}

/* ============================================================ 6. SHARED BUTTONS (home's .btn-solid / .btn-ghost) */
.page-training .btn {
  font-family: inherit;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
}

.training-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

@media(max-width:575.98px) {
  .training-actions .btn {
    flex: 1 1 100%;
    text-align: center;
  }
}
