/*
Theme Name: Juste pour son sourire
Theme URI: https://justepoursonsourire.fr/
Author: Juste pour son sourire
Description: Thème de blocs sur mesure de l'association Juste pour son sourire (direction « Le sourire »). Couleurs, polices et espacements verrouillés par theme.json ; modèles de blocs prêts à l'emploi pour les bénévoles. Aucune extension requise.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.0.9
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jp2s
*/

/* Tout ce que theme.json ne sait pas exprimer : effets « autocollant », ombres décalées, arc tricolore,
   grilles des sections et pastilles numérotées. Les valeurs viennent des variables WordPress (theme.json). */

:root {
	--jp2s-decoupe: var(--wp--custom--decoupe, 6px);
	--jp2s-ombre: var(--wp--preset--shadow--nette);
	--jp2s-ombre-pressee: var(--wp--preset--shadow--pressee);
	--jp2s-encre: var(--wp--preset--color--encre);
	--jp2s-blanc: var(--wp--preset--color--blanc);
}

/* ---------- Base ---------- */
html, body { overflow-x: clip; }
body { -webkit-font-smoothing: antialiased; }
::selection { background: var(--wp--custom--decor--vert); color: var(--jp2s-encre); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--custom--focus);
	outline-offset: 3px;
}
:where(h1, h2, h3, h4) { text-wrap: balance; overflow-wrap: break-word; }
:where(p, li) { text-wrap: pretty; }
a { text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:where(:not(.wp-element-button)):hover { text-decoration-color: var(--wp--preset--color--magenta); }

/* ---------- Boutons : magenta pour le don, contour pour le reste ---------- */
.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--wp--custom--zone-tactile);
	box-shadow: 0 0 0 5px var(--jp2s-blanc), var(--jp2s-ombre);
	transition: translate 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}
.wp-element-button:active,
.wp-block-button__link:active {
	translate: 5px 5px;
	box-shadow: 0 0 0 5px var(--jp2s-blanc), var(--jp2s-ombre-pressee);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--jp2s-encre);
	border: 0;
	box-shadow: inset 0 0 0 2px var(--jp2s-encre);
	padding: 0.8rem 1.5rem;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--jp2s-blanc);
	color: var(--jp2s-encre);
}
.wp-block-button.is-style-outline > .wp-block-button__link:active { translate: 0 1px; box-shadow: inset 0 0 0 2px var(--jp2s-encre); }
.has-violet-fonce-background-color .wp-block-button.is-style-outline > .wp-block-button__link,
.is-style-bandeau-violet .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--jp2s-blanc);
	box-shadow: inset 0 0 0 2px var(--jp2s-blanc);
}
.has-violet-fonce-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.is-style-bandeau-violet .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--violet);
}

/* ---------- En-tête ---------- */
.jp2s-entete {
	position: relative;
	z-index: 20;
	border-bottom: 2px dashed var(--wp--custom--filet);
}
.jp2s-marque { gap: var(--wp--preset--spacing--30); flex-wrap: nowrap; }
/* Le logo et le titre ne sont jamais comprimés : c'est le champ de recherche qui cède la place (240 px → 9 rem). */
.jp2s-marque { flex: none; }
.jp2s-entete .wp-block-search { flex: 0 1 240px; min-width: 9rem; }
.jp2s-entete .wp-block-search__inside-wrapper { width: 100% !important; }
.jp2s-entete .wp-block-search__input { min-width: 0; }
.jp2s-marque .wp-block-image { margin: 0; flex: none; }
.jp2s-marque .wp-block-image img { width: 58px; height: auto; }
.jp2s-marque .wp-block-site-title { font-family: var(--wp--preset--font-family--titres); font-weight: 800; line-height: 1.15; }
.jp2s-marque .wp-block-site-title a { color: var(--wp--preset--color--violet-fonce); text-decoration: none; }
.jp2s-marque .wp-block-site-tagline { font-weight: 700; color: var(--wp--preset--color--encre-douce); margin: 0; }
.jp2s-entete .wp-block-navigation .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--zone-tactile);
	padding: 0 0.75rem;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
}
.jp2s-entete .wp-block-navigation .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--violet-pale); }
.jp2s-entete .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { box-shadow: inset 0 0 0 2px var(--jp2s-encre); }
.jp2s-entete .wp-block-search__inside-wrapper {
	border: 2px solid var(--jp2s-encre);
	border-radius: 999px;
	background: var(--wp--preset--color--fond-doux);
	padding: 2px;
}
.jp2s-entete .wp-block-search__input { border: 0; background: transparent; min-height: 40px; padding-inline: 0.75rem; }
.jp2s-entete .wp-block-search__button { border-radius: 999px; box-shadow: none; min-height: 40px; padding: 0 0.75rem; margin: 0; }
.jp2s-entete .wp-block-navigation__container { flex-wrap: nowrap; }
.jp2s-entete .wp-block-site-title,
.jp2s-entete .wp-block-navigation-item__label,
.jp2s-entete .wp-block-button__link { white-space: nowrap; }
@media (max-width: 99.99rem) { .jp2s-entete .wp-block-search { display: none; } }
/* Téléphone : logo et menu sur la première ligne, bouton de don en pleine largeur dessous. */
@media (max-width: 47.99rem) {
	.jp2s-marque .wp-block-site-tagline { display: none; }
	.jp2s-entete > .alignwide { flex-wrap: wrap; row-gap: var(--wp--preset--spacing--30); }
	.jp2s-marque { flex: 1 1 auto; min-width: 0; }
	.jp2s-marque .wp-block-site-title { white-space: normal; font-size: var(--wp--preset--font-size--petit) !important; }
	.jp2s-entete .wp-block-buttons { order: 3; flex: 1 0 100%; }
	.jp2s-entete .wp-block-buttons .wp-block-button { width: 100%; }
	.jp2s-entete .wp-block-buttons .wp-block-button__link { width: 100%; }
}
/* Menu replié en bouton jusqu'à 75rem (WordPress ne le replie qu'en dessous de 600 px). */
@media (min-width: 600px) and (max-width: 74.99rem) {
	.jp2s-entete .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.jp2s-entete .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
.jp2s-entete .wp-block-navigation__responsive-container-open,
.jp2s-entete .wp-block-navigation__responsive-container-close {
	min-width: var(--wp--custom--zone-tactile);
	min-height: var(--wp--custom--zone-tactile);
	justify-content: center;
	align-items: center;
	border-radius: 999px;
	box-shadow: inset 0 0 0 2px var(--jp2s-encre);
}

/* ---------- Surfaces « autocollant » ---------- */
.is-style-autocollant,
.is-style-autocollant-incline {
	border: var(--jp2s-decoupe) solid var(--jp2s-blanc);
	border-radius: var(--wp--preset--border-radius--grand);
	box-shadow: var(--jp2s-ombre);
}
.is-style-autocollant-incline { rotate: -1.5deg; }
.wp-block-image.is-style-autocollant {
	padding: var(--wp--preset--spacing--40);
	background: var(--jp2s-blanc);
	border-radius: var(--wp--preset--border-radius--autocollant);
	box-shadow: 0 0 0 2px var(--wp--custom--filet), var(--jp2s-ombre);
	rotate: -3deg;
}
.wp-block-image.is-style-autocollant img { border-radius: calc(var(--wp--preset--border-radius--autocollant) - 16px); }
@media (max-width: 47.99rem) {
	.is-style-autocollant-incline,
	.wp-block-image.is-style-autocollant { rotate: none; }
}

/* ---------- Emplacement photo (en attente des photos de l'association, avec accords) ---------- */
.is-style-emplacement-photo {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	padding: var(--wp--preset--spacing--50);
	background: var(--jp2s-blanc);
	border: 2px dashed var(--wp--custom--filet-champ);
	border-radius: var(--wp--preset--border-radius--moyen);
	text-align: center;
	color: var(--wp--preset--color--encre-douce);
	font-weight: 700;
}
.is-style-emplacement-photo.is-style-emplacement-photo > * { max-width: 32ch; margin-inline: auto; }

/* ---------- Arc tricolore du logo (séparateur) ---------- */
.wp-block-separator.is-style-arc {
	border: 0;
	height: 56px;
	max-width: none;
	margin-block: 0;
	opacity: 1;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 56' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-width='12'%3E%3Cpath stroke='%23634A9B' d='M0 14Q720 44 1440 14'/%3E%3Cpath stroke='%23E2007A' d='M0 28Q720 58 1440 28'/%3E%3Cpath stroke='%2395C11F' d='M0 42Q720 72 1440 42'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- Étiquette (petit titre-pastille) ---------- */
.is-style-etiquette {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 var(--wp--preset--spacing--40);
	border-radius: 999px;
	background: var(--wp--custom--decor--vert);
	color: var(--jp2s-encre) !important;
	border: 4px solid var(--jp2s-blanc);
	box-shadow: 4px 4px 0 var(--jp2s-encre);
	rotate: -3deg;
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--petit) !important;
	font-weight: 700;
	letter-spacing: 0;
}

/* ---------- Liste à pastilles numérotées ---------- */
ol.is-style-pastilles {
	list-style: none;
	counter-reset: jp2s;
	padding: 0;
	margin-inline: 0;
	display: grid;
}
ol.is-style-pastilles > li {
	counter-increment: jp2s;
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
	align-items: center;
	padding-block: var(--wp--preset--spacing--50);
	border-top: 2px dashed currentColor;
	font-size: var(--wp--preset--font-size--chapo);
	line-height: 1.4;
}
ol.is-style-pastilles > li:last-child { border-bottom: 2px dashed currentColor; }
ol.is-style-pastilles > li::before {
	content: counter(jp2s);
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--custom--decor--vert);
	color: var(--jp2s-encre);
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 800;
}

/* ---------- Grilles des sections ---------- */
.jp2s-grille { display: grid; gap: var(--wp--preset--spacing--60); grid-template-columns: minmax(0, 1fr); }
.jp2s-grille > * { margin-block: 0 !important; }
.jp2s-grille > .wp-block-group { padding: var(--wp--preset--spacing--60); }
@media (min-width: 48rem) {
	.jp2s-grille--2, .jp2s-grille--5, .jp2s-grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.jp2s-grille--5 > :first-child { grid-column: span 2; }
}
@media (min-width: 60rem) {
	.jp2s-grille--5 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
	.jp2s-grille--5 > :nth-child(1) { grid-column: span 7; }
	.jp2s-grille--5 > :nth-child(2) { grid-column: span 5; }
	.jp2s-grille--5 > :nth-child(n+3) { grid-column: span 4; }
	.jp2s-grille--2 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.jp2s-grille h3 { color: var(--jp2s-encre); }
.jp2s-grille--2 { align-items: start; }

@media (min-width: 60rem) {
	.jp2s-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.jp2s-grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Grande phrase (déclaration, pied de page, chiffre clé) */
.jp2s-declaration {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.02em;
	max-width: 22ch;
	text-wrap: balance;
}
.jp2s-declaration--encre { color: var(--jp2s-encre); }
.wp-block-image.jp2s-autocollant-petit { max-width: 220px; padding: var(--wp--preset--spacing--30); }

/* Pastille d'état (« En pause, ils reprendront ») */
.jp2s-etat {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 0 var(--wp--preset--spacing--40);
	border-radius: 999px;
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--encre-douce);
	font-weight: 700;
}

/* ---------- Actualités (boucle de requête) ---------- */
.jp2s-actus .wp-block-post-template { display: grid; gap: var(--wp--preset--spacing--60); grid-template-columns: minmax(0, 1fr); padding: 0; }
.jp2s-actus .wp-block-post-template > li { margin: 0; }
.jp2s-carte {
	position: relative;
	height: 100%;
	padding: var(--wp--preset--spacing--60);
	background: var(--jp2s-blanc);
	transition: translate 120ms ease-out;
}
.jp2s-carte:hover { translate: 0 -2px; }
.jp2s-carte .wp-block-post-title a { color: var(--jp2s-encre); text-decoration: none; }
.jp2s-carte .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.jp2s-carte:has(a:focus-visible) { outline: 3px solid var(--wp--custom--focus); outline-offset: 6px; }
.jp2s-carte .wp-block-post-title a:focus-visible { outline: none; }
.jp2s-carte .wp-block-post-date { font-weight: 700; color: var(--wp--preset--color--encre-douce); }
@media (min-width: 60rem) {
	.jp2s-actus .wp-block-post-template { grid-template-columns: repeat(12, minmax(0, 1fr)); }
	.jp2s-actus--une .wp-block-post-template > li:first-child { grid-column: span 7; grid-row: span 2; }
	.jp2s-actus--une .wp-block-post-template > li:first-child .jp2s-carte { background: var(--wp--preset--color--violet-pale); }
	.jp2s-actus--une .wp-block-post-template > li:first-child .wp-block-post-title { font-size: var(--wp--preset--font-size--manifeste) !important; }
	.jp2s-actus--une .wp-block-post-template > li:not(:first-child) { grid-column: span 5; }
	.jp2s-actus--grille .wp-block-post-template > li { grid-column: span 4; }
}

/* ---------- Appel au don ---------- */
.jp2s-usages { counter-reset: jp2s-u; }
.jp2s-usages > .wp-block-group {
	counter-increment: jp2s-u;
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40);
	align-items: center;
	min-height: 120px;
	background: var(--jp2s-blanc);
}
.jp2s-usages > .wp-block-group::before {
	content: counter(jp2s-u);
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--custom--decor--vert);
	color: var(--jp2s-encre);
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 800;
}
.jp2s-usages > .wp-block-group > p { margin: 0; font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: var(--wp--preset--font-size--intertitre); line-height: 1.25; }
.jp2s-fiscal { rotate: -1deg; }
.jp2s-fiscal .jp2s-grand-chiffre { font-family: var(--wp--preset--font-family--titres); font-weight: 800; font-size: var(--wp--preset--font-size--affiche); line-height: 1; letter-spacing: -0.02em; }
@media (max-width: 47.99rem) { .jp2s-fiscal { rotate: none; } }

/* ---------- Questions fréquentes (bloc Détails) ---------- */
.wp-block-details {
	background: var(--jp2s-blanc);
	border-radius: var(--wp--preset--border-radius--grand);
	box-shadow: inset 0 0 0 2px var(--wp--custom--filet);
	padding: 0 var(--wp--preset--spacing--50) var(--wp--preset--spacing--10);
}
.wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	min-height: 64px;
	padding-block: var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--chapo);
	cursor: pointer;
	list-style: none;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	display: grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--wp--preset--color--violet-pale);
	color: var(--wp--preset--color--violet-fonce);
}
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details > :not(summary) { padding-bottom: var(--wp--preset--spacing--50); margin-top: 0; max-width: 62ch; }

/* ---------- Encadrés d'article : mise à jour datée, avertissement d'archive ---------- */
.jp2s-mise-a-jour,
.jp2s-archive {
	background: var(--wp--preset--color--violet-pale);
	border-left: 4px solid var(--wp--preset--color--violet);
	border-radius: 0 var(--wp--preset--border-radius--petit) var(--wp--preset--border-radius--petit) 0;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

/* ---------- Article (mode sobre) ---------- */
.jp2s-sobre { background: var(--jp2s-blanc); }
.jp2s-sobre :where(h1, h2, h3) { color: var(--jp2s-encre); }
.jp2s-sobre .wp-block-post-content a:where(:not(.wp-element-button)) { color: var(--jp2s-encre); }
.jp2s-sobre .wp-block-post-content h2,
.wp-block-post-content > h2.wp-block-heading,
.wp-block-post-content > h3.wp-block-heading {
	font-size: var(--wp--preset--font-size--intertitre);
	line-height: var(--wp--custom--interligne--intertitre);
	margin-top: var(--wp--preset--spacing--70);
}
.wp-block-post-content > h3.wp-block-heading { font-size: var(--wp--preset--font-size--chapo); margin-top: var(--wp--preset--spacing--60); }
.jp2s-sobre .wp-block-post-content .jp2s-sources h2 { font-size: var(--wp--preset--font-size--normal); margin-top: 0; }
.jp2s-entete-article { border-bottom: 2px solid var(--jp2s-encre); }
.jp2s-meta { color: var(--wp--preset--color--encre-douce); font-weight: 700; }
.jp2s-sobre .wp-block-quote {
	border: 0;
	border-block: 2px solid var(--jp2s-encre);
	padding: var(--wp--preset--spacing--50) 0;
	margin-block: var(--wp--preset--spacing--70);
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--intertitre);
	line-height: 1.3;
}
.jp2s-sources { border-top: 2px dashed var(--wp--custom--filet-champ); padding-top: var(--wp--preset--spacing--50); }
.jp2s-a-lire { border-top: 2px solid var(--jp2s-encre); }
.jp2s-carte--sobre { border-radius: var(--wp--preset--border-radius--grand); box-shadow: inset 0 0 0 2px var(--wp--custom--filet-champ); }
@media (min-width: 60rem) {
	.jp2s-colonne-don { position: sticky; top: var(--wp--preset--spacing--50); align-self: flex-start; }
}

/* ---------- Pied de page ---------- */
.jp2s-pied a { color: var(--jp2s-blanc); }
.jp2s-pied :focus-visible { outline-color: var(--jp2s-blanc); }
.jp2s-pied .jp2s-pied-grille { border-top: 2px dashed var(--wp--preset--color--encre-douce); }
.jp2s-pied .wp-block-image img { width: 88px; border-radius: var(--wp--preset--border-radius--moyen); border: 4px solid var(--jp2s-blanc); }
.jp2s-pied ul { list-style: none; padding: 0; }
.jp2s-pied li a { display: inline-flex; align-items: center; min-height: var(--wp--custom--zone-tactile); }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
	.jp2s-carte:hover { translate: none; }
}
