/* Subscribe window (centre, dimmed page) and order thank-you card (top, page stays usable).
   Shturko_Subscribe_Popup; behaviour in shturko-subscribe-popup.js. */

html.sh-subs-open {
	overflow: hidden;
}

.sh-subs {
	position: fixed;
	inset: 0;
	z-index: 1000000; /* over the cookie bar, feedback and accessibility buttons */
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(23, 58, 94, 0.45);
	animation: sh-subs-fade 0.2s ease-out;
}

.sh-subs__box {
	position: relative;
	width: min(30rem, 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	padding: 1.25rem 1.5rem 1.4rem;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 20px 50px rgba(23, 58, 94, 0.25);
	font-family: Nunito, "Segoe UI", Arial, sans-serif;
	color: #1f2933;
	text-align: left;
	animation: sh-subs-pop 0.25s ease-out;
}

.sh-subs__x {
	position: absolute;
	top: 0.5rem;
	right: 0.6rem;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #52606d;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}

.sh-subs__x:hover {
	background: #f3f6f9;
}

.sh-subs__img {
	display: block;
	width: 120px;
	height: auto;
	margin: 0 auto 0.4rem;
}

.sh-subs__title {
	margin: 0 0 0.6rem;
	font-family: Andika, "Segoe UI", Arial, sans-serif;
	font-size: 1.3rem;
	font-weight: 400;
	line-height: 1.3;
	color: #173a5e;
	text-align: center;
}

.sh-subs__unsub {
	margin: 0 0 0.9rem;
	padding: 0.55rem 0.8rem;
	border-radius: 12px;
	background: #eef6fb;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #33475b;
}

.sh-subs__lead {
	margin: 0 0 0.4rem;
	font-weight: 600;
}

.sh-subs__opts {
	display: grid;
	gap: 0.35rem;
}

.sh-subs__opt {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0;
	padding: 0.5rem 0.7rem;
	border-radius: 12px;
	background: #f6f9fc;
	line-height: 1.4;
	cursor: pointer;
}

.sh-subs__opt:hover {
	background: #edf3f9;
}

.sh-subs__opt input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: #f04d23;
}

.sh-subs__email {
	display: grid;
	gap: 0.25rem;
	margin: 0.8rem 0 0;
	font-weight: 600;
}

.sh-subs__email input {
	min-height: 44px;
	padding: 0.4rem 0.8rem;
	border: 1px solid #c7d3df;
	border-radius: 12px;
	font: inherit;
	font-weight: 400;
	font-size: 1rem;
}

.sh-subs__msg {
	min-height: 1.2em;
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: #b83a14;
}

.sh-subs__btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
	margin-top: 0.4rem;
}

.sh-subs__btns:has(> :only-child) {
	grid-template-columns: 1fr;
}

.sh-subs__btn {
	min-height: 46px;
	margin: 0;
	padding: 0.5rem 0.9rem;
	border: 2px solid #f04d23;
	border-radius: 999px;
	font-family: Andika, "Segoe UI", Arial, sans-serif;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.2;
	cursor: pointer;
}

.sh-subs__btn--yes {
	background: #f04d23;
	color: #fff;
}

.sh-subs__btn--no {
	border-color: #173a5e;
	background: #fff;
	color: #173a5e;
}

.sh-subs__btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.sh-subs__btn:focus-visible,
.sh-subs__x:focus-visible,
.sh-subs__opt:focus-within {
	outline: 3px solid #173a5e;
	outline-offset: 2px;
}

.sh-subs__more {
	display: block;
	margin-top: 0.7rem;
	font-size: 0.9rem;
	text-align: center;
	color: #173a5e;
}

.sh-subs__done {
	margin: 0.6rem 0 0;
	padding: 0.8rem 1rem;
	border-radius: 14px;
	background: #eef7ee;
	text-align: center;
}

@media (max-width: 420px) {
	.sh-subs__box {
		padding: 1rem 1rem 1.2rem;
	}

	.sh-subs__btns {
		grid-template-columns: 1fr;
	}
}

/* Phone: the same bottom sheet as every .sh-dialog (shturko-soft-ui.css) — 16px top corners,
 * grab handle, × half above the top edge with a glow. The box has no transform animation
 * here, so the fixed × is placed against the screen, not clipped by the scrolling box. */
@media (max-width: 600px) {
	.sh-subs {
		place-items: end stretch;
		padding: 0;
	}

	.sh-subs__box {
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		padding: 32px 20px calc(20px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
		animation: none;
	}

	.sh-subs__box::before {
		content: "";
		position: absolute;
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 4px;
		background: #d3d9e0;
	}

	@supports (anchor-name: --sh-subs) {
		.sh-subs__box {
			anchor-name: --sh-subs;
		}

		.sh-subs__x {
			position: fixed;
			position-anchor: --sh-subs;
			top: calc(anchor(top) - 22px);
			right: calc(anchor(right) + 16px);
			z-index: 3;
			width: 44px;
			height: 44px;
			background: #fff;
			color: #1f4568;
			font-size: 22px;
			box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45), 0 6px 18px rgba(23, 58, 94, 0.35);
		}

		.sh-subs__x:hover {
			background: #f4f6f8;
		}
	}
}

/* Thank-you card: slides down from under the header, no dimming, its own look. */
.sh-thanks {
	position: fixed;
	top: calc(var(--header-h, 72px) + 12px);
	left: 50%;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 0.9rem;
	width: min(34rem, calc(100vw - 32px));
	padding: 0.8rem 1rem 0.8rem 0.8rem;
	border: 2px solid #ffd27a;
	border-radius: 20px;
	background: linear-gradient(180deg, #fff8e6 0%, #fff 100%);
	box-shadow: 0 14px 34px rgba(23, 58, 94, 0.18);
	font-family: Nunito, "Segoe UI", Arial, sans-serif;
	color: #1f2933;
	opacity: 0;
	transform: translate(-50%, -24px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sh-thanks.is-in {
	opacity: 1;
	transform: translate(-50%, 0);
}

.sh-thanks__img {
	flex: none;
	width: 84px;
	height: auto;
}

.sh-thanks__text {
	flex: 1;
	min-width: 0;
}

.sh-thanks__title {
	margin: 0 0 0.2rem;
	font-family: Andika, "Segoe UI", Arial, sans-serif;
	font-size: 1.15rem;
	color: #173a5e;
}

.sh-thanks__line {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.sh-thanks__ok {
	flex: none;
	min-height: 40px;
	margin: 0;
	padding: 0.35rem 1.1rem;
	border: 2px solid #f04d23;
	border-radius: 999px;
	background: #fff;
	color: #f04d23;
	font-family: Andika, "Segoe UI", Arial, sans-serif;
	font-size: 0.95rem;
	cursor: pointer;
}

.sh-thanks__ok:focus-visible {
	outline: 3px solid #173a5e;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.sh-thanks {
		flex-wrap: wrap;
	}

	.sh-thanks__img {
		width: 64px;
	}

	.sh-thanks__ok {
		width: 100%;
	}
}

@keyframes sh-subs-fade {
	from { opacity: 0; }
}

@keyframes sh-subs-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
	.sh-subs,
	.sh-subs__box {
		animation: none;
	}

	.sh-thanks {
		transition: none;
	}
}
