/* Memoricol wizard. Intentionally warm, family-friendly, print-catalogue feel. */
:root {
	--mq-ink: #2a2520;
	--mq-paper: #fbf7f1;
	--mq-accent: #d87a5c;
	--mq-accent-dark: #b85a3e;
	--mq-muted: #8a7f72;
	--mq-line: #e3d9cb;
	--mq-good: #3f8f5c;
	--mq-warn: #b8822a;
	--mq-bad: #b8473a;
	--mq-radius: 14px;
	--mq-radius-sm: 8px;
	--mq-shadow: 0 10px 30px rgba(42, 37, 32, 0.08);
	/* Hold each frame 3s, crossfade 0.7s. Tweak here if needed. */
	--mq-bg-hold: 3s;
	--mq-bg-fade: 0.7s;
}

/* Photo ↔ line-art crossfading background. Active on pages with [memoricol_wizard]. */
body.memoricol-has-bg { position: relative; }
body.memoricol-has-bg::before,
body.memoricol-has-bg::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	/* Total cycle = 2 * (hold + fade). Calculated via CSS below. */
	animation-duration: calc((var(--mq-bg-hold) + var(--mq-bg-fade)) * 2);
	animation-iteration-count: infinite;
	animation-timing-function: ease-in-out;
}
/* background-image for ::before / ::after is injected inline via wp_add_inline_style
   with a ?v= cache-buster so image swaps don't require a hard refresh. */
body.memoricol-has-bg::before { animation-name: mq-bg-photo; }
body.memoricol-has-bg::after  { animation-name: mq-bg-lineart; opacity: 0; }
/* Two halves of the cycle: 0–50% shows photo, 50–100% shows line art, with fades at the joins. */
@keyframes mq-bg-photo {
	0%, 40.5%  { opacity: 1; } /* photo held */
	50%        { opacity: 0; } /* crossfaded out */
	90.5%      { opacity: 0; } /* line art held */
	100%       { opacity: 1; } /* crossfaded back */
}
@keyframes mq-bg-lineart {
	0%, 40.5%  { opacity: 0; }
	50%, 90.5% { opacity: 1; }
	100%       { opacity: 0; }
}
/* Narrow + translucent card on the bg-enabled pages. Lets faces on both sides
   of the background photo stay visible instead of being covered by the wizard. */
body.memoricol-has-bg #memoricol-wizard-root {
	max-width: 720px;
	background: rgba(251, 247, 241, 0.82);
	backdrop-filter: blur(6px) saturate(1.1);
	-webkit-backdrop-filter: blur(6px) saturate(1.1);
	border: 1px solid rgba(255, 255, 255, 0.5);
}
/* Give the stepper + nav bars a matching translucent feel so they don't read as a solid block. */
body.memoricol-has-bg #memoricol-wizard-root .mq-stepper { border-bottom-color: rgba(227, 217, 203, 0.6); }
@media (prefers-reduced-motion: reduce) {
	body.memoricol-has-bg::before,
	body.memoricol-has-bg::after { animation: none; }
	body.memoricol-has-bg::after { opacity: 0.5; }
}

/* Mobile: swap in a dedicated portrait-friendly background and kill the crossfade.
   Mobile background-image is also injected inline for cache-busting. */
@media (max-width: 600px) {
	body.memoricol-has-bg::before { animation: none; opacity: 1; }
	body.memoricol-has-bg::after  { display: none; }
}

#memoricol-wizard-root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
	color: var(--mq-ink);
	background: var(--mq-paper);
	padding: 32px 24px 64px;
	border-radius: var(--mq-radius);
	max-width: 960px;
	margin: 0 auto;
	box-shadow: var(--mq-shadow);
}

.mq-stepper {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--mq-line);
	padding-bottom: 16px;
}
.mq-step {
	flex: 1;
	text-align: center;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--mq-muted);
	padding: 8px 4px;
	border-bottom: 2px solid transparent;
}
.mq-step.is-active { color: var(--mq-accent-dark); border-bottom-color: var(--mq-accent); font-weight: 600; }
.mq-step.is-done   { color: var(--mq-good); }

.mq-panel h2 { font-size: 24px; margin: 0 0 8px; }
.mq-panel p.mq-lede { color: var(--mq-muted); margin: 0 0 24px; font-size: 15px; line-height: 1.5; }

.mq-drop {
	border: 2px dashed var(--mq-line);
	border-radius: var(--mq-radius);
	padding: 48px 24px;
	text-align: center;
	background: white;
	transition: all 0.15s ease;
	cursor: pointer;
}
.mq-drop.is-dragover { border-color: var(--mq-accent); background: #fff5ef; }
.mq-drop strong { display: block; font-size: 17px; margin-bottom: 4px; }
.mq-drop span  { color: var(--mq-muted); font-size: 14px; }

.mq-uploads {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 12px;
	margin-top: 20px;
}
.mq-upload {
	position: relative;
	border-radius: var(--mq-radius-sm);
	overflow: hidden;
	background: #eee;
	aspect-ratio: 1;
	cursor: grab;
}
.mq-upload img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mq-upload .mq-remove {
	position: absolute; top: 6px; right: 6px;
	background: rgba(0,0,0,0.6); color: white;
	border: none; border-radius: 999px; width: 24px; height: 24px;
	cursor: pointer; font-size: 14px; line-height: 1;
}
.mq-upload .mq-cover-badge {
	position: absolute; bottom: 6px; left: 6px;
	background: var(--mq-accent); color: white;
	font-size: 10px; padding: 3px 8px; border-radius: 999px;
	text-transform: uppercase; letter-spacing: 0.05em;
}
.mq-upload .mq-quality {
	position: absolute; top: 6px; left: 6px;
	font-size: 10px; padding: 3px 6px; border-radius: 4px;
	background: rgba(255,255,255,0.9);
}
.mq-upload .mq-quality.good { color: var(--mq-good); }
.mq-upload .mq-quality.warn { color: var(--mq-warn); }
.mq-upload .mq-quality.bad  { color: var(--mq-bad); }

.mq-counter { margin-top: 12px; font-size: 14px; color: var(--mq-muted); }
.mq-counter strong { color: var(--mq-ink); }
.mq-counter.is-ok strong { color: var(--mq-good); }

.mq-style-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-top: 16px;
}
.mq-style-card {
	border: 2px solid var(--mq-line);
	border-radius: var(--mq-radius);
	padding: 20px;
	cursor: pointer;
	background: white;
	transition: border-color 0.15s ease;
}
.mq-style-card:hover { border-color: var(--mq-accent); }
.mq-style-card.is-selected { border-color: var(--mq-accent-dark); background: #fff5ef; }
.mq-style-card h3 { margin: 0 0 6px; font-size: 16px; }
.mq-style-card p { margin: 0; color: var(--mq-muted); font-size: 13px; line-height: 1.4; }
.mq-style-preview {
	display: flex;
	justify-content: center;
	align-items: center;
	background: var(--mq-paper);
	border-radius: var(--mq-radius-sm);
	padding: 20px;
	margin-bottom: 12px;
	color: var(--mq-ink);
	min-height: 110px;
}
.mq-style-preview svg { width: 84px; height: 84px; display: block; }
.mq-style-card.is-selected .mq-style-preview { background: white; }

.mq-form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}
.mq-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.mq-field input, .mq-field select, .mq-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius-sm);
	background: white;
	font-size: 15px;
	font-family: inherit;
}
.mq-field input:focus, .mq-field select:focus, .mq-field textarea:focus {
	outline: none; border-color: var(--mq-accent);
}
.mq-field-hint { color: var(--mq-muted); font-size: 12px; margin-top: 4px; }

.mq-title-preview {
	margin: 24px 0;
	padding: 20px;
	background: white;
	border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius);
	text-align: center;
}
.mq-title-preview .mq-tp-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--mq-muted);
	margin-bottom: 8px;
}
.mq-title-preview .mq-tp-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.mq-title-preview .mq-tp-sub   { color: var(--mq-muted); font-size: 14px; }

.mq-preview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-top: 16px;
}
.mq-preview-page {
	background: white;
	border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius-sm);
	overflow: hidden;
	aspect-ratio: 0.77;
}
.mq-preview-page img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mq-preview-page.is-cover { border-color: var(--mq-accent); border-width: 2px; }

.mq-actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--mq-line);
}
.mq-btn {
	padding: 12px 24px;
	border-radius: 999px;
	border: none;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: transform 0.1s ease, background 0.15s ease;
}
.mq-btn-primary { background: var(--mq-accent); color: white; }
.mq-btn-primary:hover:not(:disabled) { background: var(--mq-accent-dark); }
.mq-btn-primary:disabled { background: var(--mq-line); color: var(--mq-muted); cursor: not-allowed; }
.mq-btn-ghost { background: transparent; color: var(--mq-muted); }
.mq-btn-ghost:hover { color: var(--mq-ink); }

.mq-notice {
	padding: 12px 16px;
	border-radius: var(--mq-radius-sm);
	margin: 16px 0;
	font-size: 14px;
}
.mq-notice.is-warn { background: #fff4e0; color: var(--mq-warn); }
.mq-notice.is-bad  { background: #fde8e5; color: var(--mq-bad); }
.mq-notice.is-good { background: #e6f3ea; color: var(--mq-good); }

.mq-spinner {
	display: inline-block;
	width: 14px; height: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: mq-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}
@keyframes mq-spin { to { transform: rotate(360deg); } }

/* --- Contact form ([memoricol_contact]) -------------------------------- */
.mq-contact {
	max-width: 560px;
	margin: 0 auto;
	background: var(--mq-paper);
	padding: 32px;
	border-radius: var(--mq-radius);
	box-shadow: var(--mq-shadow);
	border: 1px solid var(--mq-line);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
	color: var(--mq-ink);
}
.mq-contact-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.mq-contact-field label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--mq-ink);
}
.mq-contact-field input,
.mq-contact-field textarea {
	font-family: inherit;
	font-size: 15px;
	padding: 12px 14px;
	border: 1px solid var(--mq-line);
	border-radius: var(--mq-radius-sm);
	background: white;
	color: var(--mq-ink);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mq-contact-field input:focus,
.mq-contact-field textarea:focus {
	outline: none;
	border-color: var(--mq-accent);
	box-shadow: 0 0 0 3px rgba(216, 122, 92, 0.15);
}
.mq-contact-field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.mq-contact-honey { position: absolute !important; left: -9999px !important; }
.mq-contact-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 8px;
}
.mq-contact .mq-btn-primary {
	background: var(--mq-accent);
	color: white;
	border: none;
	border-radius: 999px;
	padding: 12px 24px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 0 rgba(184, 90, 62, 0.22);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.mq-contact .mq-btn-primary:hover:not(:disabled) {
	background: var(--mq-accent-dark);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(184, 90, 62, 0.25);
}
.mq-contact .mq-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.mq-contact-status { font-size: 14px; color: var(--mq-muted); margin: 0; }
.mq-contact-status.is-good { color: var(--mq-good); }
.mq-contact-status.is-bad  { color: var(--mq-bad);  }
