/* Fullscreen PDF layout for the document viewer.
   Activates only when an iframe is present (via :has()). */

.document-viewer:has(.document-viewer__page iframe) {
  padding: 8px;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  min-height: 0;
}

/* Expand the document card to the available space when it contains an iframe */
.document-viewer__page:has(iframe) {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  padding: 0;
  display: block;
  min-height: 0;
  background: var(--color-white, #fff);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Make the iframe itself fill the container */
.document-viewer__page:has(iframe) iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Use a little more space on larger screens */
@media (min-width: 900px) {
  .document-viewer:has(.document-viewer__page iframe) {
    padding: 12px;
  }
}

@media (min-width: 1200px) {
  .document-viewer:has(.document-viewer__page iframe) {
    padding: 16px;
  }
}
