/* Certification pages use the existing DAM colours and machinery background. */
.certification-page {
  color: white;
  background: #00285f;
  isolation: isolate;
}

:where(.certification-page) a {
  color: inherit;
  text-underline-offset: 5px;
}

.certification-nav {
  position: sticky;
}

.certification-nav .wrapper {
  max-width: 1600px;
  margin: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.certification-languages {
  display: flex;
  gap: 8px;
}

.certification-languages a {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 0.875rem;
}

.certification-languages a[aria-current="page"],
.certification-languages a:is(:hover, :focus-visible) {
  border-color: var(--brand-accent);
}

.certification-main {
  box-sizing: border-box;
  max-width: 1664px;
  margin: auto;
  padding: 24px 32px 56px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
}

.certification-intro {
  margin: 20px 0 32px;
}

.certification-intro h1 {
  padding: 0;
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.2;
}

.certification-intro p {
  margin: 8px 0;
}

.certificate-note {
  font-size: 0.9375rem;
}

.certification-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(338px, 1.15fr);
  gap: 24px;
  align-items: start;
}

.certificate-card,
.certification-details {
  min-width: 0;
}

.certificate-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.certification-layout h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.certificate-preview {
  display: grid;
  place-items: center;
  flex: 1;
  background: white;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.certificate-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.certificate-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.875rem;
}

.certificate-actions a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  white-space: nowrap;
}

.certification-details {
  font-size: 0.9375rem;
}

.certification-details p {
  margin: 0 0 20px;
}

/* BD307-B: unchanged marks, IQNET >= 85px, X/2 outer clearance and
   X/4 between marks without a separating line. Never wrap the pair.
   On very narrow screens the unit scrolls rather than shrinking the marks. */
.certification-marks-scroll {
  overflow-x: auto;
  background: white;
  color: #00285f;
}

.marks-scroll-hint {
  display: none;
  font-size: 0.8125rem;
  padding-top: 12px;
}

.certification-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #00285f;
}

.certification-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1199px) {
  .certification-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 32px 24px;
  }

  .certification-details {
    grid-column: 1 / -1;
    max-width: 640px;
    width: 100%;
    justify-self: center;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  /* Keep both open links and both download links aligned when columns are narrow. */
  .certificate-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .certification-nav .logo {
    width: 110px;
  }

  .certification-main {
    padding: 16px 16px 40px;
  }

  .certification-intro {
    margin: 16px 0 28px;
  }

  .certification-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 368px) {
  .marks-scroll-hint {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .certification-background video {
    display: none;
  }
}
