/*
 * Editor tools: styles for the editor additions (docs-paste.js, table-style.js, color-picker.js, fonts.js).
 * Loaded on every page for everyone, since posts written with them are read by everyone.
 * Colours come from the active theme's variables, so this follows any theme.
 */

/* The fonts in the editor's Font menu (fonts.js). Only declarations: a browser downloads a font when a
   page actually uses it. Imported here rather than added as its own stylesheet, because IPS rebuilds
   stylesheet addresses and would merge the repeated family= parameters. Keep in step with fonts.js. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cinzel+Decorative:wght@400;700&family=Alegreya:ital,wght@0,400;0,700;1,400;1,700&family=EB+Garamond:ital,wght@0,400;0,700;1,400;1,700&family=IM+Fell+English:ital@0;1&family=MedievalSharp&family=UnifrakturMaguntia&family=Uncial+Antiqua&family=Almendra:ital,wght@0,400;0,700;1,400;1,700&family=Pirata+One&family=Caveat:wght@400;700&family=Dancing+Script:wght@400;700&family=Homemade+Apple&family=Kalam:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&family=Comfortaa:wght@400;700&display=swap');

/* Tables pasted from Google Docs keep their size relative to the page (docs-paste.js): the share
   of the post's width is carried as --bb-table-width. Applied here because the editor overwrites a
   table's own width with a pixel sum of its columns while editing. */
table[style*="--bb-table-width"] {
	width: var(--bb-table-width) !important;
}
/* In the editor a table sits in a box that shrinks to the table's smallest size (width: min-content),
   which would make a percentage width resolve to that; such tables get the full width to share out. */
.ipsEditor__table-wrapper:has(table[style*="--bb-table-width"]) {
	width: auto;
}

/* The editor's Custom color panel (color-picker.js). */
.bbColorPanel {
	position: absolute;
	z-index: 5000;
	width: 236px;
	padding: 10px;
	display: grid;
	gap: 8px;
	background: var(--i-box--ba-co);
	color: var(--i-color_root);
	border: 1px solid var(--i-color_soft, rgba(128,128,128,.4));
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0,0,0,.35);
	font-size: 13px;
}
.bbColorPanel__swatches {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 5px;
}
.bbColorPanel__swatches[hidden],
.bbColorPanel__label[hidden] {
	display: none;
}
.bbColorPanel__swatch {
	aspect-ratio: 1;
	width: 100%;
	padding: 0;
	border: 1px solid rgba(128,128,128,.45);
	border-radius: 5px;
	cursor: pointer;
}
.bbColorPanel__swatch:hover,
.bbColorPanel__swatch:focus-visible {
	/* The Blades and Banners theme's gold; any other theme's primary colour. */
	outline: 2px solid var(--bb-gold, var(--i-primary));
	outline-offset: 1px;
}
.bbColorPanel__swatch--current {
	outline: 2px solid var(--i-color_root);
	outline-offset: 1px;
}
.bbColorPanel__label {
	font-size: 11px;
	font-variant: small-caps;
	letter-spacing: .05em;
	opacity: .75;
	margin-bottom: -3px;
}
.bbColorPanel__row {
	display: flex;
	gap: 6px;
	align-items: center;
}
.bbColorPanel__native {
	flex: none;
	width: 34px;
	height: 30px;
	padding: 2px;
	border: 1px solid rgba(128,128,128,.45);
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
}
.bbColorPanel__hex {
	flex: 1;
	min-width: 0;
	height: 30px;
	padding: 0 8px;
	font: inherit;
	font-family: ui-monospace, monospace;
	color: inherit;
	background: var(--i-background_1, transparent);
	border: 1px solid rgba(128,128,128,.45);
	border-radius: 6px;
}
.bbColorPanel__hex--invalid {
	border-color: var(--i-color_red);
}
.bbColorPanel__apply,
.bbColorPanel__remove {
	height: 30px;
	padding: 0 10px;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid rgba(128,128,128,.45);
	border-radius: 6px;
	cursor: pointer;
}
.bbColorPanel__apply {
	color: var(--i-primary-contrast);
	background: var(--i-primary);
	border-color: transparent;
	font-weight: 600;
}
.bbColorPanel__remove:hover {
	border-color: var(--i-color_red);
}
