/*
 * Figures styles — brand-templated for engagement isjac.
 *
 * Source: vendor/zysys/wp-runtime/assets/css/figures.css.template
 * Built:  wp-content/zysys-generated/isjac/css/figures.css
 *
 * The template substitutes isjac at composer install. To change
 * a rule, edit this template and re-run `composer install` (or
 * `composer update`) in the consumer repo.
 *
 * Naming convention: <brand>-<class> per ADR-002.
 */

/*
 * Image figures + image-link affordance.
 *
 * Two concerns:
 *   1. Strip WP's default 1px <figure> border that read as "JC photo
 *      has a black frame around it."
 *   2. Image-only links must NOT inherit the body's text-link underline,
 *      because the underline reads as a stray rule under the photo and
 *      the box-outline reads as a focus error.
 */

/* ---------- Figure baseline ---------- */
.entry-content .wp-block-image {
	margin: 0;
}

.entry-content .wp-block-image figure {
	margin: 0;
	padding: 0;
	border: 0;
}

.entry-content .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
	/* Gutenberg attaches `.has-custom-border` to the figure whenever ANY
	 * border.* attribute (including radius) is set. Kadence parent then
	 * paints a 1.5px ink border on the img — which read as "framed photo"
	 * even when the editor only wanted rounded corners. Reset to zero;
	 * an editor who actually sets a border-width gets an inline style
	 * that beats this rule on specificity. */
	border-width: 0;
}

/* ---------- Caption baseline ----------
 * Brand guide §14: caption every photograph. Member name, instrument or
 * role, location, date — small, muted, faithful to the room.
 */
.entry-content .wp-block-image figcaption,
.entry-content .wp-element-caption {
	font-size: var(--isjac-font-size-small);
	color: var(--isjac-text-muted);
	line-height: var(--isjac-line-height-base);
	margin-top: var(--isjac-pad-xs);
}

/* ---------- Image-only links: no underline, no border, no outline ring ---------- *
 * Targets <a> whose only content is an <img> or <figure>. Pairs with the
 * :has(img/figure) exclusion in typography.css.template for the text-link rule.
 */
.entry-content a:has(> img),
.entry-content a:has(> figure),
.entry-content a:has(> .wp-block-post-featured-image) {
	color: inherit;
	text-decoration: none;
	border: 0;
	display: block;
	line-height: 0;
}

.entry-content a:has(> img):focus-visible,
.entry-content a:has(> figure):focus-visible {
	outline: 2px solid var(--isjac-color-brand-deep);
	outline-offset: 4px;
	border-radius: var(--isjac-radius-md);
}

/* Featured-image links inside cards — same rule, applied via card scope. */
.wp-block-post-featured-image a {
	display: block;
	line-height: 0;
	border: 0;
	text-decoration: none;
}
