/* OneBuild Ebook Engine - Core Shared Styles */

.onebuild-flipbook-container {
    position: relative;
    width: 100%;
    height: 700px;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #fff;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.flipbook-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flipbook-viewport {
    width: 100%;
    flex-grow: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.flipbook-sidebar {
    width: 240px;
    height: 100%;
    background: #252525;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
    position: absolute;
    left: 0; top: 0; z-index: 50;
}

.flipbook-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    font-weight: 700;
    border-bottom: 1px solid #333;
    background: #2a2a2a;
    font-size: 1.1rem;
}

.thumb-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.thumb-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #000;
}

.thumb-item:hover { border-color: #0d6efd; transform: scale(1.02); }
.thumb-item.active { border-color: #0d6efd; box-shadow: 0 0 10px rgba(13, 110, 253, 0.5); }
.thumb-item img { width: 100%; height: auto; display: block; }

.container-flip {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 10;
}

.flip-book {
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.flipbook-controls {
    width: 100%;
    height: 60px;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 60;
}

.btn-flip {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.btn-flip:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateY(-2px);
}

.page-num-info {
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 90px;
    text-align: center;
    color: #fff;
    letter-spacing: 1px;
}

.current-page { color: #0d6efd; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .flipbook-sidebar { width: 200px; }
    .container-flip { padding: 10px; }
}

/* ---- Extended controls (2026-09-20): 줌 · 전체보기 · 이동 입력 — 기능용 기본값, 꾸미기는 스킨 CSS ---- */
.onebuild-flipbook-container .container-flip { transform-origin: center center; transition: transform .2s ease; }
.onebuild-flipbook-container.ob-zoomed .container-flip { cursor: grab; touch-action: none; }

.ob-overview { position: absolute; inset: 0; z-index: 90; display: none; overflow: auto; padding: 56px 20px 24px; background: rgba(15, 18, 25, .94); }
.ob-overview.open { display: block; }
.ob-overview-close { position: absolute; top: 10px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.ob-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; max-width: 1100px; margin: 0 auto; }
.ob-overview-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; font-size: 13px; cursor: pointer; }
.ob-overview-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border-radius: 4px; }
.ob-overview-item:hover, .ob-overview-item:focus-visible { border-color: #fff; outline: none; }
.flipbook-controls .goto-page { width: 64px; min-height: 36px; padding: 0 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: center; }
@media (prefers-reduced-motion: reduce) { .onebuild-flipbook-container .container-flip { transition: none; } }

/* [2026-09-26 §8-16] 모바일 세로·극단 가로는 하단 툴바가 탭 전까지 숨겨져 있어 존재를 모른다 — 하단 가운데에
   강조색 손잡이(위 화살표)를 띄워 위아래로 살짝 움직이게 하고, 누르면 툴바가 열린다. 한 번 열어 본 뒤(ob-hint-seen,
   localStorage 기억)에는 움직임을 멈추고 조용히 남는다. 요소는 company 템플릿에만 있어 다른 스킨엔 영향 없음. */
.co-controls-hint { display: none; }
@media (max-width: 767px), (min-width: 768px) and (max-height: 640px) {
  .onebuild-flipbook-container.co-engine-ready:not(.ob-controls-shown) .co-controls-hint { display: grid; }
}
.co-controls-hint {
  position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 95;
  width: 52px; height: 30px; margin-left: -26px; padding: 0; border: 0; border-radius: 15px;
  place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: var(--co-accent, #1E6FD9); color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 4px 14px rgba(0, 0, 0, .3);
  box-shadow: 0 0 0 2px #fff, 0 0 0 6px color-mix(in srgb, var(--co-accent, #1E6FD9) 30%, transparent), 0 4px 14px rgba(0, 0, 0, .3);
  animation: co-hint-bob 1.6s ease-in-out infinite;
}
.co-controls-hint::before { content: ""; position: absolute; inset: -8px -6px; }
.co-controls-hint svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.skin-company-b .co-controls-hint { color: #1A1405; }
.onebuild-flipbook-container.ob-hint-seen .co-controls-hint { animation: none; opacity: .85; }
@keyframes co-hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .co-controls-hint { animation: none; } }
