/* ============================== */
/* Certificates page — organized */
/* ============================== */

/* Layout */

/* Make gallery full-width without changing global `.container` */
.cert-gallery.container {
  max-width: 100%;
  width: 100vw;
  margin: 0;
  padding: 1.5rem;
  box-sizing: border-box;
}

.cert-gallery {
  margin: 2rem 0;
  padding: 4rem 1.5rem;
  position: relative;
}
.cert-gallery__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

/* Card */
.cert-card {
  background: var(--container-color);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  min-height: 260px;
}

/* Figure / Image */
.cert-figure {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cert-figure a {
  display: block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
.cert-figure img,
.cert-card img {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

/* Caption */
.cert-caption {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--text-color, #ddd);
  text-align: center;
}

/* Header / Title */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3rem 0;
  position: relative;
}
.topbar-spacer {
  width: 64px;
}

.info__title::after {
  display: none !important;
}
.info__title {
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

/* Back buttons */
.topbar a,
.topbar a:visited {
  color: var(--title-color);
  text-decoration: none;
}
.nav__logo {
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--title-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav__logo:hover {
  background: rgba(255, 255, 255, 0.03);
}
.cert-back {
  position: absolute;
  /* place the button above the gallery's top edge */
  top: -18px;
  left: 12px;
  z-index: 40;
  box-shadow: none;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}
.cert-gallery-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}
.cert-back--centered {
  position: static;
  top: auto;
  left: auto;
  margin: 0;
}

/* ------------------------------ */
/* Responsive - moved to the end */
/* ------------------------------ */

@media (min-width: 1024px) {
  .cert-figure img,
  .cert-card img {
    height: 200px;
  }
}

@media (max-width: 500px) and (min-width: 320px) {
  .info__title {
    font-size: 1.1rem;
  }

  .cert-back {
    /* keep above but closer on small screens */
    top: -12px;
    left: 8px;
    font-size: 0.7rem;
    padding: 5px 8px;
  }
  .cert-gallery.container {
    padding: 1rem;
  }
}
