/* Thème Jereweb : styles complémentaires à theme.json */

:root {
	--jw-swoosh: #f6c21c;
}

:where(a, button, input, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--jaune);
	outline-offset: 3px;
	border-radius: 2px;
}

/* En-tête */
.jw-header a { color: inherit; text-decoration: none; }
.jw-header .wp-block-navigation a:hover,
.jw-header .wp-block-navigation a:focus-visible { color: var(--wp--preset--color--jaune); }
.jw-header .wp-block-site-logo img { height: auto; }

/* Accueil : bandeau d'ouverture */
.jw-hero { position: relative; }
.jw-hero-title { max-width: 17ch; margin-top: 0; font-size: clamp(2rem, 3.7vw, 3.3rem) !important; }
.jw-hero-text { max-width: 52ch; color: #d9dbf0; font-size: clamp(1.02rem, 1.25vw, 1.18rem) !important; }
.jw-wrap .jw-lead, .jw-wrap > p { max-width: 62ch; }
.jw-hero .is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--blanc);
	border: 2px solid rgba(255, 255, 255, .55);
}
.jw-hero .is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--jaune);
	color: var(--wp--preset--color--jaune);
}

/* Les quatre pôles, aux couleurs de leurs logos.
   Le trait jaune reprend le « swoosh » commun aux logos et fait la jonction avec le bandeau :
   le haut de chaque pôle est recouvert de la couleur du bandeau au-dessus du trait, pour que les couleurs s'arrêtent dessous. */
.jw-poles { position: relative; gap: 0 !important; margin-top: 0 !important; }
.jw-poles::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: clamp(38px, 5vw, 72px);
	transform: translateY(-7.5%);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H1200 V6 C 760 52 300 70 0 66 Z' fill='%2315173a'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	z-index: 2;
	pointer-events: none;
}
.jw-pole {
	position: relative;
	gap: 1rem !important;
	padding: calc(clamp(2.5rem, 5vw, 4rem) + clamp(38px, 5vw, 72px) * .6) clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
	min-height: 26rem;
	justify-content: flex-start;
}
.jw-pole > * { margin: 0 !important; }
.jw-pole-logo { margin-bottom: .5rem !important; }
.jw-pole-logo img { max-width: 100%; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.jw-pole-title { font-size: clamp(1.35rem, 1.75vw, 1.6rem) !important; hyphens: manual; }
.jw-pole p { color: rgba(255, 255, 255, .9); }
.jw-pole-link { margin-top: auto !important; padding-top: 1rem; font-weight: 700; }
.jw-pole--com { --jw-pc: var(--wp--preset--color--com); }
.jw-pole--net { --jw-pc: var(--wp--preset--color--net); }
.jw-pole--org { --jw-pc: var(--wp--preset--color--org); }
.jw-pole--tv { --jw-pc: var(--wp--preset--color--tv); }
/* Chaque carte de pôle est cliquable en entier (logo compris) ; le lien prend la forme d'une pastille avec une flèche. */
.jw-pole-link a {
	display: inline-flex;
	align-items: center;
	gap: .65rem;
	padding: .65rem 1.15rem;
	border: 1.5px solid rgba(255, 255, 255, .55);
	border-radius: 999px;
	color: #fff;
	font-size: .95rem;
	text-decoration: none;
	transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.jw-pole-link a::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.jw-pole-link a::after {
	content: "";
	width: 1.05rem; height: 1.05rem;
	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='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 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='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.jw-pole:hover .jw-pole-link a, .jw-pole-link a:focus-visible { background: #fff; border-color: #fff; color: var(--jw-pc, var(--wp--preset--color--encre)); }
.jw-pole:hover .jw-pole-link a::after { transform: translateX(4px); }
.jw-pole-link a:focus-visible { outline: none; }
.jw-pole:has(.jw-pole-link a:focus-visible) { outline: 3px solid var(--wp--preset--color--jaune); outline-offset: -3px; }
.jw-pole--org { background-image: radial-gradient(ellipse at 50% 0%, rgba(246, 194, 28, .16), transparent 60%); }

/* Sections */
.jw-lead { color: var(--wp--preset--color--gris); }
.jw-cas-item {
	position: relative;
	background: var(--wp--preset--color--blanc);
	border-radius: 14px;
	padding: clamp(1.4rem, 2.5vw, 2rem);
	box-shadow: 0 10px 30px rgba(21, 23, 58, .08);
	transition: transform .35s ease, box-shadow .35s ease;
}
.jw-cas-item:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(21, 23, 58, .16); }
.jw-cas-item h3 { margin-top: 0; }
/* Les étiquettes de pôles tiennent sur une ligne dans les cartes de projet. */
.jw-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.jw-tag {
	display: inline-block;
	padding: .2rem .55rem;
	font-size: .8125rem;
	border-radius: 999px;
	color: #fff;
	font-weight: 600;
	line-height: 1.5;
}
.jw-tag--com { background: var(--wp--preset--color--com); }
.jw-tag--net { background: var(--wp--preset--color--net); }
.jw-tag--org { background: var(--wp--preset--color--org); }
.jw-tag--tv { background: var(--wp--preset--color--tv); }


.jw-contact a { color: inherit; }
.jw-contact-card {
	background: var(--wp--preset--color--blanc);
	padding: clamp(1.5rem, 3vw, 2.5rem);
	border-left: 6px solid var(--wp--preset--color--accent);
	position: relative;
	border-radius: 0 14px 14px 0;
	box-shadow: 0 10px 30px rgba(21, 23, 58, .08);
}
.jw-pole-fr .jw-contact-card { border-left-color: var(--wp--preset--color--jaune); }
.jw-contact-phone { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.1; }
.jw-contact-phone a { text-decoration: none; }
.jw-contact-phone a:hover { text-decoration: underline; }

/* Pied de page */
.jw-footer a { color: inherit; text-decoration: none; }
.jw-footer a:hover { color: var(--wp--preset--color--jaune); text-decoration: underline; }
.jw-footer p { line-height: 1.9; }
.jw-footer .jw-footer-name { margin-bottom: .25rem; }

.jw-legal { margin-top: var(--wp--preset--spacing--50) !important; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .6); }

/* Pages de texte (mentions légales, confidentialité…) */
.jw-main:not(.jw-main--full) h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.5rem; }

/* ------------------------------------------------------------------
   Un site « vivant » : les cadres s'animent, comme sur le-purple.fr.
   ------------------------------------------------------------------ */

/* Trait jaune en haut des sections « Ce que nous faisons » et « Parlons de votre projet » : même courbe que sous le bandeau.
   Au-dessus du trait, la couleur de la section précédente ; en dessous, celle de la section. */
.jw-contact, .jw-trait {
	position: relative;
	--jw-avant: var(--wp--preset--color--papier);
	--jw-sous: var(--wp--preset--color--papier);
	padding-top: calc(var(--wp--preset--spacing--60) + clamp(1rem, 3vw, 2.5rem)) !important;
}
.jw-hero + .jw-contact, .jw-hero + .jw-trait { --jw-avant: var(--wp--preset--color--accent); }
.jw-blanc + .jw-contact, .jw-blanc + .jw-trait { --jw-avant: var(--wp--preset--color--blanc); }
.jw-contact::before, .jw-trait::before, .jw-contact::after, .jw-trait::after {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: clamp(30px, 4vw, 56px);
	transform: translateY(-70%);
	pointer-events: none;
}
.jw-contact::after, .jw-trait::after { background: linear-gradient(transparent 8%, var(--jw-sous) 8%); }
.jw-contact::before, .jw-trait::before {
	z-index: 1;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 66 C 300 70 760 52 1200 6' fill='none' stroke='%23f6c21c' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%, var(--jw-avant);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H1200 V6 C 760 52 300 70 0 66 Z'/%3E%3Cpath d='M0 66 C 300 70 760 52 1200 6' fill='none' stroke='%23000' stroke-width='9'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H1200 V6 C 760 52 300 70 0 66 Z'/%3E%3Cpath d='M0 66 C 300 70 760 52 1200 6' fill='none' stroke='%23000' stroke-width='9'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* Le trait jaune du bandeau se dessine de gauche à droite à l'ouverture de la page (animation dans le SVG). */
.jw-poles::after {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: clamp(38px, 5vw, 72px);
	transform: translateY(-7.5%);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cstyle%3Epath%7Bstroke-dasharray:1 2%3Bstroke-dashoffset:1%3Banimation:t 1.5s .45s cubic-bezier%28.65%2C0%2C.35%2C1%29 forwards%7D%40keyframes t%7Bto%7Bstroke-dashoffset:0%7D%7D%40media %28prefers-reduced-motion:reduce%29%7Bpath%7Banimation:none%3Bstroke-dashoffset:0%7D%7D%3C/style%3E%3Cpath pathLength='1' d='M0 66 C 300 70 760 52 1200 6' fill='none' stroke='%23f6c21c' stroke-width='9' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	z-index: 3;
	pointer-events: none;
}

/* Ouverture : le titre, le texte puis les boutons montent l'un après l'autre. */
.jw-hero-inner > * { animation: jw-monte .9s cubic-bezier(.2, .7, .2, 1) both; }
.jw-hero-inner > :nth-child(2) { animation-delay: .12s; }
.jw-hero-inner > :nth-child(3) { animation-delay: .24s; }
@keyframes jw-monte { from { opacity: 0; transform: translateY(24px); } }

/* Deux photos à droite du bandeau, légèrement inclinées, qui flottent ; une lumière fait le tour de leur cadre. */
.jw-hero-cols { gap: clamp(2rem, 5vw, 4.5rem) !important; }
.jw-hero-visuel { position: relative; min-height: clamp(300px, 30vw, 440px); }
.jw-photo {
	position: absolute;
	margin: 0 !important;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 26px 60px rgba(0, 0, 0, .5);
	animation: jw-monte 1s cubic-bezier(.2, .7, .2, 1) .35s both, jw-flotte 7s ease-in-out 1.4s infinite;
}
.jw-photo img { display: block; width: 100%; height: 100%; object-fit: cover; animation: jw-zoom 14s ease-in-out infinite alternate; }
.jw-photo--1 { top: 0; right: 0; width: 84%; aspect-ratio: 16 / 10; rotate: 2.5deg; }
.jw-photo--2 { bottom: 0; left: 0; width: 60%; aspect-ratio: 4 / 3; rotate: -4deg; z-index: 2; animation-delay: .55s, 2.6s; }
.jw-photo--2 img { animation-delay: -7s; }
@keyframes jw-flotte { 50% { translate: 0 -10px; } }
@keyframes jw-zoom { from { transform: scale(1); } to { transform: scale(1.09); } }

/* Lumière qui fait le tour des cadres (projets, carte de contact, bouton principal). */
@property --jw-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.jw-cas-item::after,
.jw-contact-card::after,
.jw-photo::after,
.jw-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
	padding: 2px;
	border-radius: inherit;
	background: conic-gradient(from var(--jw-angle), transparent 0 62%, rgba(246, 194, 28, .15) 70%, #f6c21c 84%, #fff 89%, transparent 94%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	animation: jw-tour 6s linear infinite;
	pointer-events: none;
}
.jw-cas-item:nth-child(2)::after { animation-delay: -2s; }
.jw-cas-item:nth-child(3)::after { animation-delay: -4s; }
.jw-contact-card::after { animation-duration: 8s; }
.jw-photo::after { padding: 3px; z-index: 1; animation-duration: 5s; }
.jw-photo--2::after { animation-delay: -2.5s; }
.jw-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { position: relative; }
.jw-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link::after {
	padding: 2px;
	background: conic-gradient(from var(--jw-angle), transparent 0 70%, #fff 85%, transparent 95%);
	animation-duration: 3.5s;
}
@keyframes jw-tour { to { --jw-angle: 360deg; } }

/* Boutons : légère montée au survol. */
.wp-block-button__link { transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease; }
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }

/* Pôles : un reflet balaie chaque panneau tour à tour, le logo s'anime au survol. */
.jw-pole { overflow: hidden; }
.jw-pole::after {
	content: "";
	position: absolute;
	top: 0; bottom: 0; left: -60%;
	width: 45%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .13) 45%, rgba(255, 255, 255, .22) 50%, transparent 60%);
	transform: skewX(-12deg);
	animation: jw-reflet 9s ease-in-out infinite;
	pointer-events: none;
}
.jw-pole:nth-child(2)::after { animation-delay: 1.2s; }
.jw-pole:nth-child(3)::after { animation-delay: 2.4s; }
.jw-pole:nth-child(4)::after { animation-delay: 3.6s; }
@keyframes jw-reflet { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.jw-pole-logo img { transition: transform .45s cubic-bezier(.2, .7, .2, 1.4); }
.jw-pole:hover .jw-pole-logo img { transform: scale(1.06) rotate(-2deg); }

/* Apparition au défilement (ajoutée par jereweb.js, seulement si le navigateur accepte les animations). */
.jw-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--jw-delai, 0s); }
.jw-reveal.is-in { opacity: 1; transform: none; }
.jw-cas-item.jw-reveal.is-in:hover { transform: translateY(-6px); transition-delay: 0s; }

/* Sites des pôles : cartes de services, étapes numérotées, rappel des autres pôles. */
.jw-cartes { gap: 1.25rem !important; margin-top: 2rem; }
.jw-cartes .jw-cas-item > * { margin-top: 0; margin-bottom: 0; }
.jw-cartes .jw-cas-item > * + * { margin-top: .6rem; }
.jw-cartes .jw-cas-item:nth-child(4)::after { animation-delay: -1s; }
.jw-cartes .jw-cas-item:nth-child(5)::after { animation-delay: -3s; }
.jw-cartes .jw-cas-item:nth-child(6)::after { animation-delay: -5s; }
.jw-etapes { counter-reset: jw-etape; margin-top: 2rem; }
.jw-etape { counter-increment: jw-etape; border-top: 3px solid var(--wp--preset--color--encre); padding-top: 1.1rem; }
.jw-etape h3 { margin-top: 0; }
.jw-etape h3::before { content: counter(jw-etape) ". "; }
.jw-blanc { background: var(--wp--preset--color--blanc); }
.jw-poles--plat::before, .jw-poles--plat::after { display: none; }
.jw-poles--plat .jw-pole { padding-top: clamp(2rem, 4vw, 3rem); min-height: 0; }
.jw-hero-visuel--seule { min-height: 0; }
.jw-photo--seule { position: relative; width: 100%; aspect-ratio: 16 / 10; rotate: 2deg; }
.jw-aussi-titre { margin: 0 !important; padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem) 0; }
/* « Jereweb, c'est aussi trois autres pôles » : un titre affirmé et trois cartes arrondies qui se soulèvent au survol. */
.jw-aussi { padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 5vw, 3rem) !important; }
.jw-aussi > * { max-width: 1240px; margin-inline: auto !important; }
.jw-aussi .jw-aussi-titre {
	padding: 0 0 clamp(1.75rem, 3.5vw, 2.75rem);
	font-family: var(--wp--preset--font-family--archivo, inherit);
	font-size: clamp(1.6rem, 3vw, 2.4rem) !important;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.02em;
}
.jw-poles--plat { gap: clamp(.9rem, 1.8vw, 1.5rem) !important; grid-template-columns: 1fr !important; }
@media (min-width: 900px) { .jw-poles--plat { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
.jw-poles--plat .jw-pole {
	border-radius: 22px;
	padding: clamp(1.75rem, 3vw, 2.4rem) !important;
	box-shadow: 0 0 0 rgba(0, 0, 0, 0);
	transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease;
}
.jw-poles--plat .jw-pole:hover, .jw-poles--plat .jw-pole:focus-within { transform: translateY(-8px); box-shadow: 0 28px 50px rgba(0, 0, 0, .45); }
.jw-poles--plat .jw-pole--org { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.jw-poles--plat .jw-pole--org:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 28px 50px rgba(0, 0, 0, .45); }

@media (max-width: 781px) {
	.jw-hero-title { font-size: clamp(1.85rem, 7.6vw, 2.3rem) !important; }
	.jw-hero-visuel { min-height: 0; aspect-ratio: 5 / 4; margin-top: 1rem; }
	.jw-hero-visuel--seule { aspect-ratio: auto; }
	.jw-photo--1 { right: 2%; width: 80%; }
	.jw-photo--2 { left: 2%; width: 58%; }
	.jw-pole { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
	.jw-pole::after { display: none; }
	.jw-reveal { opacity: 1; transform: none; }
}
