/* CDM Scheduled Media – Frontend */

.smed-slot { display: block; }
.smed-slot.smed-loading:empty { min-height: 40px; }
.smed-slot.smed-slot-group { display: flex; flex-direction: column; gap: 20px; }

.smed-card {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--smed-maxw, 640px);
	margin: 0 auto;
	background: var(--smed-bg, #fff);
	border: 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: 18px;
}
.smed-card *, .smed-card *::before, .smed-card *::after { box-sizing: border-box; }

/* Alignment */
.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; }

.smed-heading {
	margin: 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; }

/* Image */
.smed-img { line-height: 0; }
.smed-img img {
	display: block;
	width: 100%;
	height: var(--smed-img-h, auto);
	object-fit: var(--smed-img-fit, cover);
	border-radius: var(--smed-img-radius, 12px);
}

/* Layout variants */
.smed-l-image-left, .smed-l-image-right {
	flex-direction: row;
	align-items: center;
}
.smed-l-image-left .smed-img,
.smed-l-image-right .smed-img { flex: 0 0 44%; max-width: 44%; }
.smed-l-image-right { flex-direction: row-reverse; }
.smed-l-image-left .smed-body,
.smed-l-image-right .smed-body { flex: 1; }

/* Background image */
.smed-l-image-bg { position: relative; 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; }
.smed-l-image-bg .smed-heading { color: var(--smed-h-color, #fff); }
.smed-l-image-bg .smed-text { color: var(--smed-t-color, rgba(255,255,255,.9)); }

/* Button */
.smed-btn {
	display: inline-block;
	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;
	transition: transform .15s ease, filter .15s ease;
}
.smed-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* PDF card */
.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;
	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; color: var(--smed-btn-bg, #3b5bdb); }

/* PDF embed */
.smed-pdf-embed { width: 100%; 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; }

/* Responsive */
@media (max-width: 640px) {
	.smed-l-image-left, .smed-l-image-right { flex-direction: column; }
	.smed-l-image-left .smed-img,
	.smed-l-image-right .smed-img { flex: none; max-width: 100%; }
	.smed-card { padding: clamp(18px, 5vw, 28px); }
	.smed-heading { font-size: clamp(20px, 5.5vw, var(--smed-h-size, 26px)); }
}

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