/* 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;
  }
  
  /* 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;
  }
  
  /* 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: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 17px;
    padding: min(3vw, 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 h4,
  .selected-posts-carousel .slide-overlay span,
  .selected-posts-carousel .slide-overlay p {
    margin: 0;
    color: var(--wp--preset--color--maczna-biel);
  }

  .selected-posts-carousel .slide-overlay span{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: var(--wp--preset--color--maczna-biel);
    color: var(--wp--preset--color--cieply-orkisz);
    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: var(--wp--preset--font-family--archivo) !important;
  }
  
  /* 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 */
  }

  
  /* 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: var(--wp--preset--color--maczna-biel);
    font-size: 20px;
  }

  .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: var(--wp--preset--color--maczna-biel);
    color: var(--wp--preset--color--cieply-orkisz);
    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%, #B96C42 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%;
}

.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;
  flex-basis: 50%;
  border: 1px solid var(--wp--preset--color--zlote-zboze);
}

.selected-posts-carousel .navigation .swiper-button-prev-posts{
  border-bottom: none;
}

.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-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;
        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-button{
        padding-right: 0;
    }

    .selected-posts-carousel-button .wp-block-button{
        width: 100%;
    }

    .selected-posts-carousel-button .wp-block-button a{
        justify-content: center;
    }

    .selected-posts-carousel__left{
        min-height: 400px;
    }

    .selected-posts-carousel__right{
        min-height: 80px;
    }

    .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: 44px;
    }
    .selected-posts-carousel .navigation .swiper-button-prev-posts{
      border-bottom: 1px solid var(--wp--preset--color--zlote-zboze);
      border-right: none;
    }

    .selected-posts-carousel .navigation .swiper-button-next-posts .button-text,
    .selected-posts-carousel .navigation .swiper-button-prev-posts .button-text{
      transform: rotate(0deg);
    }
}
  