/**
 * Hamed Academic Dashboard 3.8.0
 * Readability, certificate previews, calibrated location maps and annual trends.
 */

/* Research project cards: retain the contained layout while increasing the
   text hierarchy enough for normal 100% desktop zoom. */
@media (min-width: 901px) {
  .had-research-v301 .had-project-card h3 {
    font-size: clamp(16px, 1.05vw, 18px) !important;
    line-height: 1.28 !important;
    -webkit-line-clamp: 3 !important;
  }
  .had-research-v301 .had-project-card > p {
    font-size: clamp(11.5px, .74vw, 13px) !important;
    line-height: 1.48 !important;
    -webkit-line-clamp: 4 !important;
  }
  .had-research-v301 .had-project-role span {
    font-size: clamp(10.5px, .68vw, 12px) !important;
    line-height: 1.38 !important;
  }
  .had-research-v301 .had-project-card .had-tag-row span {
    font-size: 8.5px !important;
    padding: 4px 7px !important;
  }
  .had-research-v301 .had-open-detail {
    font-size: 9.5px !important;
  }
}

/* Credentials: certificate sits naturally between provider and completion
   metadata. It remains fully visible and does not crop portrait or landscape
   certificate scans. */
.had-credentials-v3 .had-credential-detail {
  justify-content: flex-start !important;
}
.had-credentials-v3 .had-credential-certificate {
  width: min(760px, 100%);
  height: clamp(150px, 26vh, 230px);
  min-height: 150px;
  margin: 16px 0 14px;
  padding: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #24566d;
  background: linear-gradient(145deg, rgba(238, 245, 247, .98), rgba(205, 222, 229, .96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42), 0 14px 34px rgba(0, 0, 0, .22);
}
.had-credentials-v3 .had-credential-certificate[hidden] {
  display: none !important;
}
.had-credentials-v3 .had-credential-image {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  float: none !important;
  object-fit: contain !important;
  object-position: center !important;
  border: 0 !important;
  background: transparent !important;
}
.had-credentials-v3 .had-credential-meta {
  width: min(760px, 100%);
  max-width: none !important;
  margin: 0 0 14px !important;
}
.had-credentials-v3 .had-credential-summary {
  margin-top: 0 !important;
}
@media (max-height: 720px) and (min-width: 901px) {
  .had-credentials-v3 .had-credential-certificate {
    height: 150px;
    min-height: 150px;
    margin: 10px 0;
  }
  .had-credentials-v3 .had-credential-detail h2 {
    font-size: clamp(27px, 2.5vw, 39px) !important;
  }
}

/* Location markers use city coordinates projected into the same Natural Earth
   plane as the SVG. These rules preserve the exact overlay geometry. */
.had-europe-map {
  isolation: isolate;
}
.had-europe-map > img {
  object-fit: fill !important;
  object-position: center !important;
}
.had-europe-map > .had-map-marker {
  transform: translate(-50%, -50%) !important;
  transform-origin: center !important;
}
.had-europe-map > .had-map-marker > .had-map-star {
  font-size: 22px !important;
}

/* Shared annual trend line used by Teaching Experience and Pedagogical
   Training. */
.had-year-trend {
  width: 100%;
  height: calc(100% - 4px);
  min-height: 165px;
  display: grid;
  place-items: center;
  color: var(--had-current-accent, var(--had-accent));
  overflow: hidden;
}
.had-year-trend > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 165px;
  overflow: visible;
}
.had-year-trend-baseline {
  stroke: #21495d;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.had-year-trend-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px currentColor);
}
.had-year-trend-point circle {
  fill: #041722;
  stroke: currentColor;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.had-year-trend-point text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-anchor: middle;
}
.had-year-trend-value {
  fill: #e8fbff;
  font-size: 13px;
  font-weight: 800;
}
.had-year-trend-year {
  fill: #7d9eac;
  font-size: 12px;
  font-weight: 700;
}
.had-type-teaching-experience [data-had-teaching-analytics-body="years"],
.had-type-pedagogical-training [data-had-pedagogy-analytics-body="years"] {
  height: calc(100% - 4px);
  min-height: 0;
}
.had-type-teaching-experience [data-had-teaching-analytics-body="years"] .had-advanced-year-bars,
.had-type-pedagogical-training [data-had-pedagogy-analytics-body="years"] .had-advanced-year-bars {
  display: none !important;
}

@media (max-width: 900px) {
  .had-research-v301 .had-project-card h3 { font-size: 18px !important; }
  .had-research-v301 .had-project-card > p { font-size: 14px !important; }
  .had-credentials-v3 .had-credential-certificate {
    width: 100%;
    height: 230px;
  }
  .had-year-trend { min-height: 210px; }
}
