/*
 * Quilt landing page — mobile-first.
 *
 * Breakpoints (single source of truth — keep in sync if you add tiers):
 *   Mobile (base):  up to 767px
 *   Desktop:        min-width: 768px
 *
 * Aligned with Elementor Pro's active breakpoints on this site
 * (tablet 768–1240, desktop 1241+ treated as one tier for now).
 */

/* ---------------------------------------------------------------
 * Fonts
 * --------------------------------------------------------------- */

@font-face {
	font-family: 'Butler';
	src: url('../fonts/Butler-Bold.woff2') format('woff2'),
	     url('../fonts/Butler-Bold.woff') format('woff');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------------------------------------------------------------
 * Section backgrounds (placeholder heights — replaced when content lands)
 * --------------------------------------------------------------- */

/*
 * Note: keep all font-size declarations on this page >= 15px (0.9375rem).
 */

.quilt-hero {
	background: #F89C4E;
	color: #57361A;
	padding: 3rem 1.5rem 0;
	text-align: center;
	font-family: 'Montserrat', sans-serif;
}

.quilt-hero__inner {
	max-width: 47rem;
	margin: 0 auto;
}

.quilt-hero__headline {
	font-family: 'Butler', serif;
	font-weight: 700;
	font-size: 2rem;
	line-height: 1.1;
	margin: 0 0 1rem;
}

.quilt-hero__lede,
.quilt-hero__sub {
	font-size: 1rem;
	line-height: 1.5;
	margin: 0 0 1.25rem;
}

.quilt-hero__sub {
	font-weight: 700;
	margin-bottom: 1.5rem;
}

.quilt-hero .quilt-hero__cta,
.quilt-hero .quilt-hero__cta:link,
.quilt-hero .quilt-hero__cta:visited {
	position: relative;
	z-index: 2;
	display: inline-block;
	padding: 0.5rem 2rem;
	background: #5D9A83;
	border: 3px solid #53586B;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 2px;
	transform: translateY(50%);
	transition: background 0.15s;
}

.quilt-hero .quilt-hero__cta:hover,
.quilt-hero .quilt-hero__cta:focus {
	background: #4a7c69;
	color: #fff;
}

@media (min-width: 768px) {
	.quilt-hero__lede,
	.quilt-hero__sub {
		font-size: 1.25rem; /* 20px */
	}
}

.quilt-canvas-stats {
	padding: 4rem 1.5rem 3rem;
	background: linear-gradient(
		-35deg,
		#E6CAAC 0%,
		#E6CAAC 20%,
		#3D414F 20%,
		#3D414F 60%,
		#53586B 60%,
		#53586B 100%
	);
	font-family: 'Montserrat', sans-serif;
	color: #fff;
}

.quilt-stats {
	display: flex;
	justify-content: space-around;
	align-items: flex-start;
	max-width: 32rem;
	margin: 0 auto 2.5rem;
	text-align: center;
}

.quilt-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.quilt-stat__value {
	font-family: 'Butler', serif;
	font-weight: 700;
	font-size: 2rem;
	line-height: 1;
}

.quilt-stat__label {
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	margin-top: 0.4rem;
	letter-spacing: 0.02em;
}

/* Canvas wrap.
 * TODO (a11y): consider adding +/- zoom buttons for keyboard users — deferred. */
.quilt-canvas-wrap {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
	aspect-ratio: 1;
	background: rgba(255, 255, 255, 0.5); /* placeholder until canvas renders */
	border: 3px solid #1F2128;
}

.quilt-canvas-wrap canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.quilt-canvas-reset {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 2.25rem;
	height: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(83, 88, 107, 0.4);
	border-radius: 50%;
	color: #53586B;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.quilt-canvas-reset:hover,
.quilt-canvas-reset:focus {
	background: #fff;
	color: #3D414F;
}

.quilt-canvas-reset svg {
	width: 1.1rem;
	height: 1.1rem;
}

/* ---------------------------------------------------------------
 * Patch detail — desktop tooltip + mobile modal
 * --------------------------------------------------------------- */

.quilt-patch-tooltip {
	position: absolute;
	z-index: 3;
	max-width: 18rem;
	padding: 0.75rem 1rem;
	background: #1F2128;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 1.2rem;
	line-height: 1.35;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

.quilt-patch-tooltip[hidden] {
	display: none;
}

.quilt-patch-tooltip__tier {
	margin: 0;
	color: #5D9A83;
	font-size: 0.9375rem; /* 15px floor */
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.quilt-patch-tooltip__message {
	margin: 0.5rem 0 0;
	font-style: italic;
	overflow-wrap: break-word;
	word-break: break-word;
}

.quilt-patch-tooltip__donor {
	margin: 0.5rem 0 0;
	font-weight: 700;
}

.quilt-patch-modal {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(31, 33, 40, 0.7);
}

.quilt-patch-modal[hidden] {
	display: none;
}

.quilt-patch-modal__panel {
	position: relative;
	max-width: 100%;
	padding: 2rem 1.5rem 1.5rem;
	background: #fff;
	color: #57361A;
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	line-height: 1.4;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.quilt-patch-modal__close {
	position: absolute;
	top: 0.25rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	background: transparent;
	border: 0;
	color: #57361A;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.quilt-patch-modal__tier {
	margin: 0;
	color: #5D9A83;
	font-size: 0.9375rem; /* 15px floor */
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.quilt-patch-modal__message {
	margin: 0.75rem 0 0;
	font-style: italic;
	overflow-wrap: break-word;
	word-break: break-word;
}

.quilt-patch-modal__donor {
	margin: 0.75rem 0 0;
	font-weight: 700;
}

/* Show tooltip only on hover-capable pointers, modal only on touch. */
@media (hover: none) {
	.quilt-patch-tooltip {
		display: none !important;
	}
}

@media (hover: hover) {
	.quilt-patch-modal {
		display: none !important;
	}
}

.quilt-canvas-hint {
	max-width: 32rem;
	margin: 1.5rem auto 0;
	padding: 1rem 1.5rem;
	background: #53586B;
	font-size: 1rem;
	line-height: 1.5;
	text-align: center;
	color: #fff;
}

/* Pointer-capability swap: default to desktop copy; show mobile copy on touch. */
.quilt-canvas-hint--mobile {
	display: none;
}

@media (hover: none) {
	.quilt-canvas-hint--desktop {
		display: none;
	}

	.quilt-canvas-hint--mobile {
		display: inline;
	}
}

@media (min-width: 768px) {
	.quilt-stat__value {
		font-size: 2.75rem;
	}

	.quilt-stat__label {
		font-size: 1.15rem;
	}
}

.quilt-recent-patches {
	padding: 3rem 1.5rem;
	background: #E6CAAC;
	font-family: 'Montserrat', sans-serif;
	color: #57361A;
}

.quilt-recent-patches__inner {
	max-width: 32rem;
	margin: 0 auto;
}

.quilt-recent-patches__heading {
	font-family: 'Butler', serif;
	font-weight: 700;
	font-size: 1.75rem;
	text-align: center;
	margin: 0 0 1.5rem;
}

.quilt-recent-patches__search {
	margin: 0 0 1.5rem;
}

.quilt-recent-patches__input {
	width: 100%;
	padding: 0.85rem 1rem;
	background: #fff;
	border: 1px solid rgba(83, 88, 107, 0.3);
	border-radius: 4px;
	font-family: inherit;
	font-size: 1rem;
	color: #57361A;
}

.quilt-recent-patches__input::placeholder {
	color: rgba(87, 54, 26, 0.6);
}

.quilt-recent-patches__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.quilt-recent-patch__btn {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 1px solid rgba(83, 88, 107, 0.3);
	border-radius: 4px;
	text-align: left;
	font-family: inherit;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.quilt-recent-patch__btn:hover,
.quilt-recent-patch__btn:focus {
	background: #FFF7EE;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(31, 33, 40, 0.12);
}

.quilt-recent-patch__thumb {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1F2128;
	border-radius: 2px;
	padding: 4px;
}

.quilt-recent-patch__thumb svg {
	width: 100%;
	height: 100%;
}

.quilt-recent-patch__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.quilt-recent-patch__donor {
	margin: 0;
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.quilt-recent-patch__tier {
	margin: 0.25rem 0 0;
	font-size: 1rem;
	color: rgba(87, 54, 26, 0.75);
}

.quilt-recent-patches__empty {
	margin: 1rem 0 0;
	text-align: center;
	font-style: italic;
	color: rgba(87, 54, 26, 0.7);
}

/* ---------------------------------------------------------------
 * Full-page loading overlay (placeholder spinner — refine later)
 * --------------------------------------------------------------- */

.quilt-loader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	transition: opacity 0.3s ease;
}

.quilt-loader.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.quilt-loader__spinner {
	width: 48px;
	height: 48px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: quilt-loader-spin 0.8s linear infinite;
}

@keyframes quilt-loader-spin {
	to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------
 * Terms & Conditions link (below Recent Patches)
 * --------------------------------------------------------------- */

.quilt-terms-link {
	text-align: center;
	padding: 1.5rem 1rem 3rem;
	background: #fff;
}

.quilt-terms-link__link {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.9375rem;
	color: #5D9A83;
	text-decoration: underline;
}

.quilt-terms-link__link:hover,
.quilt-terms-link__link:focus {
	color: #9C3D20;
}
