/*
 * en2x Pressemeldung – styles.
 *
 * Light card with title + optional subtitle (accent colour), a description and
 * a right-aligned action row (square icon links + optional text button, all in
 * the accent colour with white glyphs/text). Card background and accent colour
 * are set inline per instance. The module brings its own side gutter so the
 * card flushes with the content edge (same as the grid).
 */

.en2x-pressemeldung {
	/* Default vertical spacing so stacked press releases are separated (min 20px
	 * top/bottom). Adjacent margins collapse to a clean 20px gap between cards. */
	margin: 20px 0;
	padding: 0 var(--en2x-gutter-right) 0 var(--en2x-gutter-left);
	font-family: inherit;
}

.en2x-pressemeldung__card {
	box-sizing: border-box;
	width: 100%;
}

/* The padded content wrapper. Padding lives here (not on the card) so an optional
 * left image column can sit flush to the card edges (no padding, full height). */
.en2x-pressemeldung__body {
	padding: 44px 56px;
}

/* ---------------------------------------------------------------------------
 * Optional left image (list module "Bild anzeigen"): same look as the Teaser-
 * Kachel side image — a narrow band that fills the FULL card height and is
 * cover-cropped, with the text pushed to the right.
 * ------------------------------------------------------------------------- */
.en2x-pressemeldung--has-image .en2x-pressemeldung__card {
	display: flex;
	align-items: stretch;
}

.en2x-pressemeldung--has-image .en2x-pressemeldung__body {
	flex: 1 1 0;
	min-width: 0;
}

.en2x-pressemeldung__media {
	/* Narrow, consistent band (like the Teaser-Kachel): capped at 280px, never
	 * more than 34% so it fits a narrow column. Flex COLUMN so its only child (the
	 * image) grows via flex-grow to the full, content-determined card height — the
	 * most robust "fill remaining height" pattern across browsers (incl. Safari). */
	flex: 0 0 auto;
	width: var(--en2x-pm-img-width, min(280px, 34%));
	align-self: stretch;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.en2x-pressemeldung__img {
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 0;
	/* flex-basis 0: grow purely by flex-grow to the FULL column height, so the
	 * image always reaches the bottom (no grey strip) and just gets taller. */
	flex: 1 1 0;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Salient adds margin-bottom:15px to content images (.row .col img); reset it via
 * the #ajax-content-wrap ID anchor so the image stays flush. */
#ajax-content-wrap .en2x-pressemeldung__img {
	margin: 0;
}

/* --- Head: title + subtitle ------------------------------------------------ */
.en2x-pressemeldung__title {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
}

.en2x-pressemeldung__subtitle {
	margin: 8px 0 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
}

/* --- Main: description (left) + actions (right) ----------------------------- */
.en2x-pressemeldung__main {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 40px;
	margin-top: 28px;
}

.en2x-pressemeldung__text {
	flex: 1 1 320px;
	min-width: 0;
	/* Inherit Salient's body font size (follows the theme typography setting). */
	font-size: inherit;
	line-height: 1.6;
	color: #333;
}

/* "Schriftgröße" option: relative steps, factors defined in global.css. */
.en2x-pressemeldung--schrift-klein .en2x-pressemeldung__text {
	font-size: var(--en2x-schrift-klein, 0.8em);
}

.en2x-pressemeldung--schrift-gross .en2x-pressemeldung__text {
	font-size: var(--en2x-schrift-gross, 1.2em);
}

.en2x-pressemeldung__text > :first-child {
	margin-top: 0;
}

.en2x-pressemeldung__text > :last-child {
	margin-bottom: 0;
}

/* margin-left:auto keeps the actions on the right even without a description. */
.en2x-pressemeldung__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-left: auto;
	flex-shrink: 0;
}

/* --- Icon links + text button (share the accent background) ----------------- */
.en2x-pressemeldung__icon,
.en2x-pressemeldung__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	transition: color 0.15s ease;
}

.en2x-pressemeldung__icon {
	width: 52px;
	flex: 0 0 auto;
}

.en2x-pressemeldung__icon svg {
	display: block;
}

.en2x-pressemeldung__button {
	padding: 0 28px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Hover/focus: the text/glyph turns en2x brand cyan (the background stays the
 * inline accent colour). Colour comes from CSS (not inline), so no !important. */
.en2x-pressemeldung__icon:hover,
.en2x-pressemeldung__icon:focus-visible,
.en2x-pressemeldung__button:hover,
.en2x-pressemeldung__button:focus-visible {
	color: var(--en2x-pm-hover, #34c7d6);
}

/* --- Icon tooltip: shows which document downloads (aria-label content) -------
 * Applies to the list card icons and the single-page download box icons. The
 * tooltip sits below the icon; content comes from the aria-label so no extra
 * markup is needed. */
.en2x-pressemeldung__icon,
.en2x-pm-downloads__icon {
	position: relative;
}

.en2x-pressemeldung__icon::after,
.en2x-pm-downloads__icon::after {
	content: attr(aria-label);
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	background: var(--en2x-color-headline, #250F51);
	color: #fff;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.25;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease;
}

.en2x-pressemeldung__icon:hover::after,
.en2x-pressemeldung__icon:focus-visible::after,
.en2x-pm-downloads__icon:hover::after,
.en2x-pm-downloads__icon:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

/* --- Single-page download box (grey container below the content) ------------ */
.en2x-pm-downloads {
	box-sizing: border-box;
	margin: 40px 0 0;
	padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 56px);
	background: #f0f0f3;
	font-family: inherit;
}

.en2x-pm-downloads__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px 40px;
}

.en2x-pm-downloads__head {
	flex: 1 1 320px;
	min-width: 0;
}

.en2x-pm-downloads__title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
}

.en2x-pm-downloads__text {
	margin: 0;
	line-height: 1.6;
	color: #333;
}

/* Weiterführende Links (simple list, cyan text links). */
.en2x-pm-downloads__links {
	margin: 20px 0 0;
}

.en2x-pm-downloads__links-title {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--en2x-color-headline, #250F51);
}

.en2x-pm-downloads__links-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.en2x-pm-downloads__links-list a {
	color: #34c7d6;
	text-decoration: none;
}

.en2x-pm-downloads__links-list a:hover,
.en2x-pm-downloads__links-list a:focus {
	color: #34c7d6;
	text-decoration: underline;
}

.en2x-pm-downloads__icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-left: auto;
	flex-shrink: 0;
}

.en2x-pm-downloads__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	transition: color 0.15s ease;
}

.en2x-pm-downloads__icon svg {
	display: block;
}

.en2x-pm-downloads__icon:hover,
.en2x-pm-downloads__icon:focus-visible {
	color: var(--en2x-pm-hover, #34c7d6);
}

/* --- Automatic list (en2x_pressemeldung_liste) ----------------------------- */
/* Wrapper only. Each item is a full .en2x-pressemeldung and keeps its own side
 * gutter and 20px top/bottom margin, so the cards stack with a clean 20px gap
 * (adjacent margins collapse) exactly like manually stacked single cards. */
.en2x-pressemeldung-liste {
	font-family: inherit;
}

/* Hidden cards – one class for both reasons a card can be invisible: filtered out
 * by the year pills, or not loaded yet (beyond the initial count). !important
 * beats the theme's ID-scoped display rule on content articles (which otherwise
 * wins over the [hidden] attribute). */
.en2x-pressemeldung.en2x-pressemeldung--filtered-out {
	display: none !important;
}

/* "Mehr laden" – same optics as the content grid button (content-grid.css). Ships
 * with the hidden attribute and is unhidden by the filter script, so no dead
 * button appears without JavaScript. */
.en2x-pressemeldung-liste__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 24px;
	padding: 0 var(--en2x-gutter-right) 0 var(--en2x-gutter-left);
}

.en2x-pressemeldung-liste__more-wrap[hidden] {
	display: none;
}

.en2x-pressemeldung-liste__more {
	padding: 10px 28px;
	background: var(--en2x-color-primary, #221182);
	border: none;
	border-radius: var(--en2x-button-radius, 999px);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.en2x-pressemeldung-liste__more:hover,
.en2x-pressemeldung-liste__more:focus {
	background: #190b63; /* darker variant of var(--en2x-color-primary) */
}

/* Year filter bar – pills styled like the content-grid "Thema" pills (primary
 * background, white text; active state in the en2x accent cyan with dark text).
 * Same side gutter as the cards so it lines up with the Satzspiegel. */
.en2x-pressemeldung-liste__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0 var(--en2x-gutter-right) 0 var(--en2x-gutter-left);
}

.en2x-pressemeldung-liste__filter-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--en2x-color-headline, #250F51);
	margin-right: 4px;
}

.en2x-pressemeldung-liste__pill {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid transparent;
	border-radius: 3px;
	background: var(--en2x-color-primary, #221182);
	color: #fff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.en2x-pressemeldung-liste__pill:hover,
.en2x-pressemeldung-liste__pill:focus-visible {
	border-color: var(--en2x-color-primary, #221182);
}

/* Active state: en2x accent cyan with dark headline text (white on #34c7d6
 * fails WCAG AA – same rationale as the grid Thema pills). */
.en2x-pressemeldung-liste__pill.is-active {
	background: #34c7d6;
	border-color: #34c7d6;
	color: var(--en2x-color-headline, #250F51);
}

/* ---------------------------------------------------------------------------
 * Fixed single-page hero (en2x-pm-hero). Prepended to the_content on every
 * Pressemeldung detail page. The ::before pseudo breaks out to the full viewport
 * width (full-bleed background), while the headline stays in the content column
 * so it lines up with the article body (Satzspiegel). Look mirrors the Hero Text
 * module. Background image/colour + text colour come from the settings (inline
 * custom properties).
 * ------------------------------------------------------------------------- */
.en2x-pm-hero {
	position: relative;
	display: flex;
	align-items: center;
	font-family: inherit;
}

.en2x-pm-hero--gering {
	min-height: 350px;
}

.en2x-pm-hero--mittel {
	min-height: 550px;
}

.en2x-pm-hero--hoch {
	min-height: 800px;
}

.en2x-pm-hero::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(50% - 50vw);
	width: 100vw;
	z-index: 0;
	background-color: var(--en2x-pm-hero-bg, #221182);
	background-image: var(--en2x-pm-hero-image, none);
	background-position: var(--en2x-pm-hero-pos, center center);
	background-size: cover;
	background-repeat: no-repeat;
}

.en2x-pm-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: 48px 0;
}

.en2x-pm-hero__headline {
	margin: 0;
	font-size: 38px;
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
	color: inherit;
}

/* Date + subheadline under the title. Inherits the hero text colour. */
.en2x-pm-hero__meta {
	margin: 16px 0 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

/* Breadcrumb strip below the hero (transparent, in the content column). The
 * generous bottom padding sets the gap between the header block and the article
 * content. */
.en2x-pm-hero__breadcrumb-inner {
	padding: 14px 0 30px;
	font-size: 13px;
	font-weight: 600;
	color: #50575e;
}

.en2x-pm-hero__crumb,
.en2x-pm-hero__breadcrumb-inner a {
	color: #50575e;
	text-decoration: none;
}

.en2x-pm-hero__crumb:hover,
.en2x-pm-hero__breadcrumb-inner a:hover {
	color: var(--en2x-color-headline, #250F51);
}

.en2x-pm-hero__crumb-sep {
	margin: 0 6px;
	color: #a7a7b0;
}

.en2x-pm-hero__crumb--current,
.en2x-pm-hero__breadcrumb-inner .breadcrumb_last {
	color: #34c7d6;
}

/* ---------------------------------------------------------------------------
 * 2/3 content column: the article body, the hero content (headline/meta) and
 * the breadcrumb + download box start at the left Satzspiegel but only run to
 * 2/3 of the content width – the right third stays whitespace. The hero
 * background stays full-bleed (only the inner content is constrained). Desktop
 * only; below that everything uses the full width for readability.
 * ------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	.en2x-pm-hero__inner,
	.en2x-pm-hero__breadcrumb-inner,
	.en2x-pm-body,
	.en2x-pm-downloads {
		max-width: var(--en2x-pm-col, 66.6667%);
	}
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 768px) {
	.en2x-pressemeldung__body {
		padding: 28px 24px;
	}

	/* Stack the image on top (full width, fixed height) like the Teaser-Kachel. */
	.en2x-pressemeldung--has-image .en2x-pressemeldung__card {
		flex-direction: column;
	}

	.en2x-pressemeldung--has-image .en2x-pressemeldung__media {
		width: 100%;
		height: 200px;
	}

	.en2x-pressemeldung__title {
		font-size: 22px;
	}

	.en2x-pressemeldung__subtitle {
		font-size: 19px;
	}

	.en2x-pressemeldung__main {
		flex-direction: column;
		align-items: stretch;
		/* Stack the description and actions with the same gap as the
		 * subtitle-to-description gap (the __main margin-top), and do not let the
		 * block spread to fill a stretched card. */
		justify-content: flex-start;
		gap: 28px;
	}

	/* In a column the text's flex-basis (320px) would become its HEIGHT and blow
	 * up the block, pushing the buttons far down. Size it to its content instead. */
	.en2x-pressemeldung__text {
		flex: 0 0 auto;
	}

	.en2x-pressemeldung__actions {
		margin-left: 0;
		justify-content: flex-start;
	}

	/* Download box: stack head + icons, icons left-aligned. */
	.en2x-pm-downloads__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
	}

	.en2x-pm-downloads__head {
		flex: 0 0 auto;
	}

	.en2x-pm-downloads__icons {
		margin-left: 0;
		justify-content: flex-start;
	}

	/* Fixed hero: cap height and shrink the headline on small screens. */
	.en2x-pm-hero--gering,
	.en2x-pm-hero--mittel,
	.en2x-pm-hero--hoch {
		min-height: 260px;
	}

	.en2x-pm-hero__inner {
		padding: 32px 0;
	}

	.en2x-pm-hero__headline {
		font-size: 28px;
	}
}
