/**
 * The classic variations screen: a locked description and its preview.
 *
 * Companion of `assets/js/variation-description.js` and of ADR-0004
 * (`docs/adr/0004-variation-description-blocks.md`): the script removes the
 * `name` of a block description's textarea and inserts the preview, this file
 * makes the result look like a read-only field instead of an empty gap.
 *
 * The textarea is hidden twice on purpose - the script also sets `hidden` - so a
 * rule that is overridden by some other stylesheet still leaves the element
 * invisible, and the `[data-bpe-description-locked]` selector keeps the rule from
 * matching a plain description's field, which must stay editable exactly as it is
 * today.
 *
 * `!important` is required for the same reason `variations-mode.css` needs it:
 * WooCommerce's own variation script calls `.show()`/`.hide()` on the row's
 * elements, which writes an inline `display`, and an inline style beats a plain
 * author rule.
 */

textarea[data-bpe-description-locked] {
	display: none !important;
}

.bpe-variation-description-locked .woocommerce-help-tip {
	display: none;
}

.bpe-variation-description-preview {
	margin: 0 0 12px;
	padding: 8px 12px;
	border: 1px solid #dcdcde;
	border-radius: 2px;
	background: #fff;
}

.bpe-variation-description-preview__body {
	max-height: 240px;
	overflow: auto;
	/* The content is server-rendered HTML, so it needs the same breathing room a
	   paragraph has on the storefront; nothing here may constrain clicks, the
	   preview stays selectable. */
	line-height: 1.5;
}

.bpe-variation-description-preview__body > :first-child {
	margin-top: 0;
}

.bpe-variation-description-preview__body > :last-child {
	margin-bottom: 0;
}

.bpe-variation-description-preview__body img {
	max-width: 100%;
	height: auto;
}

.bpe-variation-description-preview__notice {
	margin: 8px 0 0;
	padding-top: 8px;
	border-top: 1px solid #f0f0f1;
	color: #646970;
	font-size: 12px;
	line-height: 1.4;
}

/* The way out of the block mode: the action sits under the sentence that says
   the description is edited elsewhere, i.e. exactly where a merchant who wants
   to take it back is already reading. */
.bpe-variation-description-preview__actions {
	margin: 8px 0 0;
}

.bpe-variation-description-preview__actions .button {
	margin: 0;
}
