/* Version 4.6.1
   Credential image restoration and text-colour normalization.
   Individual credential hue remains on borders/stages, while all readable
   text uses the dashboard's standard white/cyan/muted palette. */

/* --------------------------------------------------------------------------
   Credential detail typography: use the same white/cyan language as the rest
   of the dashboard. Per-record hue is intentionally retained only for frames,
   stage ornaments, and index selection backgrounds.
   -------------------------------------------------------------------------- */
.had-credentials-v3 .had-credential-detail {
  color: var(--had-text) !important;
}

.had-credentials-v3 .had-credential-detail .had-kicker,
.had-credentials-v3 .had-credential-detail [data-had-credential-issuer],
.had-credentials-v3 .had-credential-detail .had-credential-meta b,
.had-credentials-v3 .had-credential-detail .had-skill-grid .dashicons,
.had-credentials-v3 .had-credential-detail .had-credential-actions a {
  color: var(--had-cyan) !important;
}

.had-credentials-v3 .had-credential-detail h2,
.had-credentials-v3 .had-credential-detail [data-had-credential-title] {
  color: var(--had-text) !important;
}

.had-credentials-v3 .had-credential-detail .had-credential-summary,
.had-credentials-v3 .had-credential-detail .had-skill-grid span {
  color: #a9c2ce !important;
}

.had-credentials-v3 .had-credential-detail .had-credential-meta small {
  color: #66899a !important;
}

/* Keep the automatic per-record border/box palette created in 4.5.8. Only the
   link label itself is normalized to cyan. */
.had-credentials-v3 .had-credential-detail .had-credential-actions a:hover,
.had-credentials-v3 .had-credential-detail .had-credential-actions a:focus-visible {
  color: #dffbff !important;
}

/* Credential popup/readers: title and metadata follow the common dashboard
   white/cyan palette instead of inheriting the record-specific pink/purple/etc. */
.had-detail-drawer.is-credential-record .had-drawer-header,
.had-detail-drawer.is-credential-record .had-drawer-header h2,
.had-detail-drawer.is-credential-record .had-drawer-header b,
.had-detail-drawer.is-credential-record .had-drawer-header strong {
  color: var(--had-text) !important;
}

.had-detail-drawer.is-credential-record .had-kicker,
.had-detail-drawer.is-credential-record .had-drawer-meta b,
.had-detail-drawer.is-credential-record .had-drawer-meta strong,
.had-detail-drawer.is-credential-record a {
  color: var(--had-cyan) !important;
}

/* --------------------------------------------------------------------------
   New supplied credential images.
   Both are always contained inside the existing white presentation board.
   -------------------------------------------------------------------------- */
.had-credentials-v3 .had-credential-image[src*="matlab-onramp-certificate"],
.had-detail-drawer.is-credential-record .had-record-cover img[src*="matlab-onramp-certificate"] {
  max-width: 92% !important;
  max-height: 86% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.had-credentials-v3 .had-credential-image[src*="challenge-turku-logo"],
.had-detail-drawer.is-credential-record .had-record-cover img[src*="challenge-turku-logo"] {
  max-width: min(74%, 420px) !important;
  max-height: 82% !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* The historic 4.5.4 CSS used cover for the old Challenge photo. Never crop
   the new logo or the restored MATLAB certificate. */
.had-credential-certificate img[src*="v461-credentials"],
.had-record-cover img[src*="v461-credentials"] {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  object-fit: contain !important;
  background: transparent !important;
  filter: drop-shadow(0 10px 16px rgba(0, 24, 38, .13)) !important;
}

@media (max-width: 900px) {
  .had-credentials-v3 .had-credential-image[src*="matlab-onramp-certificate"],
  .had-detail-drawer.is-credential-record .had-record-cover img[src*="matlab-onramp-certificate"] {
    max-width: 94% !important;
    max-height: 84% !important;
  }

  .had-credentials-v3 .had-credential-image[src*="challenge-turku-logo"],
  .had-detail-drawer.is-credential-record .had-record-cover img[src*="challenge-turku-logo"] {
    max-width: 68% !important;
    max-height: 78% !important;
  }
}
