.featured-card,
.hero-card {
  position: relative;
  color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.featured-card {
  justify-content: end;
  min-height: 18rem;
  aspect-ratio: 1/1;
}
.hero-card {
  justify-content: center;
  min-height: 70vh;
  border-radius: 0 !important;
}
.post-featured-image img {
  aspect-ratio: 1/1;
}
@media screen and (min-width: 440px) and (max-width: 1024px) {
  .featured-card {
    aspect-ratio: 9/16;
  }
  .featured-card h4 {
    font-size: var(--wp--preset--font-size--medium);
  }
}
@media screen and (min-width: 1024px) {
  /* .hero-card {
    aspect-ratio: 2.35/1;
  } */

  .post-featured-image img {
    aspect-ratio: 4/3 !important;
  }
}

.featured-card::before,
.hero-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    360deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.1) 60%,
    rgba(0, 0, 0, 0.01) 100%
  );
  z-index: 2;
}
.featured-card .featured-card-image,
.hero-card .hero-card-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  transition: transform 0.3s ease;
  margin: 0;
}
.featured-card .featured-card-image img,
.hero-card .hero-card-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  margin: 0;
}

.featured-card .card-content,
.hero-card .card-content {
  position: relative;
  z-index: 2;
  width: 100%;
  pointer-events: none;
}
.featured-card .card-content {
  padding: 0 1rem 2rem 1rem;
  justify-content: end;
  max-width: 93%;
}
.hero-card .card-content {
  padding: 1rem;
}
.featured-card .card-content a {
  text-decoration: none;
}

.featured-card .featured-card-image:hover {
  transform: scale(1.05);
}
.featured-card .category-list {
  color: white;
  font-size: 0.75rem;
}
.card-content .post-type-name {
  font-size: var(--wp--preset--font-size--small);
  text-transform: uppercase;
  font-weight: 300;
}
.related-content__image--placeholder {
  filter: grayscale(1) opacity(0.7);
}

/* Ensure image wrapper is relative for absolute positioning of no-image */
.related-content__image-wrapper,
.related-content__image-wrapper--single {
  position: relative;
}

.related-content__no-image {
  color: #aaa;
  font-size: 1em;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.related-section-wrapper {
  background: white;
  padding: var(--wp--preset--spacing--70) var(--wp--preset--spacing--40)
    var(--wp--preset--spacing--80) var(--wp--preset--spacing--40) !important;
  border-radius: 0;
}
.related-section-wrapper p:empty {
  display: none;
}
/* Related Content Block Styles */
.related-content__items {
  display: flex;
  gap: 2vw;
  flex-wrap: wrap;
  margin: var(--wp--preset--spacing--50) auto;
}

.related-content__item {
  text-decoration: none;
  color: inherit;
  flex: 1 1 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 0.5rem;
}
.related-content__item .card-content {
  padding: 0 1rem 1rem 1rem !important;
}
.related-content__item p:empty {
  display: none;
}
.related-content__item h4 {
  color: white;
  font-size: var(--wp--preset--font-size--base);
  margin-top: 0;
}
.post-type-label {
  color: white;
  text-transform: uppercase;
  font-size: calc(var(--wp--preset--font-size--small) * 0.8);
}
.related-content__item.featured-card {
  justify-content: end;
  min-height: 16rem;
  aspect-ratio: 4/3;
}
.related-content__figure {
  margin: 0;
}

.related-content__image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eee;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-content__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-content__caption {
  margin-top: 0.5em;
  font-size: 1em;
}

/* Single item: horizontal layout (image left, title right) */
.related-content__items--single {
  display: flex;
  justify-content: start;
}

.related-content__item--single {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  box-sizing: border-box;
  gap: 2em;
}
@media screen and (min-width: 990px) {
  .related-content__items--single .related-content__item {
    max-width: 40%;
  }
}
.related-content__figure--single {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  width: 100%;
}

.related-content__image-wrapper--single {
  flex: 0 0 220px;
  width: 220px;
  aspect-ratio: 4 / 3;
  margin-right: 1.5em;
}

.related-content__caption--single {
  flex: 1 1 auto;
  margin: 0;
  text-align: left;
  font-size: 1.2em;
  font-weight: bold;
}

/* Responsive: stack vertically on mobile */
@media (max-width: 700px) {
  .related-section-wrapper {
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
  }
  .related-content__items {
    display: grid;
    gap: var(--wp--preset--spacing--50);
  }
  .related-content__item,
  .related-content__item--single {
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1em;
  }
  .related-content__figure--single {
    flex-direction: column;
    align-items: stretch;
  }
  .related-content__image-wrapper--single {
    margin-right: 0;
    margin-bottom: 1em;
    width: 100%;
  }
  .related-content__caption--single {
    text-align: left;
    font-size: 1.1em;
  }
}

/* Stack items on tablet and below */
/* @media (max-width: 900px) {
  .wp-block-post-template {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .wp-block-post-template > * {
    width: 100% !important;
  }
} */

.wh-card-container,
.editor-styles-wrapper .wh-card-container {
  height: 100%;
  container-name: wh-card;
  container-type: inline-size;
}
.wh-card,
.editor-styles-wrapper .wh-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  max-width: 100%;
  height: 100%;
  padding: var(--wp--preset--spacing--40);
  gap: var(--wp--preset--spacing--40);
}

.wh-card__image,
.editor-styles-wrapper .wh-card__image {
  width: 100%;
  display: block;
  overflow: hidden;
  margin: 0;
}
.wh-card__image img,
.editor-styles-wrapper .wh-card__image img {
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  object-fit: cover;
  margin: 0 !important;
}

.wh-card__content,
.editor-styles-wrapper .wh-card__content {
  margin: var(--wp--preset--spacing--medium) 0;
  width: 100%;
}

.wh-card__title,
.editor-styles-wrapper .wh-card__title {
  margin: 0 0 0.5rem 0;
}

.wh-card__text,
.editor-styles-wrapper .wh-card__text {
  margin: 0;
}

/* Responsive behavior for wh-card */
@container wh-card (min-width: 480px) {
  .wh-card,
  .editor-styles-wrapper .wh-card {
    flex-direction: row;
    align-items: stretch;
  }
  .wh-card__image,
  .editor-styles-wrapper .wh-card__image {
    width: 40%;
    margin: 0 !important;
  }
  .wh-card__image img,
  .editor-styles-wrapper .wh-card__image img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .wh-card__content,
  .editor-styles-wrapper .wh-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
