/* Certifications page (certificate cards and full-screen viewer). Loaded only on this page.
*/

  /* ================= Certifications page ================= */
  .certs-sec { padding-block: clamp(56px, 6.4vw, 118px) clamp(64px, 7vw, 130px); }
  .certs-top { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 80px); align-items: end; }
  .certs-top p { margin: 0; font-size: clamp(14.5px, 1.05vw, 17.5px); line-height: 1.95; color: #1f2622; max-width: 44em; }

  .cgrid { list-style: none; margin: clamp(32px, 3.6vw, 64px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 28px); }
  .ccard { min-width: 0; }
  .cbtn {
    position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--card); border-radius: 10px; overflow: hidden; text-align: left;
    padding: clamp(12px, 1.2vw, 20px) clamp(12px, 1.2vw, 20px) 0;
    transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, background .3s ease;
  }
  .cpaper {
    position: relative; display: block; aspect-ratio: 210 / 297; background: #fff; border-radius: 3px; overflow: hidden;
    box-shadow: 0 10px 22px -12px rgba(10,30,20,.45), 0 0 0 1px rgba(0,0,0,.06);
  }
  .cpaper img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
  .cpaper::after {          /* green wash + magnifier on hover */
    content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,81,42,.0) 40%, rgba(8,81,42,.55) 100%); opacity: 0; transition: opacity .4s ease;
  }
  .czoom {
    position: absolute; z-index: 2; right: 12px; top: 12px; width: 42px; height: 42px; border-radius: 50%; background: var(--orange);
    display: grid; place-items: center; opacity: 0; transform: scale(.5) rotate(-45deg);
    transition: opacity .3s ease, transform .45s cubic-bezier(.2,.9,.3,1.3);
  }
  .czoom svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
  .cmeta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 2px 18px; }
  .cmeta b { display: block; font-size: clamp(15px, 1.1vw, 18px); font-weight: 600; line-height: 1.3; }
  .cmeta span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
  .cnum { flex: none; font-size: clamp(20px, 1.6vw, 28px); font-weight: 700; color: #b4bab6; font-variant-numeric: tabular-nums; transition: color .3s ease; }
  .cbtn:hover, .cbtn:focus-visible { transform: translateY(-8px); box-shadow: 0 26px 38px -22px rgba(8,40,22,.65); background: #e3ece6; }
  .cbtn:hover .cpaper img, .cbtn:focus-visible .cpaper img { transform: scale(1.05); }
  .cbtn:hover .cpaper::after, .cbtn:focus-visible .cpaper::after { opacity: 1; }
  .cbtn:hover .czoom, .cbtn:focus-visible .czoom { opacity: 1; transform: scale(1) rotate(0); }
  .cbtn:hover .cnum, .cbtn:focus-visible .cnum { color: var(--green); }

  /* ---------- Full-screen viewer ---------- */
  .lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(5,10,8,.94); animation: lbIn .25s ease both; }
  .lb[hidden] { display: none; }
  .lb figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 94vw; }
  .lb img { display: block; aspect-ratio: 210 / 297; height: min(calc(100vh - 110px), calc(92vw * 297 / 210)); width: auto; object-fit: contain; background: #fff; border-radius: 3px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: lbPop .35s cubic-bezier(.2,.8,.3,1) both; }
  .lb figcaption { color: #fff; font-size: 14.5px; font-weight: 600; letter-spacing: .02em; text-align: center; }
  .lb figcaption em { font-style: normal; color: rgba(255,255,255,.65); font-weight: 500; margin-left: 10px; }
  .lb-btn {
    position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: rgba(10,16,13,.5); color: #fff;
    display: grid; place-items: center; transition: background .2s ease, border-color .2s ease, transform .25s ease;
  }
  .lb-btn:hover { background: var(--green); border-color: var(--green); }
  .lb-btn svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .lb-x { top: 18px; right: 18px; } .lb-x:hover { transform: rotate(90deg); }
  .lb-prev { left: 18px; top: 50%; margin-top: -26px; }
  .lb-next { right: 18px; top: 50%; margin-top: -26px; }
  body.lb-open { overflow: hidden; }
  @keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes lbPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

  @media (max-width: 1020px) {
    .phero-in { padding-top: 150px; }
    .certs-top { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 640px) {
    .phero { min-height: 400px; }
    .phero .panel h1 { font-size: clamp(30px, 9vw, 44px); }
    .lb-btn { width: 44px; height: 44px; }
    .lb-prev { left: 8px; } .lb-next { right: 8px; } .lb-x { top: 10px; right: 10px; }
  }
  @media (max-width: 420px) { .cgrid { grid-template-columns: minmax(0, 1fr); max-width: 340px; margin-inline: auto; } }
  @media (hover: none) { .czoom { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) {
    .phero-bg img, .phero .panel, .phero .panel .rule, .phero .panel .edge, .lb, .lb img { animation: none !important; }
    .phero .panel .rule { transform: translateY(-100%); } .phero .panel .edge { transform: none; }
    .cbtn, .cpaper img, .czoom, .lb-btn { transition: none; }
  }
