/**
 * Post Image — Common base CSS ( loads for every style ).
 *
 * Owns the shared skeleton: the figure, media box, image sizing ( with an
 * optional fixed aspect ratio ), caption and the hover effects. Per-style
 * files paint the frame chrome. CSS variables drive theme and sizing:
 *   --captwiki-pi-ratio   → image aspect ratio ( auto = natural )
 *   --captwiki-pi-accent  → frame / border accent colour
 *
 * @package captain-widgets-kit
 * @since   1.7.0
 */

.captwiki-post-image {
	--captwiki-pi-ratio: auto;
	--captwiki-pi-accent: #6d5efc;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	box-sizing: border-box;
}

.captwiki-post-image *,
.captwiki-post-image *::before,
.captwiki-post-image *::after {
	box-sizing: border-box;
}

/* ── Media ─────────────────────────────────────────────── */
.captwiki-post-image__media {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.captwiki-post-image__link {
	display: block;
}

.captwiki-post-image__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	aspect-ratio: var( --captwiki-pi-ratio );
	object-fit: cover;
	transition: transform 0.5s ease, filter 0.5s ease;
}

/* ── Caption ───────────────────────────────────────────── */
.captwiki-post-image__caption {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
	text-align: center;
}

/* ── Hover effects ─────────────────────────────────────── */
.captwiki-post-image--hover-zoom .captwiki-post-image__media:hover .captwiki-post-image__img {
	transform: scale( 1.06 );
}

.captwiki-post-image--hover-lift {
	transition: transform 0.35s ease;
}

.captwiki-post-image--hover-lift:hover {
	transform: translateY( -6px );
}

.captwiki-post-image--hover-grayscale .captwiki-post-image__img {
	filter: grayscale( 1 );
}

.captwiki-post-image--hover-grayscale:hover .captwiki-post-image__img {
	filter: grayscale( 0 );
}
