/* CDM Aktionen – Frontend
 * Breakpoints: Mobil <= 767px, Tablet 768–1024px, Desktop >= 1025px
 * (identisch zu den Elementor-Standards)
 */

.smed-slot { display: block; }
.smed-slot.smed-slot-group { display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------------------ Card */

.smed-card {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--smed-maxw, 640px);
	margin: 0 auto;
	background: var(--smed-bg, #fff);
	border: var(--smed-bw, 1px) solid var(--smed-border, #e6e8ee);
	border-radius: var(--smed-radius, 16px);
	padding: var(--smed-pad, 28px);
	box-shadow: var(--smed-shadow, none);
	font-family: var(--smed-font, inherit);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: var(--smed-gap, 18px);
}
.smed-card *, .smed-card *::before, .smed-card *::after { box-sizing: border-box; }

/* Ausrichtung */
.smed-a-left   { text-align: left; }
.smed-a-center { text-align: center; }
.smed-a-right  { text-align: right; }
.smed-a-center .smed-body { align-items: center; }
.smed-a-right  .smed-body { align-items: flex-end; }

.smed-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; }

.smed-heading {
	margin: 0;
	padding: 0;
	color: var(--smed-h-color, #12172a);
	font-size: var(--smed-h-size, 26px);
	font-weight: var(--smed-h-weight, 700);
	line-height: 1.2;
	font-family: inherit;
}
.smed-text {
	color: var(--smed-t-color, #4a5069);
	font-size: var(--smed-t-size, 16px);
	line-height: 1.6;
}
.smed-text p { margin: 0 0 .6em; }
.smed-text p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- Badge */

.smed-badge-tag {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	background: var(--smed-badge-bg, #d63939);
	color: var(--smed-badge-color, #fff);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .2px;
	padding: 9px 13px;
	border-radius: 999px;
	box-shadow: 0 6px 16px -6px rgba(0,0,0,.45);
}

/* ------------------------------------------------------------------ Bild */

.smed-img { line-height: 0; display: block; min-width: 0; }
.smed-img img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: var(--smed-img-h, auto);
	object-fit: var(--smed-img-fit, cover);
	border-radius: var(--smed-img-radius, 12px);
}
.smed-img-link { transition: transform .15s ease, filter .15s ease; }
.smed-img-link:hover { filter: brightness(1.03); }

/* --------------------------------------------------------------- Layouts */

.smed-l-image-left, .smed-l-image-right { flex-direction: row; align-items: center; }
.smed-l-image-right { flex-direction: row-reverse; }
.smed-l-image-left  > .smed-img, .smed-l-image-left  > .smed-pdf-card,
.smed-l-image-right > .smed-img, .smed-l-image-right > .smed-pdf-card {
	flex: 0 0 var(--smed-mediaw, 44%);
	max-width: var(--smed-mediaw, 44%);
}
.smed-l-image-left .smed-body, .smed-l-image-right .smed-body { flex: 1 1 auto; }

/* Bild als Hintergrund */
.smed-l-image-bg { min-height: 260px; justify-content: flex-end; }
.smed-bg-overlay {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
}
.smed-l-image-bg .smed-bg-overlay::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,var(--smed-overlay,.35)), rgba(0,0,0,calc(var(--smed-overlay,.35) * .3)));
}
.smed-l-image-bg .smed-body { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- Button */

.smed-btn {
	background: var(--smed-btn-bg, #3b5bdb);
	color: var(--smed-btn-color, #fff) !important;
	text-decoration: none;
	padding: 12px 22px;
	border-radius: var(--smed-btn-radius, 10px);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	min-height: 44px;              /* Touch-Ziel (WCAG) */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease, filter .15s ease;
}
.smed-btn:hover, .smed-btn:focus { transform: translateY(-1px); filter: brightness(1.05); color: var(--smed-btn-color, #fff) !important; }

/* ------------------------------------------------------------------- PDF */

.smed-pdf-card {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	background: rgba(0,0,0,.03);
	border: 1px solid var(--smed-border, #e6e8ee);
	border-radius: var(--smed-img-radius, 12px);
	padding: 16px 18px;
	min-height: 44px;
	transition: background .15s ease, transform .15s ease;
}
.smed-pdf-card:hover { background: rgba(0,0,0,.05); transform: translateY(-1px); }
.smed-pdf-icon {
	flex: 0 0 auto;
	background: #d63939;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .5px;
	padding: 10px 12px;
	border-radius: 8px;
}
.smed-pdf-meta { display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; }
.smed-pdf-title { font-weight: 600; color: var(--smed-h-color, #12172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smed-pdf-sub { font-size: 13px; color: var(--smed-t-color, #7b8199); }
.smed-pdf-dl { margin-left: auto; font-size: 22px; line-height: 1; color: var(--smed-btn-bg, #3b5bdb); }

.smed-pdf-embed {
	width: 100%;
	height: var(--smed-pdf-h, 520px);
	border-radius: var(--smed-img-radius, 12px);
	overflow: hidden;
	border: 1px solid var(--smed-border, #e6e8ee);
}
.smed-pdf-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* PDF-Vorschaubild */
.smed-pdf-preview { position: relative; }
.smed-pdf-badge {
	position: absolute;
	left: 12px;
	bottom: 12px;
	background: #d63939;
	color: #fff;
	font: 600 13px/1 system-ui, sans-serif;
	padding: 8px 12px;
	border-radius: 999px;
}

/* Eingebettetes PDF: auf Smartphones automatisch die Download-Karte zeigen,
   weil iOS-Safari PDF-iframes nicht zuverlässig darstellt. */
.smed-pdf-fallback { display: none; }

/* --------------------------------------------------- Responsive (Tablet) */

@media (max-width: 1024px) {
	.smed-l-image-left  > .smed-img, .smed-l-image-left  > .smed-pdf-card,
	.smed-l-image-right > .smed-img, .smed-l-image-right > .smed-pdf-card {
		flex-basis: 40%;
		max-width: 40%;
	}
}

/* --------------------------------------------------- Responsive (Mobil)  */

@media (max-width: 767px) {
	.smed-l-image-left, .smed-l-image-right { flex-direction: column; align-items: stretch; }
	.smed-l-image-left  > .smed-img, .smed-l-image-left  > .smed-pdf-card,
	.smed-l-image-right > .smed-img, .smed-l-image-right > .smed-pdf-card {
		flex: none;
		max-width: 100%;
	}
	.smed-l-image-bg { min-height: 220px; }
	.smed-badge-tag { top: 10px; right: 10px; font-size: 13px; padding: 7px 11px; }

	.smed-pdf-embed { display: none; }
	.smed-pdf-fallback { display: block; }

	/* Mobil-Layout-Override */
	.smed-m-image-top { flex-direction: column; }
	.smed-m-text-only > .smed-img,
	.smed-m-text-only > .smed-pdf-card,
	.smed-m-text-only > .smed-pdf-embed,
	.smed-m-text-only > .smed-pdf-fallback,
	.smed-m-text-only > .smed-bg-overlay { display: none !important; }
	.smed-m-text-only.smed-l-image-bg { min-height: 0; }
	.smed-m-media-only > .smed-body { display: none !important; }

	/* Mobil-Ausrichtung */
	.smed-ma-left   { text-align: left; }
	.smed-ma-center { text-align: center; }
	.smed-ma-right  { text-align: right; }
	.smed-ma-left   .smed-body { align-items: flex-start; }
	.smed-ma-center .smed-body { align-items: center; }
	.smed-ma-right  .smed-body { align-items: flex-end; }

	/* Button über volle Breite */
	.smed-btnfull-m .smed-btn { display: flex; width: 100%; }
}

/* ---------------------------------------------- Sichtbarkeit pro Gerät   */

@media (min-width: 1025px) {
	.smed-hide-d { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.smed-hide-t { display: none !important; }
}
@media (max-width: 767px) {
	.smed-hide-m { display: none !important; }
}

/* ------------------------------------------------------- Editor-Hinweise */

.smed-editor-note {
	padding: 12px 16px;
	margin: 0 0 10px;
	border: 1px dashed #c9ccd4;
	border-radius: 10px;
	background: #f8f9fb;
	color: #6b7280;
	font: 14px/1.4 system-ui, -apple-system, sans-serif;
	text-align: center;
}
.smed-editor-note-scheduled { border-color: #a5b4fc; background: #eef2ff; color: #4338ca; }
.smed-editor-note-expired   { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.smed-editor-note-off,
.smed-editor-note-draft     { border-color: #d1d5db; background: #f3f4f6; color: #4b5563; }

@media (prefers-reduced-motion: reduce) {
	.smed-btn, .smed-pdf-card, .smed-img-link { transition: none; }
	.smed-btn:hover, .smed-pdf-card:hover { transform: none; }
}
