/**
 * Hamed Academic Dashboard 3.9.1
 * Credential title and certificate display corrections.
 */

/* The credential detail panel must never crop a long title or a certificate.
   It remains an internal scroll region on short screens, so the document
   itself still fits the desktop viewport. */
.had-credentials-v3 .had-credential-detail {
  justify-content: flex-start !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  padding: clamp(18px, 2.15vw, 34px) !important;
}

/* Remove the old line clamp that caused long credential names to overlap the
   provider line. The balanced, slightly smaller title remains prominent while
   allowing the full name to wrap naturally. */
.had-credentials-v3 .had-credential-detail h2,
.had-credentials-v3 [data-had-credential-title] {
  display: block !important;
  width: 100% !important;
  max-width: min(920px, 100%) !important;
  max-height: none !important;
  margin: 12px 0 8px !important;
  overflow: visible !important;
  -webkit-box-orient: initial !important;
  -webkit-line-clamp: unset !important;
  font-size: clamp(29px, 2.35vw, 42px) !important;
  line-height: 1.09 !important;
  letter-spacing: -0.025em;
  text-wrap: balance;
  flex: 0 0 auto;
}

.had-credentials-v3 [data-had-credential-issuer] {
  margin: 0 0 2px !important;
  flex: 0 0 auto;
}

/* Display the complete uploaded certificate, regardless of whether it is a
   landscape Coursera certificate, a portrait scan or another aspect ratio.
   Width/height are auto and constrained independently, preventing the image
   from being stretched or cropped. */
.had-credentials-v3 .had-credential-certificate {
  width: min(820px, 100%) !important;
  height: clamp(185px, 28vh, 255px) !important;
  min-height: 185px !important;
  margin: 12px 0 12px !important;
  padding: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
  border: 1px solid #2a6177 !important;
  border-radius: 5px !important;
  background: #eef4f6 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 14px 30px rgba(0, 0, 0, .2) !important;
}

.had-credentials-v3 .had-credential-certificate[hidden] {
  display: none !important;
}

.had-credentials-v3 .had-credential-image {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  float: none !important;
  object-fit: scale-down !important;
  object-position: center !important;
  border: 0 !important;
  background: transparent !important;
}

.had-credentials-v3 .had-credential-meta {
  width: min(820px, 100%) !important;
  margin: 0 0 12px !important;
  flex: 0 0 auto;
}

.had-credentials-v3 .had-credential-summary,
.had-credentials-v3 .had-skill-grid,
.had-credentials-v3 .had-credential-actions {
  flex: 0 0 auto;
}

@media (max-height: 720px) and (min-width: 901px) {
  .had-credentials-v3 .had-credential-detail h2,
  .had-credentials-v3 [data-had-credential-title] {
    font-size: clamp(27px, 2.15vw, 37px) !important;
    line-height: 1.08 !important;
  }

  .had-credentials-v3 .had-credential-certificate {
    height: 175px !important;
    min-height: 175px !important;
    margin-block: 9px !important;
  }
}

@media (max-width: 900px) {
  .had-credentials-v3 .had-credential-detail h2,
  .had-credentials-v3 [data-had-credential-title] {
    font-size: clamp(28px, 7vw, 42px) !important;
  }

  .had-credentials-v3 .had-credential-certificate {
    width: 100% !important;
    height: clamp(210px, 48vw, 320px) !important;
  }
}
