/**
 * InsightWire Featured Image Caption
 * Puts the featured-image caption under the image: italic, left-aligned,
 * exactly the width of the image. !important is used on purpose so theme /
 * Elementor overlay styles cannot win.
 */

/* 1. Containers that hold the featured image: stop any overlay positioning. */
.iwn-fc-container,
.elementor-widget-theme-post-featured-image figure.wp-caption,
.wp-block-post-featured-image,
.single .post-thumbnail figure,
.single .featured-image figure {
	position: relative !important;
	display: block !important;
	overflow: visible !important;
	margin-bottom: 0 !important;
}

/* 2. The caption itself (known selectors are styled even before JS runs,
      so there is no flash of the old black overlay). */
.iwn-fc-caption,
.elementor-widget-theme-post-featured-image figcaption,
.elementor-widget-theme-post-featured-image .widget-image-caption,
.wp-block-post-featured-image figcaption,
.single .post-thumbnail figcaption,
.single .featured-image figcaption {
	/* layout: under the image, never on top of it */
	position: static !important;
	inset: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	float: none !important;
	display: block !important;
	box-sizing: border-box !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 10px 0 10px !important;
	z-index: auto !important;

	/* look: clean editorial caption */
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
	border-bottom: var(--iwn-fc-divider, 1px solid rgba(0,0,0,.12)) !important;
	border-radius: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;

	font-family: var(--iwn-fc-font, Georgia, 'Times New Roman', serif) !important;
	font-size: var(--iwn-fc-size, 15px) !important;
	font-style: italic !important;
	font-weight: 400 !important;
	line-height: 1.55 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-align: left !important;
	text-shadow: none !important;
	color: var(--iwn-fc-color, #555) !important;
	white-space: normal !important;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Child elements (<span>, <p>, <a>) inside the caption inherit the style. */
.iwn-fc-caption *,
.elementor-widget-theme-post-featured-image figcaption *,
.wp-block-post-featured-image figcaption * {
	position: static !important;
	inset: auto !important;
	transform: none !important;
	padding: 0 !important;
	border: 0 !important;
	font: inherit !important;
	color: inherit !important;
	background: transparent !important;
	text-align: left !important;
	margin: 0;
}

.iwn-fc-caption a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Hide decorative overlay layers some themes put behind the caption. */
.iwn-fc-container .iwn-fc-hidden-overlay {
	display: none !important;
}

@media (max-width: 767px) {
	.iwn-fc-caption,
	.elementor-widget-theme-post-featured-image figcaption,
	.wp-block-post-featured-image figcaption {
		font-size: calc(var(--iwn-fc-size, 15px) - 1px) !important;
		padding: 8px 0 !important;
	}
}

@media print {
	.iwn-fc-caption {
		border-bottom: 0 !important;
		color: #333 !important;
	}
}
