/*
Theme Name: Repy One
Theme URI: https://www.repyone.com
Author: La Ferme Graphique
Author URI: https://www.lafermegraphique.fr
Description: Thème bloc du site de Repy One, artiste graffiti & street art à Vichy.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.6.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: repyone
*/

/*
 * Ce fichier ne contient que ce que theme.json ne sait pas exprimer.
 */

html {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	scroll-behavior: smooth;
}

::selection {
	background: var(--wp--preset--color--rouge);
	color: var(--wp--preset--color--blanc);
}

a,
.wp-element-button,
.wp-block-button__link {
	transition: color var(--wp--custom--transition), background-color var(--wp--custom--transition), border-color var(--wp--custom--transition), opacity var(--wp--custom--transition);
}

a {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

img {
	height: auto;
}

/* En-tête, contenu et pied de page se touchent : pas d'espace entre eux. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Lien d'évitement */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--noir);
}

/* ---------- En-tête ---------- */

.site-header {
	position: relative;
	z-index: 100;
}

.site-header .wp-block-navigation a:hover,
.site-header .wp-block-social-links a:hover {
	opacity: 0.65;
}

.site-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--noir);
	color: var(--wp--preset--color--blanc);
}

/* ---------- Pied de page ---------- */

.site-footer .partner-logo img {
	opacity: 0.75;
	transition: opacity var(--wp--custom--transition);
}

.site-footer .partner-logo a:hover img {
	opacity: 1;
}

@media (max-width: 600px) {
	.site-footer .wp-block-group.alignwide {
		flex-direction: column;
		justify-content: center;
		gap: var(--wp--preset--spacing--40);
	}

	.site-footer .wp-block-image {
		margin-inline: auto;
	}
}

/* ---------- Page d'accueil ---------- */

/* Les sections pleine largeur s'enchaînent sans espace entre elles. */
.contenu-accueil > .alignfull {
	margin-block: 0;
}

.hero-accroche {
	letter-spacing: 0.3em;
	text-transform: uppercase;
	text-wrap: balance;
}

@media (max-width: 600px) {
	.hero-accroche {
		letter-spacing: 0.18em;
	}
}

/* ---------- Séparateur « trait court » ---------- */

.wp-block-separator.is-style-trait-court {
	width: 64px;
	max-width: 64px;
	margin-left: 0;
	margin-right: auto;
	border: 0;
	border-top: 2px solid var(--wp--preset--color--rouge);
	opacity: 1;
}

.has-text-align-center + .wp-block-separator.is-style-trait-court,
.is-layout-flex > .wp-block-separator.is-style-trait-court,
.wp-block-separator.is-style-trait-court.aligncenter {
	margin-left: auto;
}

/* ---------- Cartes projet ---------- */

.carte-projet .wp-block-post-featured-image {
	overflow: hidden;
	background: var(--wp--preset--color--surface);
}

.carte-projet .wp-block-post-featured-image img {
	transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 600ms ease;
}

.carte-projet:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.carte-projet .wp-block-post-title a:hover {
	color: var(--wp--preset--color--rouge);
}

/* ---------- Article (projet) ---------- */

.hero-article .wp-block-post-title {
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.hero-article .wp-block-post-terms a:hover {
	color: var(--wp--preset--color--rouge);
}

.chapeau {
	margin-bottom: var(--wp--preset--spacing--30);
	line-height: 1.5;
}

.chapeau .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/* Intertitres : un peu d'air au-dessus. */
.contenu-article > h2,
.contenu-article > h3 {
	margin-top: var(--wp--preset--spacing--50);
}

/* Colonnes sans alignement (ex. contenus déjà publiés) : plus larges que le
   texte, pour que les duos photo/texte respirent. */
.contenu-article > .wp-block-columns:not(.alignwide):not(.alignfull) {
	max-width: min(1080px, 100%);
	margin-block: var(--wp--preset--spacing--50);
}

.contenu-article .wp-block-columns {
	column-gap: var(--wp--preset--spacing--50);
}

.contenu-article .wp-block-column > h2:first-child,
.contenu-article .wp-block-column > h3:first-child {
	margin-top: 0;
}

.contenu-article .wp-block-image img {
	display: block;
	width: 100%;
}

.contenu-article .wp-block-image a {
	display: block;
	cursor: zoom-in;
}

.contenu-article figcaption,
.contenu-article .wp-element-caption {
	margin-top: 0.6em;
	text-align: left;
}

.photo-pleine-largeur figcaption {
	padding-inline: var(--wp--style--root--padding-left);
}

/* Fiche « En bref » */
.liste-fiche {
	padding-left: 0;
	list-style: none;
}

.liste-fiche li {
	padding-block: 0.35em;
	border-bottom: 1px solid var(--wp--preset--color--trait);
}

.liste-fiche li:last-child {
	border-bottom: 0;
}

.liste-fiche strong {
	font-weight: 500;
	color: var(--wp--preset--color--blanc);
}

/* Citation */
.wp-block-pullquote.citation {
	padding: var(--wp--preset--spacing--40) 0;
	text-align: left;
}

.wp-block-pullquote.citation cite {
	font-size: var(--wp--preset--font-size--x-small);
	font-style: normal;
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
	color: var(--wp--preset--color--gris);
}

/* Navigation entre projets */
.navigation-projets .post-navigation-link-previous,
.navigation-projets .post-navigation-link-next {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	text-transform: uppercase;
}

.navigation-projets .post-navigation-link__label {
	display: block;
	margin-bottom: 0.3em;
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	color: var(--wp--preset--color--gris);
}

.navigation-projets a {
	text-decoration: none;
}

.navigation-projets .post-navigation-link-previous .post-navigation-link__label::before {
	content: "← ";
}

.navigation-projets .post-navigation-link-next .post-navigation-link__label::after {
	content: " →";
}

/* ---------- Titres de page, archives, recherche ---------- */

.sur-titre {
	margin: 0;
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
}

.titre-page .wp-block-query-title,
.titre-page .wp-block-post-title {
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.titre-page .wp-block-term-description {
	max-width: 60ch;
	margin-top: var(--wp--preset--spacing--30);
}

/* Filtres « Tous / Peinture / Graffiti » */
.filtres-categories {
	gap: 0.5rem;
}

.filtres-categories p,
.filtres-categories .wp-block-categories {
	margin: 0;
}

.filtres-categories .wp-block-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	list-style: none;
}

.filtres-categories a {
	display: inline-block;
	padding: 0.5em 1.1em;
	border: 1px solid var(--wp--preset--color--trait);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-decoration: none;
	text-transform: uppercase;
	color: var(--wp--preset--color--creme);
}

.filtres-categories a:hover {
	border-color: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--blanc);
}

.filtres-categories .is-active a,
.filtres-categories .current-cat a {
	border-color: var(--wp--preset--color--blanc);
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--noir);
}

/* Pagination */
.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
}

.wp-block-query-pagination a {
	text-decoration: none;
}

.wp-block-query-pagination .page-numbers.current {
	color: var(--wp--preset--color--rouge);
}

/* Champ de recherche */
.wp-block-search.recherche .wp-block-search__inside-wrapper {
	max-width: 640px;
	border: 1px solid var(--wp--preset--color--trait);
	background: var(--wp--preset--color--surface);
}

.wp-block-search.recherche .wp-block-search__input {
	padding: 0.9em 1em;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--creme);
	font: inherit;
}

.wp-block-search.recherche .wp-block-search__input:focus {
	outline: 2px solid var(--wp--preset--color--blanc);
	outline-offset: -2px;
}

.wp-block-search.recherche .wp-block-search__button {
	margin: 0;
	border-width: 0 0 0 1px;
}

/* ---------- Formulaire de contact (Contact Form 7) ---------- */

.wpcf7 form > p {
	margin-block: 0 var(--wp--preset--spacing--30);
}

.wpcf7 label {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
	color: var(--wp--preset--color--gris);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.9em 1em;
	border: 1px solid var(--wp--preset--color--trait);
	border-radius: 0;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--creme);
	font: inherit;
	transition: border-color var(--wp--custom--transition);
}

.wpcf7 textarea {
	min-height: 10rem;
	resize: vertical;
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
	color: var(--wp--preset--color--gris);
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--blanc);
}

.wpcf7 input[type="submit"] {
	padding: 0.85em 1.75em;
	border: 1px solid var(--wp--preset--color--blanc);
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--blanc);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--wide);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 input[type="submit"]:focus-visible {
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--noir);
}

.wpcf7 .wpcf7-response-output {
	margin: var(--wp--preset--spacing--20) 0 0;
	padding: 0.75em 1em;
	border-color: var(--wp--preset--color--trait);
}

/* ---------- reCAPTCHA ---------- */

/* Badge flottant masqué : la mention obligatoire est affichée sous le
   formulaire (voir repyone_mention_recaptcha() dans functions.php). */
.grecaptcha-badge {
	visibility: hidden;
}

.mention-recaptcha {
	margin-top: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--gris);
}

.mention-recaptcha a {
	color: inherit;
}

/* ---------- Transitions entre les pages (View Transitions API) ---------- */

/*
 * Navigateurs compatibles (Chrome, Edge, Safari récents) : fondu entre les
 * pages, en-tête immobile, et l'image d'un projet glisse de sa carte jusqu'au
 * hero de l'article. Les autres navigateurs changent de page normalement.
 */
@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}

	.site-header {
		view-transition-name: en-tete;
	}

	::view-transition-old(root) {
		animation: 220ms ease both repyone-sortie;
	}

	::view-transition-new(root) {
		animation: 380ms ease both repyone-entree;
	}

	/* Images de projet (carte ↔ hero) */
	::view-transition-group(*) {
		animation-duration: 520ms;
		animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	::view-transition-old(*):only-child,
	::view-transition-new(*):only-child {
		animation-duration: 300ms;
	}

	::view-transition-image-pair(*) {
		overflow: hidden;
	}

	::view-transition-old(*),
	::view-transition-new(*) {
		height: 100%;
		object-fit: cover;
	}
}

@keyframes repyone-sortie {
	to {
		opacity: 0;
	}
}

@keyframes repyone-entree {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}

/* ---------- Apparition douce (remplace Blocks Animation) ---------- */

@media (prefers-reduced-motion: no-preference) {
	.is-style-apparition {
		animation: repyone-apparition 0.9s ease both;
	}
}

@keyframes repyone-apparition {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
