/* 专门的证书展示页样式 */

/* 证书展示网格 - 默认每排3个 */
.certificate-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  justify-items: center;
  gap: 10px;
  height: 100%;
  flex: 1;
  overflow: hidden;
  /* 确保在page-content的grid布局中正确显示 */
  grid-area: content;
  padding: 10px 20px;
}

/* 当证书数量为5个时的特殊布局 */
.certificate-showcase-grid.five-items {
  grid-template-columns: repeat(5, 1fr);
}

/* 当证书数量为4个时的特殊布局 */
.certificate-showcase-grid.four-items {
  grid-template-columns: repeat(4, 1fr);
}

/* 当证书数量为3个时的特殊布局 */
.certificate-showcase-grid.three-items {
  grid-template-columns: repeat(3, 1fr);
}

/* 证书排标题 */
.certificate-row-title {
  grid-column: 1 / -1; /* 占据整行 */
  font-size: 1.7rem;
  font-weight: 600;
  color: #333;
  text-align: left;
}

/* 第一个标题上边距调整 */
.certificate-row-title:first-child {
  margin-top: 0;
}

/* 证书项目 */
.certificate-showcase-item {
  width: 100%;
  height: auto; /* 统一父元素高度 */
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-showcase-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 证书图片 */
.certificate-showcase-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 确保照片显示完整 */
}

/* 证书模态框 */
.certificate-showcase-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.certificate-showcase-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.certificate-showcase-modal-image {
  width: 100%;
  height: auto;
  display: block;
}

.certificate-showcase-modal-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.certificate-showcase-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* 响应式设计 */

/* 横向平板端 */
@media (min-width: 768px) and (max-width: 1180px) and (orientation: landscape) {
  .certificate-showcase-grid {
    max-width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .certificate-row-title {
    font-size: 1.5rem;
  }

  .certificate-showcase-item:hover {
    transform: translateY(-4px);
  }

  .certificate-showcase-item:hover .certificate-showcase-image {
    transform: scale(1.03);
  }
}
