/* 아트서울 상세 갤러리 v5 / 크기 단위: rem, em, % */
.as-gallery .as-gallery-view { position: relative; overflow: hidden; padding: 0; }
.as-gallery .as-gallery-primary { display: flex; align-items: center; justify-content: center; position: relative; width: 100%; min-height: 29rem; padding: 2rem; border: 0; background: transparent; cursor: zoom-in; }
.as-gallery .as-gallery-primary img { display: block; max-width: 100%; max-height: 32rem; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.as-gallery-magnify { position: absolute; right: .95rem; top: .95rem; display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border-radius: 50%; background: rgba(255,255,255,.93); color: #263948; box-shadow: 0 .15rem .6rem rgba(20,30,40,.13); }
.as-gallery-magnify svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.as-gallery-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 0; border-radius: 50%; color: #263948; background: rgba(255,255,255,.93); cursor: pointer; font-size: 1.1rem; box-shadow: 0 .1rem .55rem rgba(0,0,0,.1); }
.as-gallery-arrow--prev { left: .8rem; }
.as-gallery-arrow--next { right: .8rem; }
.as-gallery-count { position: absolute; left: 50%; bottom: .85rem; transform: translateX(-50%); background: rgba(25,37,48,.75); border-radius: 2em; color: #fff; font-size: .72rem; padding: .3rem .7rem; pointer-events: none; }
.as-gallery-thumbs { display: flex; gap: .6rem; overflow-x: auto; padding: .8rem 0 .25rem; scrollbar-width: thin; }
.as-gallery-thumb { flex: 0 0 5.5rem; height: 5.5rem; overflow: hidden; border: .12rem solid transparent; background: #f0f1f3; padding: .25rem; cursor: pointer; }
.as-gallery-thumb.is-active { border-color: #263f59; }
.as-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.as-gallery button:focus-visible, .as-art-zoom button:focus-visible { outline: .16rem solid #74a5e2; outline-offset: .13rem; }

.as-art-zoom[hidden] { display: none !important; }
html.as-art-zoom-open, body.as-art-zoom-open { overflow: hidden !important; }
body.as-art-zoom-open .art-detail-floating { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.as-art-zoom { position: fixed; inset: 0; z-index: 9999; display: block; background: #111820; color: #fff; overflow: hidden; overscroll-behavior: contain; touch-action: none; font-family: inherit; }
.as-art-zoom-backdrop { position: absolute; inset: 0; background: #111820; }
.as-art-zoom-top { position: absolute; inset: 0 0 auto; height: 4.3rem; z-index: 4; padding: .8rem 1.3rem; display: flex; align-items: center; gap: 1rem; background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent); }
.as-art-zoom-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .9rem; font-weight: 550; flex: 1; }
.as-art-zoom-index { font-size: .79rem; color: #cfd8e0; white-space: nowrap; }
.as-art-zoom-close { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; color: #fff; background: rgba(255,255,255,.15); cursor: pointer; border-radius: 50%; font-size: 2rem; line-height: 1; }
.as-art-zoom-stage { position: absolute; inset: 4.4rem 0 5.7rem; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: grab; }
.as-art-zoom-stage.is-dragging { cursor: grabbing; }
.as-art-zoom-image { display: block; position: absolute; left: 50%; top: 50%; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: center center; transform: translate3d(-50%, -50%, 0) scale(1); pointer-events: none; user-select: none; -webkit-user-select: none; }
.as-art-zoom-arrow { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); width: 2.65rem; height: 3.2rem; display: grid; place-items: center; border: 0; color: #fff; background: rgba(0,0,0,.48); cursor: pointer; font-size: 1.35rem; }
.as-art-zoom-arrow--prev { left: .8rem; }
.as-art-zoom-arrow--next { right: .8rem; }
.as-art-zoom-tools { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: .4rem; padding: .35rem; border: .0625rem solid rgba(255,255,255,.2); border-radius: 2.4rem; background: rgba(10,15,22,.88); white-space: nowrap; }
.as-art-zoom-tools button { min-width: 2.65rem; min-height: 2.65rem; border: 0; border-radius: 1.7rem; color: #fff; background: rgba(255,255,255,.13); font-size: 1.05rem; cursor: pointer; padding: 0 .7rem; }
.as-art-zoom-tools button:last-child { padding: 0 .85rem; font-size: .72rem; }
.as-art-zoom-tools button:hover, .as-art-zoom-close:hover { background: rgba(255,255,255,.26); }
.as-art-zoom-percent { min-width: 3.3rem; font-size: .75rem; text-align: center; font-variant-numeric: tabular-nums; }
.as-art-zoom-help { position: absolute; bottom: .4rem; left: 0; right: 0; z-index: 4; margin: 0; text-align: center; font-size: .65rem; color: #afbac4; pointer-events: none; }

@media (max-width: 70rem) { .as-gallery .as-gallery-primary { min-height: 24rem; } }
@media (max-width: 48rem) {
  .as-gallery .as-gallery-primary { min-height: 20rem; }
  .as-gallery-thumb { flex-basis: 4.7rem; height: 4.7rem; }
  .as-art-zoom-top { padding: .7rem .8rem; }
  .as-art-zoom-arrow { width: 2.2rem; height: 2.8rem; }
  .as-art-zoom-arrow--prev { left: .25rem; }
  .as-art-zoom-arrow--next { right: .25rem; }
  .as-art-zoom-stage { inset: 4.4rem 0 5.4rem; }
  .as-art-zoom-tools { bottom: calc(1.7rem + env(safe-area-inset-bottom, 0rem)); }
  .as-art-zoom-help { display: none; }
}
@media (max-width: 28rem) { .as-gallery .as-gallery-primary { min-height: 17rem; padding: 1.2rem; } .as-gallery .as-gallery-primary img { max-height: 22rem; } }
@media (prefers-reduced-motion: reduce) { .as-gallery *, .as-art-zoom * { scroll-behavior: auto !important; transition: none !important; } }

/* v5: 마우스 및 터치 드래그 시 실제 슬라이드가 손을 따라 움직이는 트랙 */
.as-gallery .as-gallery-primary.as-gallery-can-drag {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.as-gallery .as-gallery-primary.is-dragging { cursor: grabbing; }
.as-gallery .as-gallery-primary img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.as-gallery-drag-track {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  width: 300%;
  height: 100%;
  transform: translate3d(-33.333333%, 0, 0);
  will-change: transform;
  pointer-events: none;
}
.as-gallery-drag-slide {
  flex: 0 0 33.333333%;
  box-sizing: border-box;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}
.as-gallery .as-gallery-magnify { z-index: 1; pointer-events: none; }
@media (max-width: 28rem) {
  .as-gallery-drag-slide { padding: 1.2rem; }
}

/* v6 - 동영상/PDF 썸네일 및 팝업: 모두 rem/em/% 크기 */
.as-gallery-media-tag { position: absolute; bottom: .25rem; left: .25rem; right: .25rem; display: block; background: rgba(17,25,35,.83); color: #fff; text-align: center; font-size: .65rem; letter-spacing: .04em; padding: .24rem .2rem; }
.as-gallery-thumb { position: relative; }
.as-art-zoom [hidden] { display: none !important; }
.as-media-video { position: absolute; z-index: 2; inset: 4.7rem 2.7rem 5.6rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; }
.as-media-video video { display: block; width: 100%; height: 100%; max-width: 72rem; max-height: 100%; object-fit: contain; background: #05090d; }
.as-media-video p { color: #dfe6ee; font-size: .82rem; margin: 0; }
.as-pdf-pane { position: absolute; z-index: 2; inset: 4.5rem 0 0; display: flex; flex-direction: column; background: #353c45; }
.as-pdf-toolbar { display: flex; gap: .45rem; padding: .55rem .8rem; align-items: center; justify-content: center; flex-wrap: wrap; background: #222e3a; z-index: 3; }
.as-pdf-toolbar button, .as-pdf-toolbar a { border: .0625rem solid rgba(255,255,255,.22); background: rgba(255,255,255,.12); color: #fff; padding: .5rem .7rem; border-radius: .35rem; cursor: pointer; font: inherit; font-size: .76rem; text-decoration: none; white-space: nowrap; }
.as-pdf-toolbar button:hover, .as-pdf-toolbar a:hover { background: rgba(255,255,255,.24); }
.as-pdf-toolbar span { font-size: .76rem; min-width: 3.2rem; text-align: center; }
.as-pdf-toolbar-separator { display: block; width: .0625rem; height: 1.35rem; min-width: 0 !important; background: rgba(255,255,255,.3); margin: 0 .3rem; }
.as-pdf-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 1rem; text-align: center; touch-action: pan-x pan-y; }
.as-pdf-scroll canvas { display: block; margin: 0 auto; background: #fff; box-shadow: 0 .2rem 1.4rem rgba(0,0,0,.3); }
.as-pdf-status { position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%); padding: 1rem; background: rgba(11,19,27,.9); border-radius: .3rem; font-size: .82rem; color: #fff; width: max-content; max-width: 80%; white-space: normal; }
.as-art-zoom:has(.as-pdf-pane:not([hidden])) .as-art-zoom-arrow { top: 60%; }
@media (max-width: 48rem) {
  .as-media-video { inset: 4.5rem .3rem 5.6rem; }
  .as-pdf-pane { inset: 4.3rem 0 0; }
  .as-pdf-toolbar { gap: .25rem; padding: .45rem .35rem; }
  .as-pdf-toolbar button, .as-pdf-toolbar a { padding: .45rem .55rem; font-size: .7rem; }
  .as-pdf-toolbar-separator { margin: 0; }
}
