/* ==========================================================================
   Certifications section — builds on css/styles.css (tokens, buttons, links)
   ========================================================================== */

/* section background */
.certs {
  background:
    radial-gradient(55% 40% at 85% 0%, rgba(139, 92, 246, 0.12), transparent 70%),
    radial-gradient(40% 30% at 10% 30%, rgba(34, 211, 238, 0.08), transparent 70%),
    var(--bg-2);
}

/* fallback for the medium section label used in index.html (zero specificity, so any rule in styles.css wins) */
:where(.section__index--medium) { font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; }

.certs__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}
.certs__stats li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 36, 0.6);
}
.certs__stats strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--text); }
.certs__stats span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }

/* filters */
.certs__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(28px, 4vw, 44px); }
.chip-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
}
.chip-btn:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.5); transform: translateY(-2px); }
.chip-btn.is-active { color: #04121a; background: var(--grad); border-color: transparent; }

/* grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.cert {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 27, 48, 0.8), rgba(14, 20, 36, 0.9));
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.4s, box-shadow 0.5s, opacity 0.4s;
}
.cert:hover { transform: translateY(-6px); border-color: rgba(34, 211, 238, 0.45); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), var(--shadow-glow); }
.cert.is-hidden { display: none; }

.cert__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e9edf5;
  overflow: hidden;
  cursor: zoom-in;
}
.cert__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.8s var(--ease-out), filter 0.4s;
}
.cert:hover .cert__media img { transform: scale(1.04); }
.cert__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 8, 15, 0.55), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
}
.cert:hover .cert__media::after { opacity: 1; }
.cert__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(6, 8, 15, 0.75);
  color: var(--text);
  border: 1px solid var(--border-strong);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
  z-index: 1;
}
.cert__zoom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cert:hover .cert__zoom, .cert__media:focus-visible .cert__zoom { opacity: 1; transform: none; }
@media (hover: none) { .cert__zoom { opacity: 1; transform: none; } }

.cert__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.cert__issuer { color: var(--violet); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }
.cert__title { font-size: 1.15rem; line-height: 1.25; }
.cert__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}
.cert__meta .icon { color: var(--cyan); width: 1em; height: 1em; }
.cert__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.9rem;
}
.text-link--muted { color: var(--muted); }
.text-link--muted:hover { color: var(--text); }

.certs__empty { margin-top: 40px; color: var(--dim); text-align: center; }

/* lightbox */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(6, 8, 15, 0.88); backdrop-filter: blur(8px); }
.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 100%;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: lbIn 0.45s var(--ease-out);
}
@keyframes lbIn { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: none; } }
.lightbox__figure img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  border-radius: 12px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--border-strong);
  background: #fff;
}
.lightbox__figure figcaption { color: var(--muted); font-size: 0.78rem; text-align: center; padding: 0 60px; }
.lightbox__close, .lightbox__nav {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(14, 20, 36, 0.8);
  color: var(--text);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.lightbox__close { top: 18px; right: 18px; font-size: 1.6rem; line-height: 1; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
.lightbox__nav .icon { width: 22px; height: 22px; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(34, 211, 238, 0.2); }
.lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }

@media (max-width: 1024px) { .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cert-grid { grid-template-columns: 1fr; }
  .cert__body { padding: 18px; }
  .lightbox__nav { top: auto; bottom: 18px; transform: none; }
  .lightbox__nav:hover { transform: scale(1.06); }
  .lightbox__figure figcaption { padding: 0 16px 60px; }
  .certs__stats li { padding: 8px 12px; }
}
