/* ==========================================================================
   Products page (products.html)

   Product gallery as a 3D card grid. Everything is scoped under .pr so it
   cannot leak into the shared site header and footer, and so the legacy
   #gallery / .one_fifth rules in style-new.css and framework.css no longer
   apply to this section.
   ========================================================================== */

.pr {
  --pr-navy: #06274b;
  --pr-navy2: #0b3a70;
  --pr-red: #df1d2f;
  --pr-ink: #0d2340;
  --pr-muted: #66788f;
  --pr-line: #dce4ee;
  --pr-soft: #f4f7fb;

  padding: 20px 0 34px;
  color: var(--pr-ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.pr *,
.pr *::before,
.pr *::after {
  box-sizing: border-box;
}

/* style.css capitalizes and recolours every bare h1-h6 and points them at a
   font that is not loaded on this site. Pin both here. */
.pr h1,
.pr h2 {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--pr-navy);
  font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-transform: none;
}

.pr-wrap {
  width: min(1180px, 94%);
  margin: 0 auto;
}

/* style.css gives #container 50px of padding top and bottom, which stacked on
   top of this section's own padding left a large gap under the banner. This
   sheet is only loaded by products.html, so trimming it here affects no other
   page. */
#container {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* ==========================================================================
   Section head
   ========================================================================== */

.pr-head {
  margin-bottom: 24px;
  text-align: center;
}

.pr-head__kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 4px solid var(--pr-red);
  color: var(--pr-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.pr h1 {
  font-size: clamp(26px, 3.4vw, 38px);
}

.pr-head p {
  max-width: 660px;
  margin: 14px auto 0;
  color: var(--pr-muted);
}

/* ==========================================================================
   Grid

   Perspective is deliberately NOT set here. A shared perspective puts its
   vanishing point at the centre of the whole grid, which on a one-column
   phone layout is thousands of pixels from most cards - any translateZ then
   throws the card body far off its own box. Each card carries its own
   perspective instead, so the vanishing point is always its own centre.
   ========================================================================== */

.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Card
   --rx / --ry are written by the pointer-tilt script; they default to 0 so
   the card is a plain lift without JavaScript.
   ========================================================================== */

.pr-card {
  --rx: 0deg;
  --ry: 0deg;

  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--pr-line);
  border-radius: 12px;
  transform-style: preserve-3d;
  transform: perspective(1400px) rotateX(var(--rx)) rotateY(var(--ry));
  /* Two hard-edged offsets give the card a visible thickness - that is what
     reads as 3D at rest - and a small soft shadow underneath is the light it
     casts. Keeping the blur tight stops the grid looking hazy. */
  box-shadow:
    0 3px 0 -1px #e7eef7,
    0 5px 0 -2px #d5e1ef,
    0 4px 8px rgba(6, 39, 75, 0.10),
    0 1px 2px rgba(6, 39, 75, 0.06);
  transition:
    transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
  will-change: transform;
}

/* Lifting the card thickens the edge and drops the cast shadow further. */
.pr-card:hover,
.pr-card:focus-within {
  border-color: rgba(11, 58, 112, 0.35);
  box-shadow:
    0 5px 0 -1px #e2eaf4,
    0 9px 0 -2px #c9d8e9,
    0 16px 24px rgba(6, 39, 75, 0.16),
    0 4px 8px rgba(6, 39, 75, 0.08);
}

/* The lift is a separate translate so the pointer tilt can drive rotation
   without fighting it. */
.pr-card:hover {
  transform:
    perspective(1400px) translateY(-10px) scale(1.015)
    rotateX(var(--rx)) rotateY(var(--ry));
}

/* --- media --- */

.pr-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 11px 11px 0 0;
  background: var(--pr-soft);
  transform: translateZ(0);
}

.pr-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pr-card:hover .pr-card__media img {
  transform: scale(1.07);
}

/* A soft sheen that sweeps the image on hover - reads as depth without
   adding another element to every card. */
.pr-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
      rgba(255, 255, 255, 0) 38%,
      rgba(255, 255, 255, 0.34) 50%,
      rgba(255, 255, 255, 0) 62%);
  transform: translateX(-120%);
  transition: transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}

.pr-card:hover .pr-card__media::after {
  transform: translateX(120%);
}

/* --- zoom affordance --- */

.pr-card__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 39, 75, 0.82);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.pr-card:hover .pr-card__zoom,
.pr-card__media:focus-visible .pr-card__zoom {
  opacity: 1;
  transform: none;
}

.pr-card__media:hover .pr-card__zoom {
  background: var(--pr-red);
}

/* --- body --- */

.pr-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 20px 20px;
  /* Lifts slightly off the card face so the tilt reads as depth */
  transform: translateZ(22px);
}

.pr .pr-card__title {
  margin-bottom: 14px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
}

.pr .pr-card__title a {
  color: var(--pr-navy);
  text-decoration: none;
}

.pr-card:hover .pr-card__title a {
  color: var(--pr-navy2);
}

.pr-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--pr-red);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.pr-card__cta i {
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pr-card:hover .pr-card__cta i {
  transform: translateX(5px);
}

/* Accent rule that grows along the bottom of the card on hover */
.pr-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--pr-navy2), var(--pr-red));
  border-radius: 0 0 0 11px;
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pr-card:hover::after {
  width: 100%;
  border-radius: 0 0 11px 11px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 1080px) {
  .pr-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}

@media screen and (max-width: 820px) {
  .pr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 480px) {
  .pr {
    padding: 32px 0 42px;
  }

  .pr-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Touch devices get no tilt and no hover lift - it only ever fires as a
   sticky state after a tap. */
@media (hover: none) {
  .pr-card:hover {
    transform: none;
  }

  .pr-card__zoom {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pr-card,
  .pr-card__media img,
  .pr-card__media::after,
  .pr-card__zoom,
  .pr-card__cta i,
  .pr-card::after {
    transition: none !important;
  }

  .pr-card:hover {
    transform: none;
  }

  .pr-card:hover .pr-card__media img {
    transform: none;
  }
}
