/**
 * Job listings.
 *
 * Loaded by both the job blocks and the shortcodes used in Mai Post Grid
 * custom content, and registered as an editor style so the block previews
 * match the front end.
 */

/*
 * Mai runs grid custom content through wpautop, which wraps the shortcodes in
 * a paragraph and leaves an empty one behind once shortcode_unautop unwraps
 * them. It is not visually empty, since Mai gives every p a bottom margin.
 */
.entry-custom-content p:empty {
	display: none;
}

/*
 * Spacing between any two of these, so it never depends on whitespace typed
 * between the shortcodes or on a spacer block sitting between the blocks.
 * Matches Mai's paragraph rhythm. Margin set by the block editor's spacing
 * control lands inline and still wins over this.
 */
:is(.job-meta, .job-intro, .job-apply) + :is(.job-meta, .job-intro, .job-apply) {
	margin-block-start: var(--spacing-md);
}

.job-meta,
.job-meta__item {
	margin-block: 0;
}

.job-meta--inline {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-xs) var(--spacing-lg);
}

.job-meta--stacked {
	display: grid;
	gap: var(--spacing-xxs);
}

.job-intro > :last-child {
	margin-block-end: 0;
}

/*
 * Example values shown only in the editor, when the post being edited has no
 * job fields of its own. Never reaches the front end.
 */
.job-is-placeholder {
	opacity: 0.55;
}

/* The block gets display and justification from core's flex layout support. */
.job-apply:not([class*="is-layout-"]) {
	display: flex;
}
