/* PDTI Visitor Archive v1.1.0 — only applies where archive shortcode is used. */
.pdti-visitor-archive,
.pdti-visitor-archive * { box-sizing: border-box; }

/* Widen via margins rather than transforms: transforms on ancestors break fixed modals. */
.pdti-visitor-archive--wide {
  --pdti-archive-max-width: 1760px;
  --pdti-archive-gutter: clamp(12px, 2vw, 30px);
  width: min(var(--pdti-archive-max-width), calc(100vw - (2 * var(--pdti-archive-gutter)))) !important;
  max-width: none !important;
  min-width: 0;
  position: relative;
  margin-left: calc(50% - min(880px, (50vw - var(--pdti-archive-gutter)))) !important;
  margin-right: 0 !important;
  transform: none !important;
  contain: none !important;
  overflow: visible !important;
}

/* The plugin's immediate surface can fill the archive width. The script
   relaxes only the ancestor chain of the list, never the individual cards. */
.pdti-visitor-archive--wide > :is(div,section,main) {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}

/* Only the dialog actively moved to the body receives viewport-level styles. */
body > .pdti-visitor-archive-portal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 12px !important;
  z-index: 2147483000 !important;
  box-sizing: border-box !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
body > .pdti-visitor-archive-portal :is([role="dialog"],[class*="modal-dialog"],[class*="modal-content"],[class*="popup-content"],[class*="modal-inner"]) {
  box-sizing: border-box !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

@media (max-width: 767px) {
  .pdti-visitor-archive--wide {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body > .pdti-visitor-archive-portal { padding: 8px !important; }
}
