/**
 * Catalogue Designer — front-end viewer styles (ported from the proven viewer).
 * Standalone full-screen dark stage with designed nav, toolbar (zoom, scroll
 * toggle, PDF, fullscreen), page indicator. Flip + vertical scroll views.
 */

.wccd-viewer-body { margin: 0; background: #fff; }

.wccatview-viewer-mount {
	--v-primary: #2563eb;
	--v-text: #0f172a;
	--v-muted: #475569;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	width: 100%;
	box-sizing: border-box;
}

.wccatview-viewer-loading { padding: 80px; text-align: center; color: #475569; }
.wccatview-viewer-error { padding: 40px; color: #475569; font-style: italic; text-align: center; }

.wccatview-viewer {
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: 100%;
}

.wccatview-viewer.is-immersive {
	background: #fff;
	min-height: 88vh;
	padding: 28px clamp( 12px, 4vw, 64px ) 22px;
	box-sizing: border-box;
}

.wccatview-viewer.is-immersive:fullscreen { min-height: 100vh; justify-content: center; }

/* Stage */
.wccatview-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp( 8px, 2vw, 28px );
	flex: 1;
	min-height: 0;
}
.wccatview-stage__inner {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 1100px;
	overflow: hidden;
}
.wccatview-zoomwrap { transition: transform 0.2s ease; transform-origin: center center; position: relative; }

/* Back to site */
.wccatview-back {
	position: absolute; top: 18px; left: 18px; z-index: 20;
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 14px 8px 10px;
	background: #fff;
	color: #14171d; text-decoration: none;
	font-size: 13px; font-weight: 600;
	border-radius: 999px;
	border: 1px solid rgba( 15, 23, 42, 0.08 );
	box-shadow: 0 1px 3px rgba( 15, 23, 42, 0.1 ), 0 1px 2px rgba( 15, 23, 42, 0.06 );
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.wccatview-back svg { width: 18px; height: 18px; }
.wccatview-back:hover { background: #fff; transform: translateX( -2px ); box-shadow: 0 2px 6px rgba( 15, 23, 42, 0.14 ); }

/* Center gutter / spine on a two-page spread */
.wccatview-viewer.has-gutter .wccatview-book::after {
	content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
	width: 24px; transform: translateX( -50% );
	pointer-events: none; z-index: 5;
	background: linear-gradient( to right,
		rgba( 0, 0, 0, 0 ) 0%,
		rgba( 0, 0, 0, 0.08 ) 42%,
		rgba( 0, 0, 0, 0.16 ) 50%,
		rgba( 0, 0, 0, 0.08 ) 58%,
		rgba( 0, 0, 0, 0 ) 100% );
}
.wccatview-book { position: relative; }

/* Zoomed-in: allow panning, show grab cursor, don't clip */
.wccatview-viewer.is-zoomed .wccatview-stage__inner { overflow: hidden; cursor: grab; }
.wccatview-viewer.is-zoomed .wccatview-stage__inner:active { cursor: grabbing; }
.wccatview-viewer.is-zoomed .wccatview-zoomwrap { transition: none; }

/* Book & pages */
.wccatview-book { margin: 0 auto; }
.wccatview-page { background: #fff; }
.wccatview-page__inner { position: relative; width: 100%; height: 100%; background: #fff; overflow: hidden; }
.wccatview-viewer.is-immersive .wccatview-book { box-shadow: 0 2px 6px rgba( 15, 23, 42, 0.1 ), 0 12px 28px rgba( 15, 23, 42, 0.18 ), 0 30px 60px rgba( 15, 23, 42, 0.16 ), 0 0 0 1px rgba( 15, 23, 42, 0.05 ); }

/* Designed navigation */
.wccatview-nav {
	flex-shrink: 0;
	width: 56px; height: 56px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: #14171d;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	border: 1px solid rgba( 15, 23, 42, 0.08 );
	box-shadow: 0 1px 3px rgba( 15, 23, 42, 0.1 ), 0 1px 2px rgba( 15, 23, 42, 0.06 );
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.wccatview-nav svg { width: 26px; height: 26px; }
.wccatview-nav:hover { background: #fff; transform: scale( 1.08 ); box-shadow: 0 4px 12px rgba( 15, 23, 42, 0.16 ); }
.wccatview-nav:active { transform: scale( 0.96 ); }

/* Toolbar */
.wccatview-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 14px;
	background: #fff;
	border-radius: 999px;
	border: 1px solid rgba( 15, 23, 42, 0.08 );
	box-shadow: 0 1px 3px rgba( 15, 23, 42, 0.1 ), 0 2px 8px rgba( 15, 23, 42, 0.08 );
	align-self: center;
}
.wccatview-toolbar__group { display: flex; align-items: center; gap: 6px; }
.wccatview-tool {
	height: 38px; min-width: 38px; padding: 0 8px;
	border: none; background: transparent; color: var(--v-text);
	cursor: pointer; border-radius: 999px;
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	font-size: 13px; font-weight: 600;
	transition: background 0.15s ease;
}
.wccatview-tool svg { width: 18px; height: 18px; }
.wccatview-tool:hover { background: #eef2f7; }
.wccatview-tool--labeled { padding: 0 14px; }
.wccatview-zoomlevel { font-size: 13px; font-weight: 600; color: var(--v-muted); min-width: 44px; text-align: center; }
.wccatview-pageno { font-size: 13px; font-weight: 700; color: var(--v-text); min-width: 70px; text-align: center; }

/* Scroll view */
.wccatview-viewer.is-scroll .wccatview-nav { display: none; }
.wccatview-viewer.is-scroll .wccatview-stage { align-items: stretch; }
.wccatview-viewer.is-scroll .wccatview-stage__inner { align-items: stretch; overflow: hidden; }
.wccatview-viewer.is-scroll .wccatview-zoomwrap { width: 100%; height: 100%; overflow-y: auto; transform-origin: top center; }
.wccatview-scroll { display: flex; flex-direction: column; gap: 24px; align-items: center; width: 100%; padding: 8px 8px 24px; box-sizing: border-box; --page-scale: 1; }
.wccatview-scrollpage {
	position: relative; width: 100%; max-width: calc( 620px * var( --page-scale ) ); aspect-ratio: 1 / 1.414;
	background: #fff; box-shadow: 0 2px 10px rgba( 15, 23, 42, 0.12 ), 0 0 0 1px rgba( 15, 23, 42, 0.05 ); flex-shrink: 0;
}

/* Responsive */
@media ( max-width: 700px ) {
	.wccatview-nav { width: 44px; height: 44px; }
	.wccatview-nav svg { width: 20px; height: 20px; }
	.wccatview-tool--labeled span { display: none; }
	.wccatview-viewer.is-immersive { padding: 16px 8px; }
}

/* Standalone full-screen (catalogue's own URL) */
.wccatview-viewer-mount--standalone { height: 100vh; height: 100dvh; }
.wccatview-viewer-mount--standalone .wccatview-viewer.is-immersive {
	min-height: 100vh; min-height: 100dvh; height: 100vh; height: 100dvh;
	border-radius: 0; padding: 24px clamp( 12px, 4vw, 72px ) 16px;
	display: flex; flex-direction: column; box-sizing: border-box;
}
/* Stage takes all remaining height; its own bottom padding sizes the catalogue
   so it never reaches the controls band. */
.wccatview-viewer-mount--standalone .wccatview-stage { flex: 1; min-height: 0; padding-bottom: 28px; box-sizing: border-box; }
.wccatview-viewer-mount--standalone .wccatview-stage__inner { height: 100%; max-width: none; }
/* Controls live in their own fixed-height footer band, separated from the
   catalogue above. */
.wccatview-viewer-mount--standalone .wccatview-toolbar {
	margin: 0 auto;
	flex: 0 0 auto;
}

