/* Email-gated PDF popup + "Download PDF / Jump to pattern" buttons (shared by ftoursm.com and dreket.com).
   Colours come from the variables on .pg / .pg-bar so each site keeps its own palette. */

/* ---------- Buttons under the featured image ---------- */
.pg-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 0 0 30px;
}

.pg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 24px;
	border-radius: 999px;
	font: 700 16px/1.1 var(--pg-sans, system-ui, sans-serif);
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.pg-btn svg {
	flex-shrink: 0;
}

.pg-btn--pdf {
	border: 0;
	color: #fff;
	background: linear-gradient(135deg, var(--pg-accent, #a4472a), var(--pg-accent-2, #d07a3d));
	box-shadow: 0 10px 22px -10px var(--pg-accent, #a4472a);
}

.pg-btn--pdf:hover {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 14px 26px -10px var(--pg-accent, #a4472a);
}

.pg-btn--pdf small {
	display: inline-block;
	margin-left: 2px;
	padding: 3px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.22);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pg-btn--jump {
	border: 2px solid var(--pg-ink, #1e1e1c);
	color: var(--pg-ink, #1e1e1c);
	background: transparent;
}

.pg-btn--jump:hover {
	color: #fff;
	background: var(--pg-ink, #1e1e1c);
}

/* Phones: both buttons side by side, normal height */
@media (max-width: 600px) {
	.pg-bar {
		flex-wrap: nowrap;
		gap: 8px;
		margin-bottom: 24px;
	}
	.pg-btn {
		flex: 1 1 0;
		min-width: 0;
		min-height: 44px;
		padding: 0 10px;
		gap: 7px;
		font-size: 14px;
		white-space: nowrap;
	}
	.pg-btn svg {
		width: 17px;
		height: 17px;
	}
	.pg-btn--pdf small {
		display: none;
	}
	.pg-btn--jump {
		border-width: 1.5px;
	}
}

/* ---------- Popup ---------- */
html.pg-lock {
	overflow: hidden;
}

.pg {
	width: min(880px, calc(100vw - 24px));
	max-width: none;
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 22px;
	background: var(--pg-bg, #fffefb);
	color: var(--pg-ink, #1e1e1c);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}

.pg:focus,
.pg:focus-visible {
	outline: none !important;
}

.pg::backdrop {
	background: rgba(20, 18, 16, 0.6);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.pg[open] {
	animation: pg-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pg-in {
	from { opacity: 0; transform: translateY(18px) scale(0.98); }
}

.pg__in {
	position: relative;
	display: grid;
	grid-template-columns: 40% 60%;
	max-height: calc(100dvh - 24px);
	overflow-y: auto;
}

.pg__x {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--pg-ink, #1e1e1c);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	cursor: pointer;
}

.pg__x:hover {
	background: #fff;
	transform: rotate(90deg);
	transition: transform 0.2s;
}

/* Left: photo stack that looks like the PDF they'll get */
.pg__art {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	padding: 34px 20px;
	background:
		radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.55), transparent 45%),
		var(--pg-band, #f3e7da);
	overflow: hidden;
}

.pg__stack {
	position: relative;
	width: min(230px, 80%);
	aspect-ratio: 3 / 4;
}

.pg__ph {
	position: absolute;
	background: var(--pg-band, #f3e7da);
	width: 62%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border: 5px solid #fff;
	border-radius: 10px;
	box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35);
}

.pg__ph--a {
	top: -6%;
	left: -14%;
	transform: rotate(-10deg);
}

.pg__ph--b {
	bottom: -8%;
	right: -16%;
	transform: rotate(9deg);
}

.pg__page {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	padding: 10px 10px 12px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.4);
	transform: rotate(-2deg);
}

.pg__page-top {
	height: 7px;
	margin: 0 0 8px;
	border-radius: 3px;
	background: var(--pg-accent, #a4472a);
}

.pg__page img {
	flex: 1;
	background: var(--pg-band, #f3e7da);
	width: 100%;
	min-height: 0;
	object-fit: cover;
	border-radius: 5px;
}

.pg__page-lines {
	height: 22px;
	margin-top: 8px;
	background: repeating-linear-gradient(#e7e1d8 0 3px, transparent 3px 8px);
	border-radius: 2px;
}

.pg__tag {
	position: absolute;
	top: -12px;
	right: -14px;
	z-index: 3;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--pg-accent, #a4472a);
	color: #fff;
	font: 800 14px/1 var(--pg-sans, system-ui, sans-serif);
	letter-spacing: 0.06em;
	box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.35);
	transform: rotate(6deg);
}

.pg__ribbon {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 3;
	margin: 0;
	padding: 7px 16px;
	border-radius: 999px;
	background: #fff;
	color: var(--pg-accent-dk, #86381f);
	font: 800 12.5px/1 var(--pg-sans, system-ui, sans-serif);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	transform: translateX(-50%);
	white-space: nowrap;
}

/* Right: the offer */
.pg__body {
	padding: 40px 38px 30px;
}

.pg__state {
	display: none;
}

.pg[data-state="form"] .pg__state--form,
.pg[data-state="sending"] .pg__state--form,
.pg[data-state="making"] .pg__state--making,
.pg[data-state="done"] .pg__state--done {
	display: block;
}

.pg__kicker {
	display: inline-block;
	margin: 0 0 12px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--pg-band, #f3e7da);
	color: var(--pg-accent-dk, #86381f);
	font: 800 12px/1 var(--pg-sans, system-ui, sans-serif);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pg__title {
	margin: 0 0 10px;
	font: 700 clamp(1.6rem, 1.2rem + 1.4vw, 2.15rem)/1.15 var(--pg-serif, Georgia, serif);
	letter-spacing: -0.01em;
	color: var(--pg-ink, #1e1e1c);
}

.pg__title em {
	font-style: normal;
	color: var(--pg-accent, #a4472a);
}

.pg__state--form .pg__title {
	margin-bottom: 16px;
}

/* The "DAILY free patterns" highlight */
.pg__daily {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 2px dashed var(--pg-accent, #a4472a);
	border-radius: 14px;
	background: color-mix(in srgb, var(--pg-accent, #a4472a) 9%, #fff);
	text-align: left;
}

.pg__daily-ico {
	flex: 0 0 46px;
	height: 46px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--pg-accent, #a4472a);
	color: #fff;
	box-shadow: 0 6px 14px -6px var(--pg-accent, #a4472a);
}

.pg__daily-txt {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pg__daily-txt strong {
	font: 800 16.5px/1.25 var(--pg-sans, system-ui, sans-serif);
	color: var(--pg-ink, #1e1e1c);
}

.pg__daily-txt small {
	font-size: 13.5px;
	color: var(--pg-mut, #6b655c);
}

.pg__daily-tag {
	flex-shrink: 0;
	align-self: flex-start;
	padding: 6px 10px;
	border-radius: 999px;
	background: var(--pg-accent-dk, #86381f);
	color: #fff;
	font: 800 11px/1 var(--pg-sans, system-ui, sans-serif);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	animation: pg-pulse 2.2s ease-in-out infinite;
}

@keyframes pg-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
	.pg__daily-tag {
		animation: none;
	}
}

.pg__fine svg {
	margin-right: 3px;
	vertical-align: -2px;
}

.pg__lead {
	margin: 0 0 16px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--pg-ink-2, #3d3a35);
}

.pg__perks {
	display: grid;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}

.pg__perks li {
	position: relative;
	padding-left: 30px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--pg-ink, #1e1e1c);
}

.pg__perks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--pg-accent, #a4472a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.pg__form {
	display: grid;
	gap: 10px;
}

.pg__form input[type="email"] {
	width: 100%;
	height: 54px;
	padding: 0 18px;
	border: 2px solid var(--pg-line, #e2d8c7);
	border-radius: 14px;
	background: #fff;
	color: var(--pg-ink, #1e1e1c);
	font: 500 16px/1 var(--pg-sans, system-ui, sans-serif);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.pg__form input[type="email"]:focus {
	border-color: var(--pg-accent, #a4472a);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--pg-accent, #a4472a) 18%, transparent);
}

.pg__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.pg__go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 56px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--pg-accent, #a4472a), var(--pg-accent-2, #d07a3d));
	color: #fff;
	font: 800 17px/1 var(--pg-sans, system-ui, sans-serif);
	cursor: pointer;
	box-shadow: 0 12px 24px -12px var(--pg-accent, #a4472a);
	transition: transform 0.15s, filter 0.15s;
}

.pg__go:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
}

.pg[data-state="sending"] .pg__go {
	opacity: 0.7;
	pointer-events: none;
}

.pg[data-state="sending"] .pg__go span::after {
	content: "...";
}

.pg__err {
	min-height: 1em;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #b3261e;
}

.pg__fine {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--pg-mut, #6b655c);
}

.pg__fine a {
	color: inherit;
}

.pg__state--making,
.pg__state--done {
	padding: 30px 0;
	text-align: center;
}

.pg__spin {
	width: 54px;
	height: 54px;
	margin: 0 auto 18px;
	border: 5px solid var(--pg-band, #f3e7da);
	border-top-color: var(--pg-accent, #a4472a);
	border-radius: 50%;
	animation: pg-spin 0.9s linear infinite;
}

@keyframes pg-spin {
	to { transform: rotate(360deg); }
}

.pg__check {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: #2e7d4f;
	color: #fff;
}

.pg__done-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 20px;
}

.pg__done-actions .pg-btn {
	min-height: 46px;
	font-size: 15px;
}

/* Phones: photos on top, offer below, big tap targets */
@media (max-width: 700px) {
	.pg {
		width: calc(100vw - 16px);
		border-radius: 20px;
	}
	.pg__in {
		grid-template-columns: 1fr;
	}
	.pg__art {
		min-height: 0;
		height: 168px;
		padding: 14px;
	}
	.pg__stack {
		width: 100px;
	}
	.pg__body {
		padding-top: 18px;
	}
	.pg__kicker {
		margin-bottom: 8px;
	}
	.pg__title {
		font-size: 1.55rem;
	}
	.pg__daily {
		padding: 10px 12px;
		gap: 10px;
	}
	.pg__daily-ico {
		flex-basis: 40px;
		height: 40px;
	}
	.pg__daily-txt strong {
		font-size: 15px;
	}
	.pg__daily-txt small {
		font-size: 12.5px;
	}
	.pg__ph {
		border-width: 3px;
	}
	.pg__tag {
		font-size: 12px;
		padding: 6px 9px;
	}
	.pg__ribbon {
		bottom: 10px;
		font-size: 11px;
		padding: 6px 12px;
	}
	.pg__body {
		padding: 22px 20px 22px;
		text-align: center;
	}
	.pg__perks {
		width: fit-content;
		margin-left: auto;
		margin-right: auto;
		justify-items: start;
		text-align: left;
	}
	.pg__lead {
		font-size: 15px;
	}
}

@media print {
	.pg,
	.pg-bar {
		display: none !important;
	}
}
