/* Certificate gallery. Scoped styles preserve the rest of the website. */
.certificates-section {
  --cert-ink: #172952;
  --cert-blue: #2c50c5;
  position: relative;
  padding: 56px 0 38px;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f6fc 0%, #fff 100%);
  border-bottom: 1px solid #e5ebf5;
  scroll-margin-top: 146px;
}
.certificates-heading, .certificates-bottom {
  width: min(1280px, calc(100% - 72px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.certificates-heading .certificates-eyebrow {
  display: block;
  color: #47649a;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 12px;
}
.certificates-heading h2 {
  color: var(--cert-ink);
  font-size: clamp(25px, 2.6vw, 36px);
  line-height: 1.25;
  letter-spacing: -.9px;
  margin: 0;
  font-weight: 500;
}
.certificates-heading h2 em { color: var(--cert-blue); font-style: normal; font-weight: 400; }
.certificates-heading p { color: #65738a; font-size: 13px; margin: 12px 0 0; line-height: 1.7; }
.certificates-count {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding-left: 25px; border-left: 1px solid #ccd6e8;
}
.certificates-count strong { color: var(--cert-blue); font-size: 43px; font-weight: 500; line-height: 1; }
.certificates-count span { color: #67758d; font-size: 11px; line-height: 1.7; }
.certificates-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 28px max(36px, calc((100vw - 1280px) / 2)) 24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.certificates-rail::-webkit-scrollbar { display: none; }
.certificate-card {
  flex: 0 0 292px;
  width: 292px;
  display: block;
  color: var(--cert-ink);
  text-align: left;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 18px #182e5510;
  transition: border-color .2s, box-shadow .2s;
}
.certificate-card:hover { border-color: #8499ce; box-shadow: 0 8px 22px #182e5522; }
.certificate-card:focus-visible, .certificates-section button:focus-visible {
  outline: 3px solid #5a80df; outline-offset: 4px;
}
.certificate-image {
  height: 208px; display: flex; justify-content: center; align-items: center;
  background: #f6f7f9;
  border: 1px solid #edf0f4;
  overflow: hidden;
}
.certificate-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.certificate-caption { display: block; padding: 14px 6px 6px; }
.certificate-kind {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: #68809c; font-size: 9px; letter-spacing: .3px; margin-bottom: 7px;
}
.certificate-kind span:last-child { color: #8795a9; font-variant-numeric: tabular-nums; }
.certificate-caption strong { display: block; font-size: 13px; line-height: 1.55; font-weight: 500; min-height: 40px; }
.certificate-caption small { display: block; color: #77869b; font-size: 10px; margin-top: 8px; }
.certificate-caption small span { margin-left: 4px; color: #2c50c5; }
.certificates-bottom { margin-top: 1px; }
.certificates-hint { color: #78869b; font-size: 11px; margin: 0; }
.certificates-controls { display: flex; align-items: center; gap: 9px; }
.certificates-controls button {
  display: inline-flex; justify-content: center; align-items: center;
  width: 40px; height: 40px; border: 1px solid #d7e0ef;
  border-radius: 50%; color: #304b7a; background: #fff;
  padding: 0; font: inherit; font-size: 17px; cursor: pointer;
}
.certificates-controls button:hover { color: white; background: #2c50c5; border-color: #2c50c5; }
.certificates-controls #certificates-motion { width: auto; border-radius: 30px; padding: 0 16px; gap: 8px; font-size: 11px; }
.certificates-controls svg { width: 16px; height: 16px; }
html.certificate-open { overflow: hidden; }
#certificate-dialog {
  padding: 0; border: 0; border-radius: 16px; width: min(1120px, calc(100vw - 40px));
  max-width: none; max-height: calc(100dvh - 40px);
  color: #172952; background: #f5f7fb; overflow: auto;
}
#certificate-dialog::backdrop { background: #09152de8; backdrop-filter: blur(5px); }
.certificate-dialog-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; padding: 20px 24px; background: #fff;
  border-bottom: 1px solid #e1e7f0;
}
.certificate-dialog-head p { margin: 0 0 3px; color: #78869b; font-size: 10px; }
.certificate-dialog-head h2 { font-size: 19px; line-height: 1.4; margin: 0; letter-spacing: -.3px; }
.certificate-dialog-close {
  flex: 0 0 44px; height: 44px; border: 1px solid #dbe2ed; border-radius: 50%;
  background: #fff; font: inherit; font-size: 25px; color: #172952; cursor: pointer;
}
.certificate-dialog-view { padding: 22px; overflow: auto; text-align: center; }
.certificate-dialog-view img {
  display: block; width: auto; max-width: 100%; height: auto;
  max-height: calc(100dvh - 230px); object-fit: contain; margin: 0 auto; background: #fff;
  box-shadow: 0 5px 24px #1729521a;
}
.certificate-dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 24px 22px; }
.certificate-dialog-foot a { color: #2c50c5; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.certificate-dialog-nav { display: flex; align-items: center; gap: 10px; }
.certificate-dialog-nav button { width: 42px; height: 42px; border: 1px solid #cbd6e7; border-radius: 50%; color: #203762; background: white; font-size: 20px; cursor: pointer; }
.certificate-dialog-nav span { min-width: 42px; text-align: center; font-size: 11px; color: #6b7c97; }
@media (max-width: 800px) {
  .certificates-section { padding: 30px 0 25px; }
  .certificates-heading, .certificates-bottom { width: calc(100% - 36px); gap: 12px; }
  .certificates-heading { align-items: flex-start; }
  .certificates-heading .certificates-eyebrow { font-size: 8px; letter-spacing: 1.5px; margin-bottom: 9px; }
  .certificates-heading h2 { font-size: 25px; letter-spacing: -.7px; max-width: 290px; }
  .certificates-heading h2 em { display: block; }
  .certificates-heading p { font-size: 11px; margin-top: 10px; max-width: 270px; }
  .certificates-count { padding-left: 12px; gap: 4px; flex-direction: column; margin-top: 4px; align-items: flex-start; }
  .certificates-count strong { font-size: 30px; }
  .certificates-count span { font-size: 8px; white-space: nowrap; }
  .certificates-rail { padding: 20px 18px; gap: 12px; }
  .certificate-card { flex-basis: 272px; width: 272px; padding: 8px; border-radius: 10px; }
  .certificate-image { height: 194px; }
  .certificate-caption { padding: 11px 5px 5px; }
  .certificate-caption strong { font-size: 12px; min-height: 38px; }
  .certificates-hint { max-width: 120px; line-height: 1.6; font-size: 10px; }
  .certificates-controls { gap: 6px; }
  .certificates-controls button { width: 38px; height: 38px; }
  .certificates-controls #certificates-motion { padding: 0 11px; font-size: 10px; }
  #certificate-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .certificate-dialog-head { padding: 15px; gap: 10px; }
  .certificate-dialog-head h2 { font-size: 15px; }
  .certificate-dialog-view { padding: 12px; }
  .certificate-dialog-view img { max-height: calc(100dvh - 220px); }
  .certificate-dialog-foot { padding: 4px 14px 15px; gap: 8px; }
  .certificate-dialog-foot a { font-size: 10px; max-width: 125px; }
}
@media (prefers-reduced-motion: reduce) {
  .certificate-card { transition: none; }
}
