/*
 * Ville de Gaspé — Horaire des plateaux
 * Jetons du système de design de la Ville (phase 1 de la refonte) :
 * bleu #004B97, survol #003A76, marine #00294D, bleu clair #E5F2FF,
 * sable #F5EDE3, focus #99CCFF ; Raleway (titres), Lexend (texte) ;
 * cartes 12 px, champs 8 px, boutons en pilule.
 *
 * Tout est préfixé .ghp et en spécificité (0,2,0) ou plus, pour ne pas
 * perdre contre les feuilles d'Activis émises plus bas dans la page.
 */

.ghp {
	container: ghp / inline-size; /* colonnes selon la place réelle, pas la largeur de l'écran */
	width: 100%;       /* requis : la mesure du conteneur ne doit pas dépendre du contenu */
	align-self: stretch;
	min-width: 0;
	--ghp-bleu: #004B97;
	--ghp-bleu-survol: #003A76;
	--ghp-marine: #00294D;
	--ghp-bleu-clair: #E5F2FF;
	--ghp-sable: #F5EDE3;
	--ghp-focus: #99CCFF;
	--ghp-gris: #5B6770;
	--ghp-filet: #D5DEE8;
	--ghp-blanc: #FFFFFF;
	--ghp-rayon: 12px;
	--ghp-rayon-champ: 8px;
	--ghp-titre: "Raleway", ui-sans-serif, system-ui, sans-serif;
	--ghp-texte: "Lexend", ui-sans-serif, system-ui, sans-serif;

	font-family: var(--ghp-texte);
	color: var(--ghp-marine);
	font-size: 1rem;
	line-height: 1.45;
	margin-block: 1.5rem;
}

.ghp *,
.ghp *::before,
.ghp *::after { box-sizing: border-box; }

.ghp [hidden] { display: none !important; }

/*
 * Garde-fous contre l'espacement automatique du thème :
 * Activis ajoute une marge après chaque titre (« h3 + * », spécificité 0,2,1)
 * qui creusait un vide sous le nom de chaque jour. On la neutralise en (0,5,0).
 */
.ghp.ghp.ghp .ghp__jour > .ghp__jour-titre + * { margin-block-start: 0; }

/* ---------- Bandeau démo ---------- */

.ghp .ghp__demo {
	margin: 0 0 1rem;
	padding: .65rem 1rem;
	border-radius: var(--ghp-rayon-champ);
	background: var(--ghp-sable);
	font-size: .9rem;
}

/* ---------- Barre : onglets + navigation ---------- */

.ghp .ghp__barre {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin-bottom: 1.25rem;
}

.ghp .ghp__onglets {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr); /* onglets de même largeur */
	gap: .25rem;
	padding: .3rem;
	border-radius: 1.6rem;
	background: var(--ghp-bleu-clair);
	flex: 1 1 32rem;
	max-width: 52rem;
}

.ghp .ghp__onglet {
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .15rem;
	min-width: 0;
	margin: 0;
	border: 0;
	border-radius: 1.3rem;
	padding: .6rem 1rem;
	background: transparent;
	color: var(--ghp-marine);
	font: 600 1rem/1.2 var(--ghp-texte);
	text-align: center;
	text-wrap: balance;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.ghp .ghp__nom { display: block; }
.ghp .ghp__lieu { display: block; font-size: .8rem; font-weight: 400; opacity: .85; }
.ghp .ghp__onglet[aria-selected="true"] {
	background: var(--ghp-bleu);
	color: var(--ghp-blanc);
}

.ghp .ghp__plateau-seul {
	margin: 0;
	font: 700 1.25rem/1.2 var(--ghp-titre);
}
.ghp .ghp__plateau-seul .ghp__lieu { margin-top: .2rem; font-family: var(--ghp-texte); font-size: .9rem; font-weight: 400; color: var(--ghp-gris); opacity: 1; }

.ghp .ghp__nav {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
}

.ghp .ghp__periode {
	margin: 0;
	min-width: 15rem;
	text-align: center;
	font: 700 1.05rem/1.3 var(--ghp-titre);
}

.ghp .ghp__navbtn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	border: 1.5px solid var(--ghp-bleu);
	border-radius: 999px;
	background: var(--ghp-blanc);
	color: var(--ghp-bleu);
	font: 600 .95rem/1 var(--ghp-texte);
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.ghp .ghp__nav-icone { width: 2.6rem; min-width: 0; height: 2.6rem; padding: 0; flex: none; }
.ghp .ghp__nav-texte { min-width: 0; height: 2.6rem; padding: 0 1.1rem; }
.ghp .ghp__navbtn:disabled { opacity: .35; cursor: not-allowed; }
.ghp .ghp__navbtn::after, .ghp .ghp__onglet::after, .ghp .ghp__filtre::after { content: none; } /* flèches Activis */

.ghp .ghp__onglet:focus-visible,
.ghp .ghp__navbtn:focus-visible,
.ghp .ghp__filtre:focus-visible,
.ghp .ghp__panneau:focus-visible {
	outline: 3px solid var(--ghp-focus);
	outline-offset: 2px;
}

/* ---------- Filtres ---------- */

.ghp .ghp__filtres {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-bottom: 1rem;
}
.ghp .ghp__filtres-etiquette { font-size: .9rem; color: var(--ghp-gris); margin-right: .25rem; }

.ghp .ghp__filtre {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	margin: 0;
	padding: .4rem .85rem;
	border: 1px solid var(--ghp-filet);
	border-radius: 999px;
	background: var(--ghp-blanc);
	color: var(--ghp-marine);
	font: 500 .875rem/1.2 var(--ghp-texte);
	cursor: pointer;
}
.ghp .ghp__filtre[aria-pressed="true"] {
	background: var(--ghp-marine);
	border-color: var(--ghp-marine);
	color: var(--ghp-blanc);
}
.ghp .ghp__filtre[aria-pressed="true"] .ghp__pastille { box-shadow: 0 0 0 2px var(--ghp-blanc); }

.ghp .ghp__pastille {
	flex: none;
	width: .65rem;
	height: .65rem;
	border-radius: 50%;
	background: var(--ghp-type, var(--ghp-bleu));
	box-shadow: inset 0 0 0 1px rgba(0, 41, 77, .35); /* la pastille sable reste visible sur blanc */
}

/* ---------- Grille de la semaine ---------- */

.ghp .ghp__panneau { border-radius: var(--ghp-rayon); }
.ghp .ghp__panneau[aria-busy="true"] { opacity: .55; transition: opacity .2s; }

.ghp .ghp__grille {
	display: grid;
	grid-template-columns: 1fr;
	gap: .75rem;
}
@container ghp (min-width: 640px) {
	.ghp .ghp__grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container ghp (min-width: 740px) {
	.ghp .ghp__grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container ghp (min-width: 1100px) {
	.ghp .ghp__grille { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
}

.ghp .ghp__jour {
	display: flex;
	flex-direction: column;
	align-items: stretch;     /* le thème centre le contenu des <section> */
	justify-content: flex-start;
	gap: 0;                   /* et leur donne un écart de 72 px */
	min-width: 0;
	margin: 0;
	padding: .9rem .8rem 1rem;
	border: 1px solid var(--ghp-filet);
	border-radius: var(--ghp-rayon);
	background: var(--ghp-blanc);
}
.ghp .ghp__jour-auj {
	border: 2px solid var(--ghp-bleu);
	background: linear-gradient(var(--ghp-bleu-clair), var(--ghp-bleu-clair)) top / 100% 4.1rem no-repeat, var(--ghp-blanc);
}
.ghp .ghp__jour-passe { opacity: .7; }

.ghp .ghp__jour-titre {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem .5rem;
	margin: 0 0 .75rem;
	padding: 0 0 .6rem;
	border-bottom: 1px solid var(--ghp-filet);
	font: 700 1.05rem/1.2 var(--ghp-titre);
	color: var(--ghp-marine);
	text-transform: none;
	letter-spacing: 0;
}
.ghp .ghp__jour-date {
	font: 400 .9rem/1.2 var(--ghp-texte);
	color: var(--ghp-gris);
}
.ghp .ghp__auj {
	padding: .15rem .5rem;
	border-radius: 999px;
	background: var(--ghp-bleu);
	color: var(--ghp-blanc);
	font: 600 .7rem/1.3 var(--ghp-texte);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.ghp .ghp__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: .45rem;
}
.ghp .ghp__liste > li::before { content: none; } /* puces du thème */

.ghp .ghp__plage {
	margin: 0;
	padding: .45rem .55rem .5rem .7rem;
	border-left: 4px solid var(--ghp-type, var(--ghp-bleu));
	border-radius: 0 var(--ghp-rayon-champ) var(--ghp-rayon-champ) 0;
	background: #F6F8FB;
	overflow-wrap: anywhere;
}
/*
 * Catégories (0.4) — couleurs du système de design de la Ville :
 * activité libre = filet bleu sur fond bleu clair, titre en gras ;
 * autre activité = filet marine ; location = fond sable.
 */
.ghp .ghp__plage[data-type="activite-libre"] {
	background: var(--ghp-bleu-clair);
}
.ghp .ghp__plage[data-type="activite-libre"] .ghp__titre { font-weight: 700; }
.ghp .ghp__plage[data-type="location"] {
	border-left-color: var(--ghp-sable);
	background: var(--ghp-sable);
}

.ghp .ghp__heure {
	display: block;
	font-size: .8rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ghp-bleu);
	white-space: nowrap;
}
.ghp .ghp__tiret { margin: 0 .15em; }
.ghp .ghp__titre {
	display: block;
	font-size: .9rem;
	font-weight: 500;
	line-height: 1.3;
}
.ghp .ghp__type {
	display: flex;
	align-items: center;
	gap: .35rem;
	margin-top: .2rem;
	font-size: .75rem;
	color: var(--ghp-gris);
}
.ghp .ghp__type .ghp__pastille { width: .5rem; height: .5rem; }

.ghp .ghp__vide {
	margin: 0;
	font-size: .875rem;
	color: var(--ghp-gris);
	font-style: italic;
}

/* ---------- Sélecteur de jour (mobile seulement) ---------- */

.ghp .ghp__choix-jour { display: none; }

@container ghp (max-width: 639px) {
	/* Avec JavaScript : un jour à la fois. Sans JavaScript : toute la semaine. */
	.ghp.ghp-js .ghp__choix-jour {
		display: grid;
		grid-template-columns: repeat(7, minmax(0, 1fr));
		gap: .3rem;
		margin-bottom: .9rem;
	}
	.ghp.ghp-js .ghp__jour:not(.ghp__jour-choisi) { display: none; }

	.ghp .ghp__choix {
		appearance: none;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: .1rem;
		min-width: 0;
		padding: .45rem 0 .5rem;
		border: 1px solid var(--ghp-filet);
		border-radius: var(--ghp-rayon-champ);
		background: var(--ghp-blanc);
		color: var(--ghp-marine);
		cursor: pointer;
		font-family: var(--ghp-texte);
	}
	.ghp .ghp__choix::after { content: none; }
	.ghp .ghp__choix-nom { font-size: .72rem; line-height: 1.1; }
	.ghp .ghp__choix-num { font-size: 1.05rem; font-weight: 700; line-height: 1.1; }
	.ghp .ghp__choix-auj { border-color: var(--ghp-bleu); }
	.ghp .ghp__choix[aria-pressed="true"] {
		background: var(--ghp-bleu);
		border-color: var(--ghp-bleu);
		color: var(--ghp-blanc);
	}
	.ghp .ghp__choix-vide:not([aria-pressed="true"]) { color: var(--ghp-gris); }
	.ghp .ghp__choix:focus-visible { outline: 3px solid var(--ghp-focus); outline-offset: 2px; }
}

/* Mobile : les journées vides restent compactes. */
@container ghp (max-width: 639px) {
	.ghp .ghp__jour-vide { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; padding-block: .7rem; }
	.ghp.ghp .ghp__jour-vide .ghp__jour-titre { margin: 0; padding: 0; border: 0; }
	.ghp .ghp__nav { flex-wrap: wrap; gap: .5rem; }
	.ghp .ghp__periode { min-width: 0; flex: 1 1 0; font-size: .95rem; }
	.ghp .ghp__onglets { width: 100%; max-width: none; }
	.ghp.ghp .ghp__ecran { display: none; } /* un téléphone affiche déjà l'horaire en plein écran */
	.ghp .ghp__nav { width: 100%; }
	.ghp .ghp__nav-texte { flex: 1 1 100%; height: 2.3rem; }
}

/* ---------- Messages ---------- */

.ghp .ghp__alerte {
	margin: 0 0 1rem;
	padding: .9rem 1rem;
	border-radius: var(--ghp-rayon-champ);
	background: var(--ghp-sable);
}
.ghp .ghp__alerte-admin { font-size: .85rem; background: #FCEDEA; }

.ghp .ghp__maj {
	margin: 1rem 0 0;
	font-size: .8rem;
	color: var(--ghp-gris);
}

@media (prefers-reduced-motion: reduce) {
	.ghp * { transition: none !important; }
}

@media print {
	.ghp .ghp__barre .ghp__nav button, .ghp .ghp__filtres { display: none; }
	.ghp .ghp__grille { grid-template-columns: repeat(7, 1fr); }
	.ghp .ghp__ecran { display: none; }
	.ghp .ghp__jour { break-inside: avoid; }
}

/* ---------- Onglets : empilés quand la place manque ---------- */
@container ghp (max-width: 520px) {
	.ghp .ghp__onglets { grid-auto-flow: row; }
}

/* ---------- Lien « Plein écran » ---------- */
.ghp .ghp__ecran {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	height: 2.6rem;
	padding: 0 1rem;
	border-radius: 999px;
	color: var(--ghp-bleu);
	font: 600 .9rem/1 var(--ghp-texte);
	text-decoration: none;
	white-space: nowrap;
}
.ghp .ghp__ecran::after { content: none; }
.ghp .ghp__ecran:focus-visible { outline: 3px solid var(--ghp-focus); outline-offset: 2px; }
@media (hover: hover) {
	.ghp .ghp__ecran:hover { background: var(--ghp-bleu-clair); }
}

/* ---------- Pleine largeur : [horaire_plateaux largeur="pleine"] ---------- */
.ghp.ghp-pleine {
	width: calc(100vw - var(--ghp-barre-defil, 0px));
	max-width: none;
	margin-inline: calc(50% - (100vw - var(--ghp-barre-defil, 0px)) / 2);
	padding-inline: clamp(1rem, 3vw, 3rem);
}

/* Texte lu par les lecteurs d'écran seulement. */
.ghp .ghp__lu {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
