/* =========================================================
   صفحة المؤهلات — شهادات الشركاء
   يعتمد على نفس متغيرات gallery.css:
   --primary-green / --primary-red / --dark-bg / --light-bg / --white / --text-light / --text-muted
   ========================================================= */

/* شارة/لوقو فوق كل شهادة */
.cert-badge {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #eef0f2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.cert-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* بطاقة الشهادة: مستطيل صغير، لوقو أعلى، صورة واحدة أسفل */
.cert-card {
  width: 260px;
  background: var(--white, #ffffff);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.cert-title {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  color: var(--dark-bg, #1a1a1a);
  margin: 0 0 14px 0;
  line-height: 1.4;
}

/* صورة الشهادة الواحدة */
.cert-image-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
}

.cert-image-wrap img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.cert-image-wrap img:hover {
  transform: scale(1.03);
}

/* ===== نافذة تكبير صورة الشهادة ===== */

.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cert-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.cert-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.cert-lightbox.open .cert-lightbox-inner {
  transform: scale(1);
}

.cert-lightbox-inner img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.cert-lightbox-close {
  position: absolute;
  top: -18px;
  left: -18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--white, #ffffff);
  color: var(--dark-bg, #1a1a1a);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, color 0.2s ease;
}

.cert-lightbox-close:hover {
  background: var(--primary-red);
  color: #ffffff;
}

@media (max-width: 640px) {
  .cert-card {
    width: 100%;
    max-width: 300px;
  }

  .cert-lightbox-close {
    top: -14px;
    left: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cert-image-wrap img,
  .cert-lightbox,
  .cert-lightbox-inner {
    transition-duration: 0.01ms !important;
  }
}
/* ===== Mobile layout ===== */
@media (max-width: 768px) {
  .cert-card {
    width: min(100%, 340px);
    max-width: 340px;
    padding: 16px;
    margin-inline: auto;
  }

  .cert-badge {
    width: 54px;
    height: 54px;
    margin-inline: auto;
  }

  .cert-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
  }

  .cert-title {
    font-size: .98rem;
    line-height: 1.55;
  }

  .cert-image-wrap {
    width: 100%;
  }

  .cert-image-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    max-height: 72vh;
    object-fit: contain;
    background: #f3f3f3;
  }

  .cert-lightbox {
    padding: 10px;
  }

  .cert-lightbox-inner {
    max-width: 96vw;
    max-height: 90vh;
  }

  .cert-lightbox-inner img {
    max-width: 96vw;
    max-height: 84vh;
    object-fit: contain;
  }
}
