/* =====================================================================
   WPSB additions to the IPSB stylesheets (tokens, base, components, landing, quiz are
   carried over unchanged). Only new components and the certificate's new shape live here.
   Decisions D9 (certificate), D18 (profession tabs), D21 (one design system).
   ===================================================================== */

/* ---- Profession tabs (D18) ----
   A horizontal row of links; it scrolls sideways on narrow screens with a visible fade so
   it is clear more tabs exist (Baymard). The current tab carries the brass rule. */
.profession-tabs { border-bottom: 1px solid var(--line); background: var(--surface); position: relative; }
.profession-tabs .container { position: relative; }
.pt-list {
  display: flex; gap: .3rem; list-style: none; margin: 0; padding: .55rem 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.pt-list::-webkit-scrollbar { display: none; }
.pt-list li { flex: none; scroll-snap-align: start; }
.pt-tab {
  display: inline-block; padding: .55rem .95rem; border-radius: var(--r-pill, 999px);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border: 1px solid transparent; white-space: nowrap;
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.pt-tab:hover { color: var(--ink-2); border-color: var(--line-2); }
.pt-tab.is-current { color: var(--ink-2); background: var(--paper-warm); border-color: var(--brass); }
.pt-tab:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@media (max-width: 960px) {
  .profession-tabs .container::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 2.5rem; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--surface));
  }
}
.desc-note { display: block; margin-top: .35rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-deep); }

/* ---- The certificate, landscape (D9) ----
   One fixed proportion (4:3) at every width; every size below is in container units, so the
   document scales as a whole instead of reflowing taller on narrow screens. IPSB's specimen
   measured 1.04 wide-to-tall on desktop and 0.68 on phones. */
/* Padding in % of the width (cqi on the container itself would resolve against the viewport). */
.cert-frame.is-landscape { padding: 1.6%; container-type: inline-size; aspect-ratio: 4 / 3; width: 100%; }
.cert-frame.is-landscape .cert {
  height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; padding: 4.2cqi 5cqi 3.6cqi;
}
.cert-frame.is-landscape .cert .guilloche { height: 4.4cqi; margin: -1.2cqi 0 .8cqi; width: 100%; }
.cert-frame.is-landscape .cert .org { font-size: 1.9cqi; letter-spacing: .22em; }
.cert-frame.is-landscape .cert .seal { width: 11cqi; height: 11cqi; margin: 1.2cqi auto .4cqi; }
.cert-frame.is-landscape .cert .conf { font-size: 2.5cqi; margin-top: .6cqi; }
.cert-frame.is-landscape .cert .name { font-size: 5.6cqi; margin: .3cqi 0; }
.cert-frame.is-landscape .cert .for { font-size: 2.5cqi; }
.cert-frame.is-landscape .cert .track { font-size: 3.6cqi; margin-top: .4cqi; }
.cert-frame.is-landscape .cert .lvrow { gap: 1.6cqi; margin-top: 1.4cqi; align-items: baseline; }
.cert-frame.is-landscape .cert .lvrow .lvtag { font-size: 1.8cqi; }
.cert-frame.is-landscape .cert .lvword { font-family: var(--font-display); font-weight: 600; font-size: 3.4cqi; color: var(--ink-2); letter-spacing: .01em; }
.cert-frame.is-landscape .cert .diamond { margin: 1.4cqi 0 1.2cqi; }
.cert-frame.is-landscape .cert .diamond::before, .cert-frame.is-landscape .cert .diamond::after { width: 10cqi; }
.cert-frame.is-landscape .cert .foot { width: 100%; gap: 2cqi; }
.cert-frame.is-landscape .cert .foot .cell { font-size: 1.75cqi; }
.cert-frame.is-landscape .cert .foot .cell .v { font-size: 1.95cqi; margin-top: .5cqi; }
.cert-frame.is-landscape .cert .foot .sign { font-size: 4.2cqi; }
.cert-frame.is-landscape .cert .ribbon { top: 3.4cqi; right: -7.6cqi; font-size: 1.85cqi; padding: .45em 3.4em; }

/* On a phone the certificate is ~340px wide; its smallest lines keep a readable floor rather
   than shrinking with the box (the layout has room for it at every width). */
.cert-frame.is-landscape .cert .org { font-size: max(1.9cqi, 7.5px); }
.cert-frame.is-landscape .cert .lvrow .lvtag { font-size: max(1.8cqi, 7.5px); }
.cert-frame.is-landscape .cert .foot .cell { font-size: max(1.75cqi, 7.5px); }
.cert-frame.is-landscape .cert .foot .cell .v { font-size: max(1.95cqi, 8px); }
.cert-frame.is-landscape .cert .ribbon { font-size: max(1.85cqi, 7px); }
.cert-frame.is-landscape .cert .cert-locktag { font-size: max(1.9cqi, 8px); }

/* After payment: the "preparing your credential" list (IPSB success.php kept these rules inline). */
@keyframes wpsb-spin { to { transform: rotate(360deg); } }
#stage-prep .dl-status { position: relative; margin-left: auto; width: 1.2rem; height: 1.2rem; flex: none; display: inline-block; }
#stage-prep .dl-status .tick { position: absolute; inset: 0; margin: auto !important; line-height: 1.2rem; }
#stage-prep .dl-status .spin { position: absolute; inset: 0; margin: auto; width: 1.05rem; height: 1.05rem; border: 2px solid var(--line-2); border-top-color: var(--brass); border-radius: 50%; opacity: 0; transition: opacity .25s ease; box-sizing: border-box; }
#stage-prep .deliver li.is-active { opacity: 1; }
#stage-prep .deliver li.is-active .dl-status .spin { opacity: 1; animation: wpsb-spin .7s linear infinite; }
#stage-prep .deliver li.is-done .dl-status .spin { opacity: 0; animation: none; }
