/* FIX2813 — Full Labs Guide PDF viewer only. Never affects paid previews, other resources, or PDFs. */
body.resource-topic-page .resource-topic-reader .nga2813-reader{
  box-sizing:border-box;min-width:0;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader-heading{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin:4px 0 14px;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader-heading h2{
  margin:0;min-width:0;
}
body.resource-topic-page .resource-topic-reader .nga2813-maximize{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:10px 16px;border:1px solid #bdd0e6;background:#f7fbff;color:#174a85;
  border-radius:10px;font-family:inherit;font-weight:700;font-size:14px;line-height:1.3;cursor:pointer;white-space:nowrap;
  box-shadow:0 1px 3px rgba(14,49,95,.08);
}
body.resource-topic-page .resource-topic-reader .nga2813-maximize:hover,
body.resource-topic-page .resource-topic-reader .nga2813-maximize:focus-visible{
  border-color:#2580e5;background:#ecf5ff;outline-offset:2px;
}
/* A4-sized viewing window: height tracks the *actual* reader width, not viewport height.
   The old 82vh cap hid the bottom of the first page and forced an inner scrollbar. */
body.resource-topic-page .resource-topic-reader .nga2813-reader .document-viewer.nga2813-full-pdf-frame{
  box-sizing:border-box;position:relative;width:100%!important;max-width:none!important;
  height:auto!important;min-height:0!important;aspect-ratio:210 / 297!important;
  margin:0 auto!important;background:#e9eff6;border:1px solid #d5e1ed;
  border-radius:10px;overflow:hidden;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader .nga2813-full-pdf-frame iframe{
  position:absolute;inset:0;width:100%!important;height:100%!important;
  min-height:0!important;max-height:none!important;border:0;display:block;
}
/* Full viewport reading mode. Native Fullscreen API is used where allowed;
   fixed positioning remains available on browsers that deny the API. */
body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded,
body.resource-topic-page .resource-topic-reader .nga2813-reader:fullscreen{
  position:fixed!important;inset:0!important;z-index:2147483000!important;
  display:flex!important;flex-direction:column!important;gap:12px!important;
  box-sizing:border-box!important;overflow:hidden!important;
  width:100vw!important;height:100vh!important;height:100dvh!important;
  max-width:none!important;min-width:0!important;max-height:none!important;
  margin:0!important;padding:clamp(8px,1.8vw,20px)!important;
  border:0!important;border-radius:0!important;
  background:#f5f8fd!important;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded .nga2813-reader-heading,
body.resource-topic-page .resource-topic-reader .nga2813-reader:fullscreen .nga2813-reader-heading{
  flex:0 0 auto;margin:0!important;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded > .eyebrow,
body.resource-topic-page .resource-topic-reader .nga2813-reader:fullscreen > .eyebrow{
  display:none!important;
}
body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded .nga2813-full-pdf-frame,
body.resource-topic-page .resource-topic-reader .nga2813-reader:fullscreen .nga2813-full-pdf-frame{
  flex:1 1 auto!important;aspect-ratio:auto!important;min-height:0!important;
  height:auto!important;width:100%!important;max-width:none!important;
  margin:0!important;border-radius:8px!important;
}
html.nga2813-no-scroll,body.nga2813-no-scroll{overflow:hidden!important;}
@media(max-width:850px){
  body.resource-topic-page .resource-topic-reader .nga2813-reader{padding:12px!important;}
  body.resource-topic-page .resource-topic-reader .nga2813-reader-heading{align-items:center;gap:8px;}
  body.resource-topic-page .resource-topic-reader .nga2813-reader-heading h2{font-size:clamp(19px,5.3vw,25px);}
  body.resource-topic-page .resource-topic-reader .nga2813-maximize{font-size:13px;padding:9px 11px;}
  /* FIX2809 PDF.js creates its own intrinsic-height page on mobile. Let it show
     in full, rather than reintroducing the previous 70vh/75vh viewport cap. */
  body.resource-topic-page .resource-topic-reader .nga2813-reader .nga2813-full-pdf-frame.nga-pdf-mobile-ready{
    height:auto!important;min-height:0!important;aspect-ratio:auto!important;
  }
  body.resource-topic-page .resource-topic-reader .nga2813-reader:not(.nga2813-expanded) .nga2813-full-pdf-frame .nga-mobile-pdf-scroll{
    max-height:none!important;height:auto!important;
  }
  body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded{
    padding:9px!important;
  }
  body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded .nga2813-full-pdf-frame.nga-pdf-mobile-ready{
    height:auto!important;aspect-ratio:auto!important;display:flex!important;
    flex:1 1 auto!important;overflow:hidden!important;
  }
  body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded .nga-mobile-pdf{
    height:100%!important;min-height:0!important;flex:1 1 auto!important;
  }
  body.resource-topic-page .resource-topic-reader .nga2813-reader.nga2813-expanded .nga-mobile-pdf-scroll{
    flex:1 1 auto!important;min-height:0!important;max-height:none!important;
    height:auto!important;overflow:auto!important;
  }
}
