@layer demo, base;

/* This is the CSS for the relevant demo: */
@layer demo {
  :root {
    --clr-button: rgba(137, 137, 137, .60);
    --clr-button-text: hsl(0, 0%, 100%);
    --clr-marker: var(--clr-button);
    --clr-marker-inactive: color-mix(
      in hsl,
      var(--clr-marker),
      var(--clr-button-text) 80%
    );

    --svg-arrow-right-white: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M5 12h14'/%3e%3cpath d='m12 5 7 7-7 7'/%3e%3c/svg%3e");
    --svg-arrow-left-white: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m12 19-7-7 7-7'/%3e%3cpath d='M19 12H5'/%3e%3c/svg%3e");
  }

  .gallery {
    /* Gallery Layout */
    display: grid;
    grid-template-columns: 50% 50% 50% 50%;
    gap: 1rem;
    overflow-x: auto;
    padding: 40px 0;
    scroll-behavior: smooth;

    @media(max-width: 700px) {
      grid-template-columns: 100% 100% 100% 100%;
    }

    /* Settings for buttons and markers */
    anchor-name: --gallery;
    scroll-snap-type: x mandatory;

    container-type: inline-size;

    list-style: none;
    padding-inline: 0;

    .gallery-item {
      /* Force Items and Images to a specific aspect ratio */
      min-height: 500px !important;
      border-radius: 0.5rem;

      padding: 0 20px;

      scroll-snap-align: start;

      /* Initital width of the image (mobile) */
      flex: 0 0 100%;

      img {
  display: block;
  width: 100%;
  height: auto;          /* don't force 100% height */
  max-height: 400px;
  object-fit: cover;     /* fill the box so corners are visible */
  border-radius: 40px;   /* 16–24px looks clean */
  padding: 30px;            /* remove padding on the img */
  filter: drop-shadow(0 0 6px gray);
      }
    }

    @supports selector(::scroll-button(left)) {
      /* Hide the scrollbar */
      &::-webkit-scrollbar {
        display: none;
      }

      /* Add the Buttons */
      &::scroll-button(left),
      &::scroll-button(right) {
        cursor: pointer;
        background-color: var(--clr-button);
        color: var(--clr-button-text);
        border: none;
        inline-size: 3rem;
        block-size: 3rem;
        border-radius: 50%;
        text-align: center;
        transition: filter 120ms ease-in-out;

        position: fixed;
        position-anchor: --gallery;
      }

      &::scroll-button(left):hover,
      &::scroll-button(right):hover {
        filter: brightness(1.2);
      }

      /* Disabled Buttons */
      &::scroll-button(left):disabled,
      &::scroll-button(right):disabled {
        filter: grayscale(90%);
        opacity: 0.6;
        cursor: auto;
      }

      &::scroll-button(right) {
        content: "";
        position-area: right center;
        translate: -75%;
        background: var(--clr-button) no-repeat center
          var(--svg-arrow-right-white);
      }

      &::scroll-button(left) {
        content: "";
        position-area: left center;
        translate: 75%;
        background: var(--clr-button) no-repeat center
          var(--svg-arrow-left-white);
      }
    }

    @supports selector(.gallery-item::scroll-marker) {
      &::scroll-marker-group {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
      }

      .gallery-item::scroll-marker {
        display: block;
        content: "";
        inline-size: 1rem;
        block-size: 1rem;
        border-radius: 50%;
        background-color: var(--clr-marker-inactive);
        transition: background-color 80ms ease-in-out;
      }

      .gallery-item::scroll-marker:hover {
        background-color: var(--clr-marker);
      }

      .gallery-item::scroll-marker:target-current {
        background-color: var(--clr-marker);
      }
    }

    @container (width >= 30rem) {
      .gallery-item {
        flex: 0 0 50cqw;
      }
    }

    @container (width >= 45rem) {
      .gallery-item {
        flex: 0 0 33.3333cqw;
      }
    }

    @container (width >= 70rem) {
      .gallery-item {
        flex: 0 0 25cqw;
      }
    }
  }
}


/* CSS for general presentation.
   You do not need this for your implementation! */
@layer base {
  :root {
    --sp: 1.25rem;
    --sp-s: calc(var(--sp) / 2);
    --sp-m: calc(var(--sp) * 2);
    --sp-l: calc(var(--sp) * 3);

    --clr-border: hsl(0, 0%, 85%);

    --radius: 0.5rem;
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: system-ui;
    margin: 0;
    line-height: 1.3;
  }

  main {
    padding-inline: var(--sp);
    padding-block: var(--sp-m);
    margin-inline: auto;
    max-inline-size: 150rem;
  }

  h1 {
    margin-block: 0 0.3em;
    text-wrap: balance;
  }

  p {
    margin-block: 0 1em;
  }

  baseline-status {
    border-radius: var(--radius);
  }

  section {
    padding-block-end: var(--sp-l);
  }

  header,
  footer {
    container: header / inline-size;
    max-width: 70ch;
    margin-inline: auto;
    margin-block-end: var(--sp-m);

    h1 {
      margin-block: 0 0.4em;
    }
  }

  .warning {
    display: block;
    background-color: #fcd34d;
    margin-block: var(--sp);
    padding: var(--sp);
    border-radius: var(--radius);

    @supports selector(::scroll-button(left)) and (scroll-marker-group: after) {
      display: none;
    }
  }

  .baseline-grid {
    display: flex;
    justify-content: space-between;
    gap: var(--sp);
    flex-direction: column;

    > * {
      flex: 1 1 50%;
    }

    @container (width >= 40em) {
      flex-direction: row;
    }
  }
}

.fade-carousel{
  position: relative;
  width: 80%;
  margin: 0 auto;
}

.exp-gallery{
  position: relative;
  list-style: none;
  color: #E8E8E6;
  padding: 40px 0 80px;
  height: auto !important;

}

.exp-gallery-item{
  box-sizing: border-box;
  width: 90%;
  margin: 0 auto;
  padding: 0 20px;
  border-left: 1px solid #E8E8E6;
  border-right: 1px solid #E8E8E6;


  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;


}

.exp-gallery-item.is-current{
  max-height: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  min-height: 330px;
}

.fade-btn{
  position: absolute;
  bottom: 50%;
  margin-left: -30px;
  margin-right: -30px;

  inline-size: 3rem;
  block-size: 3rem;
  border-radius: 50%;
  border: 0;
  background: var(--clr-button);
  color: var(--clr-button-text);
  cursor: pointer;
  transition: filter 120ms ease-in-out;
}

.fade-btn:hover{
  filter: brightness(1.15);
}

.fade-btn.next{
  right:0;


  background: var(--clr-button) no-repeat center var(--svg-arrow-right-white);
}

.fade-btn.prev {
  left: 0;
  background: var(--clr-button) no-repeat center var(--svg-arrow-left-white);
}
