/* Zéro4 Fermentation — style « étiquette brute » jaune/noir */

.z4f-widget {
	--z4f-accent: #FFD100; /* jaune Zéro4 — caler sur la valeur exacte de la charte */
	--z4f-ink: #111111;
	--z4f-paper: #FAF6EC;
	--z4f-display: 'BioRhyme', Georgia, serif;

	background: var(--z4f-paper);
	border: 3px solid var(--z4f-ink);
	box-shadow: 6px 6px 0 var(--z4f-ink);
	padding: 1.5rem;
	color: var(--z4f-ink);
	max-width: 960px;
	margin: 2rem auto;
}

/* ---- En-tête ---- */
.z4f-head {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	gap: 1rem;
	border-bottom: 3px solid var(--z4f-ink);
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
}

.z4f-label-img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border: 3px solid var(--z4f-ink);
	background: #fff;
	align-self: center;
	flex-shrink: 0;
}

.z4f-head-txt { flex: 1; min-width: 0; }

.z4f-bjcp {
	display: inline-block;
	vertical-align: middle;
	background: var(--z4f-ink);
	color: var(--z4f-accent);
	font-family: system-ui, sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 0.2em 0.55em;
	white-space: nowrap;
}

.z4f-eyebrow {
	margin: 0 0 0.25rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

.z4f-title {
	margin: 0;
	font-family: var(--z4f-display);
	font-weight: 800;
	font-size: clamp(1.6rem, 4vw, 2.6rem);
	line-height: 1.05;
}

.z4f-substyle {
	margin: 0.4rem 0 0;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.z4f-badge {
	display: inline-block;
	background: var(--z4f-ink);
	color: var(--z4f-accent);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 0.2rem 0.55rem;
}

.z4f-active .z4f-badge { background: var(--z4f-accent); color: var(--z4f-ink); border: 2px solid var(--z4f-ink); }

.z4f-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--z4f-accent);
	border: 3px solid var(--z4f-ink);
	min-width: 92px;
	padding: 0.4rem 0.8rem;
}

.z4f-day-n {
	font-family: var(--z4f-display);
	font-weight: 800;
	font-size: 2.2rem;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.z4f-day-l {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

/* ---- Corps : jauge + données ---- */
.z4f-body {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 1.5rem;
	align-items: stretch;
}

.z4f-gauge { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.z4f-fermenter { width: 128px; height: auto; }
.z4f-tank { fill: none; stroke: var(--z4f-ink); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.z4f-thin { stroke-width: 3; }
.z4f-tick { stroke: var(--z4f-ink); stroke-width: 2.5; stroke-linecap: round; opacity: 0.55; }
.z4f-fill { fill: var(--z4f-accent); transition: y 1.2s ease, height 1.2s ease; }
.z4f-foam { fill: var(--z4f-paper); opacity: 0.9; }
.z4f-level { transition: transform 1.2s ease; }
.z4f-active .z4f-wave { animation: z4f-swash 2.8s linear infinite; }

@keyframes z4f-swash {
	from { transform: translateX(0); }
	to   { transform: translateX(-16px); }
}

.z4f-bubble { fill: var(--z4f-paper); opacity: 0; }
.z4f-active .z4f-bubble { animation: z4f-rise 3.2s linear infinite; }
.z4f-active .z4f-bubble.b2 { animation-delay: 1.1s; animation-duration: 2.6s; }
.z4f-active .z4f-bubble.b3 { animation-delay: 2s; animation-duration: 3.8s; }
.z4f-active .z4f-bubble.b4 { animation-delay: 0.6s; animation-duration: 3s; }

@keyframes z4f-rise {
	0%   { transform: translateY(0); opacity: 0; }
	15%  { opacity: 0.85; }
	85%  { opacity: 0.85; }
	100% { transform: translateY(-200px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.z4f-active .z4f-bubble { animation: none; opacity: 0.6; }
	.z4f-active .z4f-wave { animation: none; }
	.z4f-fill, .z4f-level { transition: none; }
}

.z4f-gauge-cap {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-align: center;
	max-width: 130px;
}

/* ---- Stats ---- */
.z4f-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	border: 3px solid var(--z4f-ink);
	background: var(--z4f-ink);
	gap: 3px;
	margin-bottom: 1.25rem;
}

.z4f-stat { display: flex; flex-direction: column; padding: 0.7rem 0.9rem; background: var(--z4f-accent); }

.z4f-label {
	font-size: 0.66rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.z4f-value {
	font-family: var(--z4f-display);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
}

/* ---- Graphique ---- */
.z4f-chart-wrap {
	position: relative;
	height: 320px;
	background: #fff;
	border: 3px solid var(--z4f-ink);
	padding: 0.75rem;
}

.z4f-meta { margin: 1rem 0 0; font-size: 0.8rem; opacity: 0.75; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
	.z4f-body { grid-template-columns: 1fr; }
	.z4f-gauge { flex-direction: row; justify-content: center; }
	.z4f-fermenter { width: 84px; }
	.z4f-head { flex-direction: row; }
	.z4f-chart-wrap { height: 260px; }
}

/* ---- Vue masonry : cartes complètes en colonnes ---- */
.z4f-masonry {
	columns: 2 420px;
	column-gap: 1.5rem;
	max-width: 1200px;
	margin: 2rem auto;
}

.z4f-masonry .z4f-widget {
	break-inside: avoid;
	margin: 0 0 1.5rem;
	max-width: none;
}

/* ---- Vue grid : vignettes ---- */
.z4f-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1.5rem;
	max-width: 960px;
	margin: 2rem auto;
}

.z4f-card {
	display: flex;
	flex-direction: column;
	padding: 0;
	background: var(--z4f-paper, #FAF6EC);
	border: 3px solid var(--z4f-ink, #111);
	box-shadow: 4px 4px 0 var(--z4f-ink, #111);
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	color: var(--z4f-ink, #111);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.z4f-card { --z4f-accent: #FFD100; --z4f-ink: #111111; --z4f-paper: #FAF6EC; }

.z4f-card:hover, .z4f-card:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--z4f-ink);
}

.z4f-card-media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	border-bottom: 3px solid var(--z4f-ink);
	background: #fff;
	overflow: hidden;
}

.z4f-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.z4f-card-tank { height: 82%; width: auto; }

.z4f-card-tankfill { fill: var(--z4f-accent); transition: y 1s ease, height 1s ease; }

.z4f-card-body { display: block; padding: 0.8rem 0.9rem 0.95rem; }

.z4f-card-name {
	display: block;
	font-family: var(--z4f-display, 'BioRhyme', Georgia, serif);
	font-weight: 800;
	font-size: 1.1rem;
	line-height: 1.15;
}

.z4f-card-style {
	display: block;
	font-size: 0.8rem;
	margin: 0.25rem 0 0.6rem;
}

.z4f-card-bar {
	display: block;
	height: 12px;
	border: 2px solid var(--z4f-ink);
	background: #fff;
	overflow: hidden;
}

.z4f-card-bar-fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--z4f-accent);
	transition: width 1s ease;
}

.z4f-card-meta {
	display: block;
	margin-top: 0.45rem;
	font-size: 0.78rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ---- Lightbox ---- */
.z4f-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

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

.z4f-modal-back {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.z4f-modal-box {
	position: relative;
	width: 100%;
	max-width: 960px;
	max-height: 92vh;
	overflow-y: auto;
}

.z4f-modal-box .z4f-widget { margin: 0; }

.z4f-modal-close {
	position: sticky;
	top: 0;
	float: right;
	margin: 0 0 -3rem;
	z-index: 2;
	width: 44px;
	height: 44px;
	background: var(--z4f-accent, #FFD100);
	border: 3px solid var(--z4f-ink, #111);
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1;
	color: var(--z4f-ink, #111);
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.z4f-card, .z4f-card-bar-fill, .z4f-card-tankfill { transition: none; }
}

/* ---- Comparaison de brassins ---- */
.z4f-compare .z4f-chart-wrap { height: 360px; }

.z4f-compare-stats {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	font-size: 0.85rem;
}

.z4f-compare-stats li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid rgba(17, 17, 17, 0.15);
	font-variant-numeric: tabular-nums;
}

.z4f-compare-stats li:last-child { border-bottom: none; }

.z4f-cmp-dot {
	width: 14px;
	height: 14px;
	border: 2px solid var(--z4f-ink, #111);
	flex-shrink: 0;
}

/* ---- Sélecteur de période ---- */
.z4f-range {
	display: flex;
	gap: 6px;
	margin-bottom: 0.6rem;
	justify-content: flex-end;
}

.z4f-range button {
	background: #fff;
	border: 2px solid var(--z4f-ink);
	color: var(--z4f-ink);
	font: 700 0.72rem/1 system-ui, sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 5px 10px;
	cursor: pointer;
}

.z4f-range button.is-active {
	background: var(--z4f-accent);
}

/* ---- Sparkline des vignettes ---- */
.z4f-card-spark {
	display: block;
	width: 100%;
	height: 26px;
	margin-bottom: 0.45rem;
}

.z4f-card-spark polyline {
	stroke: var(--z4f-ink);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

/* ---- Pastille « bientôt prête » ---- */
.z4f-ready {
	display: inline-block;
	background: var(--z4f-accent);
	border: 2px solid var(--z4f-ink);
	color: var(--z4f-ink);
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 1px 6px;
	margin-left: 4px;
	vertical-align: middle;
}

/* ---- Skeleton loading ---- */
@keyframes z4f-shimmer {
	from { background-position: -200px 0; }
	to   { background-position: 200px 0; }
}

.is-loading .z4f-value,
.is-loading .z4f-title,
.is-loading .z4f-day-n,
.is-loading .z4f-card-name,
.is-loading .z4f-card-meta {
	color: transparent !important;
	border-radius: 3px;
	background: linear-gradient(90deg, rgba(17,17,17,0.08) 25%, rgba(17,17,17,0.16) 50%, rgba(17,17,17,0.08) 75%);
	background-size: 400px 100%;
	animation: z4f-shimmer 1.3s linear infinite;
	user-select: none;
}

@media (prefers-reduced-motion: reduce) {
	.is-loading .z4f-value,
	.is-loading .z4f-title,
	.is-loading .z4f-day-n,
	.is-loading .z4f-card-name,
	.is-loading .z4f-card-meta { animation: none; }
	.z4f-card-bar-fill { transition: none; }
}
