/* Shared certificate gallery. Document artwork always remains uncropped. */
.certificate-section {
  --certificate-ink: #182e3d;
  --certificate-muted: #64727a;
  --certificate-accent: #c14f20;
  --certificate-columns: 4;
  --certificate-gap: 36px;
  background: #fff;
}
.certificate-section .certificate-heading {
  display: block;
  margin: 0 auto 44px;
  text-align: center;
}
.home .home-quality.certificate-section .certificate-heading h2,
.certificate-section .certificate-heading h2 {
  margin: 0;
  color: var(--certificate-ink);
  font: 500 clamp(30px, 3.1vw, 44px)/1.2 Inter, Arial, sans-serif;
  letter-spacing: -.035em;
}
.home .home-quality.certificate-section .certificate-heading .eyebrow,
.certificate-section .certificate-heading .ci-overline {
  margin: 0 0 14px;
  max-width: none;
  width: 100%;
  color: var(--certificate-muted);
  font: 400 13px/1.5 Inter, Arial, sans-serif;
  letter-spacing: .025em;
  text-transform: none;
}
.certificate-gallery {
  position: relative;
  margin-inline: auto;
  padding-inline: 48px;
}
.certificate-viewport {
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x mandatory;
}
.certificate-gallery[data-ready] .certificate-viewport {
  overflow: hidden;
  overflow: clip;
  /* Snapping would follow the previous card after the track is reordered. */
  scroll-snap-type: none;
  touch-action: pan-y;
}
.certificate-track {
  display: flex;
  align-items: flex-start;
  gap: var(--certificate-gap);
  margin: 0;
  padding: 6px 0 4px;
  list-style: none;
}
.certificate-card {
  flex: 0 0 calc((100% - (var(--certificate-columns) - 1) * var(--certificate-gap)) / var(--certificate-columns));
  min-width: 0;
  scroll-snap-align: start;
}
.certificate-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--certificate-ink);
  text-align: center;
  cursor: zoom-in;
}
.certificate-sheet {
  display: block;
  aspect-ratio: 1 / 1.42;
  background: #fff;
  box-shadow: 0 0 0 1px #e6e9e9;
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.certificate-sheet img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.certificate-label {
  display: block;
  padding: 17px 4px 2px;
  font: 500 14px/1.4 Inter, Arial, sans-serif;
}
.certificate-label small {
  display: block;
  margin-top: 5px;
  color: var(--certificate-muted);
  font: 400 11px/1.5 Inter, Arial, sans-serif;
}
.certificate-open:focus-visible {
  outline: 2px solid #0063d5;
  outline-offset: 3px;
}
.certificate-arrow {
  position: absolute;
  top: calc((100% - 66px) / 2);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 56px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: #f0f1f1;
  color: var(--certificate-accent);
  transition: background-color 180ms ease, border-color 180ms ease;
}
.certificate-arrow svg { width: 20px; height: 20px; }
.certificate-arrow[data-certificate-prev] { left: 0; }
.certificate-arrow[data-certificate-next] { right: 0; }
.certificate-arrow:hover { background: #e7ebec; border-color: #bcc7cb; }
.certificate-status {
  margin: 23px auto 0;
  text-align: center;
  color: var(--certificate-muted);
  font: 400 12px/1.5 Inter, Arial, sans-serif;
}
.certificate-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.certificate-viewer-open { overflow: hidden; }
.certificate-dialog {
  --certificate-ink: #182e3d;
  position: fixed;
  inset: 0;
  width: min(1060px, calc(100vw - 40px));
  height: min(980px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  color: var(--certificate-ink);
  background: #f1f3f3;
  box-shadow: 0 24px 100px #0005;
}
.certificate-dialog::backdrop { background: #0b1b2bcc; }
.certificate-dialog[open] { display: flex; flex-direction: column; }
.certificate-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #d7dfe2;
  background: #fff;
}
.certificate-dialog-title {
  margin: 0;
  font: 500 17px/1.4 Inter, Arial, sans-serif;
  letter-spacing: -.01em;
}
.certificate-dialog-close,
.certificate-dialog-step {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #c6d1d7;
  border-radius: 0;
  background: #fff;
  color: #234457;
}
.certificate-dialog-close svg,
.certificate-dialog-step svg { width: 20px; height: 20px; }
.certificate-dialog-close:hover,
.certificate-dialog-step:hover { background: #edf2f4; border-color: #7b919f; }
.certificate-dialog-body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}
.certificate-dialog-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 14px #10233118;
}
.certificate-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 20px;
  padding: 10px 20px;
  border-top: 1px solid #d7dfe2;
  background: #fff;
}
.certificate-dialog-count { min-width: 40px; text-align: center; font-size: 13px; }
@media (hover: hover) {
  .certificate-open:hover .certificate-sheet { box-shadow: 0 0 0 1px #b9c6cd, 0 6px 16px #17394c12; transform: translateY(-3px); }
}
@media (min-width: 1360px) and (min-height: 600px) and (hover: hover) {
  /* Keep the next arrow clear of the fixed contact shortcuts. */
  .certificate-gallery { max-width: calc(100vw - 156px); }
}
@media (max-width: 1000px) {
  .certificate-section { --certificate-columns: 2; }
  .certificate-gallery { max-width: 810px; }
}
@media (max-width: 600px) {
  .certificate-section { --certificate-columns: 1; --certificate-gap: 20px; }
  .certificate-section .certificate-heading { margin-bottom: 30px; }
  .home .home-quality.certificate-section .certificate-heading h2,
  .certificate-section .certificate-heading h2 { font-size: clamp(28px, 7.2vw, 36px); }
  .certificate-gallery { padding-inline: 40px; max-width: 480px; }
  .certificate-arrow { width: 32px; height: 52px; }
  .certificate-label { padding-top: 15px; }
  .certificate-status { margin-top: 18px; }
  .certificate-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .certificate-dialog-header { padding: 10px 12px; }
  .certificate-dialog-title { font-size: 15px; }
  .certificate-dialog-body { padding: 8px; }
  .certificate-dialog-footer { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .certificate-sheet, .certificate-arrow { transition: none; }
}
