/***** POST GRID *****/

.pg-grid {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}

.pg-grid::-webkit-scrollbar {
  display: none;
}

@media (min-width: 720px) {
  .pg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
}

@media (min-width: 1040px) {
  .pg-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pg-card {
  min-height: 450px;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  flex: 0 0 100%;
  scroll-snap-align: start;
}

@media (min-width: 720px) {
  .pg-card {
    flex: initial;
  }
}

.pg-inner {
  padding: 30px 35px;
  position: relative;
  z-index: 2;
}

span.pg-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: transparent;
  color: #f04b23;
  font-weight: 500;
  padding: 3px 12px;
  font-size: 16px;
  border: 1px solid #f04b23;
  margin-top: 15px;
}

.pg-cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

h3.pg-title {
  font-size: 28px;
  line-height: 125%;
  color: #1e1645;
  margin-top: 0 !important;
}

.pg-card--image h3 {
  margin-bottom: 25px;
}

.pg-date {
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 15px;
}

p.pg-excerpt {
  line-height: 1.6;
  font-size: 16px;
}

/* Image card variant */

.pg-card--image {
  background-size: cover;
  background-position: center;
  min-height: 450px;
}

.kb-button {
  background: var(--global-palette-btn-bg);
  color: var(--global-palette-btn);
}
.kb-button:hover {
  background: var(--global-palette-btn-bg-hover);
  color: var(--global-palette-btn-hover);
}


/* --- Make CTA stick to the bottom of the card --- */

/* Turn the whole card into a vertical flex container */
.pg-card {
  display: flex;               /* was block */
  flex-direction: column;
}

/* Keep the thumb predictable and non-flexing */
.pg-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;        /* use a fixed ratio; change if you prefer */
  object-fit: cover;           /* crops nicely */
  flex: 0 0 auto;              /* don't let it stretch/compress */
}

/* Content column should consume the remaining height */
.pg-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;              /* fill available space below the image */
  min-height: 0;               /* allow shrinking in Firefox/Safari */
}

/* Push the CTA to the bottom of the card.
   Use higher specificity than the existing `span.pg-cta` rule. */
.pg-inner .pg-cta {
  margin-top: auto;            /* takes all remaining vertical space above */
  align-self: flex-start;      /* keep it left-aligned */
}

/* Optional: keep the rule above the CTA but don't force extra space */
.pg-inner .pg-rule {
  margin-top: 12px;
}

/* If you prefer a fixed thumb height instead of aspect-ratio, use this:
.pg-thumb { height: 220px; width: 100%; object-fit: cover; }
*/

/* --- Keep the visible thumb height fixed; zoom without layout shift --- */

/* Tweak once, use everywhere */
:root { --pg-thumb-height: 240px; } /* adjust to your design */

.pg-card {
  position: relative;
  overflow: hidden; /* clip any extra zoom outside the card */
}

/* The image area stays the same height */
.pg-thumb {
  display: block;
  width: 100%;
  height: var(--pg-thumb-height);   /* lock the visible media height */
  object-fit: cover;
  transform: scale(1);
  transform-origin: center;
  transition: transform 450ms ease;
  backface-visibility: hidden;
  will-change: transform;
}

/* Make sure the content masks any bleed from the zoomed image */
.pg-inner {
  position: relative;
  z-index: 2;
  background: #fff; /* same as .pg-card background */
}

/* Subtle zoom that doesn't alter layout */
.pg-card:is(:hover, :focus-visible) .pg-thumb {
  transform: scale(1.06);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pg-thumb { transition: none; }
  .pg-card:is(:hover, :focus-visible) .pg-thumb { transform: none; }
}
