/* One viewer, two independent four-page galleries. */
#free-resources .m-page-preview-box .ar-study-open {
  position:absolute;inset:0;z-index:2;border-radius:inherit;cursor:zoom-in;
}
#free-resources :is(.ar-study-open,.r115-study-tile):focus-visible {outline:3px solid #e5ba76;outline-offset:-3px;}
#free-resources .r115-study-tile {cursor:zoom-in;}
#free-resources .ar-study-open::after {
  content:'+';position:absolute;right:4%;top:4%;display:grid;place-items:center;
  width:clamp(22px,5.6vw,43px);aspect-ratio:1;border-radius:6px;
  background:#201710e8;color:#fff0d0;border:1px solid #a88655;
  font:600 clamp(15px,3vw,26px)/1 system-ui,sans-serif;box-shadow:0 2px 9px #0008;
}
html[data-unified-phone-layout] #free-resources .ar-study-open::after{width:43px;}
#ar-study-gallery {
  --study-unit:1;
  --study-pad:calc(10px * var(--study-unit));
  box-sizing:border-box;position:fixed;inset:0;margin:auto;
  width:min(96vw,calc(860px * var(--study-unit)));height:min(94vh,calc(930px * var(--study-unit)));
  height:min(94dvh,calc(930px * var(--study-unit)));max-width:none;max-height:none;padding:0;
  border:1px solid #927341;border-radius:calc(13px * var(--study-unit));
  color:#f5e8d2;background:#15110d;box-shadow:0 16px 60px #000a;overflow:hidden;
}
#ar-study-gallery[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;}
#ar-study-gallery::backdrop{background:#050403ea;}
#ar-study-gallery [hidden]{display:none!important;}
#ar-study-gallery :is(header,footer) {
  min-width:0;display:grid;align-items:center;gap:var(--study-pad);padding:var(--study-pad);
  background:linear-gradient(135deg,#2b2118,#1a140f 75%);
}
#ar-study-gallery header{grid-template-columns:minmax(0,1fr) auto;border-bottom:1px solid #6b5031;}
#ar-study-gallery footer{grid-template-columns:auto minmax(0,1fr) auto;border-top:1px solid #6b5031;}
#ar-study-gallery h2{margin:0;color:inherit;font:600 calc(16px * var(--study-unit))/1.2 Georgia,serif;}
#ar-study-gallery .ar-study-caption{margin:.25em 0 0;color:#e2c79d;font:500 calc(12px * var(--study-unit))/1.3 system-ui,sans-serif;}
#ar-study-gallery button{
  min-width:calc(44px * var(--study-unit));min-height:calc(44px * var(--study-unit));padding:0 calc(10px * var(--study-unit));
  color:#ffebc6;background:linear-gradient(#3d2e20,#241a13);border:1px solid #957344;border-radius:calc(7px * var(--study-unit));
  cursor:pointer;touch-action:manipulation;font:650 calc(13px * var(--study-unit))/1 system-ui,sans-serif;
}
#ar-study-gallery button:hover{background:#503b27;}
#ar-study-gallery button:focus-visible,#ar-study-gallery a:focus-visible{outline:2px solid #f1c780;outline-offset:2px;}
#ar-study-gallery .ar-study-stage{
  --study-image-pad:calc(5px * var(--study-unit));position:relative;display:grid;place-items:center;min-width:0;min-height:0;padding:var(--study-image-pad);
  overflow:hidden;touch-action:pan-y pinch-zoom;background:radial-gradient(ellipse at center,#2b2118,#0e0c0a 78%);
}
#ar-study-gallery .ar-study-stage img{position:absolute;inset:var(--study-image-pad);display:block;width:calc(100% - 2 * var(--study-image-pad));height:calc(100% - 2 * var(--study-image-pad));object-fit:contain;user-select:none;filter:drop-shadow(0 2px 8px #0009);}
#ar-study-gallery .ar-study-stage p{margin:1em;font:calc(14px * var(--study-unit))/1.4 system-ui,sans-serif;}
#ar-study-gallery .ar-study-tools{display:grid;justify-items:center;gap:calc(3px * var(--study-unit));font:600 calc(12px * var(--study-unit))/1.25 system-ui,sans-serif;}
#ar-study-gallery .ar-study-count{color:#f6e6c9;font-variant-numeric:tabular-nums;}
#ar-study-gallery .ar-study-original{color:#e2c79d;text-decoration:underline;text-underline-offset:2px;}
#ar-study-gallery :is(.ar-study-prev,.ar-study-next){font-size:calc(23px * var(--study-unit));}
@media(orientation:landscape) and (max-height:580px){
 #ar-study-gallery{--study-pad:calc(5px * var(--study-unit));height:96dvh;}
 #ar-study-gallery :is(header,footer){padding-block:calc(4px * var(--study-unit));}
}

@layer ar-study-gallery-controls {
 #ar-study-gallery button {
  min-width:calc(44px * var(--study-unit))!important;
  min-height:calc(44px * var(--study-unit))!important;
  font-size:calc(13px * var(--study-unit))!important;
  line-height:1!important;
 }
 #ar-study-gallery :is(.ar-study-prev,.ar-study-next){font-size:calc(23px * var(--study-unit))!important;}
}

