/*
Theme Name:   Graphothérapeute
Theme URI:    https://example.com/
Author:       Cabinet de graphothérapie
Description:  Thème sur-mesure, léger et accessible pour un cabinet de graphothérapie (Peggy Volery – Hyères). Contenus éditables via Apparence > Personnaliser.
Version:      1.3.0
Requires at least: 6.4
Requires PHP: 8.0
License:      GPL-2.0-or-later
Text Domain:  grapho
*/

/* =========================================================================
   0. POLICES AUTO-HÉBERGÉES (aucun appel à Google → RGPD + performance)
   Fichiers woff2 réduits au jeu latin (≈ 19 Ko par graisse Nunito).
   Les polices « Fallback » ajustent Arial aux proportions des vraies polices :
   le texte ne « saute » pas quand la police se charge (CLS ≈ 0).
   ========================================================================= */
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito-semibold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('assets/fonts/caveat-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Nunito Fallback';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 99.51%; ascent-override: 101.59%; descent-override: 35.47%; line-gap-override: 0%;
}
@font-face {
  font-family: 'Caveat Fallback';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 74.34%; ascent-override: 129.14%; descent-override: 40.36%; line-gap-override: 0%;
}

/* =========================================================================
   1. VARIABLES (charte graphique)
   ========================================================================= */
:root {
  --color-sage: #8CA082;
  --color-sage-light: #DDE4D6;
  --color-terracotta: #CF8163;
  --color-terracotta-dark: #A85A3D;   /* variante AA pour textes/boutons (contraste ≥ 4.5:1 avec le blanc) */
  --color-terracotta-light: #F3D9CC;
  --color-sand: #F1E6CF;
  --color-bg-light: #F8F6F0;
  --color-white: #FFFFFF;
  --color-forest: #3B5249;
  --color-text: #2C3E35;
  --color-muted: #55665D;              /* gris-vert lisible (≈ 5.9:1 sur fond crème) */
  --color-line: #E3DED2;

  --font-primary: 'Nunito', 'Nunito Fallback', system-ui, sans-serif;
  --font-heading: 'Nunito', 'Nunito Fallback', system-ui, sans-serif;
  --font-handwritten: 'Caveat', 'Caveat Fallback', cursive;

  --radius-organic: 40px 120px 40px 80px;
  --radius-blob: 62% 38% 55% 45% / 48% 58% 42% 52%;
  --radius-pill: 999px;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 8vw, 104px);
  --shadow-soft: 0 10px 30px -12px rgba(59, 82, 73, .25);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* =========================================================================
   2. BASE & RESET LÉGER
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg-light);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--color-forest); text-underline-offset: 3px; }
a:hover { color: var(--color-terracotta-dark); }
h1, h2, h3 { font-family: var(--font-heading); color: var(--color-forest); line-height: 1.2; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

/* Focus visible pour la navigation clavier (WCAG 2.4.7) */
:focus-visible { outline: 3px solid var(--color-terracotta-dark); outline-offset: 3px; border-radius: 6px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; margin: 0; z-index: 1000;
  top: 12px; left: 12px; padding: 12px 20px; background: var(--color-white);
  color: var(--color-forest); border-radius: 8px; box-shadow: var(--shadow-soft);
}

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.handwritten { font-family: var(--font-handwritten); font-weight: 400; line-height: 1.15; color: var(--color-forest); }

/* Petit trait décoratif au-dessus des titres de section */
.section-title { position: relative; padding-top: 22px; }
.section-title::before {
  content: ""; position: absolute; top: 0; left: 0; width: 40px; height: 2px; background: var(--color-forest);
}
.section-title--center { text-align: center; padding-top: 0; }
.section-title--center::before { display: none; }
.section-intro { color: var(--color-muted); max-width: 46ch; }

/* =========================================================================
   3. BOUTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .85em 1.6em; border-radius: var(--radius-pill);
  font: 600 .95rem/1.2 var(--font-primary); text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--primary { background: var(--color-terracotta-dark); color: var(--color-white); box-shadow: 0 8px 20px -10px rgba(168, 90, 61, .7); }
.btn--primary:hover { background: #8F4A31; color: var(--color-white); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--color-forest); border-color: var(--color-forest); }
.btn--ghost:hover { background: var(--color-forest); color: var(--color-white); }

/* =========================================================================
   4. HEADER
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 246, 240, .92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-color: var(--color-line); box-shadow: 0 4px 18px -14px rgba(0, 0, 0, .3); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }

.site-brand { flex-shrink: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-forest); }
.site-brand__icon { width: 44px; color: var(--color-sage); }
.site-brand__name { font-family: var(--font-handwritten); font-size: 2.3rem; line-height: 1; display: block; }
.site-brand__tagline { white-space: nowrap; display: block; font-size: .62rem; letter-spacing: .28em; text-transform: uppercase; margin-top: 4px; }
.site-brand__text { display: block; }
.site-brand__logo { max-height: 64px; width: auto; }
.site-brand--footer .site-brand__logo { max-height: 44px; }

.main-nav__list { list-style: none; display: flex; gap: clamp(12px, 1.5vw, 26px); }
.main-nav li { white-space: nowrap; }
.main-nav__list a {
  font-size: .9rem; text-decoration: none; color: var(--color-text);
  padding-block: 6px; position: relative;
}
.main-nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--color-terracotta); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.main-nav__list a:hover::after,
.main-nav__list .current-menu-item > a::after,
.main-nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav__list .current-menu-item > a, .main-nav__list a[aria-current="page"] { color: var(--color-terracotta-dark); }
.header-cta--mobile { display: none; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--color-forest);
}
.nav-toggle__bar { display: block; width: 26px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle__bar + .nav-toggle__bar { margin-top: 6px; }
/* 1er enfant du bouton = libellé pour lecteurs d'écran → les barres sont les enfants 2 à 4 */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(4) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1240px) {
  .nav-toggle { display: block; }
  .header-cta--desktop { display: none; }
  .main-nav {
    position: fixed; inset: 84px 0 auto 0; max-height: calc(100vh - 84px); overflow-y: auto;
    background: var(--color-bg-light); border-top: 1px solid var(--color-line);
    padding: 24px var(--gutter) 32px; box-shadow: var(--shadow-soft);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    /* visibility bascule tout de suite à l'ouverture (focus possible), après le fondu à la fermeture */
    transition: transform .3s var(--ease), opacity .3s, visibility 0s linear .3s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .main-nav__list { flex-direction: column; gap: 4px; }
  .main-nav__list a { display: inline-block; font-size: 1.1rem; padding: 10px 0; }
  .header-cta--mobile { display: inline-flex; margin-top: 20px; }
  body.nav-open { overflow: hidden; }
}

/* =========================================================================
   5. HERO
   ========================================================================= */
.hero { padding-block: clamp(32px, 5vw, 64px) clamp(40px, 6vw, 80px); overflow: hidden; }
.hero__grid { display: grid; gap: 40px; align-items: center; }
.hero__kicker {
  display: flex; width: fit-content; align-items: center; gap: 14px;
  font-family: var(--font-primary); line-height: 1.4;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: var(--color-terracotta-dark); margin-bottom: 18px;
}
.hero__kicker::after { content: ""; width: 26px; height: 1.5px; background: currentColor; }
.hero__title { font-weight: 400; position: relative; }
.hero__title-main { display: block; }
.hero__title em { font-family: var(--font-handwritten); font-style: normal; font-size: 1.25em; display: inline-block; }
.hero__leaves { position: absolute; width: 70px; right: -10px; top: 40%; color: var(--color-sage); }
.hero__text { max-width: 46ch; margin-bottom: 28px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__media { position: relative; }
.hero__image {
  width: 100%; aspect-ratio: 4 / 3.1; object-fit: cover;
  border-radius: var(--radius-organic);
}
.hero__note {
  position: absolute; right: 6%; bottom: 6%;
  background: rgba(248, 246, 240, .88); padding: 14px 20px; border-radius: 22px 40px 18px 34px;
  font-size: 1.75rem; transform: rotate(-6deg); max-width: 220px; text-align: center;
}
@media (max-width: 899px) { .hero__note { font-size: 1.3rem; max-width: 180px; padding: 10px 14px; } }
.hero__note svg { width: 22px; display: inline; vertical-align: middle; color: var(--color-terracotta-dark); }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1fr 1.1fr; }
  .hero__image { border-radius: 46% 0 0 54% / 60% 0 0 40%; aspect-ratio: 4 / 3.3; } /* découpe façon maquette */
  .hero__media { margin-right: calc(-1 * max(var(--gutter), (100vw - var(--container)) / 2)); }
}

/* ----- Bénéfices (3 badges) ----- */
.benefits { padding-block: 24px var(--section-y); position: relative; isolation: isolate; }
.benefits__list { list-style: none; display: grid; gap: 36px; text-align: center; }
.benefit__icon {
  width: 104px; height: 92px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: var(--radius-blob); color: var(--color-white); position: relative;
}
.benefit__icon svg { width: 46px; }
.benefit__icon--sage { background: var(--color-sage); }
.benefit__icon--terracotta { background: var(--color-terracotta); }
.benefit__icon--forest { background: #7E9481; }
.benefit__icon::after { /* petits traits « d'énergie » */
  content: ""; position: absolute; top: 2px; right: -12px; width: 14px; height: 14px;
  border-top: 2px solid var(--color-sand); border-right: 2px solid var(--color-sand); transform: rotate(10deg); border-radius: 0 6px 0 0;
}
.benefit__title { font-weight: 400; margin-bottom: 6px; }
.benefit__text { color: var(--color-muted); font-size: .95rem; max-width: 22ch; margin-inline: auto; }
@media (min-width: 700px) { .benefits__list { grid-template-columns: repeat(3, 1fr); } }

/* Formes organiques de fond */
.deco-blob { position: absolute; z-index: -1; color: var(--color-sage-light); pointer-events: none; }
.deco-blob--left { left: 0; bottom: 0; width: min(260px, 30vw); }

/* =========================================================================
   6. QUAND CONSULTER ?
   ========================================================================= */
.consult { background: #F3F0E7; overflow: hidden; }
.consult__grid { display: grid; gap: 40px; align-items: center; }
.consult__list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
.consult__item { text-align: center; padding-inline: 8px; }
.consult__icon {
  width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: var(--color-forest);
}
.consult__icon svg { width: 36px; }
.consult__item:nth-child(5n+1) .consult__icon { background: #E6E3CF; }
.consult__item:nth-child(5n+2) .consult__icon { background: var(--color-sand); }
.consult__item:nth-child(5n+3) .consult__icon { background: var(--color-terracotta-light); }
.consult__item:nth-child(5n+4) .consult__icon { background: var(--color-sage-light); }
.consult__item:nth-child(5n+5) .consult__icon { background: #F6D7C8; }
.consult__title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.consult__text { font-size: .85rem; color: var(--color-muted); margin: 0; }
@media (min-width: 640px) { .consult__list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) {
  .consult__grid { grid-template-columns: 1fr 2.1fr; }
  .consult__list { grid-template-columns: repeat(5, 1fr); gap: 0; }
  .consult__item + .consult__item { border-left: 1px solid var(--color-line); }
}

/* =========================================================================
   7. ACCOMPAGNEMENT PERSONNALISÉ
   ========================================================================= */
.support__grid { display: grid; gap: 48px; align-items: center; }
.support__media { position: relative; }
.support__image { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 30px 160px 120px 30px / 30px 200px 140px 30px; }
.support__frame {
  position: absolute; top: 12%; right: 16%; background: var(--color-white); padding: 14px 18px;
  border: 6px solid #D9C9A8; font-size: 1.4rem; transform: rotate(-3deg); box-shadow: var(--shadow-soft);
}
.support__checks { list-style: none; margin: 24px 0; display: grid; gap: 14px; }
.support__checks li { display: flex; align-items: center; gap: 12px; }
.support__checks svg { width: 22px; flex: none; color: var(--color-sage); }
.support__note {
  display: inline-block; margin-top: 8px; padding: 22px 30px; font-size: 1.65rem;
  background: var(--color-sand); border-radius: 18px 60px 22px 48px; transform: rotate(-4deg);
}
.support__note svg { width: 20px; display: inline; vertical-align: middle; color: var(--color-forest); }
@media (min-width: 900px) {
  .support__grid { grid-template-columns: 1fr 1fr; }
  .support__media { margin-left: calc(-1 * max(var(--gutter), (100vw - var(--container)) / 2)); }
  .support__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .support__note { max-width: 250px; flex: none; }
}

/* =========================================================================
   8. PARCOURS EN 3 ÉTAPES
   ========================================================================= */
.steps__header { text-align: center; margin-bottom: 48px; }
.steps__header .section-intro { margin-inline: auto; }
.steps__list { list-style: none; display: grid; gap: 40px; counter-reset: step; }
.step { text-align: center; position: relative; }
.step__icon {
  width: 92px; height: 80px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: var(--radius-blob); color: var(--color-forest);
}
.step__icon svg { width: 40px; }
.step:nth-child(1) .step__icon { background: var(--color-sage-light); }
.step:nth-child(2) .step__icon { background: var(--color-terracotta); color: var(--color-white); }
.step:nth-child(3) .step__icon { background: var(--color-sage); color: var(--color-white); }
.step__title { font-weight: 400; margin-bottom: 8px; }
.step__text { color: var(--color-muted); font-size: .92rem; max-width: 30ch; margin-inline: auto; }
.step__arrow { display: none; }
@media (min-width: 800px) {
  .steps__list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .step__arrow {
    display: block; position: absolute; top: 34px; right: -22%; width: 36%; color: var(--color-sage);
  }
}

/* =========================================================================
   9. BLOC CONTACT + FOOTER
   ========================================================================= */
.contact { padding-block: 40px; position: relative; overflow: hidden; background: linear-gradient(90deg, #F1EEE4, var(--color-bg-light)); }
.contact__grid { display: grid; gap: 28px; align-items: center; }
.contact__teaser { font-size: 1.7rem; display: flex; gap: 12px; align-items: flex-end; }
.contact__teaser svg { width: 60px; color: var(--color-forest); }
.contact-card {
  background: var(--color-forest); color: var(--color-white);
  border-radius: 48px 70px 54px 80px; padding: 32px clamp(24px, 4vw, 48px);
  display: grid; gap: 28px;
}
.contact-card__head { display: flex; gap: 18px; align-items: center; }
.contact-card__badge {
  width: 58px; height: 58px; flex: none; border-radius: 50%; background: var(--color-bg-light);
  display: grid; place-items: center; color: var(--color-forest);
}
.contact-card__badge svg { width: 28px; }
.contact-card h2 { color: var(--color-white); font-size: 1.45rem; font-weight: 400; margin-bottom: 4px; }
.contact-card p { font-size: .9rem; margin: 0; opacity: .92; }
.contact-card__list { list-style: none; display: grid; gap: 12px; font-size: .95rem; }
.contact-card__list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-card__list svg { width: 18px; flex: none; margin-top: 4px; color: var(--color-sand); }
.contact-card a { color: var(--color-white); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }
.contact-card__address { font-style: normal; }
.contact-card__cta { margin-top: 16px; }
.contact__map-pin { position: absolute; left: 46%; top: 34%; width: 26px; color: var(--color-terracotta-dark); }
.contact__map { position: relative; width: 150px; justify-self: center; text-decoration: none; }
.contact__map-label { position: absolute; left: 22%; bottom: 22%; font-size: 1.45rem; transform: rotate(-8deg); }
@media (min-width: 760px) {
  .contact-card { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .contact-card__list { border-left: 1px solid rgba(255, 255, 255, .25); padding-left: 28px; }
}
@media (min-width: 1100px) { .contact__grid { grid-template-columns: .9fr 2.6fr .6fr; } }

.site-footer { padding-block: 28px 20px; border-top: 1px solid var(--color-line); font-size: .85rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.site-footer .site-brand__name { font-size: 1.85rem; }
.footer-nav__list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { text-decoration: none; color: var(--color-text); }
.footer-nav a:hover, .footer-nav .current-menu-item > a { text-decoration: underline; }
.social-link { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--color-forest); }
.social-link svg { width: 22px; }
.site-footer__legal { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; color: var(--color-muted); font-size: .78rem; }
.site-footer__legal a { color: inherit; }
.legal-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* =========================================================================
   10. PAGES INTÉRIEURES (page.php / index.php)
   ========================================================================= */
.breadcrumbs { font-size: .85rem; color: var(--color-muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--color-sage); }
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-terracotta-dark); }
.page-hero { padding-block: clamp(40px, 6vw, 72px) 24px; }
.entry-content { max-width: 72ch; padding-bottom: var(--section-y); }
.entry-content img { border-radius: 24px; }
.alignwide { max-width: var(--container); }
.post-card { padding-block: 24px; border-bottom: 1px solid var(--color-line); }

/* =========================================================================
   11. ANIMATIONS AU DÉFILEMENT
   ========================================================================= */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.js .reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .1s; }
.js .reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .2s; }
.js .reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .3s; }
.js .reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .4s; }

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