/* Polices de la refonte, chargées seulement si le thème ne fournit pas les siennes (voir fonts/LISEZMOI.md). */
@font-face { font-family: "HPB Nunito"; src: url(fonts/nunito-variable.woff2) format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "HPB Figtree"; src: url(fonts/figtree-variable.woff2) format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }

/* Hello Park : cases Date et Heure, petit calendrier et liste des heures (assets/picker.js).
 * Modèle : l'ancien formulaire de réservation. Couleurs et polices du thème quand il est actif. */
.hpbp-legs, .hpbp-pop {
	--p-ink: var(--ink, #0B1220);
	--p-muted: var(--muted, #4D5769);
	--p-card: var(--card, #FFFFFF);
	--p-chip: var(--chip, #ECE9E0);
	--p-btn: var(--btn, #0B1220);
	--p-on-btn: var(--on-btn, #FFFFFF);
	--p-teal: var(--teal, #30CFC2);
	--p-teal-ink: var(--teal-ink, #0B6F68);
	--p-band: var(--t-mint, #DDF6EE);
	--p-border: rgb(11 18 32 / .16);
	--p-line: var(--line, rgb(11 18 32 / .10));
	--p-shadow: 0 2px 6px rgb(11 18 32 / .06), 0 22px 44px -18px rgb(11 18 32 / .32);
	--p-display: var(--f-display, "HPB Nunito", "Arial Rounded MT Bold", system-ui, sans-serif);
	--p-body: var(--f-body, "HPB Figtree", system-ui, -apple-system, "Segoe UI", sans-serif);
	--p-ease: var(--ease, cubic-bezier(.23, 1, .32, 1));
}

/* Champs du navigateur gardés pour les valeurs, mais invisibles. */
.hpbp-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }

/* Départ puis Retour l'un sous l'autre ; côte à côte quand le bloc est large. */
.legs.hpbp-legs, .hpb-legs.hpbp-legs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.legs.hpbp-legs.is-wide, .hpb-legs.hpbp-legs.is-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

/* Chaque trajet : un titre, puis une rangée « Date | Heure ». */
.leg.hpbp-leg, .hpb-leg.hpbp-leg {
	display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 8px;
	padding: 0; border-radius: 0; background: none; box-shadow: none; min-width: 0;
}
.leg.hpbp-leg:hover, .leg.hpbp-leg:focus-within, .hpb-leg.hpbp-leg:hover, .hpb-leg.hpbp-leg:focus-within { box-shadow: none; }
.hpbp-leg.hpbp-leg > b { font: 800 1rem/1.3 var(--p-display); color: var(--p-ink); }
.hpbp-leg.hpbp-leg > small { min-height: 0; color: var(--p-muted); font-size: .85rem; line-height: 1.3; }

.hpbp-fields {
	position: relative; flex: 1 0 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	border-radius: 14px; background: var(--p-card); box-shadow: inset 0 0 0 1.5px var(--p-border);
}
.hpbp-field {
	position: relative; display: grid; gap: 2px; align-content: center; min-width: 0; min-height: 64px; margin: 0; padding: 10px 14px;
	border: 0; border-radius: 14px; background: none; box-shadow: none; color: var(--p-ink); text-align: left; text-transform: none; letter-spacing: normal;
	cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color 140ms, box-shadow 140ms;
}
.hpbp-field + .hpbp-field::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--p-border); }
.hpbp-flabel { font: 600 .8rem/1.2 var(--p-body); color: var(--p-muted); }
.hpbp-fval { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 800 1.05rem/1.25 var(--p-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.hpbp-field.is-empty .hpbp-fval { color: var(--p-teal-ink); }
.hpbp-field:hover { background: rgb(11 18 32 / .035); color: var(--p-ink); }
.hpbp-field.is-open { background: none; box-shadow: inset 0 0 0 2px var(--p-teal); }
.hpbp-field.is-open::before { display: none; }
.hpbp-field.is-open + .hpbp-field::before { display: none; }
.hpbp-field:focus-visible { outline: 2px solid var(--p-teal); outline-offset: -2px; }

/* Fenêtre sous la case */
.hpbp-pop {
	position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; box-sizing: border-box;
	padding: 12px; border-radius: 16px; background: var(--p-card); color: var(--p-ink);
	box-shadow: var(--p-shadow), 0 0 0 1px var(--p-line); font-family: var(--p-body); text-align: left;
}
.hpbp-pop[hidden] { display: none; }
.hpbp-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.hpbp-pop.is-date { width: min(320px, calc(100vw - 24px)); }
.hpbp-pop.is-time { left: auto; right: 0; width: max(46%, 150px); padding: 6px; }
.hpbp-pop.is-in { animation: hpbpIn 180ms var(--p-ease); transform-origin: top center; }
.hpbp-pop.is-up.is-in { transform-origin: bottom center; }
@keyframes hpbpIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.hpbp-pop button { font-family: var(--p-display); text-transform: none; letter-spacing: normal; box-shadow: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Mois */
.hpbp-mhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hpbp-pop .hpbp-mtitle { margin: 0; font: 800 1rem var(--p-display); color: var(--p-ink); }
.hpbp-mtitle::first-letter { text-transform: uppercase; }
.hpbp-arrow { display: grid; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--p-ink); cursor: pointer; transition: background-color 140ms, transform 100ms; }
.hpbp-arrow svg { width: 18px; height: 18px; }
.hpbp-arrow:hover { background: var(--p-chip); color: var(--p-ink); }
.hpbp-arrow:active { transform: scale(.94); }
.hpbp-arrow:disabled { opacity: .3; cursor: default; background: none; transform: none; }
.hpbp-arrow:focus-visible { outline: 2px solid var(--p-teal); outline-offset: 1px; }
.hpbp-grid { display: grid; gap: 2px; }
.hpbp-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hpbp-pad { height: 40px; }
.hpbp-hd { display: grid; place-items: center; height: 26px; font: 600 .75rem var(--p-body); color: var(--p-muted); }
.hpbp-cell { position: relative; display: grid; place-items: center; }

.hpbp-day {
	position: relative; z-index: 1; width: 100%; max-width: 40px; aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: none; color: var(--p-ink); font: 700 .92rem/1 var(--p-display); font-variant-numeric: tabular-nums; cursor: pointer;
	transition: background-color 120ms, color 120ms;
}
.hpbp-day:hover { background: var(--p-chip); color: var(--p-ink); }
.hpbp-day:focus-visible { outline: 2px solid var(--p-teal); outline-offset: 1px; }
.hpbp-day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.hpbp-day.is-off { color: var(--p-muted); opacity: .4; cursor: default; background: none; }
.hpbp-day.is-closed { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* Séjour : bande menthe entre le départ et le retour */
.hpbp-cell:has(.in-range)::before,
.hpbp-cell:has(.has-range)::before { content: ""; position: absolute; top: 50%; height: min(40px, 100%); transform: translateY(-50%); background: var(--p-band); }
.hpbp-cell:has(.in-range)::before { left: 0; right: 0; }
.hpbp-cell:has(.has-range.is-start)::before { left: 50%; right: 0; }
.hpbp-cell:has(.has-range.is-end)::before { left: 0; right: 50%; }
.hpbp-cell:has(.has-range.is-start.is-end)::before { display: none; }
.hpbp-day.in-range { color: #0B1220; }
.hpbp-day.in-range:hover { background: rgb(11 18 32 / .08); }
.hpbp-day.is-start, .hpbp-day.is-end, .hpbp-day.is-start:hover, .hpbp-day.is-end:hover { background: var(--p-btn); color: var(--p-on-btn); opacity: 1; }

/* Heures : liste à faire défiler */
.hpbp-list { display: grid; gap: 1px; max-height: min(264px, 46vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hpbp-opt {
	display: flex; align-items: center; min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 10px;
	background: none; color: var(--p-ink); font: 700 1rem/1 var(--p-display); font-variant-numeric: tabular-nums; text-align: left; cursor: pointer;
}
.hpbp-opt:hover { background: var(--p-chip); color: var(--p-ink); }
.hpbp-opt:focus-visible { outline: 2px solid var(--p-teal); outline-offset: -2px; }
.hpbp-opt.is-on, .hpbp-opt.is-on:hover { background: var(--p-btn); color: var(--p-on-btn); }
.hpbp-pop .hpbp-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--t-sun, #FFEFC2); color: #0B1220; font-size: .85rem; font-weight: 600; }

@media (max-width: 360px) {
	.hpbp-field { padding: 10px 11px; }
	.hpbp-fval { font-size: .98rem; }
}
@media (prefers-reduced-motion: reduce) {
	.hpbp-pop.is-in { animation: none; }
	.hpbp-day, .hpbp-opt, .hpbp-arrow, .hpbp-field { transition: none; }
}
