.site-popup[hidden] { display: none !important; }

.site-popup {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

body.site-popup-open { overflow: hidden; }

.site-popup__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(20, 20, 20, 0.62);
  cursor: pointer;
}

.site-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 28rem);
  max-height: min(92vh, 42rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-elev, #fff);
  color: var(--ink, #141414);
  border: 1px solid var(--line, #e4e4e0);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.site-popup__x {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--bg-elev, #fff);
  color: var(--ink, #141414);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.site-popup__x:hover,
.site-popup__x:focus-visible {
  color: var(--accent, #0a8f6e);
}

.site-popup__media {
  display: block;
  margin: 0;
  min-height: 0;
}

.site-popup__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 32rem);
  object-fit: contain;
  background: var(--bg, #f7f7f5);
}

.site-popup__bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 0.9rem 0.8rem;
}

.site-popup__hide {
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 0.82rem;
  color: var(--ink-muted, #5c5c58);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-popup__hide:hover,
.site-popup__hide:focus-visible {
  color: var(--accent, #0a8f6e);
}

@media (prefers-reduced-motion: reduce) {
  .site-popup,
  .site-popup__dialog {
    animation: none;
  }
}
