/* ==========================================================================
   CAIRUI CONSULT — qualifications
   Figma: 417-8705
   ========================================================================== */

.cert-page {
  padding: 0;
  background: #fff;
}

/* Tabs ---------------------------------------------------------------- */

.cert-tabs-wrap {
  display: flex;
  justify-content: center;
  padding: 55px 0 0;
  margin-bottom: 56px;
}

.cert-tabs-wrap .pill-tabs {
  display: flex;
  width: 804px;
  max-width: calc(100% - 48px);
  height: 100px;
  padding: 17px 18px;
  gap: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: #f7f7f8;
}

.cert-tabs-wrap .pill-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 66px;
  padding: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 66px;
  letter-spacing: 0.03em;
  text-align: center;
}

.cert-tabs-wrap .pill-tab:hover {
  color: var(--red);
}

.cert-tabs-wrap .pill-tab.is-active {
  color: #fff;
  background: var(--red);
  box-shadow: none;
}

/* Group sections ------------------------------------------------------ */

.cert-groups {
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}

.cert-group {
  padding: 70px 0 43px;
  background: #fff;
}

.cert-group:nth-child(even) {
  background: #f6f6f7;
}

.cert-group__head {
  width: min(1712px, calc(100% - 208px));
  margin: 0 auto;
}

.cert-group__eyebrow {
  display: block;
  color: var(--red);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cert-group__title {
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* Two-column certificate board --------------------------------------- */

.cert-board {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 876px;
  max-width: calc(100% - 208px);
  margin: 80px auto 0;
  gap: 64px;
}

.cert-col {
  display: flex;
  flex: 0 0 406px;
  flex-direction: column;
  width: 406px;
  min-width: 0;
}

/* The first Figma group uses distinct optical column widths. */
.cert-group--engineering .cert-col--left {
  flex-basis: 370px;
  width: 370px;
}

.cert-group--engineering .cert-col--right {
  flex-basis: 442px;
  width: 442px;
}

.cert-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  cursor: zoom-in;
}

.cert-card__media {
  display: block;
  width: 100%;
  background: #fff;
}

.cert-card__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 240ms var(--ease-ui);
}

.cert-card:hover .cert-card__media img {
  opacity: 0.9;
}

.cert-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 6px;
}

.cert-card__title {
  display: block;
  margin-top: var(--title-gap, 42px);
  color: var(--ink);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-align: center;
}

.cert-group--engineering .cert-col--right {
  --title-gap: 47px;
}

.cert-card + .cert-card {
  margin-top: 78px;
}

.cert-group--engineering .cert-card + .cert-card {
  margin-top: 40px;
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 1180px) {
  .cert-tabs-wrap {
    padding-top: 44px;
    margin-bottom: 48px;
  }

  .cert-group__head,
  .cert-board {
    width: calc(100% - 128px);
    max-width: 876px;
  }

  .cert-board {
    gap: 40px;
  }

  .cert-col {
    flex: 1 1 0;
    width: auto;
  }

  .cert-group--engineering .cert-col--left {
    flex-basis: 43%;
    width: auto;
  }

  .cert-group--engineering .cert-col--right {
    flex-basis: 51%;
    width: auto;
  }
}

@media (max-width: 900px) {
  .cert-tabs-wrap {
    padding-top: 36px;
    margin-bottom: 40px;
  }

  .cert-tabs-wrap .pill-tabs {
    width: min(804px, calc(100% - 64px));
    height: 84px;
    padding: 12px 14px;
  }

  .cert-tabs-wrap .pill-tab {
    height: 60px;
    font-size: 20px;
    line-height: 60px;
  }

  .cert-group {
    padding: 48px 0 32px;
  }

  .cert-group__head,
  .cert-board {
    width: calc(100% - 64px);
  }

  .cert-group__eyebrow {
    font-size: 12px;
  }

  .cert-group__title {
    margin-top: 14px;
    font-size: 24px;
  }

  .cert-board {
    margin-top: 48px;
    gap: 32px;
  }

  .cert-card__title {
    margin-top: 24px;
    font-size: 18px;
  }

  .cert-card + .cert-card,
  .cert-group--engineering .cert-card + .cert-card {
    margin-top: 44px;
  }
}

@media (max-width: 640px) {
  .cert-tabs-wrap {
    padding-top: 28px;
    margin-bottom: 32px;
  }

  .cert-tabs-wrap .pill-tabs {
    width: calc(100% - 32px);
    height: 72px;
    padding: 8px 10px;
  }

  .cert-tabs-wrap .pill-tab {
    height: 56px;
    font-size: 16px;
    line-height: 56px;
  }

  .cert-group {
    padding: 36px 0 26px;
  }

  .cert-group__head {
    width: calc(100% - 32px);
  }

  .cert-group__eyebrow {
    font-size: 11px;
  }

  .cert-group__title {
    margin-top: 12px;
    font-size: 20px;
  }

  .cert-board {
    flex-direction: column;
    width: calc(100% - 32px);
    margin-top: 36px;
    gap: 0;
  }

  .cert-col,
  .cert-group--engineering .cert-col--left,
  .cert-group--engineering .cert-col--right {
    flex: 0 0 auto;
    width: 100%;
  }

  .cert-col--right {
    margin-top: 40px;
  }

  .cert-card__title {
    margin-top: 18px;
    font-size: 16px;
  }

  .cert-card + .cert-card,
  .cert-group--engineering .cert-card + .cert-card {
    margin-top: 32px;
  }
}
