/* Vomela Drop Cap — front end.
 * Sizes are tied to the paragraph's line height (the lh unit), so the box always spans
 * exactly N lines. The em-based declarations above each lh one are fallbacks for older browsers.
 */

.has-vomela-dropcap {
	display: flow-root; /* keeps the drop cap from hanging into the next paragraph */
}

.vomela-dropcap {
	--vdc-lines: var(--vomela-dropcap-lines, 3);
	--vdc-color: var(--vomela-dropcap-color, #0b4a75);

	float: left;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;

	/* Height = N lines, minus a hair so the text wraps beside exactly N lines. */
	height: calc(var(--vdc-lines) * 1.6em - 0.3em);
	height: calc(var(--vdc-lines) * 1lh - 0.3em);
	min-width: calc((var(--vdc-lines) * 1.6em - 0.3em) * 0.92);
	min-width: calc((var(--vdc-lines) * 1lh - 0.3em) * 0.92);
	padding: 0 0.15em;
	margin: 0.2em 0.65em 0 0;

	font-size: 1em; /* keep the paragraph's size so 1lh = one line of body text */
	color: var(--vdc-color);
	border: var(--vomela-dropcap-border, 3px) solid var(--vdc-color);
	border-radius: var(--vomela-dropcap-radius, 6px);
}

.vomela-dropcap.vomela-dropcap--short {
	--vdc-lines: 2;
}

.vomela-dropcap__letter {
	font-family: inherit;
	font-weight: var(--vomela-dropcap-weight, 400);
	font-size: calc(var(--vdc-lines) * 0.6 * 1.6em);
	font-size: calc(var(--vdc-lines) * 0.6lh);
	line-height: 1;
}

/* Filled */
.vomela-dropcap--filled {
	background: var(--vdc-color);
	color: var(--vomela-dropcap-fill-text, #ffffff);
}

/* Plain letter */
.vomela-dropcap--plain {
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	justify-content: flex-start;
	margin-right: 0.3em;
}
.vomela-dropcap--plain .vomela-dropcap__letter {
	font-size: calc(var(--vdc-lines) * 0.85 * 1.6em);
	font-size: calc(var(--vdc-lines) * 0.85lh);
}
