/* ════════════════════════════════════════════════════
   Certifications section
   Eyebrow · h2 · lead · grid 4 cards · lightbox
   На мобильном — горизонтальный свайп-слайдер с точками
   Tokens: design-system/colors_and_type.css
   ════════════════════════════════════════════════════ */

.certs {
  border-top: 1px solid var(--border);
  padding: clamp(72px, 9vw, 112px) 0 clamp(80px, 9vw, 112px);
  color: var(--text-dark);
}
.certs__container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

/* ─── Header (центрированный) ─── */
.certs__eyebrow {
  font: 500 13px/1.3 var(--font-body);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.certs__eyebrow::before,
.certs__eyebrow::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.certs__h2 {
  font: 500 clamp(30px, 3.4vw, 44px)/1.2 var(--font-serif);
  letter-spacing: -0.4px;
  color: var(--text-dark);
  margin: 0 auto 20px;
  max-width: 920px;
  text-align: center;
  text-wrap: pretty;
}
.certs__h2 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.certs__lead {
  font: 400 italic clamp(16px, 1.3vw, 19px)/1.55 var(--font-serif);
  color: var(--text-muted, rgba(60, 50, 40, 0.65));
  margin: 0 auto clamp(48px, 5vw, 64px);
  max-width: 640px;
  text-align: center;
  text-wrap: pretty;
}

/* ─── Grid 4 cols ─── */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
}

/* ─── Card ─── */
.cert-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  cursor: zoom-in;
  transition: border-color var(--dur, 0.2s) var(--ease-out, ease-out),
              transform var(--dur, 0.2s) var(--ease-out, ease-out);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cert-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.cert-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cert-card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--bg-cream, #FAF6F0);
  border-radius: 4px;
  display: block;
}
.cert-card__image--placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted, rgba(60, 50, 40, 0.55));
  font: 500 11px/1.4 var(--font-body);
  letter-spacing: 1.5px;
  padding: 24px;
  text-align: center;
}

.cert-card__caption {
  font: 400 13px/1.45 var(--font-body);
  letter-spacing: 0.2px;
  color: var(--text-muted, rgba(60, 50, 40, 0.7));
}
.cert-card__caption b {
  display: block;
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.1px;
}

/* ─── Primary cert highlighting ─── */
.cert-card--primary {
  border-color: var(--accent);
}
.cert-card--primary::before {
  content: 'ОСНОВНАЯ АККРЕДИТАЦИЯ';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 5px 12px;
  border-radius: 3px;
  font: 500 10px/1 var(--font-body);
  letter-spacing: 1.5px;
  white-space: nowrap;
  z-index: 2;
}

/* ─── Mobile dots indicator (default hidden) ─── */
.certs-dots {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.certs-dots__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--dur, 0.2s), width var(--dur, 0.2s);
}
.certs-dots__dot--active {
  background: var(--accent);
  width: 20px;
  border-radius: 3px;
}

/* ════════════════════════════════════════════════
   Lightbox
   ════════════════════════════════════════════════ */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(31, 27, 23, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  animation: lightbox-fade 0.2s ease;
}
.lightbox-backdrop[hidden] { display: none; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  cursor: default;
}
.lightbox__image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.lightbox__caption {
  margin: 16px 0 0;
  text-align: center;
  font: 400 13px/1.5 var(--font-body);
  letter-spacing: 0.3px;
  color: rgba(245, 241, 236, 0.85);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: transparent;
  border: 0;
  color: rgba(245, 241, 236, 0.75);
  cursor: pointer;
  font: 500 24px/1 var(--font-body);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.lightbox__close:hover,
.lightbox__nav:hover {
  color: #fff;
  background: rgba(245, 241, 236, 0.08);
}
.lightbox__close {
  top: -48px;
  right: 0;
  font-size: 28px;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
}
.lightbox__nav--prev { left: -56px; }
.lightbox__nav--next { right: -56px; }

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .certs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 860px) {
  .certs {
    padding: 64px 0;
  }
  .certs-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 16px 20px 20px;
    margin: 0 -20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .certs-grid::-webkit-scrollbar { display: none; }
  .cert-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }
  .certs-dots { display: flex; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: -44px; }
}

@media (max-width: 600px) {
  .certs__h2 { font-size: 26px; }
  .certs__lead { font-size: 15px; }
}
