/*
 * Vybe Book Publisher - chapter editor and content preview styles.
 */

.vbp-ed {
	--vbp-ed-line: #DCE0E6;
	--vbp-ed-ink: #1F2430;
	--vbp-ed-muted: #5F6B7A;
	--vbp-ed-brand: var(--vbp-brand, #1E6B52);
	position: relative;
	border: 1px solid #BCC3CD;
	border-radius: 6px;
	background: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", "Nirmala UI", Arial, sans-serif;
	color: var(--vbp-ed-ink);
}

.vbp-ed__bar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 6px;
	border-bottom: 1px solid var(--vbp-ed-line);
	background: #F7F8FA;
	border-radius: 6px 6px 0 0;
}

.admin-bar .vbp-ed__bar {
	top: 32px;
}

.vbp-ed__group {
	display: flex;
	gap: 1px;
	padding-right: 5px;
	margin-right: 3px;
	border-right: 1px solid var(--vbp-ed-line);
}

.vbp-ed__group:last-child {
	border-right: 0;
	margin-right: 0;
}

.vbp-ed .vbp-ed__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: transparent;
	color: #3C4452;
	cursor: pointer;
	box-shadow: none;
	font: 600 15px/1 system-ui, sans-serif;
	text-transform: none;
	letter-spacing: normal;
}

.vbp-ed .vbp-ed__btn:hover {
	background: #E9ECF0;
	color: var(--vbp-ed-ink);
}

.vbp-ed .vbp-ed__btn.is-on {
	background: #DDE9E3;
	border-color: #B9D4C6;
	color: #134536;
}

.vbp-ed .vbp-ed__btn[disabled] {
	opacity: .35;
	cursor: default;
}

.vbp-ed .vbp-ed__btn--tamil .vbp-ed__glyph {
	font-family: "Noto Sans Tamil", "Nirmala UI", Latha, sans-serif;
	font-size: 17px;
	color: var(--vbp-ed-brand);
}

.vbp-ed .vbp-ed__select {
	height: 32px;
	min-width: 160px;
	padding: 0 28px 0 8px;
	border: 1px solid var(--vbp-ed-line);
	border-radius: 4px;
	background-color: #fff;
	font: 14px system-ui, sans-serif;
	color: var(--vbp-ed-ink);
	box-shadow: none;
	margin: 0;
}

.vbp-ed [hidden],
.vbp-ed__pop[hidden] {
	display: none !important;
}

.vbp-ed__tablebar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	padding: 6px 8px;
	border-bottom: 1px solid var(--vbp-ed-line);
	background: #FFF9EC;
}

.vbp-ed__tlabel {
	font-size: 12px;
	font-weight: 700;
	color: #7A3E06;
	margin-right: 4px;
}

.vbp-ed .vbp-ed__tbtn {
	appearance: none;
	height: 28px;
	padding: 0 9px;
	border: 1px solid #E5D9BF;
	border-radius: 4px;
	background: #fff;
	color: #3C4452;
	font: 500 12.5px system-ui, sans-serif;
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.vbp-ed .vbp-ed__tbtn:hover {
	border-color: #B9A16C;
}

.vbp-ed .vbp-ed__tbtn.is-on {
	background: #DDE9E3;
	border-color: #9CC3AF;
}

.vbp-ed .vbp-ed__tbtn--danger {
	color: #A1271F;
}

.vbp-ed__body {
	position: relative;
}

.vbp-ed__content {
	padding: 28px clamp(16px, 5%, 56px);
	outline: none;
	overflow-wrap: break-word;
	cursor: text;
}

.vbp-ed__content.is-empty::before {
	content: attr(data-placeholder);
	position: absolute;
	color: #9AA3AF;
	pointer-events: none;
	font-style: italic;
}

.vbp-ed__status {
	padding: 6px 12px;
	border-top: 1px solid var(--vbp-ed-line);
	background: #F7F8FA;
	color: var(--vbp-ed-muted);
	font-size: 12.5px;
	border-radius: 0 0 6px 6px;
	font-variant-numeric: tabular-nums;
}

.vbp-ed__status.is-over,
.vbp-ed__status.is-under {
	color: #A1271F;
}

.vbp-ed__status.is-ok {
	color: #145533;
}

.vbp-ed__pop {
	position: absolute;
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	padding: 8px;
	border: 1px solid #BCC3CD;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}

.vbp-ed__pop--grid {
	display: block;
	width: 236px;
}

.vbp-ed__gridlabel {
	font-size: 12.5px;
	margin-bottom: 6px;
	color: var(--vbp-ed-muted);
}

.vbp-ed__grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 3px;
}

.vbp-ed .vbp-ed__gcell {
	appearance: none;
	aspect-ratio: 1;
	width: 100%;
	height: auto;
	min-height: 0;
	padding: 0;
	border: 1px solid #C9CED6;
	border-radius: 2px;
	background: #fff;
	cursor: pointer;
	box-shadow: none;
}

.vbp-ed .vbp-ed__gcell.is-on {
	background: #CFE3D8;
	border-color: var(--vbp-ed-brand);
}

.vbp-ed__check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	margin-top: 8px;
}

.vbp-ed__pop--chars {
	width: 300px;
	display: grid;
	grid-template-columns: repeat(8, 1fr);
}

.vbp-ed .vbp-ed__char {
	appearance: none;
	height: 32px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: #F4F5F7;
	font: 17px "Noto Serif", "Noto Sans Tamil", "Nirmala UI", serif;
	cursor: pointer;
	padding: 0;
	box-shadow: none;
	color: var(--vbp-ed-ink);
}

.vbp-ed .vbp-ed__char:hover {
	border-color: var(--vbp-ed-brand);
	background: #fff;
}

.vbp-ed.is-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 99999;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	background: #E9ECF0;
}

.vbp-ed.is-fullscreen .vbp-ed__bar {
	top: 0;
	border-radius: 0;
}

.vbp-ed.is-fullscreen .vbp-ed__body {
	flex: 1;
	overflow: auto;
	padding: 24px 12px;
}

.vbp-ed.is-fullscreen .vbp-ed__content {
	max-width: 820px;
	margin: 0 auto;
	background: #fff;
	min-height: calc(100vh - 160px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

body.vbp-ed-noscroll {
	overflow: hidden;
}

/* ------------------------------------------------------------- content */

.vbp-content {
	font-family: "Noto Serif", Georgia, "Noto Serif Tamil", "Nirmala UI", Latha, serif;
	font-size: 17px;
	line-height: 1.7;
	color: #1F2430;
	counter-reset: vbp-fn;
}

.vbp-content :lang(ta),
.vbp-content[lang="ta"] {
	line-height: 1.85;
}

.vbp-content p {
	margin: 0 0 .9em;
}

.vbp-content h1,
.vbp-content h2,
.vbp-content h3,
.vbp-content h4 {
	font-family: inherit;
	line-height: 1.3;
	margin: 1.4em 0 .5em;
	color: #11151C;
}

.vbp-content h2 {
	font-size: 1.45em;
}

.vbp-content h3 {
	font-size: 1.2em;
}

.vbp-content h4 {
	font-size: 1.05em;
	font-style: italic;
}

.vbp-content > :first-child {
	margin-top: 0;
}

.vbp-content blockquote {
	margin: 1em 0 1em 1.5em;
	padding: 0 0 0 1em;
	border-left: 3px solid #C9CED6;
	color: #3C4452;
}

.vbp-content ul,
.vbp-content ol {
	margin: 0 0 1em 1.6em;
	padding: 0;
}

.vbp-content li {
	margin: 0 0 .3em;
}

.vbp-content a {
	color: var(--vbp-brand, #1E6B52);
}

.vbp-content pre {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: .85em;
	background: #F5F6F8;
	padding: .8em 1em;
	white-space: pre-wrap;
}

.vbp-content table,
.vbp-content .vbp-table {
	width: 100%;
	border-collapse: collapse;
	margin: .4em 0 1.2em;
	font-size: .9em;
	line-height: 1.45;
}

.vbp-content th,
.vbp-content td {
	border: 1px solid #C9CED6;
	padding: .4em .55em;
	vertical-align: top;
	min-width: 2em;
}

.vbp-content th {
	background: #F2F4F6;
	font-weight: 600;
	text-align: left;
}

.vbp-content figure,
.vbp-content .vbp-figure {
	margin: 1.2em 0;
	text-align: center;
}

.vbp-content figure img {
	max-width: 100%;
	height: auto;
	display: inline-block;
}

.vbp-content .vbp-figure--medium img {
	max-width: 60%;
}

.vbp-content .vbp-figure--small img {
	max-width: 38%;
}

.vbp-content figcaption,
.vbp-content .vbp-caption {
	font-size: .88em;
	color: #3C4452;
	text-align: center;
	margin: .4em 0 .6em;
	font-style: italic;
}

.vbp-content figcaption:empty::before {
	content: attr(data-placeholder);
	color: #9AA3AF;
}

.vbp-content figure.is-uploading {
	opacity: .5;
	position: relative;
}

.vbp-content figure.is-uploading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 3px solid #1F2430;
	border-right-color: transparent;
	border-radius: 50%;
	animation: vbp-spin .8s linear infinite;
}

.vbp-content figure.is-selected img {
	outline: 3px solid var(--vbp-brand, #1E6B52);
	outline-offset: 2px;
}

.vbp-content .vbp-fn {
	counter-increment: vbp-fn;
	display: inline;
	margin: 0 .15em;
	padding: .05em .4em;
	border-radius: 3px;
	background: #EEF3EF;
	border: 1px solid #CFE0D6;
	color: #3C4452;
	font-family: system-ui, "Noto Sans Tamil", sans-serif;
	font-size: .72em;
	line-height: 1.4;
	vertical-align: .25em;
	cursor: pointer;
	user-select: none;
}

.vbp-content .vbp-fn::before {
	content: counter(vbp-fn) " ";
	font-weight: 700;
	color: var(--vbp-brand, #1E6B52);
}

.vbp-content .vbp-ix {
	text-decoration: underline dotted #B45309;
	text-underline-offset: 3px;
}

.vbp-content .vbp-math {
	font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", serif;
	font-style: italic;
	background: #F6F2FF;
}

.vbp-content .vbp-verse {
	white-space: pre-line;
	margin-left: 2em;
	font-style: normal;
}

.vbp-content .vbp-ref {
	padding-left: 2em;
	text-indent: -2em;
	font-size: .92em;
}

.vbp-content .vbp-refs li {
	font-size: .92em;
}

.vbp-content .vbp-epigraph {
	margin-left: 30%;
	font-style: italic;
	font-size: .92em;
}

.vbp-content .vbp-indented {
	margin-left: 2em;
}

.vbp-content img[data-lowres] {
	outline: 2px dashed #B45309;
}
