/**
 * tingle.js - A simple modal plugin written in pure JavaScript
 * @version v0.16.0
 * @link https://github.com/robinparisi/tingle#readme
 * @license MIT
 */

.tingle-modal * {
  box-sizing: border-box;
}

.tingle-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  touch-action: none;
  background: rgba(0, 0, 0, .3);
  opacity: 0;
  will-change: opacity;
  transition: opacity .3s ease-in-out;
  padding: 0 2em;
}


/* modal
-------------------------------------------------------------- */

.tingle-modal--noOverlayClose {
  cursor: default;
}

.tingle-modal--noClose .tingle-modal__close {
  display: none;
}

.tingle-modal__close {
    position: fixed;
    top: -15px;
    right: -15px;
    z-index: 1000;
    padding: 0;
    width: 45px;
    height: 45px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 40px 2px rgb(0 0 0 / 15%);
    transition: box-shadow 0.3s ease-in-out;
    --primarybtnbg: var(--nv-site-bg);
    --primarybtnhoverbg: var(--nv-site-bg);
    --primarybtncolor: var(--nv-text-color);
    --primarybtnhovercolor: var(--nv-text-color);
}

.tingle-modal__close svg {
  width: 15px;
  height: 15px;
  display: block;
  transition: transform 0.25s ease-in-out;
}

.tingle-modal__close:hover svg {
	transform: scale(1.2);
}

.tingle-modal__closeLabel {
  display: none;
}

.tingle-modal-box {
  position: relative;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: auto;
  border-radius: 16px;
  background: var(--nv-site-bg);
  color: var(--nv-text-color);
  opacity: 1;
  cursor: auto;
  will-change: transform, opacity;
  max-width: var(--container);
  width: 100%;
  padding: 3em 1.5em;
  max-height: calc(100svh - 4em);
}

.tingle-modal-box__content {
  padding: 0 1.5em;
  max-height: 100%;
  overflow-y: auto;
  position: relative;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch; 
  touch-action: pan-y;
}


/* state
-------------------------------------------------------------- */

html {
  scrollbar-gutter: stable;
}

body.tingle-enabled {
  overflow: hidden;
}

.tingle-modal--visible {
  opacity: 1;
}

.tingle-modal--visible .tingle-modal-box {
  animation: fadeInUp 0.4s ease-out forwards;
}


/* animations
-------------------------------------------------------------- */

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  60% {
    opacity: 1;
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}


/* responsive
-------------------------------------------------------------- */

@media (max-width: 959px) {
  .tingle-modal {
    padding: 0 1.5em;
  }
  .tingle-modal-box {
    max-height: calc(100svh - 3em);
    padding: 2.5em 1em;
  }
  .tingle-modal-box__content {
    padding: 0 1em;
  }
}