/* e카탈로그 뷰어 (sub/sub1_7.php) */
.ebook {position: relative; padding: 34px 20px 22px; background: radial-gradient(ellipse at 50% 40%, #3b4557 0%, #232a36 55%, #161b23 100%); color: #fff; user-select: none;}
.ebook-inner {max-width: 1500px; margin: 0 auto;}

/* 무대: 책 + 양옆 화살표 */
.ebook-stage {position: relative; display: flex; align-items: center; justify-content: center;}
/* 펼친 책(두 쪽)이 화면 높이에 맞게 들어오도록 폭을 높이로부터 정한다. 1.4219 = 쪽 비율(0.711) × 2 */
.ebook-book-wrap {width: min(100% - 120px, calc((100vh - 250px) * 1.4219)); min-width: 260px; transition: transform .6s ease;}
.ebook-stage.is-cover .ebook-book-wrap {transform: translateX(-25%);}   /* 표지만 보일 때 가운데로 */
.ebook-stage.is-back .ebook-book-wrap {transform: translateX(25%);}     /* 뒤표지만 보일 때 가운데로 */
.ebook-stage .stf__parent {margin: 0 auto;}
.ebook-stage .stf__block {filter: drop-shadow(0 18px 30px rgba(0,0,0,.55));}
.ebook-page {background: #fff; overflow: hidden;}
.ebook-page img {display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none;}
/* 가운데 접힘선: 왼쪽 쪽은 오른쪽 가장자리, 오른쪽 쪽은 왼쪽 가장자리를 어둡게 */
.ebook-page::after {content: ""; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; z-index: 1;}
.ebook-page.--left::after {right: 0; background: linear-gradient(to left, rgba(0,0,0,.20), rgba(0,0,0,0));}
.ebook-page.--right::after {left: 0; background: linear-gradient(to right, rgba(0,0,0,.20), rgba(0,0,0,0));}

/* 아이콘(sub1_7.php eb_icon) */
.ebook-ico {display: block; width: 20px; height: 20px; flex: 0 0 auto;}

.ebook-arrow {position: absolute; top: 50%; z-index: 5; display: flex; align-items: center; justify-content: center; width: 52px; height: 92px; margin-top: -46px; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; transition: background .2s;}
.ebook-arrow .ebook-ico, .ebook-photo-nav .ebook-ico {width: 30px; height: 30px; stroke-width: 1.8;}
.ebook-arrow.prev {left: 0;} .ebook-arrow.next {right: 0;}
.ebook-arrow:hover, .ebook-arrow:focus-visible {background: #ED4E27; outline: none;}
.ebook-arrow:disabled {opacity: .15; cursor: default; background: rgba(255,255,255,.08);}

/* 툴바 */
.ebook-toolbar {display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 22px auto 0; padding: 6px 10px; width: fit-content; max-width: 100%; border-radius: 30px; background: rgba(0,0,0,.35);}
.ebook-toolbar button, .ebook-toolbar select {height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;}
.ebook-toolbar button {display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px;}
.ebook-toolbar button[aria-label] {padding: 0 8px;}   /* 아이콘만 있는 버튼 */
.ebook-toolbar .ebook-ico {width: 18px; height: 18px;}
.ebook-toolbar select {background: rgba(255,255,255,.1); padding-right: 6px;}
.ebook-toolbar select option {color: #222;}
.ebook-toolbar button:hover, .ebook-toolbar button:focus-visible, .ebook-toolbar select:focus-visible {background: #ED4E27; outline: none;}
.ebook-toolbar button:disabled {opacity: .3; cursor: default; background: transparent;}
/* PDF 다운로드: 다른 버튼과 같은 모양, 눈에 띄게 테두리 */
.ebook-toolbar .ebook-down {display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .2s, box-shadow .2s;}
.ebook-toolbar .ebook-down:hover, .ebook-toolbar .ebook-down:focus-visible {background: #ED4E27; box-shadow: none; outline: none;}
.ebook-toolbar .ebook-count {min-width: 84px; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: .5px;}
.ebook-toolbar .ebook-sep {width: 1px; height: 20px; background: rgba(255,255,255,.25); margin: 0 4px;}

/* 쪽 미리보기 띠 */
.ebook-thumbs {display: flex; gap: 8px; margin: 18px auto 0; padding: 4px 4px 10px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent;}
.ebook-thumbs button {flex: 0 0 auto; width: 54px; padding: 0; border: 2px solid transparent; border-radius: 3px; background: none; cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s;}
.ebook-thumbs button img {display: block; width: 100%; aspect-ratio: 0.711; object-fit: cover;}
.ebook-thumbs button span {display: block; margin-top: 3px; font-size: 11px; color: rgba(255,255,255,.8);}
.ebook-thumbs button:hover, .ebook-thumbs button:focus-visible {opacity: 1; outline: none;}
.ebook-thumbs button.is-on {opacity: 1; border-color: #ED4E27;}

/* 페이지 위 클릭 영역 (목차·영상) */
.ebook-hs {position: absolute; display: block; z-index: 3; border-radius: 4px; transition: background .2s, box-shadow .2s;}
/* 사진 버튼: 평소에는 투명, 올리면 테두리 */
.ebook-ph {position: absolute; z-index: 2; padding: 0; border: 0; background: transparent; cursor: zoom-in; transition: box-shadow .2s, background .2s;}
.ebook-ph:hover, .ebook-ph:focus-visible {background: rgba(237,78,39,.08); box-shadow: inset 0 0 0 2px rgba(237,78,39,.75); outline: none;}
.ebook-hs:hover, .ebook-hs:focus-visible {background: rgba(237,78,39,.10); box-shadow: inset 0 0 0 2px rgba(237,78,39,.6); outline: none;}
.ebook-hs.is-video:hover, .ebook-hs.is-video:focus-visible {background: rgba(237,78,39,.16);}
.ebook-page img {cursor: zoom-in;}
.ebook-hint {margin: 10px 0 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.55);}

/* 전체화면 */
.ebook:fullscreen {display: flex; flex-direction: column; justify-content: center; padding: 20px;}
.ebook:fullscreen .ebook-book-wrap {width: min(100% - 120px, calc((100vh - 190px) * 1.4219));}

/* 확대 보기 */
.ebook-zoom {position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; background: rgba(10,14,22,.95);}
.ebook-zoom[hidden] {display: none;}
.ebook-zoom-bar {display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; color: #fff;}
.ebook-zoom-bar button {display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 40px; padding: 0 12px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-size: 15px; font-weight: 600; border-radius: 4px; cursor: pointer;}
.ebook-zoom-bar button:hover, .ebook-zoom-bar button:focus-visible {border-color: #ED4E27; background: #ED4E27; outline: none;}
.ebook-zoom-bar .ebook-zoom-label {min-width: 110px; text-align: center; font-weight: 700;}
.ebook-zoom-view {flex: 1; overflow: auto; cursor: grab; text-align: center; -webkit-overflow-scrolling: touch;}
.ebook-zoom-view.dragging {cursor: grabbing;}
.ebook-zoom-view img {display: inline-block; max-width: none; height: auto; margin: 0 auto; user-select: none; -webkit-user-drag: none;}

/* 사진 원본 보기 */
.ebook-photo {position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; background: rgba(10,14,22,.95);}
.ebook-photo[hidden] {display: none;}
.ebook-photo-bar {display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; color: #fff;}
.ebook-photo-label {font-weight: 700; font-size: 15px;}
.ebook-photo-bar button {display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-weight: 600; border-radius: 4px; cursor: pointer;}
.ebook-photo-bar button:hover, .ebook-photo-bar button:focus-visible {border-color: #ED4E27; background: #ED4E27; outline: none;}
.ebook-photo-view {flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 80px 24px; overflow: auto;}
.ebook-photo-view img {max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; box-shadow: 0 10px 40px rgba(0,0,0,.5);}
.ebook-photo-view.is-alpha img {background: #fff; padding: 24px;}
.ebook-photo-view.is-full {display: block; text-align: center;}
.ebook-photo-view.is-full img {max-width: none; max-height: none; cursor: zoom-out;}
.ebook-photo-nav {position: absolute; top: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; width: 52px; height: 92px; margin-top: -46px; padding: 0; border: 0; border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; cursor: pointer;}
.ebook-photo-nav.prev {left: 14px;} .ebook-photo-nav.next {right: 14px;}
.ebook-photo-nav:hover, .ebook-photo-nav:focus-visible {background: #ED4E27; outline: none;}

/* 영상 보기 */
.ebook-video {position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 60px 20px 20px; background: rgba(10,14,22,.9);}
.ebook-video[hidden] {display: none;}
.ebook-video-box {position: relative; width: min(960px, 100%, (100vh - 100px) * 1.7778); aspect-ratio: 16 / 9; background: #000;}
.ebook-video-box.is-short {width: min(420px, 100%, (100vh - 100px) * 0.5625); aspect-ratio: 9 / 16;}
.ebook-video-box iframe {width: 100%; height: 100%; border: 0;}
.ebook-video-close {position: absolute; right: 0; top: -46px; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-weight: 600; border-radius: 4px; cursor: pointer;}
.ebook-video-close:hover, .ebook-video-close:focus-visible {border-color: #ED4E27; background: #ED4E27; outline: none;}

@media (max-width: 768px) {
  .ebook {padding: 20px 8px 14px;}
  .ebook-book-wrap {width: min(100% - 16px, calc((100vh - 260px) * 0.711));}
  .ebook-stage.is-cover .ebook-book-wrap, .ebook-stage.is-back .ebook-book-wrap {transform: none;}
  .ebook-arrow {display: none;}
  .ebook-toolbar {border-radius: 12px; gap: 2px;}
  .ebook-toolbar button, .ebook-toolbar select {height: 34px; padding: 0 9px; font-size: 13px;}
  .ebook-toolbar button[aria-label] {padding: 0 6px;}
  .ebook-toolbar .ebook-down {height: 34px; padding: 0 10px; font-size: 13px;}
  .ebook-toolbar .ebook-sep, .ebook-toolbar .ebook-full {display: none;}
  .ebook-thumbs button {width: 44px;}
  .ebook-photo-view {padding: 0 8px 70px;}
  .ebook-photo-nav {top: auto; bottom: 12px; margin-top: 0; width: 56px; height: 48px;}
  .ebook-photo-nav .ebook-ico {width: 26px; height: 26px;}
}
