/**
 * Newsletter form + popup. Theme-native: typography inherits, the submit button uses the
 * theme's .wp-element-button styling, no webfonts.
 */

.dct-newsletter__title {
	margin: 0 0 0.4em;
}

.dct-newsletter__desc {
	margin: 0 0 1em;
}

/* Controls: sans-serif preset, slightly smaller than body, rounded, compact padding. */
.dct-newsletter__fields {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	font-family: var(--wp--preset--font-family--sans-serif, sans-serif);
	font-size: 0.75em;
}

.dct-newsletter__field {
	display: block;
}

.dct-newsletter__field input {
	box-sizing: border-box;
	width: 100%;
	padding: 0.45em 0.7em;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	color: #333;
	font: inherit;
	line-height: 1.4;
}

.dct-newsletter__field input:focus {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* The submit is a real button carrying the theme's button-block classes
   (.wp-block-button__link.wp-element-button); only size/shape are tightened here. */
.dct-newsletter__button {
	display: flex;
}

.dct-newsletter .dct-newsletter__submit {
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
	padding: 0.45em 1.4em;
	border-radius: 6px;
	line-height: 1.4;
}

/* Horizontal bar variant: fields and button in one wrapping row. */
.is-style-horizontal .dct-newsletter__fields {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: stretch;
}

.is-style-horizontal .dct-newsletter__field {
	flex: 1 1 180px;
}

.is-style-horizontal .dct-newsletter__button {
	flex: 0 0 auto;
}

/* Honeypot: visually removed, still in the DOM for bots. */
.dct-newsletter__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.dct-newsletter__status {
	margin: 0.6em 0 0;
	min-height: 1.4em;
}

.dct-newsletter__status.is-error {
	color: #b32d2e;
}

.dct-newsletter__form.is-success .dct-newsletter__status {
	font-weight: 600;
}

/* ------------------------------------------------------------------- popup */

.dct-ops-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow: auto;
}

/* display:flex above would defeat the hidden attribute's UA display:none — the popup
   must stay invisible until the view script's delay timer clears `hidden`. */
.dct-ops-popup[hidden] {
	display: none !important;
}

/* Scrim: dims the page behind the modal. Color/opacity come from
   inline style set by render_popup(); this rgba is the fallback when none is configured. */
.dct-ops-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

/* The optional image belongs to the modal itself: it frames the inset white card. */
.dct-ops-popup__frame {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
	border-radius: 16px;
}

.dct-ops-popup__frame.has-background {
	max-width: 540px;
	padding: 48px 44px 34px;
	border-radius: 28px;
	background-position: center;
	background-size: cover;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dct-ops-popup__card {
	position: relative;
	box-sizing: border-box;
	max-width: 420px;
	width: 100%;
	margin-inline: auto;
	max-height: 90vh;
	overflow: auto;
	padding: 32px 28px 22px;
	border-radius: 16px;
	background: #fff;
	color: #333;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dct-ops-popup__frame.has-background .dct-ops-popup__card {
	max-height: none;
	box-shadow: none;
}

/* Arm-level treatment geometry. The form and close semantics remain shared, while the
   container can range from a quiet corner card to an immersive takeover. */
.dct-ops-popup__frame.is-size-compact {
	max-width: 360px;
}

.dct-ops-popup__frame.is-size-standard {
	max-width: 520px;
}

.dct-ops-popup__frame.is-size-wide {
	max-width: 760px;
}

.dct-ops-popup__frame.is-size-full {
	max-width: min(1100px, calc(100vw - 48px));
}

.dct-ops-popup.is-backdrop-none .dct-ops-popup__overlay {
	display: none;
}

.dct-ops-popup.is-backdrop-soft .dct-ops-popup__overlay {
	backdrop-filter: blur(5px);
}

.dct-ops-popup.is-presentation-bottom_bar,
.dct-ops-popup.is-presentation-corner_card {
	pointer-events: none;
}

.dct-ops-popup.is-presentation-bottom_bar {
	align-items: flex-end;
	justify-content: stretch;
	padding: 0;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-ops-popup__frame {
	max-width: none;
	border-radius: 0;
	pointer-events: auto;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-ops-popup__card {
	max-width: none;
	padding: 18px 56px 16px;
	border-radius: 0;
	text-align: left;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter {
	display: grid;
	grid-template-columns: minmax(220px, 0.8fr) minmax(520px, 1.8fr);
	align-items: center;
	gap: 4px 28px;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter__title,
.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter__desc {
	grid-column: 1;
	margin: 0;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter__form {
	grid-column: 2;
	grid-row: 1 / span 2;
}

.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter__fields {
	flex-direction: row;
}

.dct-ops-popup.is-presentation-side_panel {
	align-items: stretch;
	justify-content: flex-end;
	padding: 0;
}

.dct-ops-popup.is-presentation-side_panel .dct-ops-popup__frame,
.dct-ops-popup.is-presentation-side_panel .dct-ops-popup__card {
	height: 100%;
	max-height: none;
	border-radius: 0;
}

.dct-ops-popup.is-presentation-side_panel .dct-ops-popup__frame.has-background {
	display: flex;
	align-items: flex-end;
	padding: 38vh 24px 24px;
}

.dct-ops-popup.is-presentation-side_panel .dct-ops-popup__card {
	display: flex;
	align-items: center;
	padding: 48px 34px;
	text-align: left;
}

.dct-ops-popup.is-presentation-takeover .dct-ops-popup__frame {
	min-height: min(760px, calc(100vh - 48px));
	display: flex;
	align-items: center;
	background-image: linear-gradient(135deg, #2f193f, #7c3f91);
}

.dct-ops-popup.is-presentation-takeover .dct-ops-popup__card {
	max-width: 720px;
	padding: 64px 56px 46px;
}

.dct-ops-popup.is-presentation-corner_card {
	align-items: flex-end;
	justify-content: flex-end;
	padding: 24px;
}

.dct-ops-popup.is-presentation-corner_card .dct-ops-popup__frame {
	pointer-events: auto;
}

.dct-ops-popup.is-presentation-editorial .dct-ops-popup__frame {
	max-width: 820px;
	padding: 48px 42px 38px min(46%, 360px);
	background-color: #d9c3e2;
	background-image: linear-gradient(135deg, #432758 0 42%, #d9c3e2 42% 100%);
	background-size: cover;
}

.dct-ops-popup.is-presentation-editorial .dct-ops-popup__card {
	text-align: left;
}

/* Registered experiment design presets. They change creative only; form behavior and
   accessibility remain shared. */
.dct-ops-popup__frame.is-layout-split.has-background {
	display: flex;
	justify-content: flex-end;
	max-width: 720px;
	padding-left: min(48%, 340px);
}

.dct-ops-popup__frame.is-layout-minimal {
	max-width: 380px;
}

.dct-ops-popup__frame.is-layout-minimal .dct-ops-popup__card {
	padding: 24px;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.dct-ops-popup__frame.is-layout-bold .dct-ops-popup__card {
	padding: 42px 34px 30px;
	border-radius: 28px 8px;
}

.dct-ops-popup__frame.is-card-dark .dct-ops-popup__card {
	background: #2f193f;
	color: #fff;
}

.dct-ops-popup__frame.is-card-accent .dct-ops-popup__card {
	background: #f3e8f8;
	color: #2f193f;
}

.dct-ops-popup__frame.is-card-dark .dct-newsletter__title,
.dct-ops-popup__frame.is-card-dark .dct-newsletter__desc,
.dct-ops-popup__frame.is-card-accent .dct-newsletter__title,
.dct-ops-popup__frame.is-card-accent .dct-newsletter__desc {
	color: inherit;
}

.dct-ops-popup__frame.is-button-dark .dct-newsletter__submit,
.dct-ops-popup__frame.is-button-dark .dct-ops-popup__mobile-reveal {
	background: #2f193f;
	color: #fff;
}

.dct-ops-popup__frame.is-button-light .dct-newsletter__submit,
.dct-ops-popup__frame.is-button-light .dct-ops-popup__mobile-reveal {
	background: #fff;
	color: #2f193f;
	border: 1px solid currentColor;
}

.dct-ops-popup__frame.is-image-soft.has-background {
	background-blend-mode: screen;
	background-color: rgba(255, 255, 255, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
	.dct-ops-popup.is-motion-rise .dct-ops-popup__frame { animation: dct-ops-popup-rise 0.28s ease-out; }
	.dct-ops-popup.is-motion-slide_up .dct-ops-popup__frame { animation: dct-ops-popup-slide-up 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
	.dct-ops-popup.is-motion-slide_left .dct-ops-popup__frame { animation: dct-ops-popup-slide-left 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
	.dct-ops-popup.is-motion-fade .dct-ops-popup__frame { animation: dct-ops-popup-fade 0.42s ease-out; }
	.dct-ops-popup.is-motion-pop .dct-ops-popup__frame { animation: dct-ops-popup-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }

	@keyframes dct-ops-popup-rise { from { opacity: 0; transform: translateY(20px); } }
	@keyframes dct-ops-popup-slide-up { from { transform: translateY(100%); } }
	@keyframes dct-ops-popup-slide-left { from { transform: translateX(100%); } }
	@keyframes dct-ops-popup-fade { from { opacity: 0; } }
	@keyframes dct-ops-popup-pop { from { opacity: 0; transform: scale(0.82); } }
}

.dct-ops-popup__close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 6px;
	z-index: 1;
}

.dct-ops-popup__mobile-summary {
	display: none;
}

.dct-ops-popup__frame.has-background .dct-ops-popup__close {
	top: 10px;
	right: 12px;
}

.dct-ops-popup .dct-newsletter__fields {
	flex-direction: column;
}

.dct-ops-popup .dct-newsletter {
	font-size: 80%;
}

.dct-ops-popup .dct-newsletter__button,
.dct-ops-popup .dct-newsletter__submit {
	width: 100%;
}

.dct-ops-popup .dct-newsletter__submit {
	display: block;
}

.dct-ops-popup-open {
	overflow: hidden;
}

@media (max-width: 900px) and (min-width: 600px) {
	.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter {
		display: block;
	}

	.dct-ops-popup.is-presentation-bottom_bar .dct-newsletter__form {
		margin-top: 10px;
	}
}

/* Mobile is deliberately non-modal: a compact bottom prompt does not cover the nav,
   dim the page, lock scrolling, or capture clicks outside its own frame. */
@media (max-width: 599px) {
	.dct-ops-popup.is-mobile {
		align-items: flex-end;
		justify-content: stretch;
		z-index: 900;
		padding: 12px;
		pointer-events: none;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__overlay {
		display: none;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__frame,
	.dct-ops-popup.is-mobile .dct-ops-popup__frame.has-background {
		display: block;
		min-height: 0;
		height: auto;
		max-width: none;
		padding: 0;
		border: 1px solid rgba(53, 28, 77, 0.16);
		border-radius: 14px;
		background: #fff !important;
		box-shadow: 0 8px 28px rgba(53, 28, 77, 0.22);
		pointer-events: auto;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__frame.is-layout-split.has-background {
		display: block;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__close {
		top: 7px;
		right: 7px;
		padding: 8px;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__card {
		display: block;
		height: auto;
		max-width: none;
		max-height: min(70vh, 520px);
		padding: 42px 18px 16px;
		border-radius: 14px;
		box-shadow: none;
		text-align: left;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__mobile-summary {
		display: flex;
		align-items: center;
		gap: 12px;
		min-height: 48px;
		padding: 10px 48px 10px 14px;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__mobile-title {
		flex: 1 1 auto;
		font-family: var(--wp--preset--font-family--sans-serif, sans-serif);
		font-size: 15px;
		line-height: 1.25;
	}

	.dct-ops-popup.is-mobile .dct-ops-popup__mobile-reveal {
		flex: 0 0 auto;
		padding: 8px 12px;
		border: 0;
		border-radius: 6px;
		font-size: 14px;
		line-height: 1.2;
		cursor: pointer;
	}

	.dct-ops-popup.is-mobile.is-mobile-collapsed .dct-ops-popup__card {
		display: none;
	}

	.dct-ops-popup.is-mobile:not(.is-mobile-collapsed) .dct-ops-popup__mobile-summary {
		display: none;
	}

	.dct-ops-popup.is-mobile.is-mobile-mode-expanded .dct-ops-popup__mobile-summary {
		display: none;
	}
}
