/* ===========================================================
   RECYCLOR CALCULATOR — Scoped styles
   All rules prefixed with .rcyc- to avoid clashing with any
   theme (Church FSE, Twenty Twenty-*, etc.). The .rcyc-calc
   section also uses `isolation: isolate` to keep z-index
   effects contained.
   =========================================================== */

.rcyc-calc {
	--rcyc-ink:       #1A1A1A;
	--rcyc-ink-mid:   #6B6B6B;
	--rcyc-ink-light: #8A8A8A;
	--rcyc-gold:      #C9A961;
	--rcyc-bg:        #FAFAF7;
	--rcyc-bg-warm:   #F2EFE7;
	--rcyc-line:      #E5E5E0;
	--rcyc-white:     #FFFFFF;

	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: var(--rcyc-bg-warm);
	padding: 80px 20px;
	color: var(--rcyc-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}

/* Full-width breakout + kill vertical gap — applied by default on every
 * .rcyc-calc instance. Recyclor blocks are designed edge-to-edge with no
 * surrounding whitespace. */
.rcyc-calc {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-left:  calc( 50% - 50vw ) !important;
	margin-right: calc( 50% - 50vw ) !important;
	margin-top:    0 !important;
	margin-bottom: 0 !important;
	margin-block-start: 0 !important;
	margin-block-end:   0 !important;
	box-sizing: border-box;
}
body:has( .rcyc-calc ) {
	overflow-x: clip;
}
/* Annule la marge bas du bloc juste avant */
*:has( + .rcyc-calc ) {
	margin-bottom: 0 !important;
	margin-block-end: 0 !important;
}
/* Annule la marge haut du bloc juste après */
.rcyc-calc + * {
	margin-top: 0 !important;
	margin-block-start: 0 !important;
}
/* Annule le gap CSS du parent */
*:has( > .rcyc-calc ) {
	--wp--style--block-gap: 0 !important;
	row-gap: 0 !important;
	gap: 0 !important;
}
.rcyc-calc *,
.rcyc-calc *::before,
.rcyc-calc *::after { box-sizing: border-box; }

@media (min-width: 768px) {
	.rcyc-calc { padding: 112px 40px; }
}

.rcyc-calc .rcyc-container {
	max-width: 1024px;
	margin: 0 auto;
	position: relative;
}

/* ============ TITLE BLOCK + HANDS STAGE ============ */
.rcyc-calc .rcyc-title-block {
	text-align: center;
	max-width: 640px;
	margin: 0 auto 48px;
	position: relative;
}
.rcyc-calc .rcyc-eyebrow {
	position: relative;
	z-index: 10;
	font-size: 11px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--rcyc-gold);
	margin-bottom: 12px;
}
.rcyc-calc .rcyc-heading {
	position: relative;
	z-index: 10;
	font-size: 36px;
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--rcyc-ink);
	margin: 0 0 16px;
}
@media (min-width: 768px) {
	.rcyc-calc .rcyc-heading { font-size: 48px; }
}
.rcyc-calc .rcyc-subtitle {
	position: relative;
	z-index: 10;
	color: var(--rcyc-ink-mid);
	margin: 0;
}

/* Hands stage — sits behind title block content */
.rcyc-calc .rcyc-hand-stage {
	--hand-p: 0;
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: -1;
}
.rcyc-calc .rcyc-hand {
	position: absolute;
	top: 50%;
	width: 70vw;
	max-width: none;
	height: auto;
	opacity: 0.5;
	pointer-events: none;
	user-select: none;
	will-change: transform;
}
.rcyc-calc .rcyc-hand-left {
	left: 50%;
	transform: translate3d( calc( -100% - (1 - var(--hand-p)) * 70vw ), -50%, 0 );
}
.rcyc-calc .rcyc-hand-right {
	right: 50%;
	transform: translate3d( calc(  100% + (1 - var(--hand-p)) * 70vw ), -50%, 0 );
}
@media (max-width: 768px) {
	.rcyc-calc .rcyc-hand { width: 95vw; }
}
@media (prefers-reduced-motion: reduce) {
	.rcyc-calc .rcyc-hand-left  { transform: translate3d( -100%, -50%, 0 ); }
	.rcyc-calc .rcyc-hand-right { transform: translate3d(  100%, -50%, 0 ); }
}

/* ============ MAIN CARD ============ */
.rcyc-calc .rcyc-card {
	position: relative;
	z-index: 1;
	background: var(--rcyc-white);
	border: 1px solid var(--rcyc-line);
	border-radius: 6px;
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr;
}
@media (min-width: 768px) {
	.rcyc-calc .rcyc-card { grid-template-columns: 3fr 2fr; }
}

/* ============ INPUTS SIDE ============ */
.rcyc-calc .rcyc-card-inputs {
	padding: 24px;
	border-bottom: 1px solid var(--rcyc-line);
}
@media (min-width: 768px) {
	.rcyc-calc .rcyc-card-inputs {
		padding: 40px;
		border-bottom: none;
		border-right: 1px solid var(--rcyc-line);
	}
}
.rcyc-calc .rcyc-field { margin-bottom: 36px; }
.rcyc-calc .rcyc-field:last-child { margin-bottom: 0; }
.rcyc-calc .rcyc-field-label {
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--rcyc-ink-mid);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.rcyc-calc .rcyc-step { color: var(--rcyc-gold); }

/* Metals grid */
.rcyc-calc .rcyc-metals {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.rcyc-calc .rcyc-metal-btn {
	appearance: none;
	background: transparent;
	border: 1px solid var(--rcyc-line);
	border-radius: 6px;
	padding: 12px;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.rcyc-calc .rcyc-metal-btn:hover { border-color: var(--rcyc-ink); }
.rcyc-calc .rcyc-metal-btn.rcyc-active {
	background: var(--rcyc-ink);
	color: var(--rcyc-white);
	border-color: var(--rcyc-ink);
}
.rcyc-calc .rcyc-metal-big {
	display: block;
	font-size: 20px;
	font-weight: 500;
}
.rcyc-calc .rcyc-metal-sub {
	display: block;
	font-size: 10px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rcyc-ink-mid);
	margin-top: 2px;
}
.rcyc-calc .rcyc-metal-btn.rcyc-active .rcyc-metal-sub { color: rgba(255, 255, 255, 0.6); }
.rcyc-calc .rcyc-metal-btn.rcyc-disabled {
	opacity: 0.32;
	pointer-events: none;
	cursor: not-allowed;
}
.rcyc-calc .rcyc-metal-btn.rcyc-disabled .rcyc-metal-sub { color: var(--rcyc-ink-light); }

/* Weight input */
.rcyc-calc .rcyc-weight {
	display: flex;
	border: 1px solid var(--rcyc-line);
	border-radius: 6px;
	overflow: hidden;
	transition: border-color 0.2s;
}
.rcyc-calc .rcyc-weight:focus-within { border-color: var(--rcyc-ink); }
.rcyc-calc .rcyc-weight-input {
	flex: 1;
	min-width: 0;
	width: 0;
	appearance: none;
	background: transparent;
	border: 0;
	padding: 16px 20px;
	font: inherit;
	font-size: 28px;
	font-weight: 300;
	color: var(--rcyc-ink);
	font-variant-numeric: tabular-nums;
}
.rcyc-calc .rcyc-weight-input:focus { outline: none; }
.rcyc-calc .rcyc-weight-input::-webkit-outer-spin-button,
.rcyc-calc .rcyc-weight-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.rcyc-calc .rcyc-weight-input { -moz-appearance: textfield; }
.rcyc-calc .rcyc-weight-unit {
	display: flex;
	align-items: center;
	padding: 0 20px;
	background: var(--rcyc-bg);
	border-left: 1px solid var(--rcyc-line);
	color: var(--rcyc-ink-mid);
}

/* Unit toggle — now a step-01 pair of cards */
.rcyc-calc .rcyc-units {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.rcyc-calc .rcyc-unit-btn {
	appearance: none;
	background: transparent;
	border: 1px solid var(--rcyc-line);
	border-radius: 6px;
	padding: 14px 16px;
	font: inherit;
	color: var(--rcyc-ink);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.rcyc-calc .rcyc-unit-btn:hover { border-color: var(--rcyc-ink); }
.rcyc-calc .rcyc-unit-btn.rcyc-active {
	background: var(--rcyc-ink);
	color: var(--rcyc-white);
	border-color: var(--rcyc-ink);
}
.rcyc-calc .rcyc-unit-big {
	display: block;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: -0.005em;
}
.rcyc-calc .rcyc-unit-sub {
	display: block;
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--rcyc-ink-mid);
	margin-top: 4px;
}
.rcyc-calc .rcyc-unit-btn.rcyc-active .rcyc-unit-sub { color: rgba(255, 255, 255, 0.6); }
.rcyc-calc .rcyc-unit-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--rcyc-ink-mid);
	line-height: 1.5;
	padding: 10px 12px;
	background: var(--rcyc-bg-warm);
	border-radius: 6px;
}

/* Help "?" popover next to "Type de métal" */
.rcyc-calc .rcyc-field-label { position: relative; }
.rcyc-calc .rcyc-help {
	display: inline-block;
	margin-left: 8px;
	vertical-align: middle;
	position: relative;
}
.rcyc-calc .rcyc-help[open] { z-index: 5; }
.rcyc-calc .rcyc-help-btn {
	list-style: none;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: var(--rcyc-bg);
	border: 1px solid var(--rcyc-line);
	color: var(--rcyc-ink-mid);
	font-size: 12px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rcyc-calc .rcyc-help-btn::-webkit-details-marker,
.rcyc-calc .rcyc-help-btn::marker { display: none; content: ""; }
.rcyc-calc .rcyc-help-btn:hover { border-color: var(--rcyc-ink); color: var(--rcyc-ink); }
.rcyc-calc .rcyc-help[open] .rcyc-help-btn {
	background: var(--rcyc-ink); color: var(--rcyc-white); border-color: var(--rcyc-ink);
}
.rcyc-calc .rcyc-help-pop {
	position: absolute;
	top: calc(100% + 10px);
	left: -12px;
	width: min(320px, 88vw);
	background: var(--rcyc-white);
	color: var(--rcyc-ink);
	border: 1px solid var(--rcyc-line);
	border-radius: 8px;
	padding: 16px 18px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	font-weight: 400;
	z-index: 5;
}
.rcyc-calc .rcyc-help-title {
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--rcyc-gold);
	margin-bottom: 8px;
}
.rcyc-calc .rcyc-help-body {
	font-size: 13px;
	line-height: 1.55;
	color: var(--rcyc-ink-mid);
	margin: 0 0 12px;
}
.rcyc-calc .rcyc-help-list {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	font-size: 13px;
}
.rcyc-calc .rcyc-help-list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 6px 0;
	border-top: 1px solid var(--rcyc-line);
}
.rcyc-calc .rcyc-help-list li:first-child { border-top: 0; }
.rcyc-calc .rcyc-help-list li span:first-child { color: var(--rcyc-ink); }
.rcyc-calc .rcyc-help-list li span:last-child  {
	color: var(--rcyc-ink-mid);
	font-variant-numeric: tabular-nums;
	font-size: 12px;
	letter-spacing: 0.05em;
}
.rcyc-calc .rcyc-help-footer {
	margin: 0;
	font-size: 11px;
	color: var(--rcyc-ink-light);
	font-style: italic;
}

/* Presets */
.rcyc-calc .rcyc-presets-wrap {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--rcyc-line);
}
.rcyc-calc .rcyc-presets-label {
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--rcyc-ink-light);
	margin-bottom: 12px;
}
.rcyc-calc .rcyc-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.rcyc-calc .rcyc-preset {
	appearance: none;
	background: var(--rcyc-white);
	border: 1px solid var(--rcyc-line);
	color: #4A4A4A;
	padding: 9px 16px;
	border-radius: 999px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.15s, color 0.15s;
}
.rcyc-calc .rcyc-preset:hover {
	border-color: var(--rcyc-ink);
	color: var(--rcyc-ink);
}

/* ============ RESULT SIDE (dark panel) ============ */
.rcyc-calc .rcyc-card-result {
	padding: 24px;
	background: var(--rcyc-ink);
	color: var(--rcyc-white);
	display: flex;
	flex-direction: column;
}
@media (min-width: 768px) {
	.rcyc-calc .rcyc-card-result { padding: 40px; }
}
.rcyc-calc .rcyc-result-eyebrow {
	font-size: 11px;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--rcyc-gold);
	margin-bottom: 12px;
}
.rcyc-calc .rcyc-result-amount {
	font-size: 48px;
	font-weight: 300;
	font-variant-numeric: tabular-nums;
	line-height: 1.05;
}
@media (min-width: 768px) {
	.rcyc-calc .rcyc-result-amount { font-size: 56px; }
}
.rcyc-calc .rcyc-result-detail {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.6);
	margin-top: 8px;
	min-height: 1.2em;
}
.rcyc-calc .rcyc-result-table {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	display: grid;
	gap: 12px;
	font-size: 14px;
}
.rcyc-calc .rcyc-result-row {
	display: flex;
	justify-content: space-between;
	font-variant-numeric: tabular-nums;
}
.rcyc-calc .rcyc-result-row > span:first-child { color: rgba(255, 255, 255, 0.5); }
.rcyc-calc .rcyc-result-cta {
	margin-top: auto;
	padding-top: 32px;
}
.rcyc-calc .rcyc-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: var(--rcyc-white);
	color: var(--rcyc-ink);
	text-align: center;
	text-decoration: none;
	padding: 16px 24px;
	border-radius: 999px;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-weight: 500;
	transition: background 0.2s, color 0.2s;
}
.rcyc-calc .rcyc-cta-btn:hover {
	background: var(--rcyc-gold);
	color: var(--rcyc-white);
}
.rcyc-calc .rcyc-cta-icon {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
}
.rcyc-calc .rcyc-result-disclaimer {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.4);
	text-align: center;
	margin: 12px 0 0;
	line-height: 1.5;
}

/* Pulse animation on result */
@keyframes rcyc-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.02); }
}
.rcyc-calc .rcyc-pulse {
	animation: rcyc-pulse 0.4s ease-out;
	display: inline-block;
	transform-origin: left center;
}

/* Number input chrome cleanup */
.rcyc-calc input[type=number] { -moz-appearance: textfield; }
.rcyc-calc input[type=number]::-webkit-outer-spin-button,
.rcyc-calc input[type=number]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
