/* =============================================================================
   Pep Research -- Documentation (coas.html), CEO direction 2026-09-30:
   a compact header, then the certificates as dark glass cards. The page hero,
   the breadcrumbs, buttons and the card light come from css/v3.css; colors
   from css/v3-palette.css. Every value on a card is transcribed from the
   certificate file it opens (images/coas/). The viewer (#docViewer) is a
   native <dialog> driven by js/v3-docs.js; without it, "View Certificate" is
   a plain link to the file.
   ============================================================================= */

.v3-docs .v3-page-hero { padding-bottom: 48px; }
.v3-docs .v3-page-lead { max-width: 40rem; }

.v3-docs-sec { padding-top: 16px; }
.v3-docs-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* ---- The grid: three across, two on tablets, one on phones ---- */
.v3-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ---- A certificate card ---- */
.v3-cert {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-radius: var(--v3-radius-card);
  background: var(--v3-glass-card);
  border: 1px solid var(--v3-card-line);
  box-shadow: var(--v3-card-shadow);
  transition: border-color 400ms var(--v3-ease-out), box-shadow 500ms var(--v3-ease-out), transform 500ms var(--v3-ease-out);
}
.v3-cert:hover { border-color: var(--v3-card-line-hover); box-shadow: var(--v3-card-shadow-hover); transform: translate3d(0, -3px, 0); }
.v3-cert:target { border-color: rgba(91, 110, 224, 0.55); }

.v3-cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--v3-line-dark);
}
.v3-cert-lab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pv-periwinkle);
}
.v3-cert-lab svg { width: 14px; height: 14px; flex: none; color: var(--pv-cyan); }
.v3-cert-ref {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--v3-on-dark-soft);
  font-variant-numeric: tabular-nums;
}

.v3-cert-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 18px;
  font-size: var(--t-h3);
  line-height: var(--t-h3-lh);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--v3-on-dark);
}
.v3-cert-strength {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: var(--pv3-radius-full);
  border: 1px solid rgba(58, 75, 200, 0.32);
  background: rgba(58, 75, 200, 0.1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pv-lavender);
}

/* the purity reading, the one figure a researcher scans for */
.v3-cert-purity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--pv3-radius-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--v3-line-dark);
}
.v3-cert-purity .v3-caps { color: var(--v3-on-dark-soft); }
.v3-cert-purity strong {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--v3-on-dark);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(91, 110, 224, 0.35);
}
.v3-cert-purity strong span { margin-left: 1px; font-size: 14px; color: var(--pv-cyan); }

/* the certificate fields, label left, value right */
.v3-cert-data { margin: 14px 0 0; }
.v3-cert-data > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--v3-line-dark);
}
.v3-cert-data > div:first-child { border-top: 0; }
.v3-cert-data dt {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--v3-on-dark-soft);
}
.v3-cert-data dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  font-size: var(--t-data);
  line-height: 20px;
  font-weight: 500;
  color: var(--v3-on-dark);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.v3-cert-data .v3-cert-key { font-size: 12px; letter-spacing: 0.06em; color: var(--pv-lavender); }

/* ---- The call to action: calm at rest, violet on intent ---- */
.v3-cert-cta {
  margin-top: auto;
  padding-top: 18px;
}
.v3-cert-cta .v3-btn { width: 100%; }
.v3-btn--cert {
  background: rgba(11, 22, 64, 0.024);
  border-color: rgba(58, 75, 200, 0.34);
  color: var(--v3-on-dark);
}
.v3-btn--cert:hover,
.v3-btn--cert:focus-visible {
  background: var(--v3-action-gradient);
  border-color: rgba(58, 75, 200, 0);
  box-shadow: inset 0 1px 0 rgba(11, 22, 64, 0.06), 0 10px 26px -12px rgba(11, 22, 64, 0.12);
}
.v3-btn--cert:active { background: var(--v3-action-pressed); }
.v3-btn--cert svg { color: var(--pv-lavender); }
.v3-btn--cert:hover svg, .v3-btn--cert:focus-visible svg { color: var(--v3-on-action); transform: none; }

/* ---- The certificate viewer (native dialog) ---- */
html:has(.v3-viewer[open]) { overflow: hidden; }
.v3-viewer {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border-radius: var(--v3-radius-panel);
  border: 1px solid var(--v3-card-line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--v3-on-dark);
  box-shadow: 0 40px 90px -30px rgba(11, 22, 64, 0.14), 0 0 0 1px rgba(11, 22, 64, 0.03) inset;
  overflow: hidden;
}
.v3-viewer::backdrop {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.v3-viewer[open] { display: flex; flex-direction: column; animation: v3-viewer-in 420ms var(--v3-ease-out) both; }
@keyframes v3-viewer-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.v3-viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--v3-line-dark);
}
.v3-viewer-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--v3-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-viewer-open { flex: none; }
.v3-viewer-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--pv3-radius-full);
  border: 1px solid var(--v3-line-dark-strong);
  background: rgba(11, 22, 64, 0.024);
  color: var(--v3-on-dark);
  transition: background-color 200ms var(--v3-ease-out), border-color 200ms var(--v3-ease-out);
}
.v3-viewer-close:hover { background: rgba(11, 22, 64, 0.05); border-color: rgba(11, 22, 64, 0.2); }
.v3-viewer-close svg { width: 16px; height: 16px; }
.v3-viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  overscroll-behavior: contain;
}
/* the certificate is shown as issued: a paper document */
.v3-viewer-img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--pv3-radius-sm);
  background: var(--v3-paper);
  box-shadow: 0 24px 60px -30px rgba(11, 22, 64, 0.14);
}

@media (max-width: 1023px) {
  .v3-cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .v3-docs .v3-page-hero { padding-bottom: 36px; }
  .v3-cert-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .v3-cert { padding: 18px; }
  .v3-viewer { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .v3-viewer-bar { padding-left: 16px; }
  .v3-viewer-open .v3-viewer-open-label { display: none; }
  .v3-viewer-body { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .v3-cert, .v3-cert:hover { transition: none; transform: none; }
  .v3-viewer[open] { animation: none; }
}
