/* #########################################################
   PAGE: Certificates & Approvals  —  html.pg-certs
   ######################################################### */
/* =========================================================
   Travel Point – certificates grid (images + PDFs), filter chips, "approved by" strip and the viewer
   Loaded after common.css + inner.css (hero, breadcrumbs, .btn--line).
   ========================================================= */

/* Hero numbers */
:where(.pg-certs) .cstats{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(14px, 1.6vw, 26px); }
:where(.pg-certs) .cstats li{ display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 40px; background: #fff; box-shadow: 0 4px 14px rgba(18, 48, 46, .08); font-size: 13px; color: #33403f; }
:where(.pg-certs) .cstats b{ font-family: var(--serif); font-size: 20px; color: var(--heading); line-height: 1; }
:where(.pg-certs) .cstats i{ color: var(--gold-2); }

/* =========================================================
   GRID
   ========================================================= */
:where(.pg-certs) .certs{ position: relative; background: linear-gradient(180deg, #fff 0%, #fbf8f2 100%); padding: clamp(14px, 1.6vw, 30px) 0 clamp(40px, 4.4vw, 80px); }
:where(.pg-certs) .certs::before{
  content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 96px; opacity: .05; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 14%, transparent 86%, #000 100%); mask-image: linear-gradient(90deg, #000 0%, transparent 14%, transparent 86%, #000 100%);
}

:where(.pg-certs) .cchips{ position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: clamp(20px, 2vw, 36px); }
:where(.pg-certs) .cchip{
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 40px; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500; color: #33403f; background: #fff; border: 1.5px solid var(--line); transition: background .2s, color .2s, border-color .2s;
}
:where(.pg-certs) .cchip b{ min-width: 22px; padding: 1px 7px; border-radius: 20px; font-size: 11.5px; background: #f6f1e6; color: var(--heading); }
:where(.pg-certs) .cchip:hover{ border-color: var(--gold); color: var(--heading); }
:where(.pg-certs) .cchip.is-active{ background: var(--teal-800); border-color: var(--teal-800); color: #fff; }
:where(.pg-certs) .cchip.is-active b{ background: var(--gold-mid); color: #1b2a2a; }

:where(.pg-certs) .cgrid{ position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 1.7vw, 30px); }
:where(.pg-certs) .ccert{ display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(18, 48, 46, .06); transition: transform .3s, box-shadow .3s; }
:where(.pg-certs) .ccert[hidden]{ display: none; }
:where(.pg-certs) .ccert:hover{ transform: translateY(-4px); box-shadow: 0 18px 40px rgba(18, 48, 46, .12); }
:where(.pg-certs) .ccert--featured{ border-color: #e9c98c; box-shadow: 0 12px 34px rgba(211, 162, 74, .18); }

:where(.pg-certs) .ccert__media{ position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f6f1e6; border-bottom: 1px solid var(--line); }
:where(.pg-certs) .ccert__media img{ width: 100%; height: 100%; object-fit: contain; padding: 12px; transition: transform .45s ease; }
:where(.pg-certs) .ccert:hover .ccert__media img{ transform: scale(1.04); }
:where(.pg-certs) .ccert__pdf{ position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #c0392b; background: repeating-linear-gradient(135deg, #fbf7ef 0 14px, #f7f0e2 14px 28px); }
:where(.pg-certs) .ccert__pdf i{ font-size: 54px; }
:where(.pg-certs) .ccert__pdf small{ font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8a5c22; }
:where(.pg-certs) .ccert__type, :where(.pg-certs) .ccert__star{ position: absolute; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
:where(.pg-certs) .ccert__type{ left: 12px; background: rgba(255, 255, 255, .92); color: var(--heading); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
:where(.pg-certs) .ccert__star{ right: 12px; background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-mid) 100%); color: #1b2a2a; }
:where(.pg-certs) .ccert__zoom{
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; color: #fff;
  background: rgba(1, 46, 48, .55); opacity: 0; transition: opacity .3s;
}
:where(.pg-certs) .ccert__media:hover .ccert__zoom, :where(.pg-certs) .ccert__media:focus-visible .ccert__zoom{ opacity: 1; }

:where(.pg-certs) .ccert__body{ display: flex; flex-direction: column; flex: 1; padding: clamp(16px, 1.4vw, 22px); }
:where(.pg-certs) .ccert__cat{ align-self: flex-start; margin-bottom: 8px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8a5c22; background: #fbf1dc; }
:where(.pg-certs) .ccert__title{ font-family: var(--serif); font-size: clamp(17px, 1.25vw, 20px); font-weight: 700; color: var(--heading); line-height: 1.25; }
:where(.pg-certs) .ccert__issuer{ margin-top: 6px; font-size: 13px; color: var(--muted); }
:where(.pg-certs) .ccert__issuer i{ color: var(--gold-2); margin-right: 4px; }
:where(.pg-certs) .ccert__meta{ display: grid; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
:where(.pg-certs) .ccert__meta li{ display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
:where(.pg-certs) .ccert__meta span{ color: #7c8786; }
:where(.pg-certs) .ccert__meta b{ font-weight: 600; color: #233131; text-align: right; word-break: break-word; }
:where(.pg-certs) .ccert__meta b.is-valid{ color: #1e8e3e; }
:where(.pg-certs) .ccert__meta b.is-expired{ color: #c0392b; }
:where(.pg-certs) .ccert__text{ margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: #4e5a5a; }
:where(.pg-certs) .ccert__actions{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 16px; }
:where(.pg-certs) .ccert__btn{ padding: 10px 12px; font-size: 13px; }

:where(.pg-certs) .certs__none{ text-align: center; color: var(--muted); padding: 30px 0; }
:where(.pg-certs) .certs__empty{ position: relative; max-width: 560px; margin: 10px auto; text-align: center; padding: clamp(30px, 3vw, 50px) 24px; background: #fff; border: 1px dashed #e0cfa6; border-radius: 18px; }
:where(.pg-certs) .certs__empty-ic{ display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: #fbf1dc; color: var(--gold-2); font-size: 30px; margin-bottom: 14px; }
:where(.pg-certs) .certs__empty h2{ font-family: var(--serif); color: var(--heading); font-size: 24px; }
:where(.pg-certs) .certs__empty p{ margin-top: 8px; color: var(--muted); font-size: 14.5px; }
:where(.pg-certs) .certs__empty a{ font-weight: 600; color: var(--teal-700); text-decoration: underline; }

/* Approved by strip */
:where(.pg-certs) .capproved{ background: #fbf8f2; padding: 0 0 clamp(40px, 4.4vw, 80px); }
:where(.pg-certs) .capproved__box{ background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 2vw, 34px); box-shadow: 0 10px 30px rgba(18, 48, 46, .05); }
:where(.pg-certs) .capproved__title{ display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: clamp(19px, 1.5vw, 25px); color: var(--heading); margin-bottom: 16px; }
:where(.pg-certs) .capproved__title i{ color: var(--gold-2); }
:where(.pg-certs) .capproved__box img{ width: 100%; height: auto; border-radius: 10px; }

/* =========================================================
   VIEWER
   ========================================================= */
:where(.pg-certs) .cview{ position: fixed; inset: 0; z-index: 400; background: rgba(3, 20, 20, .96); color: #fff; animation: cvFade .25s ease; }
:where(.pg-certs) .cview[hidden]{ display: none; }
@keyframes cvFade{ from{ opacity: 0; } to{ opacity: 1; } }
:where(.pg-certs) .cview__inner{ position: relative; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
:where(.pg-certs) .cview__bar{ display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(14px, 2vw, 30px); padding-top: calc(12px + var(--safe-t, 0px)); border-bottom: 1px solid rgba(255, 255, 255, .08); }
:where(.pg-certs) .cview__head{ min-width: 0; }
:where(.pg-certs) .cview__count{ font-size: 12px; letter-spacing: .08em; color: #9fb3b2; }
:where(.pg-certs) .cview__count b{ color: var(--gold-mid); }
:where(.pg-certs) .cview__title{ font-family: var(--serif); font-size: clamp(16px, 1.3vw, 21px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where(.pg-certs) .cview__sub{ font-size: 12.5px; color: #b8c7c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where(.pg-certs) .cview__sub:empty{ display: none; }
:where(.pg-certs) .cview__actions{ display: flex; gap: 6px; flex: none; }
:where(.pg-certs) .cview__act{
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06); color: #fff; font-size: 15px; cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
:where(.pg-certs) .cview__act:hover{ background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); }
:where(.pg-certs) .cview__close{ background: var(--gold-mid); border-color: var(--gold-mid); color: #1b2a2a; }
:where(.pg-certs) .cview__close:hover{ background: #ffe9b0; color: #1b2a2a; }
:where(.pg-certs) .cview.is-pdf [data-act="in"], :where(.pg-certs) .cview.is-pdf [data-act="out"], :where(.pg-certs) .cview.is-pdf [data-act="fit"]{ display: none; }

:where(.pg-certs) .cview__stage{ position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: clamp(10px, 2vw, 30px) clamp(10px, 6vw, 90px); touch-action: pan-y; }
:where(.pg-certs) .cview__img{ max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; transition: transform .2s ease; cursor: zoom-in; user-select: none; opacity: 0; }
:where(.pg-certs) .cview__stage.is-loaded .cview__img{ opacity: 1; }
:where(.pg-certs) .cview__stage.is-zoomed{ touch-action: none; }
:where(.pg-certs) .cview__stage.is-zoomed .cview__img{ cursor: grab; transition: none; }
:where(.pg-certs) .cview__spin{ position: absolute; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--gold-mid); animation: cvSpin .8s linear infinite; }
:where(.pg-certs) .cview__stage.is-loaded .cview__spin{ display: none; }
@keyframes cvSpin{ to{ transform: rotate(360deg); } }
:where(.pg-certs) .cview__pdf{ width: min(100%, 1100px); height: 100%; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
:where(.pg-certs) .cview__pdfcard{ display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; max-width: 420px; }
:where(.pg-certs) .cview__pdfcard img{ max-height: 46vh; border-radius: 8px; background: #fff; }
:where(.pg-certs) .cview__pdfcard > i{ font-size: 80px; color: #ff8a7a; }
:where(.pg-certs) .cview__pdfcard p{ font-family: var(--serif); font-size: 19px; }
:where(.pg-certs) .cview__pdfbtns{ display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

:where(.pg-certs) .cview__nav{
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(0, 0, 0, .35); color: #fff; font-size: 18px; cursor: pointer; transition: background .2s;
}
:where(.pg-certs) .cview__nav:hover{ background: var(--gold-2); border-color: var(--gold-2); }
:where(.pg-certs) .cview__nav--prev{ left: clamp(8px, 1.6vw, 24px); }
:where(.pg-certs) .cview__nav--next{ right: clamp(8px, 1.6vw, 24px); }
:where(.pg-certs) .cview__nav[hidden]{ display: none; }

:where(.pg-certs) .cview__thumbs{ display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding: 12px clamp(14px, 2vw, 30px); padding-bottom: calc(12px + var(--safe-b, 0px)); border-top: 1px solid rgba(255, 255, 255, .08); scrollbar-width: thin; }
:where(.pg-certs) .cview__thumbs[hidden]{ display: none; }
:where(.pg-certs) .cview__thumb{ flex: none; width: 64px; height: 50px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; border: 2px solid transparent; background: rgba(255, 255, 255, .08); color: #ff8a7a; font-size: 20px; cursor: pointer; opacity: .6; transition: opacity .2s, border-color .2s; }
:where(.pg-certs) .cview__thumb img{ width: 100%; height: 100%; object-fit: cover; background: #fff; }
:where(.pg-certs) .cview__thumb:hover{ opacity: 1; }
:where(.pg-certs) .cview__thumb.is-active{ opacity: 1; border-color: var(--gold-mid); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 700px){
  :where(.pg-certs) .cview__bar{ flex-wrap: wrap; }
  :where(.pg-certs) .cview__head{ flex: 1 1 100%; }
  :where(.pg-certs) .cview__actions{ width: 100%; justify-content: flex-end; }
  :where(.pg-certs) .cview__act{ width: 38px; height: 38px; }
  :where(.pg-certs) [data-act="full"]{ display: none; }
  :where(.pg-certs) .cview__stage{ padding: 10px; }
  :where(.pg-certs) .cview__nav{ width: 38px; height: 38px; font-size: 15px; background: rgba(0, 0, 0, .5); }
  :where(.pg-certs) .cview__thumbs{ justify-content: flex-start; }
}
@media (max-width: 420px){
  :where(.pg-certs) .ccert__actions{ grid-template-columns: 1fr; }
}
