/* Premier — Awards rotating grid ([pm_awards], paired with
   assets/js/awards-rotator.js). Loaded on demand: only pages running the
   shortcode enqueue it, so it stays out of the always-on bundle.

   Tokens are scoped to .pm-awd so nothing leaks into the theme. Media queries
   stay in this file (not responsive/) — self-contained widget, same reasoning
   as reviews.css and solutions-rotator.css.

   Stage height, padding and image rules deliberately differ from the services
   widget (.pm-sol): these cells hold badge art on a fixed-height stage, not
   autosized text. Section background + outer padding stay with Elementor. */

.pm-awd{
  --pm-hairline: rgba(249, 247, 250, 0.16);

  --pm-space-s: clamp(16px, 1.7vw, 24px);       /* card horizontal padding */
  --pm-space-xl: clamp(28px, 3.2vw, 40px);      /* card vertical padding */
  --pm-media-h: 72px;                           /* badge height, drives card height */

  --pm-card-w: 349px;
  --pm-cols: 4;
  --pm-cap: calc(var(--pm-card-w) * var(--pm-cols));

  --pm-swap-duration: 550ms;
  --pm-swap-travel: 24px;
  --pm-swap-ease: cubic-bezier(0.33, 0, 0.2, 1);

  width: 100%;
  max-width: min(100%, var(--pm-cap));
  margin-inline: auto;
}

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

/* Hairlines: wrapper draws the outer top + left, each cell draws its right +
   bottom. Uniform 1px lattice with no doubled lines where cells meet. */
.pm-awd__grid{
  display: grid;
  grid-template-columns: repeat(var(--pm-cols), minmax(0, 1fr));
  border-top: 1px solid var(--pm-hairline);
  border-left: 1px solid var(--pm-hairline);
}

.pm-awd__cell{
  padding: var(--pm-space-xl) var(--pm-space-s);
  border-right: 1px solid var(--pm-hairline);
  border-bottom: 1px solid var(--pm-hairline);
  min-width: 0;
}

/* Fixed-height stage so badges of different aspect ratios sit on a common
   height and the card never resizes mid-swap. overflow:hidden is a hard stop
   in case anything still escapes. */
.pm-awd__stage{
  position: relative;
  height: var(--pm-media-h);
  overflow: hidden;
}

.pm-awd__item{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

/* Definite box + object-fit rather than auto sizing. An SVG carrying only a
   viewBox has no intrinsic size, and auto/auto falls back to 300x150.
   !important because WP themes commonly ship blanket `img { width: auto;
   height: auto }` rules that win on cascade.
   --s is an optional per-badge scale (see pm_awards_badges()). */
.pm-awd .pm-awd__img{
  display: block !important;
  width: calc(100% * var(--s, 1)) !important;
  height: calc(100% * var(--s, 1)) !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}

.pm-awd__item--enter{
  animation: pm-awd-in var(--pm-swap-duration) var(--pm-swap-ease) both;
}
.pm-awd__item--exit{
  animation: pm-awd-out var(--pm-swap-duration) var(--pm-swap-ease) both;
  pointer-events: none;
}

@keyframes pm-awd-in{
  from{ opacity: 0; transform: translate3d(0, var(--pm-swap-travel), 0); }
  to{ opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes pm-awd-out{
  from{ opacity: 1; transform: translate3d(0, 0, 0); }
  to{ opacity: 0; transform: translate3d(0, calc(var(--pm-swap-travel) * -1), 0); }
}

.pm-awd__sr{
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ----------
   Column count has to divide the cell count evenly or the last row is ragged. */
@media (max-width: 1024px){
  .pm-awd{
    --pm-cols: 2;
    --pm-media-h: 60px;
    --pm-space-xl: clamp(24px, 3vw, 32px);
  }
}

@media (max-width: 600px){
  .pm-awd{
    --pm-cap: 100%;
    --pm-media-h: 46px;
    --pm-space-xl: 22px;
    --pm-space-s: 12px;
  }
}

@media (prefers-reduced-motion: reduce){
  .pm-awd__item--enter,
  .pm-awd__item--exit{ animation: none; }
  .pm-awd__item--exit{ display: none; }
}
