.wnp-post-carousel {
  --wnp-carousel-card-width-desktop: 386px;
  --wnp-carousel-card-width-tablet: 320px;
  --wnp-carousel-card-width-mobile: 260px;
  --wnp-carousel-gap: 20px;
  --wnp-carousel-image-radius: 32px;
  --wnp-carousel-image-border-width: 1px;
  --wnp-carousel-image-border-color: #ECECEC;
  --wnp-carousel-title-color: #FFFFFF;
  --wnp-carousel-title-size: 17px;
  --wnp-carousel-title-hover-color: #FFFFFF;
  --wnp-carousel-title-padding: 24px;
  --wnp-carousel-category-size: 13px;
  --wnp-carousel-category-color: #FFFFFF;
  --wnp-carousel-category-hover-color: #000000;
  --wnp-carousel-category-font-style: normal;
  --wnp-carousel-date-size: 13px;
  --wnp-carousel-date-color: #FFFFFF;
  --wnp-carousel-date-hover-color: #000000;
  --wnp-carousel-date-font-style: normal;
  --wnp-carousel-excerpt-size: 16px;
  --wnp-carousel-excerpt-color: #000000;
  --wnp-carousel-excerpt-hover-color: #000000;
  --wnp-carousel-excerpt-font-style: normal;
  --wnp-carousel-glass-bg: rgba(242, 242, 242, .66);
  --wnp-carousel-glass-border: rgba(255, 255, 255, .68);
  --wnp-carousel-glass-radius: 42px;
  --wnp-carousel-filter-font-size: 15px;
  --wnp-carousel-filter-text-color: #000000;
  --wnp-carousel-filter-border-color: #000000;
  --wnp-carousel-filter-active-bg: #CC0000;
  --wnp-carousel-filter-active-text: #FFFFFF;
  --wnp-carousel-read-all-text: #CC0000;
  --wnp-carousel-read-all-border: #CC0000;
  --wnp-carousel-read-all-bg: #FFFFFF;
  --wnp-carousel-read-all-radius: 999px;
  --wnp-carousel-container-width: 1320px;
  --wnp-carousel-container-gutter: 24px;
  --wnp-carousel-left-offset: max(var(--wnp-carousel-container-gutter), calc((100vw - var(--wnp-carousel-container-width)) / 2));
  --wnp-carousel-right-offset: max(var(--wnp-carousel-container-gutter), calc((100vw - var(--wnp-carousel-container-width)) / 2));
  --wnp-carousel-arrow-edge-offset: 18px;

  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.wnp-post-carousel,
.wnp-post-carousel * {
  box-sizing: border-box;
}

.wnp-post-carousel .wnp-post-carousel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-left: var(--wnp-carousel-left-offset);
  padding-right: var(--wnp-carousel-right-offset);
  margin-bottom: 20px;
}

.wnp-post-carousel .wnp-post-carousel__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wnp-post-carousel .wnp-post-carousel__filter,
.wnp-post-carousel button.wnp-post-carousel__filter {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--wnp-carousel-filter-border-color);
  background: #fff !important;
  color: var(--wnp-carousel-filter-text-color) !important;
  border-radius: 999px;
  min-height: 30px;
  padding: 6px 16px;
  font-size: var(--wnp-carousel-filter-font-size) !important;
  line-height: 1.1;
  font-weight: 400;
  cursor: pointer;
  box-shadow: none !important;
  font-family: inherit !important;
  transition: all .2s ease;
  white-space: nowrap;
}

.wnp-post-carousel .wnp-post-carousel__filter.is-active,
.wnp-post-carousel .wnp-post-carousel__filter:hover {
  background: var(--wnp-carousel-filter-active-bg) !important;
  border-color: var(--wnp-carousel-filter-active-bg) !important;
  color: var(--wnp-carousel-filter-active-text) !important;
  font-weight: 700 !important;
}

.wnp-post-carousel .wnp-post-carousel__read-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 32px;
  border: 1px solid var(--wnp-carousel-read-all-border);
  border-radius: var(--wnp-carousel-read-all-radius);
  background: var(--wnp-carousel-read-all-bg);
  color: var(--wnp-carousel-read-all-text) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  transition: all .2s ease;
  white-space: nowrap;
}

/* Keep the link aligned with the container edge when no filters are rendered. */
.wnp-post-carousel .wnp-post-carousel__head > .wnp-post-carousel__read-all:only-child {
  margin-left: auto;
  align-self: flex-end;
}

.wnp-post-carousel .wnp-post-carousel__read-all:hover,
.wnp-post-carousel .wnp-post-carousel__read-all:focus {
  background: var(--wnp-carousel-read-all-hover-bg);
  color: var(--wnp-carousel-read-all-hover-text) !important;
  border-color: var(--wnp-carousel-read-all-hover-border);
  text-decoration: none !important;
}

.wnp-post-carousel .wnp-post-carousel__stage {
  position: relative;
}

.wnp-post-carousel .wnp-post-carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-left: var(--wnp-carousel-left-offset);
  padding-right: 130px;
  cursor: grab;
  scroll-behavior: smooth;
  user-select: none;
  -webkit-user-select: none;
}

.wnp-post-carousel .wnp-post-carousel__track,
.wnp-post-carousel .wnp-post-carousel__item {
  cursor: grab;
}

.wnp-post-carousel .wnp-post-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging,
.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging .wnp-post-carousel__track,
.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging .wnp-post-carousel__item {
  cursor: grabbing;
}

.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging {
  scroll-behavior: auto;
}

.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging a,
.wnp-post-carousel .wnp-post-carousel__viewport.is-dragging img {
  pointer-events: none;
}

.wnp-post-carousel .wnp-post-carousel__track {
  display: flex;
  gap: var(--wnp-carousel-gap);
  align-items: stretch;
  width: max-content;
}

.wnp-post-carousel .wnp-post-carousel__item {
  position: relative;
  flex: 0 0 var(--wnp-carousel-card-width-desktop);
  width: var(--wnp-carousel-card-width-desktop);
}

.wnp-post-carousel .wnp-post-carousel__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--wnp-carousel-image-radius);
  border: var(--wnp-carousel-image-border-width) solid var(--wnp-carousel-image-border-color);
  background: #f2f2f2;
  width: 100%;
}

.wnp-post-carousel .wnp-post-carousel__media-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.wnp-post-carousel.wnp-post-carousel--ratio-1-1 .wnp-post-carousel__media-inner {
  aspect-ratio: 1 / 1;
}

.wnp-post-carousel.wnp-post-carousel--ratio-4-3 .wnp-post-carousel__media-inner {
  aspect-ratio: 4 / 3;
}

.wnp-post-carousel.wnp-post-carousel--ratio-3-4 .wnp-post-carousel__media-inner {
  aspect-ratio: 3 / 4;
}

.wnp-post-carousel .wnp-post-carousel__card-link,
.wnp-post-carousel .wnp-post-carousel__image-wrap,
.wnp-post-carousel .wnp-post-carousel__image-placeholder,
.wnp-post-carousel .wnp-post-carousel__overlay,
.wnp-post-carousel .wnp-post-carousel__content {
  position: absolute;
  inset: 0;
}

.wnp-post-carousel .wnp-post-carousel__card-link {
  z-index: 1;
  display: block;
  text-decoration: none;
  -webkit-user-drag: none;
}

.wnp-post-carousel .wnp-post-carousel__image-wrap {
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: scale(1);
  transition: transform .45s ease;
}

.wnp-post-carousel .wnp-post-carousel__image-placeholder {
  z-index: 0;
  background: #e9e9e9;
}

.wnp-post-carousel .wnp-post-carousel__overlay {
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.64) 0%,
    rgba(0, 0, 0, 0.42) 38%,
    rgba(0, 0, 0, 0.18) 70%,
    rgba(0, 0, 0, 0.06) 100%
  );
  pointer-events: none;
}

.wnp-post-carousel .wnp-post-carousel__content {
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--wnp-carousel-title-padding);
  pointer-events: none;
}

.wnp-post-carousel .wnp-post-carousel__title-block {
  position: relative;
  z-index: 5;
  padding-bottom: 14px;
  transition: transform .38s ease;
}

.wnp-post-carousel .wnp-post-carousel__title,
.wnp-post-carousel h3.wnp-post-carousel__title {
  position: relative;
  z-index: 5;
  margin: 0 !important;
  color: var(--wnp-carousel-title-color) !important;
  font-size: var(--wnp-carousel-title-size) !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: color .25s ease, transform .38s ease;
  font-family: inherit !important;
  letter-spacing: 0 !important;
}

.wnp-post-carousel .wnp-post-carousel__title a {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: auto;
}

.wnp-post-carousel .wnp-post-carousel__card-link:hover ~ .wnp-post-carousel__image-wrap,
.wnp-post-carousel .wnp-post-carousel__media-inner:hover .wnp-post-carousel__image-wrap,
.wnp-post-carousel .wnp-post-carousel__media-inner:focus-within .wnp-post-carousel__image-wrap {
  transform: scale(1.06);
}

.wnp-post-carousel .wnp-post-carousel__card-link:hover ~ .wnp-post-carousel__content .wnp-post-carousel__title,
.wnp-post-carousel .wnp-post-carousel__media-inner:hover .wnp-post-carousel__title,
.wnp-post-carousel .wnp-post-carousel__media-inner:focus-within .wnp-post-carousel__title {
  color: var(--wnp-carousel-title-hover-color) !important;
}

.wnp-post-carousel .wnp-post-carousel__glass-panel {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  width: auto;
  margin-left: 0;
  bottom: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--wnp-carousel-title-padding);
  border: 1px solid transparent;
  border-radius: var(--wnp-carousel-image-radius);
  background: transparent;
  opacity: 0;
  transform: translateY(36px);
  pointer-events: none;
  transition: max-height .42s ease, padding .42s ease, opacity .28s ease, transform .42s ease, background-color .28s ease, border-color .28s ease;
}

.wnp-post-carousel .wnp-post-carousel__excerpt-panel {
  overflow: visible;
  max-height: none;
  margin: 0;
  opacity: 1;
  transform: none;
}

.wnp-post-carousel .wnp-post-carousel__excerpt {
  margin: 0 !important;
  color: var(--wnp-carousel-excerpt-color) !important;
  font-size: var(--wnp-carousel-excerpt-size) !important;
  line-height: 1.45 !important;
  font-style: var(--wnp-carousel-excerpt-font-style) !important;
  font-weight: 400 !important;
  text-decoration: none !important;
}

.wnp-post-carousel .wnp-post-carousel__meta {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 0;
  pointer-events: auto;
  transition: opacity .24s ease, visibility .24s ease, transform .38s ease;
}

.wnp-post-carousel .wnp-post-carousel__meta--base {
  flex: 0 0 auto;
  margin-bottom: 24px;
}

.wnp-post-carousel .wnp-post-carousel__meta--glass {
  margin-top: 20px;
  color: var(--wnp-carousel-excerpt-color);
}

.wnp-post-carousel .wnp-post-carousel__meta--glass .wnp-post-carousel__category,
.wnp-post-carousel .wnp-post-carousel__meta--glass .wnp-post-carousel__date {
  color: var(--wnp-carousel-excerpt-color) !important;
}

.wnp-post-carousel .wnp-post-carousel__meta--single {
  justify-content: flex-start;
}

.wnp-post-carousel .wnp-post-carousel__category,
.wnp-post-carousel .wnp-post-carousel__date {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.wnp-post-carousel .wnp-post-carousel__category {
  color: var(--wnp-carousel-category-color) !important;
  font-size: var(--wnp-carousel-category-size) !important;
  font-style: var(--wnp-carousel-category-font-style) !important;
  text-decoration: none !important;
  transition: color .25s ease;
}

.wnp-post-carousel .wnp-post-carousel__category:hover,
.wnp-post-carousel .wnp-post-carousel__category:focus {
  color: var(--wnp-carousel-category-hover-color) !important;
  text-decoration: underline;
}

.wnp-post-carousel .wnp-post-carousel__date {
  color: var(--wnp-carousel-date-color) !important;
  font-size: var(--wnp-carousel-date-size) !important;
  font-style: var(--wnp-carousel-date-font-style) !important;
  transition: color .25s ease;
}

.wnp-post-carousel .wnp-post-carousel__date:hover,
.wnp-post-carousel .wnp-post-carousel__date:focus {
  color: var(--wnp-carousel-date-hover-color) !important;
}

/* Hover mode: the glass panel rises from the bottom only on cards with a real excerpt. */
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:hover .wnp-post-carousel__glass-panel,
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:focus-within .wnp-post-carousel__glass-panel {
  max-height: 240px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-color: var(--wnp-carousel-glass-border);
  background: var(--wnp-carousel-glass-bg);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* The base metadata disappears only while the excerpt glass panel is active. */
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:hover .wnp-post-carousel__meta--base,
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:focus-within .wnp-post-carousel__meta--base {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
}

/* The title lifts only on cards that actually have an excerpt. */
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:hover .wnp-post-carousel__title-block,
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--excerpt-hover:focus-within .wnp-post-carousel__title-block {
  transform: translateY(-120px);
}

/* Fixed mode keeps the excerpt in the normal content flow. */
.wnp-post-carousel .wnp-post-carousel__excerpt-panel--fixed {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 24px;
}

/* A card without an effective excerpt keeps its title and metadata completely still. */
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--no-excerpt .wnp-post-carousel__title-block,
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--no-excerpt:hover .wnp-post-carousel__title-block,
.wnp-post-carousel.wnp-post-carousel--excerpt-hover .wnp-post-carousel__media-inner--no-excerpt:focus-within .wnp-post-carousel__title-block {
  transform: none;
}

.wnp-post-carousel .wnp-post-carousel__category--glass,
.wnp-post-carousel .wnp-post-carousel__date--glass {
  color: var(--wnp-carousel-excerpt-color) !important;
}

.wnp-post-carousel .wnp-post-carousel__category--glass:hover,
.wnp-post-carousel .wnp-post-carousel__category--glass:focus,
.wnp-post-carousel .wnp-post-carousel__date--glass:hover,
.wnp-post-carousel .wnp-post-carousel__date--glass:focus {
  color: var(--wnp-carousel-excerpt-hover-color) !important;
}

.wnp-post-carousel .wnp-post-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1d1d1d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.wnp-post-carousel .wnp-post-carousel__arrow:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.wnp-post-carousel .wnp-post-carousel__arrow[disabled] {
  opacity: 0;
  pointer-events: none;
}

.wnp-post-carousel .wnp-post-carousel__arrow--prev {
  left: var(--wnp-carousel-arrow-edge-offset);
}

.wnp-post-carousel .wnp-post-carousel__arrow--next {
  right: var(--wnp-carousel-arrow-edge-offset);
}

.wnp-post-carousel .wnp-post-carousel__arrow-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.wnp-post-carousel .wnp-post-carousel__arrow-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wnp-post-carousel .wnp-post-carousel__empty {
  padding: 20px 0;
  color: #000;
  font-size: 16px;
}

.wnp-post-carousel.is-loading .wnp-post-carousel__track {
  opacity: .55;
  pointer-events: none;
  transition: opacity .2s ease;
}

@media (max-width: 1024px) {
  .wnp-post-carousel .wnp-post-carousel__item {
    flex-basis: var(--wnp-carousel-card-width-tablet);
    width: var(--wnp-carousel-card-width-tablet);
  }

  .wnp-post-carousel .wnp-post-carousel__viewport {
    padding-right: 100px;
  }
}

@media (max-width: 767px) {
  .wnp-post-carousel {
    --wnp-carousel-container-gutter: 16px;
    --wnp-carousel-arrow-edge-offset: 8px;
  }

  .wnp-post-carousel .wnp-post-carousel__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .wnp-post-carousel .wnp-post-carousel__filters {
    gap: 8px;
  }

  .wnp-post-carousel .wnp-post-carousel__item {
    flex-basis: var(--wnp-carousel-card-width-mobile);
    width: var(--wnp-carousel-card-width-mobile);
  }

  .wnp-post-carousel .wnp-post-carousel__viewport {
    padding-right: 68px;
  }

  .wnp-post-carousel .wnp-post-carousel__arrow {
    width: 46px;
    height: 46px;
  }

  .wnp-post-carousel .wnp-post-carousel__read-all {
    min-height: 44px;
    padding: 0 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wnp-post-carousel .wnp-post-carousel__image-wrap,
  .wnp-post-carousel .wnp-post-carousel__title,
  .wnp-post-carousel .wnp-post-carousel__excerpt-panel,
  .wnp-post-carousel .wnp-post-carousel__category,
  .wnp-post-carousel .wnp-post-carousel__date {
    transition: none !important;
  }
}
