.amz-widget{
	display:flex;
	flex-direction:column; /* stack by default on small screens */
	align-items:flex-start;
	gap:12px;
	border:1px solid #eee;
	padding:0;
	border-radius:10px;
	width:100%;
	max-width:none;
	text-decoration:none;
	color:inherit;
	background:#fff;
	transition:box-shadow .2s;
	box-sizing:border-box;
	overflow:hidden;
}
.amz-widget:hover{box-shadow:0 6px 18px rgba(0,0,0,.08)}

/* Image: fixed size on larger screens, full width on small screens */
.amz-widget img{
	width:100%;
	max-width:100%;
	height:auto;
	object-fit:cover;
	border-radius:6px;
	display:block;
}

.amz-content{
	display:flex;
	flex-direction:column;
	justify-content:center;
	padding:12px;
	min-width:0;
	width:100%;
}

.amz-title{font-weight:600;line-height:1.3;color:inherit;margin-top:1rem}
.amz-cta{font-size:.95em;color:#fff;font-weight:600}

/* Remove any link underlines and ensure title has no decoration */
.amz-widget, .amz-widget * { text-decoration: none !important; }
/* Force links and widget to inherit article text color */
.amz-widget { color: inherit !important; }
.amz-widget:link, .amz-widget:visited, .amz-widget:hover, .amz-widget:active { color: inherit !important; }
.amz-widget .amz-title { color: inherit !important; }

/* CTA button styling */
.amz-cta{
	display:inline-block;
	background:#ff9900;
	color:#fff !important;
	padding:8px 12px;
	border-radius:8px;
	font-weight:600;
	margin-top:8px;
	width:auto;
	align-self:flex-start;
}

/* On wider screens use a row layout: image left, content right */
@media (min-width:641px) {
	/* desktop layout: 1/3 image | 2/3 content */
	.amz-widget{display:grid;grid-template-columns:1fr 2fr;align-items:stretch;gap:12px}
	.amz-widget img{width:100%;height:auto;object-fit:cover}
	.amz-content{padding-left:0}
	.amz-title{margin-top:0}

	/* limit image height only so the right column can expand without being cut
	   prevent the image from overflowing the widget by clipping excess */
	.amz-widget{overflow:hidden;align-items:stretch}
	.amz-widget img{max-height:250px;height:250px;width:100%;object-fit:cover;align-self:start}
	.amz-content{height:auto;overflow:visible;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}

	/* stronger selectors to override theme/prose rules when needed */
	.content .amz-widget{display:grid !important;grid-template-columns:1fr 2fr !important;gap:12px !important}
	.content .amz-widget img{width:100% !important;height:250px !important;object-fit:cover !important;align-self:start !important}
	.content .amz-widget .amz-cta{width:auto !important;display:inline-block !important;align-self:flex-start !important}
}

/* On very small screens ensure image is full-width and content stacked */
@media (max-width:420px) {
	.amz-widget{flex-direction:column;align-items:flex-start}
	.amz-widget img{width:100%;height:auto}
	.amz-content{margin-left:0}
}
