/* Certificate pages. The field behind the document is the education hero
   lattice (qg_edu_field.js). The credential is the subject the axes point at,
   the same way the dashboard card is the subject on the education page. */

body.qg-certificate {
  margin: 0;
  min-height: 100vh;
  background: #f1f3f7;
  color: var(--qg-text-body);
}

body.qg-certificate p,
body.qg-certificate h1,
body.qg-certificate h2,
body.qg-certificate h3,
body.qg-certificate dl,
body.qg-certificate dd {
  margin: 0;
}

.qg-cert-stage {
  position: relative;
  min-height: 100vh;
  background: #f1f3f7;
}

.qg-cert-stage .qg-hero__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.qg-cert-stage .qg-hero__field {
  position: absolute;
  inset: -28px;
  width: calc(100% + 56px);
  height: calc(100% + 56px);
  display: block;
  -webkit-mask-image: none;
  mask-image: none;
}

.qg-cert-stage .qg-hero__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(820px 520px at 50% 42%, rgba(0, 74, 173, 0.07), transparent 70%),
    radial-gradient(640px 480px at 50% 58%, rgba(255, 203, 5, 0.08), transparent 68%);
}

.qg-cert-stage .qg-hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.08  0 0 0 0 0.16  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.qg-cert-main {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(var(--qg-topnav-offset, 72px) + 40px) 0 72px;
}

.qg-cert-main a {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------------------------------------- document */

.qg-cert {
  position: relative;
  padding: 18px;
  background: var(--qg-surface);
  border: 1px solid var(--qg-line);
  border-radius: 20px;
  box-shadow: var(--qg-sh-float);
}

.qg-cert__sheet {
  position: relative;
  padding: 48px 56px 40px;
  border: 1px solid rgba(138, 107, 0, 0.55);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.qg-cert__sheet::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 74, 173, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

.qg-cert__corners {
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
}

.qg-cert__corners i {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid #b89200;
}

.qg-cert__corners i:nth-child(1) {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 12px;
}

.qg-cert__corners i:nth-child(2) {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
  border-top-right-radius: 12px;
}

.qg-cert__corners i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 12px;
}

.qg-cert__corners i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
  border-bottom-right-radius: 12px;
}

.qg-cert__body,
.qg-cert__prose,
.qg-cert__facts,
.qg-cert__facts div,
.qg-cert__sign {
  text-align: center;
}

.qg-cert__body {
  position: relative;
  z-index: 1;
}

.qg-cert__mast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
}

.qg-cert__mast-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

body.qg-certificate .qg-cert__title,
body.qg-certificate .qg-cert__subtitle {
  width: max-content;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.qg-cert__seal {
  width: 88px;
  height: 88px;
  margin: 0;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #004aad;
  box-shadow:
    0 0 0 5px #fff,
    0 0 0 7px rgba(138, 107, 0, 0.92);
}

.qg-cert__seal img {
  width: 62px;
  height: 62px;
  flex: none;
  max-width: none;
  display: block;
  object-fit: contain;
}

.qg-cert__title {
  font-family: var(--qg-font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--qg-text);
}

body.qg-certificate .qg-cert__subtitle {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--qg-text-muted);
}

body.qg-certificate .qg-cert__awarded {
  margin-top: 32px;
  font-size: 15px;
  color: var(--qg-text-muted);
}

body.qg-certificate .qg-cert__name {
  margin-top: 8px;
  font-family: var(--qg-font-display);
  font-size: clamp(36px, 5.4vw, 58px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--qg-text);
  overflow-wrap: anywhere;
}

.qg-cert__rule {
  width: 72px;
  height: 2px;
  margin: 16px auto 0;
  border: 0;
  background: #c4a000;
}

body.qg-certificate .qg-cert__prose {
  width: 36rem;
  max-width: 100%;
  margin: 26px auto 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--qg-text-body);
  text-align: center;
}

.qg-cert__prose strong {
  font-weight: 600;
  color: var(--qg-text);
}

body.qg-certificate .qg-cert__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 520px;
  max-width: 100%;
  margin: 32px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--qg-line);
}

.qg-cert__facts div + div {
  border-left: 1px solid var(--qg-line);
}

.qg-cert__facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qg-text-muted);
}

body.qg-certificate .qg-cert__facts dd {
  margin: 6px 0 0;
  font-family: var(--qg-font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--qg-blue);
  overflow-wrap: anywhere;
}

.qg-cert__sign {
  margin-top: 36px;
}

.qg-cert__sign-name {
  font-family: "Great Vibes", cursive;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  color: var(--qg-text);
}

.qg-cert__sign-line {
  width: 180px;
  height: 1px;
  margin: 4px auto 10px;
  background: rgba(138, 107, 0, 0.7);
}

.qg-cert__sign-title {
  font-size: 13px;
  line-height: 1.45;
  color: var(--qg-text-muted);
}

/* -------------------------------------------------------------------- share */

.qg-cert-share {
  margin-top: 18px;
  padding: 26px 28px 28px;
  background: var(--qg-surface);
  border: 1px solid var(--qg-line);
  border-radius: 16px;
  box-shadow: var(--qg-sh-card);
}

.qg-cert-share__title {
  font-family: var(--qg-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--qg-text);
}

.qg-cert-share__title span {
  font-weight: 400;
  color: var(--qg-text-faint);
}

.qg-cert-share__row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 20px;
}

.qg-cert-share__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qg-cert-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qg-cert-share__btn:hover {
  transform: translateY(-1px);
}

.qg-cert-main a.qg-cert-share__btn--linkedin,
.qg-cert-main a.qg-cert-share__btn--linkedin i {
  color: #fff;
}

.qg-cert-share__btn--linkedin {
  background: #0077b5;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 74, 120, 0.3);
}

.qg-cert-share__btn--linkedin:hover {
  background: #00669c;
}

.qg-cert-share__btn--copy {
  background: var(--qg-surface);
  color: var(--qg-text);
  border: 1px solid var(--qg-line-strong);
}

.qg-cert-share__btn--copy:hover {
  background: var(--qg-surface-2);
}

.qg-cert-share__shot {
  display: block;
  min-width: 0;
}

.qg-cert-share__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--qg-line);
  border-radius: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qg-cert-share__shot:hover .qg-cert-share__img {
  transform: translateY(-2px);
  box-shadow: var(--qg-sh-lift);
}

/* -------------------------------------------------------------------- toast */

.qg-cert-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--qg-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--qg-sh-float);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.qg-cert-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.qg-cert-toast i {
  color: var(--qg-gold);
  font-size: 16px;
}

@media (max-width: 720px) {
  .qg-cert-main {
    width: min(920px, calc(100% - 20px));
    padding-top: calc(var(--qg-topnav-offset, 72px) + 20px);
    padding-bottom: 40px;
  }

  .qg-cert {
    padding: 10px;
    border-radius: 16px;
  }

  .qg-cert__sheet {
    padding: 32px 18px 28px;
  }

  body.qg-certificate .qg-cert__facts {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .qg-cert__facts div + div {
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid var(--qg-line);
  }

  .qg-cert__sign-name {
    font-size: 44px;
  }

  .qg-cert-share {
    padding: 20px 16px 22px;
  }

  .qg-cert-share__title {
    text-align: center;
  }

  .qg-cert-share__title span {
    display: block;
    margin-top: 4px;
  }

  .qg-cert-share__row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .qg-cert-share__actions {
    width: min(250px, 100%);
  }

  .qg-cert-share__shot {
    display: none;
  }

  .qg-cert-toast {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qg-cert-share__btn,
  .qg-cert-share__img,
  .qg-cert-toast {
    transition: none;
  }
}

@media print {
  body.qg-certificate,
  .qg-cert-stage {
    background: #fff;
  }

  .qg-hero__bg,
  .qg-topnav,
  .qg-cert-share,
  .qg-cert-toast {
    display: none !important;
  }

  .qg-cert-main {
    width: 100%;
    padding: 0;
  }

  .qg-cert {
    border: 0;
    box-shadow: none;
  }
}
