/**
 * TBB PDF Inserter – frontend viewer styles.
 *
 * "Flat embed" design: no card chrome of its own.
 * The parent theme (.job_description) already provides the card container,
 * so the viewer just renders inline inside it without competing borders,
 * backgrounds, or border-radius.
 *
 * Pages are left-aligned (flex-start) so they sit flush with the card edge.
 * The canvas area uses overflow-x:auto for horizontal scroll when zoomed in.
 */

/* -------------------------------------------------------------------------
 * Viewer shell – no card chrome
 * ---------------------------------------------------------------------- */

.tbb-pdf-viewer {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	margin: 0 0 1em;
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Toolbar – slim, flat bar; no rounded corners, no heavy background
 * ---------------------------------------------------------------------- */

.tbb-pdf-toolbar {
	position: sticky;
	top: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px 0 6px 2px;
	background: #ffffff;
	border-bottom: 1px solid #d0d0d0;
	min-height: 40px;
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Controls group
 * ---------------------------------------------------------------------- */

.tbb-pdf-controls {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.tbb-pdf-controls button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	background: #f5f5f5;
	border: 1px solid #cccccc;
	border-radius: 3px;
	color: #333333;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
	-webkit-font-smoothing: antialiased;
	touch-action: manipulation;
	white-space: nowrap;
}

.tbb-pdf-controls button:hover {
	background: #e8e8e8;
	border-color: #aaaaaa;
}

.tbb-pdf-controls button:active {
	background: #dcdcdc;
}

.tbb-pdf-controls button:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.tbb-pdf-fit-width {
	font-size: 13px !important;
	padding: 0 8px !important;
}

.tbb-pdf-zoom-level {
	min-width: 42px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	font-size: 0.82em;
	color: #555555;
}

/* -------------------------------------------------------------------------
 * Canvas area – no border, no card chrome
 * ---------------------------------------------------------------------- */

.tbb-pdf-canvas-area {
	background: transparent;
	overflow-x: auto;
	overflow-y: visible;
	padding: 12px 0 8px;
	box-sizing: border-box;
}

.tbb-pdf-loading {
	color: #888;
	text-align: left;
	padding: 1.5em 0;
	margin: 0;
}

/* Pages stacked vertically, left-aligned */
.tbb-pdf-pages {
	display: flex;
	flex-direction: column;
	align-items: flex-start;   /* left-align – no centering inside parent card */
	gap: 12px;
	min-width: min-content;    /* lets wide canvases push the scroll area */
}

/* Individual page wrappers – subtle shadow only */
.tbb-pdf-page-wrapper {
	line-height: 0;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.12 );
	background: #fff;
}

.tbb-pdf-page-wrapper canvas {
	display: block;
}

/* -------------------------------------------------------------------------
 * Mobile (≤ 480 px)
 * ---------------------------------------------------------------------- */

@media ( max-width: 480px ) {
	.tbb-pdf-toolbar {
		padding: 5px 0 5px 0;
		min-height: 38px;
	}

	.tbb-pdf-controls button {
		min-width: 36px;
		height: 36px;
	}

	.tbb-pdf-canvas-area {
		padding: 8px 0 6px;
	}

	.tbb-pdf-pages {
		gap: 8px;
	}
}
