/*
 * LEON 4703 – externí styl popupu
 * Kódování: UTF-8
 */

#leon4703-popup,
#leon4703-popup * {
  box-sizing: border-box;
}

#leon4703-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 16, 12, 0.68);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#leon4703-popup.leon-popup-visible {
  opacity: 1;
  visibility: visible;
}

#leon4703-popup .leon-popup-dialog {
  position: relative;
  width: min(92vw, 900px);
  max-width: 1254px;
  max-height: min(900px, calc(100vh - 48px));
  overflow: visible;
  border-radius: 6px;
  background: #f3e8da;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#leon4703-popup.leon-popup-visible .leon-popup-dialog {
  transform: translateY(0) scale(1);
}

#leon4703-popup .leon-popup-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: min(900px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 6px;
  background: #f3e8da;
  line-height: 0;
  text-decoration: none;
}

#leon4703-popup .leon-popup-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(900px, calc(100vh - 48px));
  object-fit: contain;
}

#leon4703-popup .leon-popup-close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #251b12;
  color: #fff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 29px;
  font-weight: 400;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#leon4703-popup .leon-popup-close:hover,
#leon4703-popup .leon-popup-close:focus-visible {
  background: #6f5a43;
  outline: none;
  transform: scale(1.08);
}

body.leon-popup-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  #leon4703-popup {
    padding: 16px;
  }

  #leon4703-popup .leon-popup-dialog,
  #leon4703-popup .leon-popup-link,
  #leon4703-popup .leon-popup-image {
    max-height: calc(100vh - 32px);
  }

  #leon4703-popup .leon-popup-dialog {
    width: min(94vw, 540px);
  }

  #leon4703-popup .leon-popup-close {
    top: -13px;
    right: -9px;
    width: 40px;
    height: 40px;
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #leon4703-popup,
  #leon4703-popup .leon-popup-dialog {
    transition: none;
  }
}
