.post-carousel {
  position: relative;
  max-width: var(--wp--style--global--wide-size);
  margin: auto 0 !important;
}

/* === Post Carousel === */
.post-carousel .wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 18px !important;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 !important;
  margin: 0;
}

.post-carousel .wp-block-post-template::-webkit-scrollbar {
  display: none;
}

.post-carousel .wp-block-post-template {
  scrollbar-width: none;
}

/* === Post Grid === */
.post-grid .wp-block-post-template{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 20px;
  isolation: isolate;
  max-width: 100%;
}

/* Wenn nur ein Post da ist, nicht auf volle Breite dehnen */
.post-grid .wp-block-post-template > li.wp-block-post:only-child {
  max-width: 350px;
}

@media (max-width: 900px) {
  .post-grid .wp-block-post-template > li.wp-block-post:only-child {
    max-width: 100%;
  }
}

@media (max-width: 1200px){
  .post-grid .wp-block-post-template{
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px){
  .post-grid .wp-block-post-template{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px){
  .post-grid .wp-block-post-template{
    grid-template-columns: repeat(1, 1fr);
  }
}





/* === Card-Item === */
.latest-posts .wp-block-post-template>li.wp-block-post {
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
  background: #1e1e1e;
  border-radius: 7px;
}

.post-carousel .wp-block-post-template>li.wp-block-post {
    flex: 0 0 auto;
    width: clamp(300px, 22vw, 450px);
}

@media (max-width: 1000px) {
  .post-carousel .wp-block-post-template>li.wp-block-post {
    width: clamp(250px, 70vw, 350px);
  }
}


.latest-posts .wp-block-post-featured-image {
  position: relative;
  margin: 0 !important;
  display: block;
  line-height: 0;
}

.latest-posts .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}


.latest-posts .wp-block-post-featured-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .0));
  pointer-events: none;
}

.latest-posts .wp-block-post-template > li.wp-block-post {
  overflow: hidden
}

.latest-posts .wp-block-post-featured-image img {
  transition: transform .35s ease;
}

.latest-posts .wp-block-post-template > li.wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.05);
}

/* === Datum oben rechts === */
.latest-posts .post-sendezeit {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: var(--wp--preset--color--black);
  color: #fff;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .95rem;
  line-height: 1;
  margin: 0 !important;
  text-wrap: nowrap;
}

.latest-posts .meta {
  display: flex;
  align-items: center;
  gap: .35rem;

}

.latest-posts .meta-text {
  padding-bottom: 0;
}

.meta svg {
  width: 1em;
  height: 1em;
}


/* === Caption Group === */
.latest-posts .post-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
  /* ← fix */
  text-align: left;
  /* ← fix */
}

/* === Pills === */
.latest-posts .post-caption .post-pills {
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  justify-content:flex-start;
  margin-left:0 !important;
  margin-right:0 !important;
  margin-bottom: 10px !important;
}

.latest-posts .post-caption .post-pills.is-layout-flex,
.latest-posts .post-caption .wp-container-core-group-is-layout-flex{
  justify-content:flex-start !important;
}

.latest-posts .post-caption .post-pills>* {
  display: inline-flex;
  align-items: start;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--wp--preset--color--sunshine);
  color: #111;
  line-height: 1;
  white-space: nowrap;
  padding: 7px 12px 7px 12px;

}
.latest-posts .post-caption .post-pills>*:hover {
  background: var(--wp--preset--color--eisvogel);
}

.latest-posts .post-caption .post-pills .no-hover:hover {
  background: var(--wp--preset--color--sunshine);
}

.latest-posts .post-caption .wp-block-post-terms span {
  display: inline-flex;
}

.latest-posts .post-caption .post-link {
    text-decoration: none !important;
    color: var(--wp--preset--color--black);
}




/* === Titel unten links im Bild === */
.latest-posts .post-caption .wp-block-post-title {
  margin: 0 !important;
  padding-left: 3px;
  color: var(--wp--preset--color--pearl);
  line-height: 1.3;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  font-family: "QuicksandRegular";
  font-size: 1.0rem;

  display: block;
  overflow: visible;
  white-space: normal;
}

.latest-posts .post-caption .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.latest-posts .post-caption .wp-block-post-title,
.latest-posts .post-caption .wp-block-post-title a {
  transition: color .25s ease;
}

.latest-posts .wp-block-post-template > li.wp-block-post:hover .post-caption .wp-block-post-title,
.latest-posts .wp-block-post-template > li.wp-block-post:hover .post-caption .wp-block-post-title a {
  color: var(--wp--preset--color--sunshine);
}

/* Sicherheit: entferne Standard-Abstände der Blöcke innerhalb der Card */
.latest-posts .wp-block-post-template>li.wp-block-post>* {
  margin: 0 !important;
}


.latest-posts .wp-block-group {
  padding: 0 !important;
}





/* Track: Platz links/rechts für die Pfeile + korrektes Snap-Ziel */


.post-carousel .lp-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  /* über Cards */
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

.post-carousel .lp-prev {
  left: 8px;
  transform: translateY(-50%) scaleX(-1);
}

.post-carousel .lp-next {
  right: 8px;
}

.post-carousel .lp-btn:disabled {
  opacity: .35;
  pointer-events: none;
}

/* Pagination */
.pagination, .wp-block-query-pagination {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.pagination .page-numbers, .wp-block-query-pagination .page-numbers, .wp-block-query-pagination-next, .wp-block-query-pagination-previous {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--wp--preset--color--pearl);
  padding: 0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  line-height: 1;
  font-size: 16px;
  vertical-align: top;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next,
.pagination .prev.page-numbers,
.pagination .next.page-numbers {
  width: 40px;
  max-width: 40px;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 200%;
  position: relative;
}

.wp-block-query-pagination-previous::after,
.wp-block-query-pagination-next::after,
.pagination .prev.page-numbers::after,
.pagination .next.page-numbers::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  background-image: url('../assets/icons/chevronWhiteWorkshops.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  transform: none;
}

.wp-block-query-pagination-previous::after,
.pagination .prev.page-numbers::after {
  transform: scaleX(-1);
}



.pagination .page-numbers:hover , .wp-block-query-pagination .page-numbers:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--wp--preset--color--sunshine);
}

.pagination .page-numbers.current, .wp-block-query-pagination .page-numbers.current {
  background: var(--wp--preset--color--pearl);
  color: var(--wp--preset--color--darkmode-dark);
  border-color: var(--wp--preset--color--pearl);
}

.pagination .dots, .wp-block-query-pagination .dots {
  display: none;
}

@media (max-width: 1000px) {
  .post-carousel .wp-block-post-template {
    padding-inline: 0 !important;
    padding-right: calc(clamp(310px, 32vw, 450px) * 0.4) !important;
    margin-right: calc(-1 * (100vw - 100%)) !important;
  }

  .post-carousel .lp-btn {
    display: none;
  }
}
