/*
 * Bénévoles Théâtre – mise en forme légère.
 * Tout hérite du thème (police, couleurs, boutons). Les sélecteurs :where()
 * ont une priorité nulle : n'importe quelle règle de votre thème l'emporte.
 * Pour changer la couleur d'accent : .bt-wrap { --bt-accent: #b00020; }
 */

:where(.bt-wrap) {
	--bt-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, currentColor));
	--bt-bord: color-mix(in srgb, currentColor 18%, transparent);
	--bt-fond: color-mix(in srgb, currentColor 4%, transparent);
	--bt-rayon: 6px;
	font: inherit;
	color: inherit;
}

:where(.bt-wrap) :where(.bt-liste) { display: grid; gap: 1.5em; }

:where(.bt-wrap) :where(.bt-spectacle) {
	border: 1px solid var(--bt-bord);
	border-radius: var(--bt-rayon);
	padding: 1.25em 1.5em;
}
:where(.bt-wrap) :where(.bt-titre) { margin: 0 0 .25em; }
:where(.bt-wrap) :where(.bt-titre a) { color: inherit; text-decoration: none; }
:where(.bt-wrap) :where(.bt-date) { margin: 0; font-weight: 600; }
:where(.bt-wrap) :where(.bt-lieu, .bt-rdv) { margin: .1em 0 0; opacity: .8; }
:where(.bt-wrap) :where(.bt-extrait) { margin: .75em 0 0; }

:where(.bt-wrap) :where(.bt-postes) {
	list-style: none; margin: 1em 0; padding: 0;
	display: grid; gap: .9em; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
:where(.bt-wrap) :where(.bt-poste-ligne) { display: flex; justify-content: space-between; gap: 1em; }
:where(.bt-wrap) :where(.bt-barre) {
	height: 6px; border-radius: 3px; background: var(--bt-bord); overflow: hidden; margin: .35em 0;
}
:where(.bt-wrap) :where(.bt-barre span) { display: block; height: 100%; background: var(--bt-accent); }
:where(.bt-wrap) :where(.bt-statut, .bt-noms) { display: block; font-size: .9em; }
:where(.bt-wrap) :where(.bt-noms) { opacity: .75; }
:where(.bt-wrap) :where(.bt-complet .bt-statut) { font-weight: 600; }
:where(.bt-wrap) :where(.bt-info) { margin: .5em 0 0; font-style: italic; }

/* Formulaire : les champs gardent le style natif du thème. */
:where(.bt-wrap) :where(.bt-form-wrap > summary) { display: inline-block; cursor: pointer; list-style: none; }
:where(.bt-wrap) :where(.bt-form-wrap > summary)::-webkit-details-marker { display: none; }
:where(.bt-wrap) :where(.bt-form-wrap[open] > summary) { opacity: .6; }
:where(.bt-wrap) :where(.bt-form) { margin-top: 1em; max-width: 34em; }
:where(.bt-wrap) :where(.bt-form p) { margin: 0 0 .9em; }
:where(.bt-wrap) :where(.bt-form label) { display: block; margin-bottom: .25em; }
:where(.bt-wrap) :where(.bt-form input:not([type=radio]), .bt-form textarea) { width: 100%; box-sizing: border-box; font: inherit; }
:where(.bt-wrap) :where(.bt-choix) { border: 0; padding: 0; margin: 0 0 .9em; }
:where(.bt-wrap) :where(.bt-choix legend) { padding: 0; margin-bottom: .25em; }
:where(.bt-wrap) :where(.bt-choix label) { display: inline-flex; gap: .4em; align-items: center; margin-right: 1.5em; }
:where(.bt-wrap) :where(.bt-rgpd) { font-size: .85em; opacity: .75; }
.bt-wrap .bt-hp { position: absolute !important; left: -9999px !important; }

/* Messages */
:where(.bt-wrap) :where(.bt-msg) {
	padding: .8em 1em; margin: 0 0 1.5em; border-radius: var(--bt-rayon);
	border-left: 4px solid currentColor; background: var(--bt-fond);
}
:where(.bt-wrap) :where(.bt-msg-succes) { border-left-color: #2e7d32; }
:where(.bt-wrap) :where(.bt-msg-erreur) { border-left-color: #c62828; }

/* Tableau de planning */
:where(.bt-wrap) :where(.bt-scroll) { overflow-x: auto; }
:where(.bt-wrap) :where(.bt-tableau) { width: 100%; border-collapse: collapse; }
:where(.bt-wrap) :where(.bt-tableau th, .bt-tableau td) {
	border-bottom: 1px solid var(--bt-bord); padding: .6em .75em; text-align: left; vertical-align: top;
}
:where(.bt-wrap) :where(.bt-cases) { list-style: none; margin: 0; padding: 0; }
:where(.bt-wrap) :where(.bt-cases li) { margin: 0 0 .2em; }
:where(.bt-wrap) :where(.bt-libre) { opacity: .7; font-style: italic; }
:where(.bt-wrap) :where(.bt-libre a) { color: var(--bt-accent); }
:where(.bt-wrap) :where(.bt-passe) { opacity: .5; }

@media (max-width: 640px) {
	:where(.bt-wrap) :where(.bt-tableau thead) { display: none; }
	:where(.bt-wrap) :where(.bt-tableau tr) { display: block; border-bottom: 2px solid var(--bt-bord); padding: .5em 0; }
	:where(.bt-wrap) :where(.bt-tableau td) { display: grid; grid-template-columns: 8em 1fr; gap: .5em; border: 0; padding: .25em 0; }
	:where(.bt-wrap) :where(.bt-tableau td)::before { content: attr(data-label); font-weight: 600; }
}

@media print {
	.bt-tableau-actions, .bt-libre a { display: none; }
	.bt-tableau-wrap .bt-libre::after { content: "______________"; }
}

/* Regroupement par spectacle */
:where(.bt-wrap) :where(.bt-groupe) { margin: 0 0 2.5em; }
:where(.bt-wrap) :where(.bt-groupe-titre) { margin: 0 0 .2em; }
:where(.bt-wrap) :where(.bt-groupe-infos) { margin: 0 0 1em; opacity: .8; }
:where(.bt-wrap) :where(.bt-groupe .bt-liste) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1em; }
:where(.bt-wrap) :where(.bt-groupe .bt-date) { font-size: 1.1em; }

/* Tableau récapitulatif : lignes = bénévoles, colonnes = dates */
:where(.bt-wrap) :where(.bt-recap-wrap) { margin: 2.5em 0 0; }
:where(.bt-wrap) :where(.bt-recap-titre) { margin: 0 0 .3em; }
:where(.bt-wrap) :where(.bt-recap) { border-collapse: separate; border-spacing: 3px; font-size: .85em; }
:where(.bt-wrap) :where(.bt-recap th, .bt-recap td) { padding: .45em .5em; text-align: center; vertical-align: middle; border: 0; }
:where(.bt-wrap) :where(.bt-recap .bt-recap-nom) {
	text-align: left; white-space: nowrap; position: sticky; left: 0; z-index: 1;
	background: var(--wp--preset--color--base, #fff);
}
:where(.bt-wrap) :where(.bt-recap thead a) { color: inherit; text-decoration: none; }
:where(.bt-wrap) :where(.bt-recap-spectacle) { font-weight: 400; opacity: .7; }
:where(.bt-wrap) :where(.bt-case) { min-width: 3.6em; border-radius: 3px; font-size: .9em; }
:where(.bt-wrap) :where(.bt-case-oui) { background: #c8e6c9; color: #1b5e20; }
:where(.bt-wrap) :where(.bt-case-non) { background: #ffcdd2; color: #b71c1c; }
:where(.bt-wrap) :where(.bt-case-vide) { background: transparent; box-shadow: inset 0 0 0 1px var(--bt-bord); }
:where(.bt-wrap) :where(.bt-recap tfoot th, .bt-recap tfoot td) { font-weight: 600; }
:where(.bt-wrap) :where(.bt-recap tfoot th) { padding-top: .8em; }
:where(.bt-wrap) :where(.bt-ok) { color: #2e7d32; font-weight: 600; }
:where(.bt-wrap) :where(.bt-manque) { color: #c62828; font-weight: 600; }
.bt-wrap .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
@media print { .bt-case-oui, .bt-case-non { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Places libres en orange/rouge, Complet en vert (lisible d'un coup d'œil) */
.bt-wrap .bt-poste .bt-statut { color: #d84315; font-weight: 700; }
.bt-wrap .bt-poste.bt-complet .bt-statut { color: #2e7d32; }
.bt-wrap .bt-poste .bt-barre span { background: #ef6c00; }
.bt-wrap .bt-poste.bt-complet .bt-barre span { background: #2e7d32; }

/* Bouton « Confirmer mon inscription » : même taille que « Je m'inscris », fond de couleur.
   Couleur réglable dans Caisse & accueil > Réglages (variable --bt-bouton). */
.bt-wrap .bt-form .bt-btn-primaire {
	cursor: pointer;
	border: 0;
	background-color: var(--bt-bouton, #2e7d32);
	color: #fff;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	/* Mêmes dimensions que les boutons standard de WordPress (« Je m'inscris »). */
	padding: calc(.667em + 2px) calc(1.333em + 2px);
	border-radius: var(--wp--custom--button--border-radius, 0);
}
.bt-wrap .bt-form .bt-btn-primaire:hover,
.bt-wrap .bt-form .bt-btn-primaire:focus-visible { filter: brightness(1.12); }

/* Annuler mon inscription */
:where(.bt-wrap) :where(.bt-annuler-wrap) { margin: 2em 0 0; padding-top: 1.5em; border-top: 1px solid var(--bt-bord); }
:where(.bt-wrap) :where(.bt-annuler-wrap > summary) { display: inline-block; cursor: pointer; list-style: none; }
:where(.bt-wrap) :where(.bt-annuler-wrap > summary)::-webkit-details-marker { display: none; }
.bt-wrap .bt-annuler-wrap > summary.bt-btn-secondaire {
	background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor;
}
