/* === CARD =============================================================== */

.wp-block-post-template .wp-block-post {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.wp-block-post-template .wp-block-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
}

.wp-block-post-excerpt__excerpt{
    margin-bottom: 0.35rem;
}

/* featured image on top (your markup already sets aspect-ratio via style) */
.wp-block-post-template .wp-block-post-featured-image { margin: 0; }
.wp-block-post-template .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* body (you already have .card-body on the Group) */
.wp-block-post-template .card-body { padding: 16px 18px!important; }
.wp-block-post-template .wp-block-post-title { margin: 8px 0 6px; font-weight: 700; }
.wp-block-post-template .wp-block-post-date { color: rgba(0,0,0,.6); font-size: .92rem;}
.wp-block-post-template .wp-block-post-excerpt { color: rgba(0,0,0,.76); margin: 6px 0 0; }

/* tiny separator spacing */
.wp-block-post-template hr.wp-block-separator { margin: 12px 0; }

/* footer pinned to the bottom */
.wp-block-post-template .card-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(0,0,0,.7);
  font-size: .9rem;
}

/* === CATEGORY "CHIPS" ================================================== */
/* Chip row */
.wp-block-post-template .card-chips,
.wp-block-post-terms .card-chips{
  margin-bottom: 8px;
}

/* Post Terms block */
.taxonomy-category.wp-block-post-terms{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

/* Hide the built-in separators - both in news and single post */
.wp-block-post-template .wp-block-post-terms__separator,
.wp-block-post-terms .wp-block-post-terms__separator {
  display: none;
}

/* === Consistent, equal-height cards =================================== */

/* Make each post a flex column so the footer can sit at the bottom */
.posts-cards .wp-block-post {
  display: flex;
  flex-direction: column;
}

/* Featured image wrapper: force the same aspect ratio on all cards */
.posts-cards .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 16 / 9;         /* same visual height regardless of source image */
  overflow: hidden;              /* crop overflow cleanly */
}

/* Image fills the wrapper */
.posts-cards .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body grows to take remaining space; footer stays at bottom */
.posts-cards .card-body { flex: 1 1 auto; }
.posts-cards .card-footer { margin-top: auto; }

/* (Optional) normalize the spacing above the body if your pattern
   added inline margin-top on .card-body */
.posts-cards .card-body { margin-top: 16px !important; }

/* === Optional polish: clamp title & excerpt lines so heights match ===== */

/* 2 lines for title */
.posts-cards .wp-block-post-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 3 lines for excerpt */
.posts-cards .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive tweak: a slightly taller image on small screens if you like */
@media (max-width: 640px) {
  .posts-cards .wp-block-post-featured-image { aspect-ratio: 4 / 3; }
}

/* Track becomes a horizontal scroller with snap */
.post-cards-carousel .wp-block-post-template {
  display: flex !important;      /* override grid */
  gap: 24px;
  margin: 0 auto;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 8px;
  -webkit-overflow-scrolling: touch;
  .post-cards-carousel .wp-block-post-template{
  position: relative; /* NEW */
  z-index: 1;
}
}

.post-cards-carousel {
  --carousel-pad: 83px;
  --arrow-size: 48px;
  --arrow-offset: 24px;

  position: relative;
  padding-inline: var(--carousel-pad);
  overflow: visible;
}

/* Track / cards */
.post-cards-carousel .wp-block-post-template > .wp-block-post {
  flex: 0 0 calc((100% - 2 * 24px) / 3);
  scroll-snap-align: start;
}

@media (max-width: 1024px) {
  .post-cards-carousel {
    --carousel-pad: 32px;
    margin-inline: 40px;
  }

  .post-cards-carousel .wp-block-post-template > .wp-block-post {
    flex-basis: calc((100% - 24px) / 2);
  }
}

@media (max-width: 640px) {
  .post-cards-carousel {
    --carousel-pad: 16px;
    margin-inline: 0;
  }

  .post-cards-carousel .wp-block-post-template > .wp-block-post {
    flex-basis: 100%;
  }
}

@media (min-width: 1025px) {
  .post-cards-carousel {
    margin-inline: auto;
  }
}

/* Arrows overlay */
.post-cards-carousel .hero-arrows.wp-block-buttons {
  position: absolute;
  inset-block: 0;
  inset-inline: var(--carousel-pad);
  margin: 0 !important;
  padding: 0 !important;
  max-width: none;
  pointer-events: none;
  z-index: 50;
}

/* Individual arrow wrappers */
.post-cards-carousel .hero-arrows .pc-prev,
.post-cards-carousel .hero-arrows .pc-next {
  position: absolute;
  top: 50%;
  margin: 0 !important;
  transform: translateY(-50%);
  pointer-events: auto;
  flex: 0 0 auto;
}

.post-cards-carousel .hero-arrows .pc-prev {
  left: 0;
  transform: translate(calc(-1 * var(--arrow-offset)), -50%);
}

.post-cards-carousel .hero-arrows .pc-next {
  right: 0;
  transform: translate(var(--arrow-offset), -50%);
}

/* Arrow button */
.post-cards-carousel .hero-arrows .wp-block-button__link {
  width: var(--arrow-size);
  height: var(--arrow-size);
  min-width: var(--arrow-size);
  min-height: var(--arrow-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  position: relative;
  flex-shrink: 0;
}

/* Chevron icon base */
.post-cards-carousel .hero-arrows .wp-block-button__link::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

/* Right chevron */
.post-cards-carousel .hero-arrows .pc-next .wp-block-button__link::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>");
}

/* Left chevron */
.post-cards-carousel .hero-arrows .pc-prev .wp-block-button__link::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 18 9 12 15 6'/></svg>");
}

/* Tighter arrow placement on small screens */
@media (max-width: 640px) {
  .post-cards-carousel {
    --arrow-size: 44px;
    --arrow-offset: 12px;
  }
}
/* POSTS Cards Carousel END */