/**
 * Diplomas gallery cards and lightbox overlay/dialog.
 */

.diplomas {
  padding-block: var(--space-section);
  background-color: var(--color-bg-section-white);
}

.diplomas__title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.diplomas__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .diplomas__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .diplomas__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.diplomas__item {
  border: none;
  padding: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-card);
  transition:
    transform var(--duration-card) ease,
    box-shadow var(--duration-card) ease;
}

.diplomas__item:hover,
.diplomas__item:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.diplomas__item:focus-visible {
  outline: 2px solid var(--color-accent-green);
  outline-offset: 3px;
}

.diplomas__card {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-card);
  background: var(--color-placeholder-bg);
  border: 1px solid var(--color-border-card);
  display: block;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.diplomas__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  visibility: hidden;
  pointer-events: none;
}

.lightbox[hidden] {
  display: none;
}

.lightbox--open {
  visibility: visible;
  pointer-events: auto;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: var(--color-lightbox-overlay);
  opacity: 0;
}

.lightbox--open .lightbox__overlay {
  opacity: 1;
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  padding: var(--space-xl);
  background: var(--color-bg-section-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-large);
  opacity: 0;
  transform: scale(0.94);
}

.lightbox--open .lightbox__dialog {
  opacity: 1;
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-section-warm);
  color: var(--color-text-primary);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close:hover {
  background: var(--color-border-card);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--color-accent-orange);
  outline-offset: 2px;
}

.lightbox__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: min(72vh, 780px);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-input);
  overflow: hidden;
  background: var(--color-bg-section-warm);
}

.lightbox__img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(72vh, 780px);
  height: auto;
  object-fit: contain;
}

.lightbox__caption {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: center;
  color: var(--color-text-primary);
}
