/**
 * Justify for Paragraph Block - Styles
 *
 * CSS styles for text justification and per-block typographic options
 * in the Block Editor.
 *
 * @package JustifyForParagraphBlock
 * @since 1.0.0
 */

/* Base text justification for paragraph blocks. */
.wp-block-paragraph.has-text-align-justify {
	text-align: justify;
}

/* Per-block typographic options for justified paragraphs.
 *
 * These classes are generated by the plugin JS based on per-block
 * attributes set via the InspectorControls sidebar.
 *
 * @since 1.2.0
 */

/* Automatic hyphenation. */
.has-text-align-justify.jfpb-hyphens {
	hyphens: auto;
	-webkit-hyphens: auto;
}

/* Word spacing presets. */
.has-text-align-justify.jfpb-word-spacing-lg {
	word-spacing: 0.02em;
}

.has-text-align-justify.jfpb-word-spacing-sm {
	word-spacing: -0.01em;
}

/* Custom word spacing.
 *
 * The actual word-spacing value is injected as an inline style on the block
 * wrapper by the JS (see jfpb_getCustomWordSpacingStyle). This class is a
 * marker so the rule can be targeted/overridden if needed.
 */
.has-text-align-justify.jfpb-word-spacing-custom {
	/* word-spacing set via inline style */
}

/* First-line indent (editorial / book style). */
.has-text-align-justify.jfpb-text-indent {
	text-indent: 1.5em;
}

/* Drop cap (magazine style).
 * The ::first-letter pseudo-element enlarges and floats the initial letter.
 */
.has-text-align-justify.jfpb-drop-cap::first-letter {
	float: left;
	font-size: 3.5em;
	line-height: 0.8;
	font-weight: bold;
	margin-right: 0.1em;
	margin-top: 0.05em;
}

/* Justify mode: inter-word (default browser behavior, made explicit). */
.has-text-align-justify.jfpb-justify-inter-word {
	text-justify: inter-word;
}

/* Justify mode: inter-character (distributes space between characters). */
.has-text-align-justify.jfpb-justify-inter-character {
	text-justify: inter-character;
}

/* Stretch last line.
 *
 * Forces the last line of a justified paragraph to be full-width instead
 * of short. This produces a more "block-like" justified text, typical of
 * editorial/book typography. Uses text-align-last, supported by all modern
 * browsers.
 *
 * @since 1.2.0
 */
.has-text-align-justify.jfpb-justify-last {
	text-align-last: justify;
}

/* End of per-block typographic option classes. */
