/* Webdoid verified-credential cards: 3D tilt, float, light sweep + certificate viewer.
   Used in the homepage hero, the DSC page hero and the About page. */

.wd-cred-dock {
  --wd-cred-gap: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wd-cred-gap);
  margin-top: 44px;
  perspective: 1100px;
  perspective-origin: 50% 0%;
  position: relative;
  z-index: 2;
}

.wd-cred-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 -2px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}
.wd-cred-heading i { color: #22c55e; font-size: 14px; }
.wd-cred-dock.is-light .wd-cred-heading { color: #475569; }

.wd-cred-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
  font: inherit;
  color: #0f172a;
  background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: 16px;
  cursor: zoom-in;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 18px 40px -14px rgba(2, 6, 23, .6),
    0 0 0 1px rgba(226, 232, 240, .9);
  transition: transform 420ms cubic-bezier(.23, 1, .32, 1), box-shadow 300ms ease;
  will-change: transform;
}
.wd-cred-card:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}
.wd-cred-card.is-tilting { transition: transform 90ms linear, box-shadow 300ms ease; }
.wd-cred-card:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 28px 55px -16px rgba(2, 6, 23, .7),
    0 0 0 1px rgba(245, 158, 11, .55);
}

/* Idle float lives on a wrapper so it never fights the pointer tilt. */
.wd-cred-float { animation: wdCredFloat 6s ease-in-out infinite; transform-style: preserve-3d; }
.wd-cred-float:nth-of-type(odd) { animation-delay: -3s; }
@keyframes wdCredFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(4deg) rotateY(-5deg); }
  50%      { transform: translate3d(0, -8px, 0) rotateX(1deg) rotateY(5deg); }
}

.wd-cred-paper {
  position: relative;
  margin: 10px 10px 0;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 4 / 3;
  transform: translateZ(28px);
  box-shadow: 0 10px 22px -10px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .08);
}
.wd-cred-paper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  aspect-ratio: auto;
}

/* Moving light sweep that follows the pointer */
.wd-cred-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.wd-cred-card:hover .wd-cred-paper::after { opacity: 1; }

/* One-time diagonal shine as the cards arrive */
.wd-cred-paper::before {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .75) 50%, transparent 60%);
  transform: translateX(-70%);
  animation: wdCredSweep 2.4s cubic-bezier(.23, 1, .32, 1) .8s 1 both;
  pointer-events: none;
  z-index: 1;
}
@keyframes wdCredSweep { to { transform: translateX(70%); } }

.wd-cred-seal {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 6px 14px -6px rgba(22, 163, 74, .9);
  transform: translateZ(14px);
}
.wd-cred-seal.is-gold { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 6px 14px -6px rgba(217, 119, 6, .9); }

.wd-cred-meta {
  display: block;
  padding: 10px 12px 12px;
  transform: translateZ(18px);
}
.wd-cred-meta strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}
.wd-cred-meta small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #475569;
}
.wd-cred-meta .wd-cred-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #c2410c;
}

/* In a hero the cards sit under the showcase image, so keep them short */
@media (min-width: 992px) {
  .wd-cred-dock:not(.is-wide) .wd-cred-paper { aspect-ratio: 16 / 9; }
}

/* Wide variant used inside page bodies (About page) */
.wd-cred-dock.is-wide { margin-top: 0; gap: 24px; max-width: 880px; margin-inline: auto; }
.wd-cred-dock.is-wide .wd-cred-meta strong { font-size: 16px; }
.wd-cred-dock.is-wide .wd-cred-meta small { font-size: 13px; }

@media (max-width: 575.98px) {
  .wd-cred-dock { --wd-cred-gap: 10px; margin-top: 40px; }
  .wd-cred-paper { margin: 7px 7px 0; }
  .wd-cred-meta { padding: 8px 9px 10px; }
  .wd-cred-meta strong { font-size: 12px; }
  .wd-cred-meta small { font-size: 10.5px; }
  .wd-cred-seal { font-size: 9.5px; padding: 2px 6px; }
}

/* ---------- Certificate viewer ---------- */
.wd-cred-viewer {
  border: 0;
  padding: 0;
  max-width: min(960px, 94vw);
  width: 100%;
  max-height: 92vh;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .65);
  overflow: hidden;
}
.wd-cred-viewer::backdrop { background: rgba(2, 6, 23, .78); backdrop-filter: blur(4px); }
.wd-cred-viewer[open] { animation: wdCredPop 320ms cubic-bezier(.23, 1, .32, 1); }
@keyframes wdCredPop {
  from { opacity: 0; transform: perspective(1200px) rotateX(10deg) translateY(18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.wd-cred-viewer-inner { display: flex; flex-direction: column; max-height: 92vh; }
.wd-cred-viewer-img { overflow: auto; background: #e2e8f0; padding: 12px; }
.wd-cred-viewer-img img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .4); }
.wd-cred-viewer-body { padding: 14px 18px 16px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.wd-cred-viewer-body h3 { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.wd-cred-viewer-body p { font-size: 13.5px; color: #475569; margin: 0; line-height: 1.5; }
.wd-cred-viewer-close {
  flex: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.wd-cred-viewer-close:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .wd-cred-float,
  .wd-cred-paper::before,
  .wd-cred-viewer[open] { animation: none; }
  .wd-cred-card { transition: box-shadow 200ms ease; transform: none; }
}
