/* ==========================================================================
   The Funky Way — styles complémentaires à theme.json
   ========================================================================== */

:root {
	--tfw-ink: var(--wp--preset--color--ink, #101010);
	--tfw-paper: var(--wp--preset--color--paper, #fff);
	--tfw-volt: var(--wp--preset--color--volt, #e1ff00);
	--tfw-mute: var(--wp--preset--color--mute, #595959);
	--tfw-hair: var(--wp--preset--color--hair, #d6d6d6);
	--tfw-pad: clamp(1.25rem, 4vw, 3rem);
	--tfw-content: 1264px;
	/* marge gauche réelle du contenu, quelle que soit la largeur d'écran */
	--tfw-gutter: max(var(--tfw-pad), calc((100vw - var(--tfw-content)) / 2));
	--tfw-ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; }
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01" on;
}
::selection { background: var(--tfw-volt); color: var(--tfw-ink); }

:where(h1, h2, h3, h4) { margin-block: 0; text-wrap: balance; }
:where(p) { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--tfw-violet, #7200ff); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   En-tête
   ----------------------------------------------------------------------- */
.tfw-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .95);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color .3s var(--tfw-ease);
}
.admin-bar .tfw-site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.tfw-site-header.is-scrolled { border-bottom-color: var(--tfw-hair); }

.tfw-logo img { width: 46px; height: auto; }

.tfw-nav .wp-block-navigation-item__content,
.tfw-footer-nav .wp-block-navigation-item__content {
	position: relative;
	padding-block: .25rem;
}
.tfw-nav .wp-block-navigation-item__content::after,
.tfw-footer-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform .35s var(--tfw-ease);
}
.tfw-nav .wp-block-navigation-item__content:hover::after,
.tfw-nav .current-menu-item > .wp-block-navigation-item__content::after,
.tfw-footer-nav .wp-block-navigation-item__content:hover::after {
	transform: scaleX(1);
	transform-origin: left;
}

/* Menu mobile */
.tfw-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--tfw-paper);
	padding: var(--tfw-pad);
}
.tfw-nav .is-menu-open .wp-block-navigation__container {
	gap: 1.1rem;
	font-size: 2rem;
	font-weight: 800;
	letter-spacing: -.03em;
}

/* --------------------------------------------------------------------------
   Styles de blocs : surtitre, lien fléché, chapo, bouton fléché
   ----------------------------------------------------------------------- */
.is-style-surtitre,
.is-style-surtitre a {
	font-size: .68rem !important;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--tfw-ink);
}
.tfw-terms-plain a { text-decoration: none; }

.is-style-lien-fleche a {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	padding-bottom: .3rem;
	border-bottom: 1px solid currentColor;
	font-weight: 500;
	text-decoration: none;
}
.is-style-lien-fleche a::after,
.is-style-fleche .wp-block-button__link::after {
	content: "↗";
	display: inline-block;
	font-size: .85em;
	transition: transform .35s var(--tfw-ease);
}
.is-style-lien-fleche a:hover::after,
.is-style-fleche .wp-block-button__link:hover::after { transform: translate(2px, -2px); }

.is-style-fleche .wp-block-button__link { display: inline-flex; align-items: center; gap: .9rem; }

.is-style-chapo {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
	max-width: 17rem;
}

/* --------------------------------------------------------------------------
   Mise en page générale
   ----------------------------------------------------------------------- */
.tfw-main { padding-top: 0; padding-bottom: 0; }
.tfw-main > * + * { margin-block-start: 0; }

.tfw-section { padding-block: var(--wp--preset--spacing--50); }
.tfw-section + .tfw-section { padding-top: 0; }

.tfw-page-head {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--40);
}
.tfw-page-head > * + * { margin-block-start: 1.25rem; }

.tfw-split { gap: 2rem; margin-bottom: 0; }
.tfw-split__aside .is-style-chapo { margin-left: auto; }
.tfw-align-right { display: flex; justify-content: flex-end; }

.tfw-section-head { margin-bottom: 1.4rem; }

.tfw-ruled {
	border-top: 1px solid var(--tfw-ink);
	padding-top: 1.4rem;
	margin-bottom: 1.2rem;
}

/* --------------------------------------------------------------------------
   Accueil — Hero
   ----------------------------------------------------------------------- */
.tfw-hero {
	position: relative;
	margin-block-start: 0 !important;
}
.tfw-hero__title {
	margin: 1.4rem 0 1.6rem;
	white-space: nowrap;
}
.tfw-hero__lead {
	max-width: 15rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	margin-bottom: 1.6rem;
}
.tfw-hero__media { margin: 0; overflow: hidden; }
.tfw-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	animation: tfw-zoom-out 1.6s var(--tfw-ease) both;
}

@media (min-width: 782px) {
	.tfw-hero {
		display: grid;
		grid-template-columns:
			var(--tfw-gutter)
			calc((100vw - 2 * var(--tfw-gutter)) * .37)
			minmax(0, 1fr);
		align-items: center;
		min-height: clamp(420px, 48vw, 720px);
		padding: 0 !important;
	}
	.tfw-hero__text {
		grid-column: 2 / 4;
		grid-row: 1;
		position: relative;
		z-index: 2;
		padding-block: var(--wp--preset--spacing--40);
		pointer-events: none;
	}
	.tfw-hero__text a { pointer-events: auto; }
	.tfw-hero__media {
		grid-column: 3 / 4;
		grid-row: 1;
		align-self: stretch;
	}
}
@media (max-width: 781px) {
	.tfw-hero { padding-inline: var(--tfw-pad) !important; }
	.tfw-hero__text { padding-block: var(--wp--preset--spacing--40); }
	.tfw-hero__title { white-space: normal; }
	.tfw-hero__media {
		margin-inline: calc(-1 * var(--tfw-pad));
		aspect-ratio: 4 / 3;
	}
}

/* --------------------------------------------------------------------------
   Cartes projets
   ----------------------------------------------------------------------- */
.tfw-card { position: relative; }
.tfw-card__media { margin: 0; overflow: hidden; background: #f1f1f1; }
.tfw-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .9s var(--tfw-ease);
}
.tfw-card:hover .tfw-card__media img { transform: scale(1.035); }

.tfw-card__meta {
	position: relative;
	padding: .95rem 1.75rem .9rem 0;
	border-bottom: 1px solid var(--tfw-hair);
}
.tfw-card__meta > * { margin: 0; }
.tfw-card__meta > * + * { margin-top: .15rem; }
.tfw-card__meta::after {
	content: "↗";
	position: absolute;
	right: 0;
	top: .95rem;
	font-size: .8rem;
	transition: transform .35s var(--tfw-ease);
}
.tfw-card:hover .tfw-card__meta::after { transform: translate(2px, -2px); }

.tfw-card__title a { text-decoration: none; }
.tfw-card__title a::before { /* toute la carte est cliquable */
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.tfw-card__terms { position: relative; z-index: 2; }
.tfw-card__terms a { color: inherit; text-decoration: none; }
.tfw-card__terms a:hover { color: var(--tfw-ink); }

/* Accueil : grille décalée */
@media (min-width: 782px) {
	.tfw-stagger .wp-block-post-template {
		grid-template-columns: 1.75fr 1.4fr 1fr !important;
		gap: 1.1rem;
		align-items: start;
	}
	.tfw-stagger .wp-block-post-template > li:nth-child(2) { margin-top: 3.5rem; }
	.tfw-stagger .wp-block-post-template > li:nth-child(3) { margin-top: 2.5rem; }
}
.tfw-stagger li:nth-child(1) .tfw-card__media { aspect-ratio: 4 / 5; }
.tfw-stagger li:nth-child(2) .tfw-card__media { aspect-ratio: 4 / 5; }
.tfw-stagger li:nth-child(3) .tfw-card__media { aspect-ratio: 7 / 8; }

/* Archives */
.tfw-archive .wp-block-post-template { gap: 2.5rem 1.1rem; }
@media (max-width: 781px) {
	.tfw-archive .wp-block-post-template,
	.tfw-stagger .wp-block-post-template { grid-template-columns: 1fr !important; }
}

/* --------------------------------------------------------------------------
   Accueil — Univers
   ----------------------------------------------------------------------- */
.tfw-univers__grid {
	gap: 0 !important;
	margin-top: var(--wp--preset--spacing--40);
}
.tfw-univers__item {
	position: relative;
	padding: 1rem 1.5rem 1.25rem 0;
}
.tfw-univers__item + .tfw-univers__item {
	border-left: 1px solid var(--tfw-hair);
	padding-left: .1rem;
}
.tfw-univers__item > * { margin: 0; }
.tfw-univers__num { margin-bottom: 2rem !important; }
.tfw-univers__title { font-weight: 700; letter-spacing: -.02em; margin-bottom: .55rem !important; }
.tfw-univers__title a { text-decoration: none; }
.tfw-univers__title a::before { content: ""; position: absolute; inset: 0; }
.tfw-univers__title::after {
	content: "↗";
	position: absolute;
	right: 1.2rem;
	font-size: .8rem;
	margin-top: .3rem;
	transition: transform .35s var(--tfw-ease);
}
.tfw-univers__item:hover .tfw-univers__title::after { transform: translate(2px, -2px); }
.tfw-univers__item > p:last-child { max-width: 11.5rem; line-height: 1.45; }

@media (max-width: 781px) {
	.tfw-split__aside .is-style-chapo { margin-left: 0; }
	.tfw-align-right { justify-content: flex-start; }
	.tfw-univers__item + .tfw-univers__item {
		border-left: 0;
		border-top: 1px solid var(--tfw-hair);
		padding-left: 0;
	}
	.tfw-univers__num { margin-bottom: .75rem !important; }
}

/* --------------------------------------------------------------------------
   Bandeau volt + appel à contact
   ----------------------------------------------------------------------- */
.tfw-band { margin-block: var(--wp--preset--spacing--30) 0 !important; }
.tfw-band h2 { line-height: 1.02; }

.tfw-cta h2 { font-weight: 700; letter-spacing: -.035em; line-height: 1.12; }

/* --------------------------------------------------------------------------
   Pied de page
   ----------------------------------------------------------------------- */
.tfw-footer { border-top: 1px solid #ececec; }
.tfw-footer .wp-block-navigation { font-weight: 500; }
.wp-block-navigation-item__content, .wp-block-button__link { white-space: nowrap; }
.tfw-copyright { margin: 0; }

/* --------------------------------------------------------------------------
   Page projet
   ----------------------------------------------------------------------- */
.tfw-project-cover img { width: 100%; height: auto; }
.tfw-content { padding-block: var(--wp--preset--spacing--40); }
.tfw-project-nav { border-top: 1px solid var(--tfw-hair); margin-top: var(--wp--preset--spacing--40); }
.tfw-project-nav a { text-decoration: none; font-weight: 600; }

/* --------------------------------------------------------------------------
   Animations d'apparition
   ----------------------------------------------------------------------- */
@keyframes tfw-zoom-out { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes tfw-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.tfw-hero__text > * { animation: tfw-rise .9s var(--tfw-ease) both; }
.tfw-hero__text > *:nth-child(2) { animation-delay: .08s; }
.tfw-hero__text > *:nth-child(3) { animation-delay: .16s; }
.tfw-hero__text > *:nth-child(4) { animation-delay: .24s; }

.tfw-reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--tfw-ease), transform .9s var(--tfw-ease); }
.tfw-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.tfw-reveal { opacity: 1; transform: none; }
}

/* Dans l'éditeur, tout reste visible */
.editor-styles-wrapper .tfw-reveal { opacity: 1; transform: none; }
