/**
 * Social Auto Embed - front-end styles
 *
 * Lightweight, theme-friendly styling for all embed types.
 * Works in both light and dark contexts via prefers-color-scheme.
 */

.social-embed-wrapper {
	margin: 1.5rem auto;
	width: 100%;
	max-width: 600px; /* overridden inline from the Max width setting */
	clear: both;
}

/* Responsive aspect-ratio box (used by YouTube). ---------------------- */
.sae-ratio {
	position: relative;
	width: 100%;
	border-radius: 14px;
	overflow: hidden;
	background: #000;
}

/* Modern browsers use aspect-ratio; older ones fall back to padding. */
.sae-ratio-16x9 {
	aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 16 / 9) {
	.sae-ratio-16x9 {
		height: 0;
		padding-bottom: 56.25%;
	}
}

.sae-ratio iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Embeds that bring their own script-driven sizing. ------------------- */
.social-embed-wrapper.sae-tiktok,
.social-embed-wrapper.sae-twitter,
.social-embed-wrapper.sae-facebook {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.social-embed-wrapper .twitter-tweet,
.social-embed-wrapper .fb-post,
.social-embed-wrapper .fb-video,
.social-embed-wrapper .tiktok-embed {
	margin: 0 auto !important;
	max-width: 100% !important;
}

/* Instagram iframe. --------------------------------------------------- */
.sae-ig {
	width: 100%;
	display: flex;
	justify-content: center;
}

.sae-ig iframe {
	width: 100%;
	max-width: 540px;
	min-height: 540px; /* updated to the real height by embeds.js */
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
}

/* Snapchat preview card. ---------------------------------------------- */
.sae-snap-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 16px;
	text-decoration: none;
	background: #fffc00; /* Snapchat yellow */
	color: #111;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sae-snap-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.sae-snap-icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.06);
	color: #111;
}

.sae-snap-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.sae-snap-title {
	font-weight: 700;
	font-size: 1rem;
}

.sae-snap-url {
	font-size: 0.85rem;
	opacity: 0.75;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sae-snap-btn {
	flex: 0 0 auto;
	padding: 8px 14px;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-weight: 600;
	font-size: 0.85rem;
}

/* Fallback card. ------------------------------------------------------ */
.sae-fallback {
	padding: 14px 16px;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 12px;
	text-align: center;
}

.sae-fallback-msg {
	margin: 0 0 6px;
	opacity: 0.7;
	font-size: 0.9rem;
}

.sae-fallback-link {
	word-break: break-all;
}

/* Copy link button. --------------------------------------------------- */
.sae-copy {
	display: inline-block;
	margin: 10px auto 0;
	padding: 6px 14px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.sae-copy:hover {
	background: rgba(0, 0, 0, 0.06);
}

.sae-copy.sae-copied {
	border-color: #1a9c4c;
	color: #1a9c4c;
}

/* Dark mode niceties. ------------------------------------------------- */
@media (prefers-color-scheme: dark) {
	.sae-ig iframe {
		border-color: rgba(255, 255, 255, 0.12);
	}
	.sae-fallback {
		border-color: rgba(255, 255, 255, 0.25);
	}
	.sae-copy {
		border-color: rgba(255, 255, 255, 0.25);
	}
	.sae-copy:hover {
		background: rgba(255, 255, 255, 0.08);
	}
}

/* Small screens. ------------------------------------------------------ */
@media (max-width: 480px) {
	.sae-snap-card {
		flex-wrap: wrap;
	}
	.sae-snap-btn {
		width: 100%;
		text-align: center;
		margin-top: 4px;
	}
}
