.slider {
  position: relative;
  display: flex;
  height: clamp(150px, 15vw, 250px);
  justify-content: center;
  align-items: center;
  width: 95%;
  
  /* Verberg radio buttons */
  input[type=radio] {
    display: none;
  }

  .slider_card {
    position: absolute;
    width: 60%;
    height: 100%;
    left: 0;
    right: 0;
    margin: auto;
    transition: transform .4s ease, opacity .4s ease; 
    cursor: pointer;
    transform: translateX(-40%) scale(0.8); /* Standaard positie links */
    opacity: 0.5;
    z-index: 0;

    /* Afbeelding in het midden */
    &.active {
      transform: translateX(0) scale(1);
      opacity: 1;
      z-index: 1;
      
      figure:hover .material-icons {
        display: flex; /* Toon fullscreen icoon bij hover */
      }
    }

    /* Volgende afbeelding rechts */
    &.next {
      transform: translateX(40%) scale(0.8);
      opacity: 0.8;
    }

    /* Fullscreen icon */
    .material-icons {
      display: none;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 2rem;
      background: hsl(0 0% 0% / 0.7);
      color: hsl(0 0% 100%);
      border-radius: 50%;
      width: 60px;
      height: 60px;
      align-items: center;
      justify-content: center;
      z-index: 10;
      cursor: pointer;
    }
    
    img {
      width: 100%;
      height: 100%;
      border-radius: 10px;
      object-fit: cover; /* Behoud aspect ratio */
      box-shadow: 0 2px 6px -2px light-dark(hsl(60 1% 50% / 0.7), hsl(60 1% 10% / 0.7));
    }

    figure {
      height: 100%;
      width: 100%;
      margin: 0;
      display: flex;
      flex-direction: column;
      justify-content: flex-end; /* Caption onderaan */
    }
    
    /* Bijschrift/Caption/Credits */
    figcaption {
      background: light-dark(hsl(0 0% 100% / 0.65), hsl(0 0% 10% / 0.65));
      color: light-dark(hsl(0 0% 20%), hsl(0 0% 90%));
      padding: 6px 10px 4px;
      border-radius: 0 0 10px 10px;
      text-align: center;
      margin-top: -30px;
      box-shadow: 0 2px 6px -2px light-dark(hsl(60 1% 50% / 0.7), hsl(60 1% 10% / 0.7));
      max-width: 100%;
      overflow-wrap: break-word;

      /* Tekst afbreken als het te lang wordt */
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.fullscreen {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  
  .fullscreen-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    cursor: default;
    
    img {
      width: 100%;
      max-width: 90vw;
      height: 100%;
      max-height: 90vh;
      object-fit: contain;
      border-radius: 8px 8px 0 0;
    }
    
    figcaption {
      background: light-dark(hsl(0 0% 100% / 0.65), hsl(0 0% 10% / 0.65));
      color: light-dark(hsl(0 0% 20%), hsl(0 0% 90%));
      padding: 10px;
      border-radius: 0 0 8px 8px;
      text-align: center;
      text-wrap: balance;
      margin-top: -8px;
    }

    .material-icons {
      display: none;
    }
  }
  
  /* Sluit knop */
  .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: hsl(0 0% 100% / 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    
    .material-icons {
      font-size: 24px;
      color: hsl(0 0% 20%);
    }
    
    &:hover {
      background: hsl(0 0% 100%);
    }
  }


  /* Fullscreen pijltjes */
  .fullscreen-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: hsl(0 0% 0% / 0.6);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    z-index: 20;
    cursor: pointer;
    
    &.fullscreen-arrow-left {
      left: 24px;
    }

    &.fullscreen-arrow-right {
      right: 24px;
    }
  }
}