/*
 * Blocs natifs habillés au design system, chargés sur le site et dans l'éditeur :
 * la directrice voit en écrivant ce que verront les parents.
 * Ce que theme.json sait faire y reste (couleurs, polices, titres, boutons, style « Carte »
 * dans styles/carte.json) ; ici, seulement le reste. Valeurs en px : les jetons de
 * style.css n'existent pas dans l'éditeur.
 */

/* Titres : le gras ajouté par la rédactrice n'alourdit pas l'écriture « cahier ». */
h2 strong {
	font-weight: inherit;
}

/* Listes */

ul.wp-block-list {
	padding-left: 24px;
}

.wp-block-list li + li {
	margin-top: 4px;
}

.wp-block-list li::marker {
	color: var(--wp--preset--color--blue);
}

/* Boutons : ombre légère, soulèvement au survol. */

.wp-element-button,
.wp-block-button__link {
	box-shadow: 0 2px 6px color-mix(in srgb, var(--wp--preset--color--ink) 10%, transparent);
	transition: transform 0.15s ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-element-button:active,
.wp-block-button__link:active {
	transform: translateY(0);
	transition-duration: 0.08s;
}

/* Carte : le contenu ne double pas le rembourrage. */

.is-style-carte > :first-child {
	margin-top: 0;
}

.is-style-carte > :last-child {
	margin-bottom: 0;
}

/* Détails : une carte qui se déplie, chevron à droite (archives par année). */

.wp-block-details {
	margin-block: 12px;
	padding: 0 24px;
	border-radius: 22px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 2px 6px color-mix(in srgb, var(--wp--preset--color--ink) 10%, transparent);
}

.wp-block-details[open] {
	padding-bottom: 16px;
}

.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
	padding: 12px 0;
	font: 700 18px/24px var(--wp--preset--font-family--rounded);
	list-style: none;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "";
	flex: none;
	width: 24px;
	height: 24px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: rotate 0.2s ease;
}

.wp-block-details[open] > summary::after {
	rotate: 180deg;
}

.wp-block-details > summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
	border-radius: 12px;
}

.wp-block-details > summary + * {
	margin-top: 0;
}

.wp-block-details > :last-child {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-details > summary::after {
		transition: none;
	}
}

/* Fichier : une carte, le nom à gauche, « Télécharger » à droite. */

.wp-block-file {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-block: 12px;
	padding: 16px 16px 16px 24px;
	border-radius: 22px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 2px 6px color-mix(in srgb, var(--wp--preset--color--ink) 10%, transparent);
}

/* Le cœur réduit le texte du bloc à 0,8 em. */
.wp-block-file:not(.wp-element-button) {
	font-size: 16px;
}

/* Éditeur : le nom et le bouton sont dans une enveloppe. */
.wp-block-file__content-wrapper {
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
}

.wp-block-file > a:not(.wp-block-file__button),
.wp-block-file__content-wrapper > a:not(.wp-block-file__button) {
	flex: 1 1 12rem;
	font: 700 16px/22px var(--wp--preset--font-family--rounded);
	text-decoration: none;
}

.wp-block-file .wp-block-file__button {
	margin-left: 0;
}

/* Aperçu PDF : petite fenêtre illisible, vide sur téléphone. Le lien ouvre le PDF en plein écran. */
.wp-block-file__embed,
.wp-block-file__preview {
	display: none;
}

/* Tableau : lignes séparées d'un trait fin, sans grille. */

.wp-block-table table {
	border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
	padding: 12px 16px 12px 0;
	border: 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 12%, transparent);
	text-align: left;
	vertical-align: top;
}

.wp-block-table th,
.wp-block-table td:first-child {
	font: 700 16px/22px var(--wp--preset--font-family--rounded);
}

.wp-block-table tr:last-child > * {
	border-bottom: 0;
}

/* Téléphone : libellé au-dessus, valeur dessous. */
@media (max-width: 600px) {
	.wp-block-table tr > * {
		display: block;
		padding-right: 0;
	}

	.wp-block-table tr > :not(:last-child) {
		padding-bottom: 0;
		border-bottom: 0;
	}
}
