/* -------------------------------
   Shell
   ------------------------------- */

.popover {
  --popover-arrow-size: 1rem;

  position: fixed;
  z-index: 1000;
  box-sizing: border-box;
  width: -moz-max-content;
  width: max-content;
  max-width: min(24rem, calc(100vw - 2rem));
  border: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-radius: 5px;
  background: var(--color-surface-white);
  color: var(--color-font-primary);
  box-shadow: 0 0.4rem 1.6rem rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-0.2rem);
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.popover.is-open {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------
   Arrow
   ------------------------------- */

.popover__arrow {
  position: absolute;
  width: var(--popover-arrow-size);
  height: var(--popover-arrow-size);
  border-top: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-left: 1px solid var(--color-ambient-mint-light-lowsaturation);
  background: var(--color-surface-white);
  transform: rotate(45deg);
  z-index: -1;
}

.popover[data-side="top"] .popover__arrow {
  border-top: 0;
  border-right: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-bottom: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-left: 0;
}

.popover[data-side="left"] .popover__arrow {
  border-top: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-right: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-bottom: 0;
  border-left: 0;
}

.popover[data-side="right"] .popover__arrow {
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--color-ambient-mint-light-lowsaturation);
  border-left: 1px solid var(--color-ambient-mint-light-lowsaturation);
}

/* -------------------------------
   Content
   ------------------------------- */

.popover__content {
  position: relative;
  display: block;
  padding: 1rem 1.2rem;
}

/* -------------------------------
   Trigger Variants
   ------------------------------- */

.popover__trigger--link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-ambient-rosa);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
