/* ---------------------------------------------------------------------------
   Prime Tech — portfolio cards
   ---------------------------------------------------------------------------
   Kept in its own file so the template's style.css stays pristine.

   The template's own project card (.case-block) hides everything behind a
   hover overlay. That is wrong for this page: the point is to show the
   software, and a hover overlay shows nothing on a phone and nothing at a
   glance on desktop. These cards are always readable, image on top, detail
   below, so a visitor scanning the grid can see what each system actually is.
--------------------------------------------------------------------------- */

.pt-projects {
  margin-top: 10px;
}

/* The column must be a flex container for the card inside it to stretch to the
   tallest card on its row; without this, cards end ragged and the bottom-pinned
   demo buttons do not line up. */
.pt-item {
  display: flex;
  margin-bottom: 30px;
}

.pt-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e8ecf3;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 300ms ease, transform 300ms ease;
}

.pt-card:hover {
  box-shadow: 0 18px 40px rgba(20, 32, 63, 0.13);
  transform: translateY(-4px);
}

/* ---- image ---------------------------------------------------------------- */

.pt-card-media {
  display: block;
  position: relative;
  background: #f2f5fa;
  /* Fixed ratio keeps the grid tidy whatever the screenshot dimensions are. */
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.pt-card-media img {
  width: 100%;
  height: 100%;
  /* top, not center: screenshots are most recognisable from their header. */
  object-fit: cover;
  object-position: top center;
  transition: transform 500ms ease;
}

.pt-card:hover .pt-card-media img {
  transform: scale(1.04);
}

/* Fallback for browsers without aspect-ratio (older Safari). */
@supports not (aspect-ratio: 4 / 3) {
  .pt-card-media { height: 0; padding-bottom: 75%; }
  .pt-card-media img { position: absolute; top: 0; left: 0; }
}

/* ---- body ----------------------------------------------------------------- */

.pt-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 24px 24px 26px;
}

.pt-card-title {
  margin: 0;
  color: #14203f;
  font-size: 19px;
  line-height: 1.35em;
  font-weight: 700;
}

/* Attribution is deliberately quiet — the system is the headline, not the brand. */
.pt-card-client {
  margin-top: 4px;
  color: #8791a6;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pt-card-cat {
  margin-top: 10px;
  color: #0060ff;
  font-size: 13px;
  font-weight: 600;
}

.pt-card-summary {
  margin: 12px 0 0;
  color: #5a6478;
  font-size: 14.5px;
  line-height: 1.65em;
}

/* ---- what was built ------------------------------------------------------- */

.pt-card-modules {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.pt-card-modules li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 5px;
  color: #45506b;
  font-size: 13.5px;
  line-height: 1.5em;
}

.pt-card-modules li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0060ff;
  opacity: .55;
}

/* ---- stack chips ---------------------------------------------------------- */

.pt-card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.pt-card-stack span {
  padding: 4px 10px;
  border: 1px solid #dde3ee;
  border-radius: 3px;
  background: #f7f9fc;
  color: #56617a;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---- demo button ---------------------------------------------------------- */

.pt-card-demo {
  align-self: flex-start;
  /* margin-top:auto pins it to the bottom so buttons line up across the row. */
  margin-top: auto;
  padding: 9px 22px;
  border-radius: 3px;
  background: #0060ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  transition: background 300ms ease;
}

/* Only add the gap when a button is actually present. */
.pt-card-demo:not(:first-child) {
  margin-top: 20px;
}

.pt-card-demo:hover {
  background: #14203f;
  color: #ffffff;
}

/* ---- filtering ------------------------------------------------------------ */
/* Cards are visible by default and hidden by class, so if JavaScript fails the
   portfolio still renders rather than showing an empty grid. */

.pt-item.pt-hidden {
  display: none;
}

.filter-tabs li.filter {
  cursor: pointer;
}

/* ---- RTL ------------------------------------------------------------------ */

html[lang="ar"] .pt-card-body {
  text-align: right;
  direction: rtl;
}

html[lang="ar"] .pt-card-modules li {
  padding-left: 0;
  padding-right: 18px;
}

html[lang="ar"] .pt-card-modules li:before {
  left: auto;
  right: 0;
}

html[lang="ar"] .pt-card-demo {
  align-self: flex-end;
}

/* ---- small screens -------------------------------------------------------- */

@media only screen and (max-width: 767px) {
  .pt-card-body { padding: 20px 20px 22px; }
  .pt-card-title { font-size: 17.5px; }
}

/* ---- lightbox (js/lightbox.js — replaces the GPL fancyBox) ---------------- */

.pt-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5vh 4vw;
  background: rgba(12, 17, 33, 0.92);
}

.pt-lb.is-open { display: flex; }

.pt-lb-stage {
  margin: 0;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.pt-lb-stage img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

.pt-lb-stage figcaption {
  color: #e6e9f2;
  font-size: 15px;
  text-align: center;
}

.pt-lb-close,
.pt-lb-nav {
  background: none;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 200ms ease;
}

.pt-lb-close:hover,
.pt-lb-nav:hover,
.pt-lb-close:focus-visible,
.pt-lb-nav:focus-visible { opacity: 1; }

.pt-lb-close {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 40px;
}

.pt-lb-nav { font-size: 54px; padding: 0 10px; }
.pt-lb-nav[hidden] { display: none; }

@media only screen and (max-width: 767px) {
  .pt-lb { padding: 6vh 2vw; }
  .pt-lb-nav { font-size: 38px; }
}

/* ---- ready-made package cross-link ----------------------------------------
   Shown only on cards whose project carries a `product` in data/projects.js.
   Deliberately a quiet text link and NOT a price: this page sells custom
   capability, and a number here would anchor clients low on bespoke work.
--------------------------------------------------------------------------- */

.pt-card-package {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #2f7df6;
}

.pt-card-package:hover { text-decoration: underline; }
