/* ============================================================
   Sample-project video cards ("proof of work") — index.html and the
   CCTV / Biometrics / Automatic Gates service pages.

   Nothing here loads a video. A card shows only a small poster image
   (natively lazy-loaded); the video file is requested when a visitor
   presses play — see js/projects.js.
============================================================ */
.pj-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; max-width: 840px; margin: 0 auto;
}
.pj-card {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}

/* --- media: fixed 9:16 box so the page never jumps when the video loads --- */
.pj-media { position: relative; aspect-ratio: 464 / 832; background: #000; overflow: hidden; }
.pj-play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; margin: 0; background: #000; cursor: pointer; display: block; color: #fff;
}
.pj-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-play::after { /* soft fade so the play badge and duration stay readable on any poster */
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent); pointer-events: none;
}
.pj-play-icon {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  border-radius: 50%; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.85);
  transition: transform .18s ease, background .18s ease;
}
.pj-play-icon::before { /* play triangle, drawn in CSS (no icon font / emoji) */
  content: ""; position: absolute; left: 22px; top: 16px;
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.pj-play:hover .pj-play-icon, .pj-play:focus-visible .pj-play-icon { transform: scale(1.1); background: rgba(143,199,38,.85); }
.pj-play:focus-visible { outline: 3px solid var(--orange, #8fc726); outline-offset: -3px; }
.pj-dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 1; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.7); color: #fff; padding: 2px 7px; border-radius: 4px; letter-spacing: .3px;
}
.pj-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* spinner while the file is being fetched after the visitor pressed play */
.pj-media.pj-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 2; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 4px solid rgba(255,255,255,.25); border-top-color: var(--orange, #8fc726); border-radius: 50%;
  animation: pj-spin .8s linear infinite;
}
@keyframes pj-spin { to { transform: rotate(360deg); } }
.pj-msg { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; text-align: center; font-size: 11px;
  background: rgba(0,0,0,.8); color: #fff; padding: 6px 8px; border-radius: 6px; }

/* --- text --- */
.pj-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pj-tag {
  align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  color: var(--orange, #8fc726); border: 1px solid rgba(143,199,38,.4); border-radius: 999px; padding: 2px 9px;
}
.pj-body h3 { font-family: var(--font-display, inherit); font-size: 15px; font-weight: 700; color: var(--white, #fff); line-height: 1.3; margin: 2px 0 0; }
.pj-body p { font-size: 12px; color: var(--grey, #999); line-height: 1.55; margin: 0; }
.pj-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.pj-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 11px; font-weight: 700; padding: 8px 12px; border-radius: 999px; line-height: 1;
  color: #0b0b0b; background: var(--orange, #8fc726); transition: transform .15s ease, filter .15s ease;
}
.pj-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pj-btn--wa { background: #25D366; }
.pj-btn--ghost { background: transparent; color: var(--light, #ccc); border: 1px solid var(--border, rgba(255,255,255,.18)); }

/* --- single-card row layout for the service pages --- */
.pj-feature { max-width: 720px; margin: 18px auto 0; }
.pj-feature-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--grey, #999); text-align: center; margin-bottom: 8px; }
.pj-card--row { flex-direction: row; }
.pj-card--row .pj-media { width: 240px; flex-shrink: 0; }
.pj-card--row .pj-body { padding: 18px; justify-content: center; }
.pj-card--row .pj-body h3 { font-size: 17px; }
.pj-card--row .pj-body p { font-size: 13px; }
.pj-card--row .pj-actions { margin-top: 0; padding-top: 14px; }

/* --- phones: swipeable row so three tall cards don't push the page down --- */
@media (max-width: 720px) {
  .pj-grid {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 2px 16px 10px; margin: 0 -16px; max-width: none; -webkit-overflow-scrolling: touch;
  }
  .pj-grid .pj-card { flex: 0 0 74%; max-width: 290px; scroll-snap-align: center; }
  .pj-card--row { flex-direction: column; max-width: 300px; margin: 0 auto; }
  .pj-card--row .pj-media { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pj-play-icon, .pj-btn { transition: none; }
  .pj-media.pj-loading::after { animation-duration: 2s; }
}
