/* =========================================================
   AYGA – styles du thème enfant Twenty Twenty-Five
   ========================================================= */

:root {
	--ayga-deep: var(--wp--preset--color--accent-3, #0C3540);
	--ayga-river: var(--wp--preset--color--river, #1D6B74);
	--ayga-shallow: var(--wp--preset--color--accent-2, #7FB7B0);
	--ayga-clear: var(--wp--preset--color--base, #EDF4F2);
	--ayga-sun: var(--wp--preset--color--accent-1, #E8B23A);
	--ayga-ink: var(--wp--preset--color--contrast, #0E2429);
	--ayga-muted: var(--wp--preset--color--accent-4, #3D5A60);
	--ayga-radius: 10px;
	--ayga-radius-l: 28px;
}

body { overflow-x: hidden; }
:focus-visible { outline: 3px solid var(--ayga-sun); outline-offset: 3px; }

/* Polices du thème prioritaires sur celles imposées par une extension */
html body { font-family: var(--wp--preset--font-family--body); }
html body p, html body li { font-family: inherit; }
html body :is(h1, h2, h3, h4, h5, h6) { font-family: var(--wp--preset--font-family--display); }

/* Les sections s'enchaînent sans espace entre elles */
.ayga-main { margin-block: 0 !important; }
.ayga-main > * { margin-block: 0 !important; }
.wp-site-blocks > * + * { margin-block-start: 0 !important; }

.ayga-section { padding-block: clamp(4.5rem, 10vw, 7.5rem); }
.ayga-section h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); max-width: 18ch; }
.ayga-lead { font-size: 1.15rem; max-width: 62ch; color: var(--ayga-muted); }
.ayga-muted { color: var(--ayga-muted); max-width: 46ch; }
.has-accent-3-background-color .ayga-lead { color: #CFE2DF; }

/* ---------- En-tête ---------- */
.ayga-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 100;
	padding-block: 14px;
	transition: background-color .3s, box-shadow .3s;
}
.admin-bar .ayga-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ayga-header { top: 46px; } }
.ayga-header.is-solid,
body:not(:has(.ayga-hero)) .ayga-header {
	background: rgba(12, 53, 64, .94);
	backdrop-filter: blur(10px);
	box-shadow: 0 6px 30px rgba(0, 0, 0, .15);
}
body:not(:has(.ayga-hero)) .wp-site-blocks { padding-top: 90px; }
.ayga-logo img { background: #fff; border-radius: 10px; padding: 4px 8px; height: auto; }
.ayga-header__inner:has(.wp-block-site-logo img) .ayga-site-title { display: none; }
.ayga-site-title, .ayga-site-title a { color: #fff; text-decoration: none; font-family: var(--wp--preset--font-family--display); font-weight: 800; }

.ayga-header .ayga-nav { gap: 6px; color: #fff; }
.ayga-header .ayga-nav .wp-block-navigation-item__content {
	color: #fff;
	font-weight: 600;
	font-size: .95rem;
	padding: 8px 14px;
	border-radius: 99px;
	text-decoration: none;
	transition: background-color .2s;
}
.ayga-header .ayga-nav .wp-block-navigation-item__content:hover { background: rgba(255, 255, 255, .15); }
.ayga-header .ayga-nav .ayga-nav__cta .wp-block-navigation-item__content { background: var(--ayga-sun); color: var(--ayga-ink); }
.ayga-nav .wp-block-navigation__responsive-container-open { color: #fff; }
.ayga-nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--ayga-deep); }
.ayga-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.2rem; }
.ayga-nav .wp-block-navigation__responsive-container-close { color: #fff; }

/* ---------- Bandeau (accueil et pages) ---------- */
.ayga-hero { overflow: hidden; color: #fff; }
.ayga-hero .wp-block-cover__image-background { animation: ayga-drift 28s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes ayga-drift { from { transform: scale(1.04); } to { transform: scale(1.14) translate(-2%, 1.5%); } }
.ayga-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(12, 53, 64, .25) 0%, rgba(12, 53, 64, 0) 35%, rgba(12, 53, 64, .75) 88%);
}
.ayga-hero .wp-block-cover__inner-container { z-index: 3; padding-bottom: clamp(120px, 18vh, 200px); }
.ayga-hero--page .wp-block-cover__inner-container { padding-bottom: clamp(70px, 10vh, 110px); padding-top: 120px; }
.ayga-hero__title { font-size: clamp(2.8rem, 8.2vw, 7rem); max-width: 13ch; color: #fff; text-wrap: balance; }
.ayga-hero--page .ayga-hero__title { font-size: clamp(2.2rem, 5.5vw, 4.4rem); max-width: 20ch; }
.ayga-hero__lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 52ch; }
.ayga-hero__actions .is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, .6); background: transparent; }
.ayga-hero__actions .is-style-outline .wp-block-button__link:hover { background: rgba(255, 255, 255, .12); }

/* Animations d'entrée du bandeau d'accueil */
.js .ayga-hero__title .ayga-line { display: block; overflow: hidden; }
.js .ayga-hero__title .ayga-line > span { display: inline-block; transform: translateY(110%); animation: ayga-rise 1s cubic-bezier(.2, .8, .2, 1) forwards; }
.js .ayga-hero__title .ayga-line:nth-child(2) > span { animation-delay: .12s; }
.js .ayga-hero__title .ayga-line:nth-child(3) > span { animation-delay: .24s; }
.js .ayga-hero__lead, .js .ayga-hero__actions { opacity: 0; animation: ayga-fade 1s .6s forwards; }
.js .ayga-hero__actions { animation-delay: .8s; }
@keyframes ayga-rise { to { transform: none; } }
@keyframes ayga-fade { to { opacity: 1; } }

/* Ondulations et vagues (ajoutées par le script) */
.ayga-ripples { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.ayga-waves { position: absolute; left: 0; right: 0; bottom: -1px; height: 120px; z-index: 4; pointer-events: none; }
.ayga-hero--page .ayga-waves { height: 70px; }
.ayga-waves svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.ayga-waves path { fill: var(--ayga-wave, var(--ayga-clear)); }
.ayga-waves .w1 { animation: ayga-flow 14s linear infinite; opacity: .45; }
.ayga-waves .w2 { animation: ayga-flow 9s linear infinite reverse; opacity: .7; }
.ayga-waves .w3 { animation: ayga-flow 18s linear infinite; }
@keyframes ayga-flow { to { transform: translateX(-50%); } }
.ayga-hint { position: absolute; z-index: 4; right: 24px; bottom: 120px; font-size: .8rem; opacity: .75; display: flex; align-items: center; gap: 8px; color: #fff; }
.ayga-hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--ayga-sun); animation: ayga-pulse 2s infinite; }
@keyframes ayga-pulse { from { box-shadow: 0 0 0 0 rgba(232, 178, 58, .7); } to { box-shadow: 0 0 0 14px rgba(232, 178, 58, 0); } }

/* ---------- L'approche ---------- */
.ayga-approach .wp-block-columns { gap: clamp(2rem, 6vw, 70px); }
.ayga-phases { list-style: none; counter-reset: ayga-ph; padding: 0; display: grid; gap: 18px; }
.ayga-phases li {
	position: relative;
	background: #fff;
	border-radius: var(--ayga-radius);
	border-left: 4px solid var(--ayga-river);
	padding: 24px 26px 24px 84px;
	color: var(--ayga-muted);
}
.ayga-phases li::before {
	counter-increment: ayga-ph;
	content: counter(ayga-ph);
	position: absolute;
	left: 24px;
	top: 22px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--ayga-deep);
	color: #fff;
	display: grid;
	place-items: center;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
}
.ayga-phases br { display: none; }
.ayga-phases strong { font-weight: 700;  display: block; color: var(--ayga-ink); font-family: var(--wp--preset--font-family--display); font-size: 1.25rem; margin-bottom: 2px; }

/* ---------- Chiffres ---------- */
.ayga-figures { overflow: hidden; }
.ayga-figures .wp-block-columns { gap: 30px; }
.ayga-count {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.6rem, 5vw, 4.2rem);
	font-weight: 800;
	line-height: 1;
	color: var(--ayga-sun);
	margin-bottom: 0;
}
.ayga-count + p { color: #CFE2DF; max-width: 22ch; margin-top: 10px; }
.ayga-marquee-wrap {
	margin-top: clamp(3rem, 6vw, 70px) !important;
	border-block: 1px solid rgba(255, 255, 255, .15);
	padding-block: 18px;
	overflow: hidden;
	white-space: nowrap;
}
.ayga-marquee {
	display: inline-flex;
	gap: 48px;
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: none !important;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3rem;
	color: var(--ayga-shallow);
	animation: ayga-marq 60s linear infinite;
}
.ayga-marquee-wrap:hover .ayga-marquee { animation-play-state: paused; }
.ayga-marquee li::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ayga-sun);
	margin-left: 48px;
	vertical-align: middle;
}
@keyframes ayga-marq { to { transform: translateX(-50%); } }

/* ---------- Domaines ---------- */
.ayga-domains__head { margin-bottom: 46px; gap: 30px; }
.ayga-mosaic { display: grid !important; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 220px; gap: 14px; }
.ayga-mosaic > * { margin: 0 !important; max-width: none !important; }
.ayga-tile { min-height: 0 !important; border-radius: var(--ayga-radius); padding: 18px 20px !important; isolation: isolate; }
.ayga-tile .wp-block-cover__image-background { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.ayga-tile:hover .wp-block-cover__image-background,
.ayga-tile:focus-within .wp-block-cover__image-background { transform: scale(1.08); }
.ayga-tile::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, transparent 40%, rgba(12, 53, 64, .85));
}
.ayga-tile .wp-block-cover__inner-container { z-index: 2; width: 100%; }
.ayga-tile h3 { font-size: 1.35rem; margin: 0; }
.ayga-tile h3 a { color: #fff; text-decoration: none; }
.ayga-tile h3 a::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.ayga-tile h3 a:focus-visible { outline: none; }
.ayga-tile:has(a:focus-visible) { outline: 3px solid var(--ayga-sun); outline-offset: 3px; }
.ayga-tile--1 { grid-column: span 3; grid-row: span 2; }
.ayga-tile--2, .ayga-tile--3 { grid-column: span 3; }
.ayga-tile--4, .ayga-tile--5, .ayga-tile--6, .ayga-tile--7, .ayga-tile--8, .ayga-tile--9 { grid-column: span 2; }

/* ---------- Histoire ---------- */
.ayga-story .wp-block-columns { gap: clamp(2rem, 6vw, 70px); }
@media (min-width: 782px) {
	.ayga-story__intro { position: sticky; top: 110px; align-self: flex-start; }
}
.ayga-photo img { border-radius: var(--ayga-radius-l); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.ayga-timeline { position: relative; padding-left: 46px; }
.ayga-timeline::before { content: ""; position: absolute; left: 14px; top: 6px; bottom: 6px; width: 3px; background: #D7E6E3; border-radius: 3px; }
.ayga-timeline__fill { position: absolute; left: 14px; top: 6px; width: 3px; height: 0; background: linear-gradient(var(--ayga-shallow), var(--ayga-river)); border-radius: 3px; }
.ayga-step { position: relative; padding-bottom: 40px; margin: 0 !important; }
.ayga-step::before {
	content: "";
	position: absolute;
	left: -40px;
	top: 8px;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid #C3D8D4;
	box-sizing: border-box;
	transition: border-color .4s, background-color .4s;
}
.ayga-step.is-on::before { border-color: var(--ayga-river); background: var(--ayga-sun); }
.ayga-year { font-family: var(--wp--preset--font-family--display); font-weight: 800; font-size: 2rem; color: var(--ayga-river); margin: 0; line-height: 1.2; }
.ayga-step h3 { font-size: 1.2rem; margin: 4px 0 6px; }
.ayga-step p:not(.ayga-year) { color: var(--ayga-muted); max-width: 56ch; margin: 0; }
.ayga-mission { border-radius: var(--ayga-radius); padding: 26px 28px; }
.ayga-mission h3 { font-size: 1.2rem; }
.ayga-mission ul { color: var(--ayga-muted); padding-left: 20px; }

/* ---------- Références ---------- */
.ayga-refs__tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 36px 0 26px; }
.ayga-chip {
	border: 2px solid var(--ayga-river);
	background: transparent;
	color: var(--ayga-deep);
	font: 600 .95rem var(--wp--preset--font-family--body);
	padding: 9px 18px;
	border-radius: 99px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.ayga-chip[aria-pressed="true"] { background: var(--ayga-deep); border-color: var(--ayga-deep); color: #fff; }
.ayga-refs__search { flex: 1; min-width: 220px; }
.ayga-refs__search input {
	width: 100%;
	font: inherit;
	padding: 11px 18px 11px 44px;
	border-radius: 99px;
	border: 2px solid #C3D8D4;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%233D5A60' stroke-width='2.4' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
}
.ayga-refs__search input:focus { border-color: var(--ayga-river); outline: none; }
.ayga-refs__count { color: var(--ayga-muted); font-size: .95rem; margin-bottom: 18px; }
.ayga-refs__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ayga-ref { background: #fff; border-radius: var(--ayga-radius); padding: 20px 22px; border-top: 3px solid var(--c, var(--ayga-river)); }
.ayga-ref[hidden] { display: none; }
.ayga-ref.is-new { animation: ayga-pop .35s ease; }
@keyframes ayga-pop { from { opacity: 0; transform: translateY(8px); } }
.ayga-ref h3 { font-family: var(--wp--preset--font-family--body); font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: 0; margin: 0; }
.ayga-ref p { font-size: .9rem; color: #4A666B; margin: 6px 0 0; }
.ayga-ref__who { display: inline-block; margin-top: 10px; font-size: .85rem; font-weight: 600; color: var(--ayga-deep); background: var(--ayga-clear); padding: 4px 10px; border-radius: 99px; }
.ayga-refs__more { margin-top: 26px; text-align: center; }
.ayga-refs__more[hidden] { display: none; }
.ayga-refs__more .wp-element-button { background: var(--ayga-deep); color: #fff; border: 0; cursor: pointer; }
.ayga-refs__none { padding: 40px; text-align: center; color: var(--ayga-muted); background: #fff; border-radius: var(--ayga-radius); }

/* ---------- Contact ---------- */
.ayga-contact .wp-block-columns { gap: clamp(2rem, 6vw, 70px); }
.ayga-contact h2 { max-width: 14ch; }
.ayga-coords { list-style: none; padding: 0; margin-top: 34px; display: grid; gap: 16px; font-size: 1.05rem; }
.ayga-coords li { display: flex; align-items: center; gap: 14px; }
.ayga-coords li::before {
	content: "";
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1) var(--ico) no-repeat center / 22px;
}
.ayga-coords a { color: #fff; text-decoration: none; }
.ayga-coords a:hover { color: var(--ayga-sun); }
.ayga-coords__adresse { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23E8B23A' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 22s7-6.2 7-12a7 7 0 1 0-14 0c0 5.8 7 12 7 12Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E"); }
.ayga-coords__tel { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23E8B23A' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E"); }
.ayga-coords__mail { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23E8B23A' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.ayga-coords__fb { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23E8B23A' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M15 3h-2a4 4 0 0 0-4 4v3H7v4h2v7h4v-7h3l1-4h-4V7a1 1 0 0 1 1-1h2Z'/%3E%3C/svg%3E"); }

.ayga-form { background: #fff; color: var(--ayga-ink); border-radius: var(--ayga-radius-l); padding: 34px; }
.ayga-form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.ayga-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.ayga-form textarea,
.ayga-form select {
	font: inherit;
	font-weight: 400;
	padding: 12px 14px;
	border-radius: var(--ayga-radius);
	border: 2px solid #D7E6E3;
	background: var(--ayga-clear);
	width: 100%;
	max-width: 100%;
}
.ayga-form input:focus, .ayga-form textarea:focus, .ayga-form select:focus { border-color: var(--ayga-river); outline: none; background: #fff; }
.ayga-form button[type="submit"], .ayga-form .wpforms-submit {
	background: var(--ayga-river) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 99px !important;
	padding: 15px 26px !important;
	font-weight: 600 !important;
	cursor: pointer;
}
.ayga-form__note { font-size: .85rem; color: #4A666B; }

/* ---------- Pages intérieures ---------- */
.ayga-page { padding-block: clamp(3rem, 7vw, 5rem); }

/* ---------- Pied de page ---------- */
.ayga-footer { padding-block: 34px; font-size: .9rem; }
.ayga-footer p { margin: 0; }
.ayga-footer a { color: #CFE2DF; }

/* ---------- Apparition au défilement ---------- */
.js .ayga-reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .ayga-reveal.is-in { opacity: 1; transform: none; }
.block-editor-page .ayga-reveal, .editor-styles-wrapper .ayga-reveal { opacity: 1 !important; transform: none !important; }

/* Éditeur : en-tête non fixe pour pouvoir le modifier */
.editor-styles-wrapper .ayga-header { position: relative; background: var(--ayga-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.ayga-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
	.ayga-mosaic .ayga-tile { grid-column: span 1; grid-row: span 1; }
	.ayga-mosaic .ayga-tile--1 { grid-column: span 2; grid-row: span 2; }
	.ayga-refs__list { grid-template-columns: 1fr; }
}
@media (max-width: 781px) {
	.ayga-hint { display: none; }
	.ayga-form { padding: 24px; }
	.ayga-figures .wp-block-columns { display: grid !important; grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
	.js .ayga-hero__title .ayga-line > span { transform: none; }
	.js .ayga-hero__lead, .js .ayga-hero__actions { opacity: 1; }
	.js .ayga-reveal { opacity: 1; transform: none; }
}
