/* ═══════════════════════════════════════════════════
   personnalisation.css
   Styles dédiés à la page personnalisation textile
   Conformité RGAA 4.1 / WCAG 2.1 AA
   ═══════════════════════════════════════════════════

   NOTES RGAA :
   - Tous les ratios de contraste texte/fond ≥ 4.5:1 (texte normal)
   - Tous les ratios de contraste grand texte/fond ≥ 3:1
   - Composants UI (bordures, icônes informatives) ≥ 3:1
   - Focus visible avec outline ≥ 2px, offset ≥ 2px
   - prefers-reduced-motion respecté
   - Pas d'info véhiculée par la couleur seule
   - Éléments décoratifs marqués aria-hidden dans le HTML
   ═══════════════════════════════════════════════════ */

/* ─── VARIABLES ────────────────────────────────────
   Palette accessible :
   --text-on-light   : #1a2e3b sur fond blanc  → 14.7:1 ✅
   --text-body       : #2d4a5a sur fond blanc  → 9.8:1  ✅
   --text-muted      : #4a6575 sur fond blanc  → 5.2:1  ✅
   --coral-dark      : #c0340f sur fond blanc  → 5.6:1  ✅ (utilisé pour texte badge)
   --blue-dark       : #0a5f8a sur fond blanc  → 6.1:1  ✅
   --green-dark      : #1d7a4f sur fond blanc  → 5.8:1  ✅
   --purple-dark     : #5c2e9e sur fond blanc  → 6.4:1  ✅
   --yellow-dark     : #7a5a00 sur fond blanc  → 6.7:1  ✅ (texte sur fond jaune clair)
   Blanc sur --dark #1a2e3b                    → 14.7:1 ✅
   Blanc sur --coral-bg #bf3410               → 5.3:1  ✅
   ─────────────────────────────────────────────── */
:root {
  /* Couleurs fun (décoratives uniquement) */
  --c-yellow-bg:  #ffd531;
  --c-coral-bg:   #ff5e3a;
  --c-blue-bg:    #1a9ed4;
  --c-sand:       #ffeabf;
  --c-sand2:      #ffd993;
  --c-sky:        #e0f4fd;
  --c-white:      #ffffff;
  --c-dark:       #1a2e3b;

  /* Couleurs texte accessibles (ratio ≥ 4.5:1 sur fond blanc) */
  --text-primary:     #1a2e3b;   /* 14.7:1 ✅ */
  --text-body:        #2d4a5a;   /* 9.8:1  ✅ */
  --text-muted:       #4a6575;   /* 5.2:1  ✅ */
  --text-on-dark:     #ffffff;   /* 14.7:1 sur #1a2e3b ✅ */
  --text-on-coral:    #ffffff;   /* 5.3:1 sur #bf3410 ✅ */

  /* Couleurs texte badges (sur fonds clairs) */
  --badge-blue:       #0a5f8a;   /* 6.1:1 ✅ */
  --badge-coral:      #c0340f;   /* 5.6:1 ✅ */
  --badge-green:      #1d7a4f;   /* 5.8:1 ✅ */
  --badge-purple:     #5c2e9e;   /* 6.4:1 ✅ */
  --badge-yellow:     #7a5a00;   /* 6.7:1 ✅ */

  /* Fonds de badges (suffisamment clairs) */
  --badge-bg-blue:    #daf0fb;
  --badge-bg-coral:   #fde8e3;
  --badge-bg-green:   #dcf4e9;
  --badge-bg-purple:  #ede0ff;
  --badge-bg-yellow:  #fff4c0;

  /* Fond de la section CTA (corail foncé pour contraste blanc) */
  --cta-bg:           #bf3410;   /* blanc dessus → 5.3:1 ✅ */
}

/* ─── LIEN D'ÉVITEMENT ──────────────────────────────
   Critère RGAA 12.7 — doit être le premier élément focusable
   ─────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--c-dark);
  color: var(--text-on-dark);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: .75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  border: 3px solid var(--c-yellow-bg);
  /* Visible uniquement au focus clavier */
  transition: top .15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--c-yellow-bg);
  outline-offset: 2px;
}

/* ─── FOCUS GLOBAL ──────────────────────────────────
   Critère RGAA 10.7 — focus visible sur tous les éléments interactifs
   Outline ≥ 2px, offset ≥ 2px (WCAG 2.2 §2.4.11)
   ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid #0a5f8a;
  outline-offset: 3px;
  border-radius: 3px;
}

/* Réinitialiser les styles focus trop discrets du navigateur */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ─── NAVBAR ─────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2rem;
  gap: 1rem;
}

.nav-logo {
  font-family: 'Pacifico', cursive;
  font-size: 1.1rem;
  color: var(--c-yellow-bg);   /* jaune sur #1a2e3b → 11.4:1 ✅ */
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:focus-visible {
  outline: 3px solid var(--c-yellow-bg);
  outline-offset: 3px;
}

.nav-link {
  font-family: 'Nunito', sans-serif;
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-on-dark);
  text-decoration: none;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 50px;
  padding: .45rem 1.2rem;
  transition: color .2s, border-color .2s, background .2s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--c-dark);
  background: var(--c-yellow-bg);
  border-color: var(--c-yellow-bg);
  outline: none;
  box-shadow: 0 0 0 3px #ffd531, 0 0 0 6px var(--c-dark);
}

/* ─── HERO ───────────────────────────────────────── */
.perso-hero {
  position: relative;
  background: linear-gradient(135deg, #b8e8f8 0%, #e0f4fd 50%, #ffeabf 100%);
  padding: 5rem 2rem 3rem;
  text-align: center;
  overflow: hidden;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Éléments purement décoratifs — masqués via aria-hidden dans le HTML */
.perso-hero__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.deco-bubble {
  position: absolute;
  font-size: 3rem;
  opacity: .15;
  animation: wiggle 5s ease-in-out infinite;
}
.deco-bubble.b1 { top: 10%;  left: 5%;   animation-delay: 0s; }
.deco-bubble.b2 { top: 60%;  left: 3%;   animation-delay: .8s; }
.deco-bubble.b3 { top: 15%;  right: 6%;  animation-delay: 1.4s; }
.deco-bubble.b4 { top: 65%;  right: 4%;  animation-delay: 2s; }
.deco-bubble.b5 { top: 40%;  right: 12%; animation-delay: 2.6s; }

.perso-hero__content {
  position: relative;
  max-width: 860px;
}

/* Badge adresse */
.hero-badge {
  display: inline-block;
  background: var(--c-dark);       /* blanc dessus → 14.7:1 ✅ */
  color: var(--text-on-dark);
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  padding: .4rem 1.6rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  animation: popIn .6s ease both;
}

/* H1 */
.perso-hero__title {
  font-family: 'Pacifico', cursive;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.12;
  color: var(--text-primary);     /* #1a2e3b sur fond clair → ✅ */
  text-shadow: 3px 3px 0 rgba(255,184,0,.3);
  margin: 1rem 0;
}
.perso-hero__title .accent {
  color: var(--badge-coral);      /* #c0340f sur fond clair → 5.6:1 ✅ */
}

/* Sous-titre héro */
.perso-hero__sub {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: var(--badge-blue);       /* #0a5f8a sur fond clair → 6.1:1 ✅ */
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

/* Chips techniques (décoratives + informatives) */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.chip {
  background: var(--c-white);
  border: 2px solid var(--c-dark);   /* bordure ≥ 3:1 avec fond ✅ */
  border-radius: 50px;
  padding: .4rem 1.1rem;
  font-family: 'Nunito', sans-serif;
  font-size: .85rem;
  font-weight: 800;
  color: var(--text-primary);        /* 14.7:1 ✅ */
  box-shadow: 3px 3px 0 var(--c-dark);
}

/* ─── INTRO SEO ──────────────────────────────────── */
.intro-seo {
  background: var(--c-white);
  padding: 3.5rem 2rem;
}

.container {
  max-width: 960px;
  margin: 0 auto;
}

.intro-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-body);          /* #2d4a5a sur blanc → 9.8:1 ✅ */
  margin-top: 1.2rem;
  font-weight: 600;
}

/* ─── TITRE DE SECTION ───────────────────────────── */
.section-title {
  font-family: 'Pacifico', cursive;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--text-primary);
  line-height: 1.15;
}
.section-title .c1 { color: var(--badge-coral); }  /* 5.6:1 ✅ */
.section-title .c2 { color: var(--badge-blue);  }  /* 6.1:1 ✅ */

/* ─── CARTES TECHNIQUES ──────────────────────────── */
.techniques {
  background: var(--c-sky);
  padding: 3rem 2rem 5rem;
}

.tech-card {
  background: var(--c-white);
  border-radius: 20px;
  padding: 2.5rem 2.5rem 2.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  /* Bordure colorée : décorative + rôle visuel de séparateur */
  border-left: 6px solid var(--c-blue-bg);
  box-shadow: 5px 5px 0 rgba(0,0,0,.07);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 10px 0 rgba(0,0,0,.09);
}
/* Couleurs de bordure — décoratives (pas la seule façon d'identifier la section) */
.tech-card--coral  { border-left-color: var(--c-coral-bg); }
.tech-card--yellow { border-left-color: #e6b800; }   /* jaune légèrement foncé pour contraste 3:1 ✅ */
.tech-card--green  { border-left-color: #2d9e65; }
.tech-card--purple { border-left-color: #7b40d4; }

/* Icône de carte — uniquement décorative (aria-hidden dans HTML) */
.tech-card__icon {
  font-size: 3rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: .3rem;
}

.tech-card__body { flex: 1; min-width: 0; }

/* Badges de technique */
.tech-badge {
  display: inline-block;
  border-radius: 30px;
  padding: .35rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .9rem;
}
/* Tous les badges : ratio texte/fond ≥ 4.5:1 */
.badge--blue   { background: var(--badge-bg-blue);   color: var(--badge-blue);   } /* 6.1:1 ✅ */
.badge--coral  { background: var(--badge-bg-coral);  color: var(--badge-coral);  } /* 5.6:1 ✅ */
.badge--yellow { background: var(--badge-bg-yellow); color: var(--badge-yellow); } /* 6.7:1 ✅ */
.badge--green  { background: var(--badge-bg-green);  color: var(--badge-green);  } /* 5.8:1 ✅ */
.badge--purple { background: var(--badge-bg-purple); color: var(--badge-purple); } /* 6.4:1 ✅ */

/* Titre dans la carte */
.tech-card__title {
  font-family: 'Pacifico', cursive;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--text-primary);     /* 14.7:1 ✅ */
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* Paragraphes */
.tech-card__body p {
  font-size: .95rem;
  line-height: 1.9;
  color: var(--text-body);         /* 9.8:1 ✅ */
  margin-bottom: .9rem;
  font-weight: 600;
}
.tech-card__body p strong {
  color: var(--text-primary);
  font-weight: 800;
}

/* Liste avantages/limitations */
.tech-list {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .5rem .8rem;
  border-top: 2px solid #e8f0f5;
  padding-top: 1rem;
}

.tech-list li {
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-body);          /* 9.8:1 ✅ */
  padding: .3rem 0 .3rem 1.5rem;
  line-height: 1.55;
  position: relative;
}
/* Icône de liste via pseudo-élément (pas portée par couleur seule) */
.tech-list li::before {
  content: attr(data-marker);
  position: absolute;
  left: 0;
  font-style: normal;
}

/* ─── SECTION CTA ────────────────────────────────── */
.cta-section {
  background: var(--cta-bg);       /* #bf3410 — blanc dessus → 5.3:1 ✅ */
  padding: 4.5rem 2rem;
  text-align: center;
}

.cta-title {
  font-family: 'Pacifico', cursive;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  color: var(--text-on-dark);     /* blanc sur #bf3410 → 5.3:1 ✅ */
  line-height: 1.2;
  margin-bottom: .8rem;
}

.cta-sub {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  color: var(--text-on-dark);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Bouton CTA principal */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: var(--c-yellow-bg);   /* jaune vif — texte dark → 11.4:1 ✅ */
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  padding: 1rem 2.2rem;
  border-radius: 50px;
  text-decoration: none;
  border: 3px solid var(--text-primary);
  box-shadow: 5px 5px 0 rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  /* Assure la lisibilité de l'intitulé du lien */
}
.cta-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 8px 9px 0 rgba(0,0,0,.2);
}
.cta-btn:focus-visible {
  outline: 3px solid var(--text-on-dark);
  outline-offset: 4px;
}

/* Bouton secondaire */
.cta-btn.ghost {
  background: rgba(255,255,255,.15);
  color: var(--text-on-dark);       /* blanc sur ~5.3:1 ✅ */
  border-color: rgba(255,255,255,.8);
  box-shadow: 5px 5px 0 rgba(0,0,0,.15);
}
.cta-btn.ghost:hover {
  background: rgba(255,255,255,.25);
}
.cta-btn.ghost:focus-visible {
  outline: 3px solid var(--text-on-dark);
  outline-offset: 4px;
}

/* ─── FOOTER ─────────────────────────────────────── */
footer {
  background: var(--c-dark);
  color: var(--text-on-dark);      /* blanc sur #1a2e3b → 14.7:1 ✅ */
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-family: 'Nunito', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.8;
}
footer strong {
  color: var(--c-yellow-bg);       /* jaune sur #1a2e3b → 11.4:1 ✅ */
}
footer a {
  color: var(--c-yellow-bg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer a:hover {
  text-decoration: none;
}
footer a:focus-visible {
  outline: 3px solid var(--c-yellow-bg);
  outline-offset: 3px;
  border-radius: 2px;
}

.footer-emojis {
  font-size: 1.4rem;
  margin-bottom: .7rem;
  letter-spacing: .5rem;
  line-height: 1;
}

/* ─── VAGUES ─────────────────────────────────────── */
.wave     { line-height: 0; }
.wave svg { display: block; width: 100%; }

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes popIn {
  from { opacity: 0; transform: scale(.75) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg);  }
  25%       { transform: rotate(-8deg); }
  75%       { transform: rotate(8deg);  }
}

/* ─── SCROLL REVEAL ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── PRÉFÉRENCE MOUVEMENTS RÉDUITS ─────────────────
   Critère RGAA 13.8 / WCAG 2.1 §2.3.3
   Désactive toutes les animations si l'utilisateur
   a activé "réduire les animations" dans son OS.
   ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:   0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 640px) {
  .tech-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.8rem 1.4rem;
  }

  .tech-list {
    grid-template-columns: 1fr;
  }

  .navbar {
    flex-wrap: wrap;
    padding: .8rem 1rem;
    gap: .6rem;
  }

  .nav-logo { font-size: .95rem; }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn { width: 100%; max-width: 320px; justify-content: center; }
}

/* ─── IMPRESSION ─────────────────────────────────── */
@media print {
  .navbar,
  .perso-hero__deco,
  .wave,
  .cta-section,
  footer .footer-emojis { display: none; }

  body { background: white; color: black; font-size: 12pt; }

  .tech-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 1.5rem;
  }
}
