/*
Theme Name: Amandine Viard
Theme URI: https://amandine-viard.dev-commpagnie.com
Author: Commpagnie
Description: Thème sur-mesure du cabinet de psychologie Amandine Viard (Saint-Max / Nancy). Direction « La Maison » — sombre & or, menu overlay.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: amandine-viard
*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: #0E0B08;
	font-family: 'Mulish', sans-serif;
	color: #23201A;
	-webkit-font-smoothing: antialiased;
}
::selection { background: #B05636; color: #F4F1E8; }

@keyframes avfloat {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-7px); }
}

/* Accessibilité — lien d'évitement */
.av-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 200;
	background: #C6A35A;
	color: #0E0B08;
	padding: 12px 20px;
	font-size: 12px;
	letter-spacing: .2em;
	text-transform: uppercase;
	text-decoration: none;
}
.av-skip:focus { left: 0; }

/* Barre admin : le header sticky doit passer dessous */
.admin-bar header[data-av-header] { top: 32px; }
@media screen and (max-width: 782px) {
	.admin-bar header[data-av-header] { top: 46px; }
}

/* -------------------------------------------------------------------------
 * Loader d'entrée — losange qui se dessine + logo
 *
 * Règles de sûreté :
 *  - il n'apparaît QUE si le script inline du <head> a posé `.av-loading`
 *    (donc jamais sans JS, jamais en `prefers-reduced-motion`, et une seule
 *    fois par session) ;
 *  - il ne bloque jamais le scroll ;
 *  - une animation CSS le fait disparaître à 3,4 s même si le JS de sortie
 *    n'a pas tourné → il ne peut pas rester coincé devant le site.
 * ---------------------------------------------------------------------- */
.av-loader { display: none; }
.av-loading .av-loader {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: center;
	justify-content: center;
	background-color: #0E0B08;
	background-image: url(assets/lattice.svg);
	background-size: 64px 64px;
	animation: avLoaderFailsafe .6s 3.4s forwards;
}
.av-loader.is-done { opacity: 0; visibility: hidden; transition: opacity .7s cubic-bezier(.2,.7,.2,1), visibility .7s; }
.av-loader__inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.av-loader__mark { width: 92px; height: 92px; display: block; }
/* Le tracé doit valoir la longueur réelle du contour, sinon le trait reste
   partiellement visible au départ. Losange ext. = 88, int. = 60, branches = 9. */
.av-loader__mark [data-draw] { animation: avDraw 1s cubic-bezier(.5,0,.2,1) forwards; }
.av-loader__mark [data-draw="1"] { stroke-dasharray: 88; stroke-dashoffset: 88; }
.av-loader__mark [data-draw="2"] { stroke-dasharray: 60; stroke-dashoffset: 60; animation-delay: .12s; }
.av-loader__mark [data-draw="3"] { stroke-dasharray: 9;  stroke-dashoffset: 9;  animation-delay: .24s; }
.av-loader__logo {
	width: 160px;
	height: auto;
	display: block;
	opacity: 0;
	transform: translateY(10px);
	animation: avLoaderLogo .7s .45s cubic-bezier(.2,.7,.2,1) forwards;
}
.av-loader__bar { position: relative; width: 140px; height: 1px; background: rgba(198,163,90,.25); overflow: hidden; }
.av-loader__bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: #C6A35A; animation: avLoaderBar 1.2s .2s cubic-bezier(.3,0,.2,1) forwards; }

@keyframes avDraw       { to { stroke-dashoffset: 0; } }
@keyframes avLoaderLogo { to { opacity: 1; transform: none; } }
@keyframes avLoaderBar  { to { width: 100%; } }
@keyframes avLoaderFailsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
