/* Certifications & Regulatory Registrations — grid, cards, lightbox */

/* ══════════════ GROUPS ══════════════ */
.cert-group { margin-bottom: 64px; }
.cert-group:last-child { margin-bottom: 0; }
.cert-group-head { max-width: 640px; margin-bottom: 32px; }
.cert-group-title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem); letter-spacing: -0.025em;
  color: var(--brand-blue-900); margin-bottom: 8px;
}
.cert-group-head::after {
  content: ''; display: block; width: 52px; height: 3px;
  background: var(--grad-divider); border-radius: 2px; margin: 14px 0 16px;
}
.cert-group-blurb { font-size: 0.92rem; color: var(--muted); line-height: 1.65; }

/* ══════════════ CARD ══════════════ */
.cert-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 22px;
}
.cert-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition);
}
.cert-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--brand-blue-300);
}

.cert-thumb {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--grad-surface);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
}
.cert-thumb-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cert-badge {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: center;
  background: rgba(var(--brand-blue-900-rgb),0.88); color: var(--white);
  padding: 5px 8px; border-radius: var(--radius); line-height: 1.35;
}

/* Generated document tile — stands in for certificates with no scan */
.cert-tile {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; padding: 18px;
}
.cert-tile-sheet {
  width: 100%; max-width: 150px; aspect-ratio: 3 / 4;
  background: var(--white); border: 1px solid var(--brand-blue-200);
  border-radius: 3px; box-shadow: var(--shadow-sm);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 7px;
}
/* Pill, not a circle — labels run from 2 to 5 characters */
.cert-tile-seal {
  min-width: 34px; height: 30px; padding: 0 9px;
  border-radius: 15px; margin-bottom: 5px; align-self: flex-start;
  background: var(--grad-primary); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em;
  font-family: 'Plus Jakarta Sans', sans-serif; white-space: nowrap;
}
.cert-tile-rule {
  display: block; height: 4px; border-radius: 2px;
  background: var(--brand-blue-100); width: 100%;
}
.cert-tile-rule-lg { height: 6px; width: 78%; background: var(--brand-blue-200); }
.cert-tile-rule-sm { width: 55%; }
.cert-tile-rule-xs { width: 38%; height: 4px; }
.cert-tile-foot {
  margin-top: auto; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 8px;
}
.cert-tile-stamp {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--brand-blue-300); opacity: 0.75;
}

.cert-body { padding: 20px 20px 14px; flex: 1; }
.cert-title {
  font-size: 0.98rem; font-weight: 600; letter-spacing: -0.015em;
  color: var(--brand-blue-900); margin-bottom: 5px; line-height: 1.32;
}
.cert-issuer { font-size: 0.78rem; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.cert-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.cert-meta-row { display: flex; gap: 8px; font-size: 0.76rem; line-height: 1.45; }
.cert-meta-row dt { color: var(--text-muted); flex-shrink: 0; }
.cert-meta-row dd {
  color: var(--brand-blue-700); font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif; font-feature-settings: 'tnum';
}
.cert-summary { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

.cert-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 20px 18px;
}
.cert-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: var(--transition); border: 1px solid transparent;
  text-decoration: none; line-height: 1;
}
.cert-btn-preview {
  background: var(--brand-blue-50); color: var(--brand-blue-700);
  border-color: var(--brand-blue-200);
}
.cert-btn-preview:hover { background: var(--brand-blue-100); border-color: var(--brand-blue-300); }
.cert-btn-download { background: var(--grad-primary); color: var(--white); }
.cert-btn-download:hover {
  background: var(--grad-primary-hover);
  box-shadow: 0 6px 16px rgba(var(--brand-blue-600-rgb),0.30);
}

/* ══════════════ HOMEPAGE TEASER ══════════════ */
.cert-teaser-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 32px;
}
.cert-teaser-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 16px; cursor: pointer;
  text-align: left; transition: var(--transition); font-family: inherit;
}
.cert-teaser-card:hover {
  border-color: var(--brand-blue-300); box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.cert-teaser-thumb {
  display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 10px;
  background: var(--grad-surface); border: 1px solid var(--gray-150);
}
.cert-teaser-thumb .cert-thumb-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cert-teaser-thumb .cert-tile { padding: 10px; }
.cert-teaser-thumb .cert-tile-sheet { max-width: 84px; padding: 9px 8px; gap: 4px; }
.cert-teaser-thumb .cert-tile-seal {
  min-width: 20px; height: 17px; padding: 0 5px;
  border-radius: 9px; font-size: 0.42rem; margin-bottom: 3px;
}
.cert-teaser-thumb .cert-tile-rule { height: 3px; }
.cert-teaser-thumb .cert-tile-stamp { width: 13px; height: 13px; border-width: 1.5px; }
.cert-teaser-title {
  font-size: 0.83rem; font-weight: 600; color: var(--brand-blue-900);
  line-height: 1.35; letter-spacing: -0.01em;
}
.cert-teaser-issuer { font-size: 0.71rem; color: var(--text-muted); line-height: 1.45; }

/* ══════════════ LIGHTBOX ══════════════ */
.cert-lb {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(var(--brand-blue-900-rgb),0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.cert-lb[hidden] { display: none; }
.cert-lb-panel {
  position: relative; width: 100%; max-width: 940px; height: 92vh;
  background: var(--white); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  animation: certLbIn 0.28s cubic-bezier(0.34,1.4,0.64,1);
}
@keyframes certLbIn {
  from { opacity: 0; transform: scale(0.95) translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.cert-lb-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 18px; flex-shrink: 0;
  background: var(--grad-deep); color: var(--white);
}
.cert-lb-headings { min-width: 0; }
.cert-lb-title {
  font-size: 0.94rem; font-weight: 600; color: var(--white);
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cert-lb-issuer {
  font-size: 0.74rem; color: rgba(255,255,255,0.65); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cert-lb-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cert-lb-count {
  font-size: 0.72rem; color: rgba(255,255,255,0.6);
  font-family: 'IBM Plex Sans', sans-serif; font-feature-settings: 'tnum';
  white-space: nowrap; margin-right: 2px;
}
.cert-lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; text-decoration: none; transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
  color: var(--white);
}
.cert-lb-btn:hover { background: rgba(255,255,255,0.2); }
.cert-lb-download { background: var(--brand-blue-500); border-color: var(--brand-blue-400); }
.cert-lb-download:hover { background: var(--brand-blue-400); }
.cert-lb-close { padding: 8px 10px; }
.cert-lb-btn:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.cert-lb-stage {
  flex: 1; overflow: auto; background: var(--gray-100);
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding: 18px;
}
.cert-lb-img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); background: var(--white);
}
.cert-lb-frame {
  width: 100%; flex: 1; min-height: 60vh; border: none;
  border-radius: var(--radius); background: var(--white);
}
.cert-lb-fallback { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }
.cert-lb-fallback a { color: var(--brand-blue-600); font-weight: 600; text-decoration: underline; }

.cert-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(var(--brand-blue-900-rgb),0.72); color: var(--white);
  border: 1px solid rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.cert-lb-nav:hover { background: var(--brand-blue-600); }
.cert-lb-nav:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.cert-lb-prev { left: 12px; }
.cert-lb-next { right: 12px; }

@media (max-width: 900px) {
  .cert-teaser-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cert-grid { grid-template-columns: 1fr; }
  .cert-teaser-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cert-lb { padding: 8px; }
  .cert-lb-panel { height: 96vh; }
  .cert-lb-issuer, .cert-lb-count { display: none; }
  .cert-lb-download { padding: 8px 10px; font-size: 0.72rem; }
  .cert-lb-nav { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .cert-lb-panel { animation: none; }
  .cert-card:hover, .cert-teaser-card:hover { transform: none; }
}

/* ── Homepage teaser section chrome ── */
.section-cert-teaser {
  padding: 96px 0; background: var(--white);
  border-top: 1px solid var(--hairline);
}
.cert-teaser-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; margin-bottom: 32px; flex-wrap: wrap;
}
.cert-teaser-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.cert-teaser-head p {
  font-size: 0.94rem; color: var(--muted); max-width: 560px; line-height: 1.7;
}
.cert-page-note {
  font-size: 0.8rem; color: var(--muted); line-height: 1.7;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--hairline); max-width: 760px;
}
.cert-page-note a { color: var(--brand-blue-600); font-weight: 600; }
.cert-page-note a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .section-cert-teaser { padding: 72px 0; }
}
