/* selected-posts-carousel.css */

:root {
    --selected-posts-carousel-desktop-height : 600px;

    --swiper-navigation-top-offset: -26px;
    --swiper-navigation-sides-offset: -46px;
    --swiper-pagination-bullet-height: 3px;
}

.selected-posts-carousel.alignwide {
    max-height: 700px; 
    display: grid;
    grid-template-columns: 3fr 1fr 44px;
    position: relative;
    box-sizing: border-box;
    gap: 16px;
  }
  
  /* Left panel (active slide) */
  .selected-posts-carousel__left {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 550px; /* set a min height or use some other approach */
    max-height: var(--selected-posts-carousel-desktop-height);
    overflow: hidden;
    border-radius: 40px;
  }
  
  /* Overlay inside the left panel */
  .selected-posts-carousel__active-slide-overlay {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, #111111 100%);
    color: #fff;
  }

  /* Both overlays: absolutely stacked */
  .selected-posts-carousel .slide-overlay {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 17px;
    padding: min(4vw, 48px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  
    /* Crossfade via opacity transitions */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    
    color: #fff; /* Ensure contrast */
    text-decoration: none; /* remove underline from <a> background */
    pointer-events: none;
  }

  .selected-posts-carousel .slide-overlay.gradient {
    pointer-events: all;
  }
  
  /* The "active" overlay is visible (opacity=1); 
     the "inactive" is hidden (opacity=0) */
  .selected-posts-carousel .slide-overlay[data-state="active"] {
    opacity: 1;
    z-index: 2;
  }
  .selected-posts-carousel .slide-overlay[data-state="inactive"] {
    opacity: 0;
    z-index: 1;
  }

  .selected-posts-carousel .slide-overlay.gradient::before{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, #111111 100%);
    z-index: -1;
  }

  .selected-posts-carousel .slide-overlay h5,
  .selected-posts-carousel .slide-overlay p {
    margin: 0;
    color: #fff;
  }

  .selected-posts-carousel .slide-overlay h5{
    flex: 0 1 auto;
  }

  .selected-posts-carousel .slide-overlay .wp-block-button{
    
    display: flex;
    justify-content: flex-end;
  }

  .selected-posts-carousel .slide-overlay .selected-posts-carousel__active-slide-category{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: #fff;
    color: #000;
    border-radius: 32px;
    font-size: 14px;
    width: fit-content;
  }

  .selected-posts-carousel .slide-overlay span:empty {
    display: none;
  }

  .selected-posts-carousel .slide-overlay p{
    font-family: inherit;
  }
  
  /* Right panel (vertical swiper) */
  .selected-posts-carousel__right {
    position: relative;
    overflow: hidden;
    min-height: 550px; /* match the left panel if you want uniform height */
    max-height: var(--selected-posts-carousel-desktop-height);
  }

  .selected-posts-carousel .swiper-posts-carousel {
    max-height: var(--selected-posts-carousel-desktop-height);
    overflow: hidden; 
    height: 100%;
  }
  
  /* Each vertical slide's background image styling */
  .selected-posts-carousel .swiper-slide {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    display: flex;
    align-items: flex-end; /* so text is bottom aligned inside */
    border-radius: 20px;
    overflow: hidden;
  }

  
  /* Slide overlay for text on the right panel */
  .selected-posts-carousel .swiper-slide .swiper-slide__overlay {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    height: 100%;
    width: 100%;
    padding: 1rem;
    color: #fff;
  }

  .selected-posts-carousel .swiper-slide .swiper-slide__overlay.gradient {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, #111111 100%);
  }

  .selected-posts-carousel .swiper-slide .swiper-slide__overlay h6{
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff;
    font-size: 14px;
  }

  .selected-posts-carousel .swiper-slide .swiper-slide__overlay span{
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: #fff;
    color: var(--wp--preset--color--primary);
    border-radius: 32px;
    font-size: 14px;
    width: fit-content;
  }

  .selected-posts-carousel .swiper-slide .swiper-slide__overlay::after {
    content: "";
    position: absolute;
    inset: 0; /* top:0, right:0, bottom:0, left:0 */
    background: linear-gradient(180deg, rgba(17, 17, 17, 0) 0%, #2C3542 140%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .selected-posts-carousel .swiper-slide .swiper-slide__overlay.active::after {
    opacity: 1;
  }
  
  /* OPTIONAL: Some simple hover effect to highlight slide */
  .selected-posts-carousel  .swiper-slide:hover {
    cursor: pointer;
    filter: brightness(1.1);
  }

 /* Navigation */
  .selected-posts-carousel .navigation {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.selected-posts-carousel .navigation .swiper-button-next-posts,
.selected-posts-carousel .navigation .swiper-button-prev-posts{
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  transform: rotate(90deg);
}

.selected-posts-carousel .navigation .swiper-button-prev-posts{
  top: 0;
}

.selected-posts-carousel .navigation .swiper-button-next-posts{
  bottom: 0;
}

.selected-posts-carousel .navigation .swiper-button-next-posts .button-text,
.selected-posts-carousel .navigation .swiper-button-prev-posts .button-text{
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
  text-wrap: nowrap;
  transform: rotate(90deg);
}

.selected-posts-carousel .navigation .swiper-pagination-posts{
    position: absolute;
    left: 50%;
    width: auto;
}

.selected-posts-carousel .navigation .swiper-pagination-posts .swiper-pagination-bullet{
  width: 12px;
  height: 12px;
  margin: 12px 0;
}

.selected-posts-carousel-button {
    display: flex;
    justify-content: flex-end;
    padding-right: 64px;
    box-sizing: border-box;
}



/* mobile */
@media (max-width: 900px) {
    .selected-posts-carousel.alignwide{
        grid-template-columns: unset;
    }

    .selected-posts-carousel-button{
        padding-right: 0;
    }

    .selected-posts-carousel-button .wp-block-button{
        width: 100%;
    }

    .selected-posts-carousel .slide-overlay .wp-block-button span{
      display: none;
    }

    .selected-posts-carousel .wp-block-button .wp-block-button__link{
        justify-content: center;
        padding: 12px;
    }

    .selected-posts-carousel__left{
        min-height: 400px;
    }

    .selected-posts-carousel__right{
        min-height: 120px;
        margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
        margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
    }

    .selected-posts-carousel .swiper-slide .swiper-slide__overlay {
        min-height: 16vw;
    }

    .selected-posts-carousel .swiper-slide .swiper-slide__overlay h6,
    .selected-posts-carousel .swiper-slide .swiper-slide__overlay span {
        display: none;
    }

    .selected-posts-carousel .navigation{
        flex-direction: row;
        height: 48px;
    }
    .selected-posts-carousel .navigation .swiper-button-prev-posts{
    top: unset;
    left: 0;
    }

    .selected-posts-carousel .navigation .swiper-button-next-posts{
      bottom: unset;
      right: 0;
      }

    .selected-posts-carousel .navigation .swiper-button-next-posts,
    .selected-posts-carousel .navigation .swiper-button-prev-posts{
      transform: rotate(0deg);
    }
    .selected-posts-carousel .navigation .swiper-pagination-posts{
      transform: translate(-50%, 0%);
    }
    .selected-posts-carousel .navigation .swiper-pagination-posts .swiper-pagination-bullet{
      margin: 0 6px;
    }
}
  