/* Certificate component — shared by certifications.html and the Certification
   section of prompting.html. Accent comes from var(--accent), so each page
   picks up its own theme color.

   Loaded by BOTH pages; don't duplicate these rules into a page stylesheet. */

.certs-page {
  max-width: var(--content-max);
  padding: 2.5rem 2.5rem 4rem;
}

.cert-total {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Category groups ---------- */

.cert-group + .cert-group {
  margin-top: 2.75rem;
}

/* Offset so a #hash jump doesn't tuck the heading under the mobile top bar. */
.cert-group {
  scroll-margin-top: 5rem;
}

.cert-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.cert-group-title {
  margin: 0;
  font-size: 1.3rem;
}

.cert-group-count {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  white-space: nowrap;
}

.cert-group-blurb {
  margin: 0.8rem 0 1.15rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 62ch;
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* ---------- One certificate ---------- */

.cert {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.cert-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  list-style: none;
}

.cert-summary::-webkit-details-marker {
  display: none;
}

.cert-summary:hover,
.cert-summary:focus-visible {
  background: var(--card-bg-hi);
}

.cert-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cert-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.cert-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.cert-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  color: var(--accent);
  white-space: nowrap;
}

.cert-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.cert[open] .cert-chevron {
  transform: rotate(180deg);
}

.cert-body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cert-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.15rem 0;
}

.cert-fact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cert-fact-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}

.cert-fact-value {
  font-size: 0.91rem;
}

.cert-fact-value a {
  color: var(--accent);
  text-decoration: none;
}

.cert-fact-value a:hover,
.cert-fact-value a:focus-visible {
  text-decoration: underline;
}

.cert-pdf {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

/* Coursera certificates are landscape (792x612); hold that ratio so the
   embedded viewer doesn't letterbox. */
.cert-pdf-frame {
  display: block;
  width: 100%;
  aspect-ratio: 792 / 612;
  min-height: 260px;
  border: 0;
  border-radius: 6px;
  background: #1a1e24;
}

.cert-pdf-frame--portrait {
  aspect-ratio: 612 / 792;
}

.cert-pdf-fallback {
  margin: 0.75rem 0 0.15rem;
  font-size: 0.81rem;
  color: var(--text-dim);
  text-align: center;
}

.cert-pdf-fallback a {
  color: var(--accent);
}

.cert-download {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.2s ease;
}

.cert-download:hover,
.cert-download:focus-visible {
  filter: brightness(1.1);
}

@media (max-width: 900px) {
  .certs-page {
    padding: 1.75rem 1.5rem 3rem;
  }

  .cert-summary {
    padding: 1rem 1.15rem;
  }

  .cert-body {
    padding: 0 1.15rem 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cert-chevron,
  .cert-download {
    transition: none;
  }
}
