/* ==========================================================================
   Certificate Display（首页区块 07a）
   来源：html/jeasnn-new 首页新稿 HomePage-*.css，按 SSR 模板口径搬过来。
   卡片：hover 微放大 + zoom-in 光标 + 键盘 focus 环
   预览：原生 <dialog> 全屏大图，点背景 / 关闭按钮 / ESC 关闭
   只在 index.html 引入，不影响其它页面；需排在 index.css 之后以覆盖旧卡片规则。
   ========================================================================== */

/* common.css 的 h2.section-title{color:var(--navy)} 优先级高于
   .section-heading__title，会把深色底上的白色标题覆盖成深蓝（看不见）。
   这里按新稿改回白色，作用域只限证书区块。 */
.certificate-section .section-heading__title.section-title {
  color: #fff;
}

.certificate-card-shell {
  display: flex;
  min-width: 0;
}

.certificate-card {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  text-align: left;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

/* 只有配了图的卡片才可点击放大 */
.certificate-card[data-preview] {
  cursor: zoom-in;
}

.certificate-card[data-preview]:hover {
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  transform: scale(1.015);
}

.certificate-card[data-preview]:focus-visible {
  outline: 3px solid #8fb4ee;
  outline-offset: 3px;
}

/* 有图：媒体区（与 .zoombox 组合，保留 hover 图片放大特效） */
.certificate-card__media {
  flex: none;
  width: 100%;
  aspect-ratio: 7 / 5;
  min-height: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  line-height: 0;
}

.certificate-card__media img {
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

/* 无图：占位框 */
.certificate-card__placeholder {
  flex: none;
  width: auto;
  height: 150px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.certificate-card__content {
  flex: none;
  min-width: 0;
  min-height: 86px;
}

.certificate-card b {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.certificate-card span {
  color: #aebdd4;
  font-size: 13.5px;
}

/* ---------- 点击放大：原生 dialog ---------- */
.certificate-preview {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: rgba(3, 10, 20, 0.96);
}

.certificate-preview[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-preview::backdrop {
  background: rgba(3, 10, 20, 0.82);
}

.certificate-preview__image {
  display: block;
  width: auto;
  max-width: calc(100vw - 96px);
  height: auto;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.certificate-preview__close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(8, 22, 39, 0.72);
  color: #fff;
  font: inherit;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.certificate-preview__close:hover {
  border-color: #fff;
  background: rgba(27, 95, 217, 0.9);
}

@media (max-width: 1024px) {
  .certificate-card {
    gap: 16px;
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .certificate-preview__image {
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 112px);
  }

  .certificate-preview__close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
