/* 새 넘김 엔진 뷰어(flipbook-viewer-v3.html) 전용. 위·아래 막대, 배지, 안내, 클릭 영역 모양은 magazine.css·flipbook-regions-v2.css 를 그대로 쓴다. */

/* 책 놓는 칸: 손가락 동작(넘김·확대·끌기)은 전부 스크립트가 받는다 → 브라우저 기본 확대·스크롤을 끈다 */
.fb3-stage {
    position: relative; flex: 1 1 auto; width: 100%; height: 100%; min-height: 0;
    overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent; padding: 0 !important; margin: 0 !important; /* #viewerRow 가 .row 라 자식에 여백이 붙는다 */
}
.fb3 #viewerRow { align-items: stretch; }
.fb3-zoom { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fb3-zoom.is-moving { will-change: transform; } /* 확대·옮기는 중에만(멈추면 빼서 선명하게 다시 그림) */
.fb3-zoom.is-anim { transition: transform .26s cubic-bezier(.2, .7, .2, 1); }
.fb3-zoom > .magazine { width: 100%; height: 100%; }
.fb3 .stf__parent { touch-action: none; }
.fb3 .stf__wrapper { height: 100%; }

/* 책장 */
.fb3 .magazine .page { background: #fff; box-shadow: none; overflow: hidden; }
.fb3 .magazine .page::before { /* 그림 오기 전 옅은 바탕 */
    content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, #f6f3ee 30%, #fbfaf7 50%, #f6f3ee 70%); background-size: 200% 100%;
    animation: fb3Shine 1.4s linear infinite; z-index: 0;
}
.fb3 .magazine .page.is-loaded::before { display: none; }
@keyframes fb3Shine { to { background-position: -200% 0; } }
.fb3 .magazine .page > img.pg {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: fill; z-index: 1;
    -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; pointer-events: none;
}
.fb3 .magazine .page .region { z-index: 3; }
.fb3 .stf__block { filter: drop-shadow(0 10px 28px rgba(26, 34, 56, .16)) drop-shadow(0 2px 6px rgba(26, 34, 56, .08)); }
/* 넘기는 동안·확대 중엔 그림자 필터를 끈다 — 필터는 매 장면 다시 그려 휴대폰에서 넘김이 끊겼다 */
.fb3.fb-zoomed .stf__block, .fb3.fb-turning .stf__block { filter: none; }
@media (hover: none) { .fb3 .stf__block { filter: drop-shadow(0 6px 16px rgba(26, 34, 56, .14)); } }
/* 한 쪽 보기: 필터 없이 칸 그림자(넘기는 동안 다시 그리지 않음). 두 쪽 보기는 표지만 홀로 있을 때가 있어 필터 유지 */
.fb3.fb3-single .stf__block { filter: none !important; }
.fb3.fb3-single .fb3-zoom { box-shadow: 0 8px 24px rgba(26, 34, 56, .16), 0 1px 4px rgba(26, 34, 56, .08); background: #fff; }
.fb3.fb-zoomed.fb3-single .fb3-zoom { box-shadow: none; }
.fb3.fb-zoomed .fb3-stage { cursor: grab; }
.fb3.fb-zoomed.is-panning .fb3-stage { cursor: grabbing; }
.fb3:not(.fb-zoomed) .stf__item { cursor: zoom-in; }
@media (hover: none) { .fb3:not(.fb-zoomed) .stf__item { cursor: default; } }

/* 양옆 넘김 단추: 넓은 화면은 책 바깥, 좁은 화면은 책 안쪽 가장자리 */
.fb3-side {
    position: absolute; top: 50%; z-index: 20; width: 52px; height: 52px; margin-top: -26px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .94); color: #1a2238; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .06); cursor: pointer; transition: transform .15s, opacity .2s;
}
.fb3-side:hover { transform: scale(1.07); }
.fb3-side:active { transform: scale(.95); }
.fb3-side[hidden], .fb3.fb-zoomed .fb3-side { display: none !important; }
@media (max-width: 767.98px) {
    .fb3-side { width: 36px; height: 36px; margin-top: -18px; font-size: 16px; background: rgba(255, 255, 255, .72); box-shadow: 0 3px 10px rgba(15, 23, 42, .14); }
}

/* 확대 배율 잠깐 보이기 */
.fb3-zoomhint {
    position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 25; pointer-events: none;
    background: rgba(17, 24, 39, .78); color: #fff; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 5px 12px;
    opacity: 0; transition: opacity .2s;
}
.fb3-zoomhint.is-on { opacity: 1; }

/* 썸네일: 펼침면 단위, 두 줄 격자 */
.fb3-thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
.fb3-thumbs.is-single { grid-template-columns: repeat(3, 1fr); }
.fb3-thumb { border: 0; background: transparent; padding: 0; text-align: center; cursor: pointer; }
.fb3-thumb .imgs { display: flex; justify-content: center; border-radius: 4px; outline: 3px solid transparent; outline-offset: 1px; }
.fb3-thumb img { width: 50%; height: auto; display: block; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.fb3-thumb.is-solo img, .fb3-thumbs.is-single .fb3-thumb img { width: 100%; }
.fb3-thumb.is-solo .imgs { width: 50%; margin: 0 auto; }
.fb3-thumbs.is-single .fb3-thumb.is-solo .imgs { width: 100%; }
.fb3-thumb .num { display: block; font-size: 12px; color: var(--fb-ink-muted, #6b7288); font-weight: 600; margin-top: 5px; }
.fb3-thumb.current .imgs { outline-color: var(--fb-accent, #ff7a1a); }

/* ?fx=inner 비교용: 넘어가는 장의 음영(innerShadow)만 남기고 바닥 쪽 큰 그림자는 안 그림 */
.fb3.fb3-innershadow .stf__outerShadow, .fb3.fb3-innershadow .stf__hardShadow, .fb3.fb3-innershadow .stf__hardInnerShadow { display: none !important; }

/* 가벼운 넘김 그림자(휴대폰 한 쪽 보기 — 엔진 그림자 대신, flipbook-v3.js fxFrame). 책 칸 밖으로는 안 나가게 자른다.
   띠 두 장의 그라데이션은 고정이고 매 장면 transform·opacity 만 바뀐다. */
.fb3-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 30; display: none; }
.fb3-fx > div { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform, opacity; }
.fb3-fx .fb3-fx-outer { background: linear-gradient(to right, rgba(0, 0, 0, .75), rgba(0, 0, 0, .25) 30%, rgba(0, 0, 0, 0)); }
.fb3-fx .fb3-fx-inner { background: linear-gradient(to left, rgba(0, 0, 0, .55), rgba(0, 0, 0, .06) 25%, rgba(0, 0, 0, .22) 60%, rgba(0, 0, 0, 0)); }
.fb3-fx.is-back .fb3-fx-outer { background: linear-gradient(to left, rgba(0, 0, 0, .75), rgba(0, 0, 0, .25) 30%, rgba(0, 0, 0, 0)); }
.fb3-fx.is-back .fb3-fx-inner { background: linear-gradient(to right, rgba(0, 0, 0, .55), rgba(0, 0, 0, .06) 25%, rgba(0, 0, 0, .22) 60%, rgba(0, 0, 0, 0)); }
.fb3.fb-zoomed .fb3-fx { display: none !important; }

/* ── 위 막대(10/23): 주황 점 없앰. 로고(올린 경우)·제목. 휴대폰에서도 제목은 보인다(주손 표기만 숨김) */
.fb3-top { gap: 12px; }
.fb3-top .fb-brand { flex: 1 1 auto; min-width: 0; }
.fb3-logo { display: inline-flex; align-items: center; flex: none; }
.fb3-logo:empty { display: none; }
.fb3-logo img { max-height: 32px !important; width: auto !important; border-radius: 4px; }
.fb3 .fb3-brandtext { display: flex !important; min-width: 0; }
.fb3 .fb-brand-title { max-width: none; font-size: 15px; }
@media (max-width: 576px) {
    .fb3 .fb-brand-eyebrow { display: none; }
    .fb3 .fb-brand-title { font-size: 14px; }
    .fb3-logo img { max-height: 26px !important; }
}

/* ── 아래 막대(10/23): 왼쪽 목록·찾기 / 가운데 ‹ 쪽 › / 오른쪽 자동·확대·더보기. 아이콘 밑에 작은 글자. */
.fb3-bottom .fb3-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; max-width: 820px; margin: 0 auto; }
.fb3-grp { display: flex; align-items: center; gap: 2px; min-width: 0; }
.fb3-left { justify-self: start; }
.fb3-right { justify-self: end; }
.fb3-btn {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 46px; height: 46px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent !important;
    color: var(--fb-ink, #1a2238) !important; cursor: pointer; transition: background .15s;
}
.fb3-btn i { font-size: 19px; line-height: 1; }
.fb3-btn span { font-size: 10.5px; font-weight: 600; color: var(--fb-ink-muted, #6b7288); line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.fb3-btn:hover { background: rgba(26, 34, 56, .06) !important; }
.fb3-btn.d-none { display: none !important; }
.fb3-pager {
    display: inline-flex; align-items: center; height: 42px; padding: 0 3px; border-radius: 999px;
    background: #fff; border: 1px solid var(--fb-line, #e8e3d2); box-shadow: 0 1px 4px rgba(26, 34, 56, .06);
}
.fb3-nav {
    width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent !important; color: var(--fb-ink, #1a2238) !important;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer;
}
.fb3-nav:hover { background: rgba(26, 34, 56, .06) !important; }
.fb3-nav[disabled] { opacity: .3; cursor: default; }
.fb3-pageno { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; font-variant-numeric: tabular-nums; cursor: text; }
.fb3-pageno input {
    width: 3.4ch; height: 28px; border: 0; padding: 0 4px; text-align: center; outline: none; border-radius: 8px;
    background: #f4f1ea; font: 700 15px/28px inherit; font-family: inherit; color: var(--fb-ink, #1a2238); box-sizing: content-box;
    transition: background .15s, box-shadow .15s;
}
.fb3-pageno input:hover { background: #ece7dc; }
.fb3-pageno input:focus { background: #fff; box-shadow: 0 0 0 2px var(--fb-accent, #ff7a1a); }
.fb3-pageno .sep { color: #b8b2a3; font-size: 13px; }
.fb3-pageno #totalPage { font-size: 13.5px; font-weight: 600; color: var(--fb-ink-muted, #6b7288); }
.fb3 .fb-speed { margin-left: 0; }
.fb3-more { position: relative; }
.fb3-menu {
    position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 236px; padding: 6px; z-index: 200;
    background: #fff; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .06);
}
.fb3-menu[hidden] { display: none; }
/* 보기 방식(자동·한 쪽·두 쪽) — 메뉴 맨 위 한 줄 */
.fb3-view { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(26, 34, 56, .08); font-size: 14px; }
.fb3-view > i { font-size: 17px; width: 20px; text-align: center; color: var(--fb-ink-muted, #6b7288); }
.fb3-view .lbl { flex: 1 1 auto; white-space: nowrap; }
.fb3-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(26, 34, 56, .07); }
.fb3-seg button { border: 0; background: transparent; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; color: var(--fb-ink-muted, #6b7288); white-space: nowrap; cursor: pointer; }
.fb3-seg button.is-on { background: #fff; color: #1d2433; font-weight: 700; box-shadow: 0 1px 3px rgba(26, 34, 56, .16); }
.fb3-seg button[hidden] { display: none; }
.fb3-mi {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px;
    background: transparent !important; color: var(--fb-ink, #1a2238) !important; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; white-space: nowrap;
}
.fb3-mi i { font-size: 17px; width: 20px; text-align: center; color: var(--fb-ink-muted, #6b7288); }
.fb3-mi:hover { background: rgba(26, 34, 56, .05) !important; }
.fb3-mi.d-none { display: none !important; }
#regionToggle.fb3-mi.is-off { opacity: 1; }
#regionToggle.fb3-mi.is-off i { opacity: .45; }
/* 휴대폰 폭: 아래 ‹ › 는 뺀다(책 양옆 화살표·밀기로 넘김) — 가운데 쪽 번호와 오른쪽 아이콘 사이가 너무 붙었다(10/23 과장님) */
@media (max-width: 560px) {
    .fb3-pager .fb3-nav { display: none; }
    .fb3-pager { padding: 0 10px; height: 38px; }
}
@media (max-width: 420px) {
    .fb3-bottom .fb3-bar { gap: 4px; }
    .fb3-btn { min-width: 40px; padding: 0 3px; }
    .fb3-btn i { font-size: 18px; }
    .fb3-btn span { font-size: 10px; }
    .fb3-nav { width: 34px; height: 34px; }
    .fb3-pageno input { width: 3ch; font-size: 14px; }
}
/* 가로로 돌린 휴대폰: 글자 빼고 얇게 */
@media (orientation: landscape) and (max-height: 500px) {
    .fb3-btn { height: 36px; } .fb3-btn span { display: none; }
    .fb3-pager { height: 34px; } .fb3-nav { width: 30px; height: 30px; }
    .fb3 .fb3-brandtext { display: flex !important; } .fb3 .fb-brand-eyebrow { display: none; }
}
.fb3-mi-kakao i { color: #3c1e1e !important; background: #fee500; border-radius: 50%; width: 26px !important; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px !important; margin: -3px -3px -3px -3px; }
/* 자동 넘김 간격 꼬리표: [자동] 단추 위에 띄움(줄 폭에 안 들어감) */
.fb3-play { position: relative; display: inline-flex; }
.fb3 .fb3-speed {
    position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); z-index: 5;
    height: 22px; min-width: 0; margin: 0; padding: 0 8px; border-radius: 999px; border: 0;
    background: var(--fb-ink, #1a2238); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 22px; text-decoration: none;
    box-shadow: 0 2px 8px rgba(26, 34, 56, .2); white-space: nowrap;
}
.fb3 .fb3-speed::after { content: " ▾"; font-size: 9px; opacity: .7; }
.fb3 .fb3-speed.d-none { display: none !important; }

/* 영상 펼침(10/26): 왼쪽 = 제목·설명, 오른쪽 = 유튜브 그림 + 재생 단추. 크기는 쪽 크기에 맞춰 cqmin 으로 */
.fb3 .magazine .page.is-video { container-type: size; }
.fb3 .fb3-vid { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.fb3 .fb3-vid-L { background: #fbfaf7; padding: 9cqmin; gap: 3.2cqmin; color: #1d2433; }
.fb3 .fb3-vid-title { font-weight: 800; font-size: 7.4cqmin; line-height: 1.25; letter-spacing: -.02em; word-break: keep-all; overflow-wrap: anywhere; }
.fb3 .fb3-vid-desc { font-size: 4.4cqmin; line-height: 1.6; color: #4b5565; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.fb3 .fb3-vid-hint { margin-top: 2cqmin; font-size: 3.8cqmin; color: #8a93a3; display: flex; align-items: center; gap: 1.6cqmin; }
.fb3 .fb3-vid-hint i { color: #e5484d; font-size: 4.8cqmin; }
.fb3 .fb3-vid-R { background: #14161b; align-items: center; padding: 6cqmin; }
.fb3 .fb3-vid-play { position: relative; display: block; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 2.4cqmin;
    overflow: hidden; background: #000; cursor: pointer; box-shadow: 0 2cqmin 6cqmin rgba(0, 0, 0, .45); }
.fb3 .fb3-vid-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.fb3 .fb3-vid-icon { position: absolute; left: 50%; top: 50%; width: 17cqmin; height: 12cqmin; transform: translate(-50%, -50%); border-radius: 3.4cqmin;
    background: #e5484d; color: #fff; display: grid; place-items: center; font-size: 8cqmin; box-shadow: 0 1cqmin 3cqmin rgba(0, 0, 0, .35); transition: transform .15s; }
.fb3 .fb3-vid-play:hover .fb3-vid-icon { transform: translate(-50%, -50%) scale(1.08); }
.fb3 .fb3-vid-frame { position: relative; width: 100%; max-height: 100%; aspect-ratio: 16 / 9; border-radius: 2.4cqmin; overflow: hidden; background: #000;
    box-shadow: 0 2cqmin 6cqmin rgba(0, 0, 0, .45); }
.fb3 .fb3-vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.fb3-thumb.is-video .num { color: #e5484d; font-weight: 700; }
.fb3-thumb .vid-title { width: 50%; display: flex; align-items: center; justify-content: center; padding: 4px; box-sizing: border-box; background: #fbfaf7; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-size: 10px; font-weight: 700; color: #1d2433; line-height: 1.3; overflow: hidden; word-break: keep-all; }
.fb3-thumb.is-video img { object-fit: cover; }

.fb3 .fb3-vid-wrap { position: absolute; inset: 0; z-index: 1; }

/* 한 쪽 보기 영상 장(S): 제목·설명 위, 영상 아래 — 한 장에 다 */
.fb3 .fb3-vid-S { background: #fbfaf7; padding: 8cqmin 7cqmin; gap: 3cqmin; color: #1d2433; align-items: stretch; }
.fb3 .fb3-vid-S .fb3-vid-title { font-size: 6.4cqmin; }
.fb3 .fb3-vid-S .fb3-vid-desc { font-size: 4cqmin; -webkit-line-clamp: 4; }
.fb3 .fb3-vid-S .fb3-vid-play, .fb3 .fb3-vid-S .fb3-vid-frame { margin-top: 2cqmin; flex: 0 0 auto; width: min(100%, 112cqh); align-self: center; } /* 가로로 긴 쪽에서 제목+영상이 넘치지 않게 */
/* 영상만(plain): 제목·설명 없이 가운데 더 크게 */
.fb3 .fb3-vid-S.is-plain, .fb3 .fb3-vid-L.is-plain { background: #14161b; justify-content: center; }
.fb3 .fb3-vid-S.is-plain .fb3-vid-play, .fb3 .fb3-vid-S.is-plain .fb3-vid-frame { margin-top: 0; width: min(100%, 150cqh); }
