/* Client-managed announcement and offer popup. */

.announcement-container--editable {
	gap: 0.8rem;
	color: inherit;
	text-decoration: none;
}

.announcement-container--editable .announcement-desktop,
.announcement-container--editable .announcement-mobile {
	margin: 0;
}

.announcement-link {
	flex: 0 0 auto;
	border-bottom: 1px solid currentColor;
	color: #fff8ea;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-decoration: none;
	text-transform: uppercase;
}

.mwo-offer-popup[hidden] {
	display: none !important;
}

.mwo-offer-popup {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 1.25rem;
}

.mwo-offer-popup__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: rgba(35, 18, 13, 0.68);
	backdrop-filter: blur(5px);
	cursor: default;
}

.mwo-offer-popup__dialog {
	position: relative;
	z-index: 1;
	display: grid;
	width: min(92vw, 560px);
	max-height: min(86vh, 720px);
	border: 1px solid rgba(111, 61, 34, 0.18);
	border-radius: 1.1rem;
	background: #fff8ea;
	box-shadow: 0 30px 90px rgba(35, 18, 13, 0.36);
	overflow: auto;
	animation: mwo-offer-enter 260ms ease both;
}

.mwo-offer-popup__dialog.has-image {
	grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.15fr);
	width: min(92vw, 820px);
}

.mwo-offer-popup__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	border: 1px solid rgba(73, 32, 27, 0.18);
	border-radius: 50%;
	background: rgba(255, 248, 234, 0.94);
	color: #49201b;
	font-size: 1.65rem;
	line-height: 1;
	cursor: pointer;
}

.mwo-offer-popup__media {
	min-height: 420px;
}

.mwo-offer-popup__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mwo-offer-popup__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(2rem, 5vw, 3.5rem);
}

.mwo-offer-popup__eyebrow {
	margin: 0 0 0.85rem;
	color: #a15a2d;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.mwo-offer-popup__content h2 {
	margin: 0 0 1rem;
	color: #3a2418;
	font-family: var(--font-serif);
	font-size: clamp(2.1rem, 5vw, 3.7rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.035em;
}

.mwo-offer-popup__content > p:not(.mwo-offer-popup__eyebrow):not(.mwo-offer-popup__code) {
	margin: 0;
	color: #68564c;
	font-size: 0.98rem;
	line-height: 1.7;
}

.mwo-offer-popup__code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 1.35rem 0 0;
	padding: 0.85rem 1rem;
	border: 1px dashed #b77a38;
	border-radius: 0.6rem;
	background: #fffdf8;
	color: #6f1e1c;
}

.mwo-offer-popup__code span {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mwo-offer-popup__code strong {
	font-size: 1rem;
	letter-spacing: 0.08em;
}

.mwo-offer-popup__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin-top: 1.4rem;
	padding: 0.9rem 1.35rem;
	border-radius: 999px;
	background: #6f1e1c;
	color: #fff8ea;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.mwo-offer-popup__close:focus-visible,
.mwo-offer-popup__cta:focus-visible {
	outline: 3px solid #d3a247;
	outline-offset: 3px;
}

body.mwo-offer-popup-open {
	overflow: hidden;
}

@keyframes mwo-offer-enter {
	from { opacity: 0; transform: translateY(18px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
	.mwo-offer-popup {
		align-items: end;
		padding: 0;
	}

	.mwo-offer-popup__dialog,
	.mwo-offer-popup__dialog.has-image {
		grid-template-columns: 1fr;
		width: 100%;
		max-height: 90vh;
		border-radius: 1rem 1rem 0 0;
	}

	.mwo-offer-popup__media {
		min-height: 0;
		max-height: 34vh;
		aspect-ratio: 16 / 9;
	}

	.mwo-offer-popup__content {
		padding: 1.75rem 1.25rem 2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mwo-offer-popup__dialog {
		animation: none;
	}
}
