/*
 * Affichage front des horaires. Reprend les variables de design du thème
 * Spoort quand elles existent, avec un repli sobre sinon (le plugin doit
 * rester présentable même activé sur un site sans ce thème).
 */

.sp-hor {
	font-family: var(--sp-font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: var(--sp-fs-body, 1rem);
	color: var(--sp-ink, #171b2b);
}

.sp-hor-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.3em 0.8em;
	border-radius: var(--sp-radius-pill, 999px);
	font-size: var(--sp-fs-small, 0.875rem);
	font-weight: 600;
}

.sp-hor-badge-ouvert {
	background: rgba(60, 160, 90, 0.12);
	color: #2f7a4a;
}

.sp-hor-badge-ferme {
	background: rgba(179, 45, 46, 0.1);
	color: #b32d2e;
}

/*
 * Semaine : une rangée par jour, séparées par un léger espace comme les
 * tableaux de tarifs du thème. Jour courant en bleu nuit, jours fermés
 * estompés, plages horaires en pastilles alignées à gauche.
 */
.sp-hor-semaine {
	width: 100%;
	margin: var(--sp-gap, 1.5rem) 0;
	border-collapse: separate;
	border-spacing: 0 6px;
}

.sp-hor-semaine th,
.sp-hor-semaine td {
	padding: 0.85em 1.25em;
	text-align: left;
	vertical-align: middle;
	background: var(--sp-paper, #fff);
}

.sp-hor-semaine tr > :first-child { border-radius: 14px 0 0 14px; }
.sp-hor-semaine tr > :last-child { border-radius: 0 14px 14px 0; }

.sp-hor-semaine th {
	width: 1%;
	font-weight: 600;
	white-space: nowrap;
}

.sp-hor-jour { display: block; }

.sp-hor-plage {
	display: inline-block;
	margin: 0.15em 0.4em 0.15em 0;
	padding: 0.3em 0.85em;
	border: 1px solid var(--sp-line, #e5e1d3);
	border-radius: var(--sp-radius-pill, 999px);
	background: var(--sp-paper-alt, #f1efe6);
	color: var(--sp-ink, #171b2b);
	font-size: var(--sp-fs-small, 0.875rem);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Jour fermé : pas de pastille pleine, un simple contour pointillé. */
.sp-hor-ligne--ferme th { color: var(--sp-ink-soft, #4b5069); font-weight: 500; }
.sp-hor-plage--ferme {
	border-style: dashed;
	background: transparent;
	color: var(--sp-ink-soft, #4b5069);
	font-weight: 500;
}

/* Jour courant : même traitement que la ligne mise en avant des tarifs. */
.sp-hor-auj th,
.sp-hor-auj td {
	background: var(--sp-nuit, #0e1220);
	color: var(--sp-cream, #f6f4ec);
}

.sp-hor-auj .sp-hor-plage {
	border-color: rgba(var(--sp-cream-rgb, 246, 244, 236), 0.28);
	background: rgba(var(--sp-cream-rgb, 246, 244, 236), 0.12);
	color: var(--sp-cream, #f6f4ec);
}

.sp-hor-auj .sp-hor-plage--ferme { background: transparent; }

.sp-hor-auj-texte {
	display: block;
	margin-top: 0.1em;
	font-size: var(--sp-fs-xs, 0.8125rem);
	font-weight: 500;
	color: var(--sp-or, #f2ce3c);
}

/* Statut en direct, sur la ligne du jour courant seulement. */
.sp-hor-statut {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin: 0.15em 0;
	padding: 0.3em 0.8em;
	border-radius: var(--sp-radius-pill, 999px);
	background: var(--sp-cream, #f6f4ec);
	font-size: var(--sp-fs-xs, 0.8125rem);
	font-weight: 700;
}

.sp-hor-statut svg { width: 1em; height: 1em; flex: none; }
.sp-hor-statut--ouvert { color: var(--sp-status-open-ink, #2f7a4a); }
.sp-hor-statut--ferme { color: var(--sp-status-closed-ink, #b32d2e); }

/* Horaire modifié (férié, exception) dans les sept prochains jours. */
.sp-hor-modif {
	display: block;
	margin-top: 0.2em;
	font-size: var(--sp-fs-xs, 0.8125rem);
	font-weight: 600;
	color: var(--sp-ink, #171b2b);
}

.sp-hor-modif::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.5em;
	border-radius: 50%;
	background: var(--sp-or-ink, #b99a13);
}

.sp-hor-auj .sp-hor-modif { color: var(--sp-cream, #f6f4ec); }

.sp-hor-exceptions-titre {
	margin: var(--sp-gap, 1.5rem) 0 0.5em;
	font-weight: 600;
}

.sp-hor-exceptions {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-hor-exceptions li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25em 1em;
	padding: 0.7em 0 0.7em 1em;
	border-bottom: 1px solid var(--sp-line, #e5e1d3);
	border-left: 3px solid var(--sp-or-ink, #b99a13);
}

.sp-hor-exceptions li.sp-hor-exc--ferme { border-left-color: var(--sp-status-closed-ink, #b32d2e); }

.sp-hor-exceptions-date {
	min-width: 8em;
	font-weight: 700;
}

.sp-hor-exceptions-detail {
	color: var(--sp-ink-soft, #4b5069);
}
