/* Open state of the dialog  */
dialog:open {
  opacity: 1;
  display: grid;
}

/* Closed state of the dialog   */
dialog {
  opacity: 0;
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out,
    overlay 0.7s ease-out allow-discrete,
    display 0.7s ease-out allow-discrete;
  border: none;
  padding: 32px;
  /* border-radius: 16px; */
  box-shadow: 0 8px 8px var(--shadow-color);
  gap: 8px;
  display: none;
  background-color: #151925;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* border: solid 1px var(--font-color); */
  /* Equivalent to
  transition: all 0.7s allow-discrete; */

  & .buttons-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
  }

  & h1 {
    width: 100%;
    text-align: center;
    color: var(--light-color);
  }

  & form {
    display: grid;
    gap: 8px;
  }
}

/* Before open state  */
/* Needs to be after the previous dialog:open rule to take effect,
    as the specificity is the same */
@starting-style {
  dialog:open {
    opacity: 0;
  }
}

/* Transition the :backdrop when the dialog modal is promoted to the top layer */
dialog::backdrop {
  background-color: transparent;
  transition:
    display 0.7s allow-discrete,
    overlay 0.7s allow-discrete,
    background-color 0.7s;
  /* Equivalent to
  transition: all 0.7s allow-discrete; */
}

dialog:open::backdrop {
  background-color: rgb(0 0 0 / 25%);
}

/* This starting-style rule cannot be nested inside the above selector
because the nesting selector cannot represent pseudo-elements. */

@starting-style {
  dialog:open::backdrop {
    background-color: transparent;
  }
}


dialog {
  & .carrousel{
    width: 20vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;

    & img {
      width: 100%;
      aspect-ratio: 1;
      object-fit: contain;
      /* background: linear-gradient(135deg,#1a2540 0%,#0f1825 100%); */
      background-color: #151925;
      /* border: solid 1px var(--font-color); */
      border-radius: 8px;
    }
    & .overlay {
      transition: all 300ms;
      opacity: 0;
      pointer-events: none;
      width: 100%;
      display: flex;
      justify-content: space-around;
      align-items: center;
      position: absolute;
      bottom: 0;
      left: 0;
      background: linear-gradient(0deg,rgba(0, 0, 0, 0.20) 30%, rgba(0, 0, 0, 0) 100%);
      padding: 64px 0 12px 0;

      & button.button.icon * {
        color: var(--highlight-color);
        text-shadow: 0 2px 2px var(--shadow-color);
        font-size: 24px;
      }
    }

    & .loading {
      display: flex;
      justify-content: center;
      align-items: center;
      background: linear-gradient(135deg,#1a2540 0%,#0f1825 100%);
      width: 100%;
      height: 100%;
      position: absolute;
      z-index: 2;

      & img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: contain;
      }
    }

    &:hover .overlay {
      opacity: 1;
      pointer-events: all;
    }

  }
}