/* ==========================================================
   Zéro4 — Bières à la pression
   Jaune : #FFC400 · Noir : #141311 · Crème : #FAF7F0
   ========================================================== */

.z4tap-grid {
	--z4-yellow: #FFC400;
	--z4-black: #141311;
	--z4-cream: #FAF7F0;
	--z4-muted: #A9A398;
	display: grid;
	grid-template-columns: repeat(var(--z4-cols, 4), minmax(0, 1fr));
	gap: 22px;
	margin: 2rem 0;
}

.z4tap-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--z4-black);
	color: var(--z4-cream);
	border-radius: 14px;
	padding: 52px 16px 22px;
	text-align: center;
	border-top: 6px solid var(--z4-yellow); /* la rampe */
	overflow: hidden;
	transition: transform .18s ease;
}
.z4tap-card:hover { transform: translateY(-3px); }

/* Médaillon de bec, façon plaque de tireuse */
.z4tap-bec {
	position: absolute;
	z-index: 3;
	top: 14px; left: 50%;
	transform: translateX(-50%);
	width: 46px; height: 46px;
	background: var(--z4-yellow);
	color: var(--z4-black);
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-weight: 800;
	font-size: 1.25rem;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 0 0 4px var(--z4-black), 0 0 0 6px var(--z4-yellow);
}

/* Rubans statut */
.z4tap-ribbon {
	position: absolute;
	z-index: 2;
	top: 26px; right: -42px;
	transform: rotate(38deg);
	padding: 5px 44px;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.z4tap-ribbon--soon  { background: var(--z4-yellow); color: var(--z4-black); }
.z4tap-ribbon--empty { background: #3A3630; color: var(--z4-muted); }

/* Visuel : étiquette ou verre. Cadre carré uniforme, teinté à la couleur EBC. */
.z4tap-visual {
	position: relative;
	margin: 14px auto 10px;
	width: 100%;
	max-width: 200px;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.z4tap-glass  { height: 100%; width: auto; color: var(--z4-cream); }
.z4tap-label  {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	box-sizing: border-box;
	border-radius: 10px;
	border: 4px solid var(--z4-ebc, var(--z4-yellow));
	box-shadow:
		0 0 0 1px rgba(250, 247, 240, .22),
		0 8px 20px rgba(0, 0, 0, .45);
}

/* Bulles qui montent dans la vignette (becs actifs uniquement).
   La montee se fait via `bottom` en %, calcule sur la hauteur du cadre :
   un % dans translate() se calculerait sur la taille de la bulle. */
.z4tap-bubbles {
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: 10px;
	overflow: hidden;
	pointer-events: none;
}
.z4tap-bubbles > span {
	position: absolute;
	display: block;
	bottom: -14%;
	width: var(--z4-bs, 8px);
	height: var(--z4-bs, 8px);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 28%,
		rgba(255, 255, 255, .98),
		rgba(255, 255, 255, .55) 46%,
		rgba(255, 255, 255, .14) 72%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, .75),
		0 0 4px rgba(0, 0, 0, .35);
	opacity: 0;
	/* Proprietes separees : le raccourci `animation` avec des var() est fragile. */
	animation-name: z4tap-rise;
	/* Duree = rythme de la bulle x vitesse propre a la biere. */
	animation-duration: calc(var(--z4-bd, 7s) * var(--z4-bspd, 1));
	/* Delai negatif : l'animation demarre en cours de cycle, donc des bulles
	   sont deja en vol au chargement, a des hauteurs differentes par carte. */
	animation-delay: calc(0s - var(--z4-bdelay, 0s) - var(--z4-boff, 0s));
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	will-change: bottom, transform, opacity;
}
/* Chaque bulle a sa taille, sa position, sa vitesse et son decalage. */
.z4tap-bubbles > span:nth-child(1) { --z4-bs: 9px; --z4-bd: 6.3s; --z4-bdelay: 0s; left: 16%; }
.z4tap-bubbles > span:nth-child(2) { --z4-bs: 5px; --z4-bd: 4.7s; --z4-bdelay: 1.9s; left: 30%; }
.z4tap-bubbles > span:nth-child(3) { --z4-bs: 12px; --z4-bd: 8.9s; --z4-bdelay: 3.4s; left: 44%; }
.z4tap-bubbles > span:nth-child(4) { --z4-bs: 6px; --z4-bd: 5.5s; --z4-bdelay: 0.8s; left: 57%; }
.z4tap-bubbles > span:nth-child(5) { --z4-bs: 10px; --z4-bd: 7.3s; --z4-bdelay: 4.6s; left: 70%; }
.z4tap-bubbles > span:nth-child(6) { --z4-bs: 4px; --z4-bd: 4.1s; --z4-bdelay: 2.7s; left: 83%; }
.z4tap-bubbles > span:nth-child(7) { --z4-bs: 7px; --z4-bd: 6.8s; --z4-bdelay: 5.9s; left: 91%; }

@keyframes z4tap-rise {
	0%   { bottom: -14%; transform: translateX(0) scale(.6);   opacity: 0; }
	10%  { opacity: .9; }
	45%  {               transform: translateX(8px) scale(1); }
	75%  {               transform: translateX(-4px) scale(1.1); opacity: .7; }
	100% { bottom: 112%; transform: translateX(2px) scale(1.2); opacity: 0; }
}

/* Fut vide ou a venir : pas de bulles. */
.z4tap-card--vide .z4tap-bubbles,
.z4tap-card--bientot .z4tap-bubbles { display: none; }

/* Nom + style */
.z4tap-name {
	font-family: 'BioRhyme', Georgia, serif;
	font-size: clamp(1.1rem, 1.5vw, 1.35rem);
	line-height: 1.15;
	text-wrap: balance;
	margin: 10px 0 2px;
	color: var(--z4-cream);
}
.z4tap-code {
	display: inline-block;
	margin-left: .4em;
	padding: 1px 7px;
	border: 1.5px solid var(--z4-yellow);
	border-radius: 999px;
	color: var(--z4-yellow);
	font-family: system-ui, sans-serif;
	font-size: .68em;
	font-weight: 700;
	vertical-align: middle;
	letter-spacing: .04em;
}
.z4tap-style {
	margin: 0 0 10px;
	text-wrap: balance;
	color: var(--z4-muted);
	font-size: .92rem;
	letter-spacing: .05em;
	text-transform: uppercase;
}

/* Statistiques — grille de 3 colonnes égales, impossible à faire déborder.
   Pas de ul/li : le thème applique ses marges de liste par-dessus les nôtres. */
.z4tap-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: end;
	gap: 6px;
	width: 100%;
	box-sizing: border-box;
	margin: auto 0 0;
	padding: 14px 0 0;
	list-style: none;
	border-top: 1px solid rgba(250, 247, 240, .14);
}
.z4tap-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	min-width: 0;
	gap: 2px;
}
.z4tap-val {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 1.5em;
	font-size: clamp(1.05rem, 1.5vw, 1.35rem);
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--z4-cream) !important;
}
.z4tap-val small { font-size: .65em; color: var(--z4-muted) !important; }
.z4tap-lab {
	font-size: clamp(.6rem, .75vw, .72rem);
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
	line-height: 1.2;
	color: var(--z4-muted);
}
.z4tap-dot {
	display: block;
	width: 1.2rem;
	height: 1.2rem;
	box-sizing: border-box;
	border-radius: 50%;
	border: 2px solid rgba(250, 247, 240, .7);
	box-shadow:
		inset 0 2px 3px rgba(255, 255, 255, .35),
		inset 0 -3px 5px rgba(0, 0, 0, .35),
		0 0 8px -3px var(--z4-ebc, transparent);
}

/* Description */
.z4tap-desc { margin-top: 12px; font-size: .92rem; line-height: 1.5; color: #D8D3C8; }
.z4tap-desc p { margin: 0 0 .5em; }

/* Statut : fût vide */
.z4tap-card--vide { filter: grayscale(1); opacity: .55; }
.z4tap-card--vide:hover { transform: none; }

/* Statut : bientôt */
.z4tap-card--bientot .z4tap-visual { opacity: .65; }

.z4tap-empty { text-align: center; font-style: italic; }
.z4tap-teaser { text-align: center; font-size: .95rem; opacity: .85; margin: 1.2rem 0; }

/* ---------- Mode TV ---------- */
.z4tap-grid--tv {
	grid-template-columns: repeat(var(--z4-cols, 4), minmax(0, 1fr));
	gap: 1.8vw;
	margin: 0;
}
/* Le fond de page TV est plus sombre : les cartes doivent ressortir. */
.z4tap-grid--tv .z4tap-card {
	background: #191714;
	border: 1px solid rgba(255, 196, 0, .18);
	border-top: 6px solid var(--z4-yellow);
	padding-bottom: 30px;
	height: 100%;
	box-sizing: border-box;
}
.z4tap-grid--tv .z4tap-name { font-size: clamp(1.4rem, 2.2vw, 2.4rem); }
.z4tap-grid--tv .z4tap-style { font-size: clamp(.9rem, 1.2vw, 1.3rem); }
.z4tap-grid--tv .z4tap-stats { gap: 10px; padding-top: 20px; }
.z4tap-grid--tv .z4tap-val { font-size: clamp(1.4rem, 2.2vw, 2.8rem); }
.z4tap-grid--tv .z4tap-lab { font-size: clamp(.75rem, .95vw, 1.05rem); }
.z4tap-grid--tv .z4tap-dot {
	width: clamp(1.5rem, 2.2vw, 2.4rem);
	height: clamp(1.5rem, 2.2vw, 2.4rem);
}
.z4tap-grid--tv .z4tap-visual { max-width: clamp(180px, 22vw, 320px); }
.z4tap-grid--tv .z4tap-label { border-width: 6px; }
.z4tap-grid--tv .z4tap-bec { width: 56px; height: 56px; font-size: 1.5rem; box-shadow: 0 0 0 4px #191714, 0 0 0 6px var(--z4-yellow); }

@media (prefers-reduced-motion: reduce) {
	.z4tap-card, .z4tap-card:hover { transition: none; transform: none; }
	.z4tap-bubbles { display: none; }
}
@media (max-width: 1024px) {
	.z4tap-grid:not(.z4tap-grid--tv) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.z4tap-card { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 560px) {
	.z4tap-grid:not(.z4tap-grid--tv) { grid-template-columns: 1fr; }
}

/* ---------- Mentions et allergènes ----------
   Une simple ligne de texte : les pastilles encadrees prenaient
   deux lignes des trois mentions. */
.z4tap-mentions {
	margin: 8px 0 0;
	padding: 0;
	font-size: .62rem;
	line-height: 1.5;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(255, 196, 0, .78);
}
.z4tap-mentions span { cursor: help; white-space: nowrap; }
.z4tap-mentions span + span::before {
	content: " · ";
	color: var(--z4-muted);
	white-space: normal;
}

/* ---------- Jauge de fût ---------- */
/* Placee sous les stats, en bas de carte : sa position ne depend plus
   de la longueur de la description ni du nombre de mentions. */
.z4tap-fut { margin: 14px 0 0; }
.z4tap-fut-bar {
	height: 7px;
	border-radius: 999px;
	background: rgba(250, 247, 240, .13);
	overflow: hidden;
}
.z4tap-fut-bar > span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #FFD34D, #FFC400);
	box-shadow: 0 0 8px -2px rgba(255, 196, 0, .8);
	transition: width .4s ease;
}
.z4tap-fut-lab {
	display: block;
	margin-top: 5px;
	font-size: .64rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--z4-muted);
}
/* Fût presque vide : on alerte discrètement. */
.z4tap-fut-bar > span[style*="width:0%"],
.z4tap-fut-bar > span[style*="width:5%"],
.z4tap-fut-bar > span[style*="width:10%"],
.z4tap-fut-bar > span[style*="width:15%"] { background: #E05B4B; box-shadow: none; }

/* Version TV : plus lisible à distance */
.z4tap-grid--tv .z4tap-mentions { font-size: clamp(.62rem, .8vw, .85rem); }
.z4tap-grid--tv .z4tap-fut-bar { height: clamp(8px, 1vw, 13px); }
.z4tap-grid--tv .z4tap-fut-lab { font-size: clamp(.65rem, .85vw, .95rem); }
