/* Popup s obrázkom (banner) – viď components/popup.php */

.du-popup,
.du-popup * {
  box-sizing: border-box;
}

.du-popup[hidden] {
  display: none !important;
}

.du-popup-open {
  overflow: hidden;
}

.du-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.du-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 11, 17, .68);
  backdrop-filter: blur(4px);
}

.du-popup__dialog {
  position: relative;
  z-index: 1;
  /* Šírka = 100 %, najviac 1200px, a zároveň taká, aby výška obrázka
     nepresiahla 80vh. --du-popup-ratio (šírka / výška) dopĺňa PHP z obrázka. */
  width: min(100%, 1200px, calc(80vh * var(--du-popup-ratio)));
  /* dvh – na mobiloch je 100vh vyššie ako viditeľná plocha */
  width: min(100%, 1200px, calc(80dvh * var(--du-popup-ratio)));
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  animation: du-popup-in .28s ease-out both;
}

.du-popup__dialog:focus {
  outline: none;
}

.du-popup__link,
.du-popup__link img {
  display: block;
}

.du-popup__link img {
  width: 100%;
  height: auto;
  max-width: none;
}

/* Tmavé koliesko s bielym krížikom – je vidieť na svetlom aj tmavom banneri. */
.du-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: background-color .15s ease;
}

.du-popup__close::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.4 2.4l11.2 11.2M13.6 2.4L2.4 13.6' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.4 2.4l11.2 11.2M13.6 2.4L2.4 13.6' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.du-popup__close:hover,
.du-popup__close:focus-visible {
  background: rgba(0, 0, 0, .7);
}

@keyframes du-popup-in {
  from { opacity: 0; transform: translateY(15px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .du-popup__close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .du-popup__dialog {
    animation: none;
  }
}
