/* ==========================================================================
   M'Road – Compte à rebours — bandeau
   Chargé UNIQUEMENT quand le bandeau est affiché. Les règles qui touchent au thème
   dépendent de la classe « mroad-compte » posée sur <body> par l'extension.
   Couleurs du thème : noir #05070b, jaune #f6c431 / #ffd659, blanc.
   ========================================================================== */

/* Hauteur du bandeau */
body.mroad-compte { --mrc-h: 56px; }
@media (max-width: 600px) { body.mroad-compte { --mrc-h: 54px; } }

/* --------------------------------------------------------------------------
   Place pour le bandeau : même principe que la barre d'administration WordPress
   (la page et l'en-tête sont décalés de la hauteur du bandeau ; rien n'est masqué).
   ----------------------------------------------------------------------- */
body.mroad-compte { padding-top: var(--mrc-h); }
body.mroad-compte .site-header { top: var(--mrc-h); }
body.mroad-compte.admin-bar .site-header { top: calc(32px + var(--mrc-h)); }
@media (max-width: 782px) { body.mroad-compte.admin-bar .site-header { top: calc(46px + var(--mrc-h)); } }

/* Éléments fixes ou « collants » du thème calés sous l'en-tête */
body.mroad-compte .mobile-nav { padding-top: calc(var(--header-h) + 24px + var(--mrc-h)); }
body.mroad-compte .contact-card { top: calc(var(--header-h) + 24px + var(--mrc-h)); }
body.mroad-compte .vsingle__aside { top: calc(var(--header-h) + 20px + var(--mrc-h)); }
html:has(> body.mroad-compte) { scroll-padding-top: calc(var(--header-h) + 16px + 56px); }
@media (max-width: 600px) { html:has(> body.mroad-compte) { scroll-padding-top: calc(var(--header-h) + 16px + 54px); } }

/* --------------------------------------------------------------------------
   Bandeau
   ----------------------------------------------------------------------- */
.mrc {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 101; /* juste au-dessus de l'en-tête du thème (100) */
	height: var(--mrc-h, 56px);
	overflow: hidden;
	background:
		linear-gradient(115deg, transparent 71%, rgba(246, 196, 49, 0.09) 71% 72.4%, transparent 72.4%),
		linear-gradient(180deg, #0a0d14, #05070b);
	color: #fff;
	font-family: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
}

body.admin-bar .mrc { top: 32px; }
@media (max-width: 782px) { body.admin-bar .mrc { top: 46px; } }

.mrc::after { /* filet jaune */
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: linear-gradient(90deg, rgba(246, 196, 49, 0) 0%, #f6c431 18%, #ffd659 50%, #f6c431 82%, rgba(246, 196, 49, 0) 100%);
}

.mrc__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	max-width: var(--container, 1240px);
	margin: 0 auto;
	padding: 0 var(--gutter, 24px) 2px;
	text-align: center;
}

.mrc__live {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	max-width: 100%;
}

.mrc__text {
	max-width: 100%;
	margin: 0;
	overflow: hidden;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.2em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.86);
}

.mrc__timer {
	display: flex;
	align-items: baseline;
	gap: 9px;
	margin: 0;
	line-height: 1;
}

.mrc__unit { display: inline-flex; align-items: baseline; gap: 4px; }

.mrc__num {
	display: inline-block;
	min-width: 2ch;
	font-size: 25px;
	font-style: italic;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	text-align: right;
	color: #f6c431;
	text-shadow: 0 0 14px rgba(246, 196, 49, 0.25);
}

.mrc__label {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.62);
}

.mrc__label-short { display: none; }

.mrc__sep {
	font-size: 18px;
	font-weight: 700;
	color: rgba(246, 196, 49, 0.45);
	transform: translateY(-2px);
}

/* Changement de seconde : léger éclat */
.mrc__num.is-tick { animation: mrc-tick 0.45s ease-out; }
@keyframes mrc-tick { from { opacity: 0.45; transform: translateY(-2px); } to { opacity: 1; transform: none; } }

/* Fin du compte à rebours : chiffres figés sur 00 ; le message de fin (facultatif) remplace le texte */
.mrc__end {
	display: none;
	max-width: 100%;
	margin: 0;
	overflow: hidden;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.2em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	color: #ffd659;
}

.mrc.is-ended .mrc__text { display: none; }
.mrc.is-ended .mrc__end { display: block; animation: mrc-fade 0.6s ease both; }
.mrc.is-ended .mrc__num { text-shadow: none; }
@keyframes mrc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Téléphone
   ----------------------------------------------------------------------- */
@media (max-width: 600px) {
	.mrc__live { gap: 2px; }
	.mrc__text { font-size: 11px; letter-spacing: 0.14em; }
	.mrc__timer { gap: 6px; }
	.mrc__unit { gap: 2px; }
	.mrc__num { font-size: 22px; }
	.mrc__label { font-size: 11px; letter-spacing: 0.06em; }
	.mrc__label-long { display: none; }
	.mrc__label-short { display: inline; }
	.mrc__sep { font-size: 15px; }
	.mrc__end { font-size: 11px; letter-spacing: 0.14em; }
}

@media (max-width: 360px) {
	.mrc__num { font-size: 20px; }
	.mrc__text { letter-spacing: 0.1em; }
}

/* Animations réduites (réglage du visiteur) */
@media (prefers-reduced-motion: reduce) {
	.mrc__num.is-tick,
	.mrc.is-ended .mrc__end { animation: none !important; }
}

/* Impression : pas de bandeau ni de décalage */
@media print {
	.mrc { display: none !important; }
	body.mroad-compte { padding-top: 0; }
}
