/*
 * en2x Beitrag-Bild – structural, instance-independent styles.
 *
 * Image at the full width of its column (responsive), an optional caption row
 * below with the caption on the left and the action icons (download, fullscreen)
 * on the right in en2x style. The side gutter is the shared token so it aligns to
 * the hero/container edge like the sibling article modules and scales in any
 * column (2/3, 1/3, …). No instance colours (icons use the primary token). Font
 * inherited (Rubik).
 */

.en2x-beitrag-bild {
	/* Self-brought side gutter (same mechanism as the sibling modules) + bottom
	 * rhythm. Fluid width, so it fills any column correctly. */
	margin: 0 var(--en2x-side-gutter, 20px) 32px;
	font-family: inherit;
}

/* --- Size: cap the width within the column. "voll" = no cap (default). The
 * caption row sits inside the figure, so it follows the capped width. --- */
.en2x-beitrag-bild--size-mittel {
	max-width: 66%;
}

.en2x-beitrag-bild--size-klein {
	max-width: 40%;
}

/* --- Alignment: only meaningful once the image is narrower than the column
 * (size mittel/klein), so it is scoped to those to never drop the side gutter on
 * a full-width image. The outer edge keeps the gutter; the inner edge is auto. */
.en2x-beitrag-bild--size-mittel.en2x-beitrag-bild--align-zentriert,
.en2x-beitrag-bild--size-klein.en2x-beitrag-bild--align-zentriert {
	margin-left: auto;
	margin-right: auto;
}

.en2x-beitrag-bild--size-mittel.en2x-beitrag-bild--align-rechts,
.en2x-beitrag-bild--size-klein.en2x-beitrag-bild--align-rechts {
	margin-left: auto;
	margin-right: var(--en2x-side-gutter, 20px);
}

.en2x-beitrag-bild__frame {
	margin: 0;
	line-height: 0; /* no descender gap under the image */
}

.en2x-beitrag-bild__link {
	display: block;
	cursor: zoom-in;
}

/* Image fills the column width, scales responsively. */
.en2x-beitrag-bild__img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

/* Caption + actions row. */
.en2x-beitrag-bild__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 10px 0 0;
	line-height: 1.4;
}

.en2x-beitrag-bild__caption {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	color: #50575e;
}

.en2x-beitrag-bild__actions {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

/* Action icons in en2x primary; subtle hover. */
.en2x-beitrag-bild__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--en2x-color-primary, #221182);
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.en2x-beitrag-bild__action:hover,
.en2x-beitrag-bild__action:focus {
	color: var(--en2x-color-primary, #221182);
	opacity: 0.7;
}

.en2x-beitrag-bild__action svg {
	display: block;
}

/* ---------------------------------------------------------------------------
 * Responsive: on small screens use the full column width regardless of the
 * chosen size/alignment, so "Mittel"/"Klein" never become unreadably small.
 * ------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.en2x-beitrag-bild--size-mittel,
	.en2x-beitrag-bild--size-klein {
		max-width: none;
	}

	.en2x-beitrag-bild--align-zentriert,
	.en2x-beitrag-bild--align-rechts {
		margin-left: var(--en2x-side-gutter, 20px);
		margin-right: var(--en2x-side-gutter, 20px);
	}
}
