/* Typographie, boutons et règles communes à toutes les pages. */

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grands titres en serif, petits titres (cartes, étapes, colonnes) en DM Sans. */
h1, h2, .h1, .h2 {
  font-family: var(--ps-font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ps-ink);
}

h3, h4, .h3, .h4 {
  font-family: var(--ps-font-sans);
  font-weight: var(--ps-weight-title);
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ps-ink);
}

/* Police manuscrite de la marque : nom de la boutique et noms d'articles mis en avant. */
.display {
  font-family: var(--ps-font-display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1;
}

/* Phrase d'accroche : une seule par section. */
.accent {
  font-family: var(--ps-font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ps-accent);
}

::selection {
  background: var(--ps-violet-600);
  color: var(--ps-white);
}

:focus-visible {
  outline: 2px solid var(--ps-accent);
  outline-offset: 3px;
}

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
}

/* Étiquette de section : surlignée d'un coup de pinceau lavande. */
.eyebrow {
  position: relative;
  isolation: isolate;
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.5em 0.95em 0.45em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ps-aubergine-950);
}

/* Le tracé irrégulier vient d'un masque SVG ; la couleur reste réglable en CSS. */
.eyebrow::before {
  content: "";
  position: absolute;
  inset: 0 -0.15em;
  z-index: -1;
  background: var(--ps-lavender-300);
  -webkit-mask: url("../img/brush-stroke.svg") center / 100% 100% no-repeat;
  mask: url("../img/brush-stroke.svg") center / 100% 100% no-repeat;
  transform: rotate(-1.5deg);
}

/*
  Survols : les mêmes règles partout.
  - Bouton pilule : le fond violet glisse de gauche à droite, la flèche avance.
  - Bouton rond (icône) : fond violet plein, icône blanche ; une flèche avance dans son sens.
  - Pastille (filtre, variante) : bordure et texte violets ; choisie, fond aubergine.
  - Lien d'action (.text-link, « Retirer », « Envoyer par mail ») : toujours souligné ;
    au survol texte et trait violets, la flèche avance.
  - Lien de liste (pied de page, fil d'Ariane, aide, barre du haut...) : non souligné ;
    au survol violet (lavande sur fond sombre) et un trait se dessine de gauche à droite.
  - Carte cliquable : elle se soulève, son image zoome, son titre passe en violet.
  Le focus clavier reprend toujours l'aspect du survol.
*/

/*
  Bouton pilule. Au survol, un fond violet glisse de gauche à droite
  et la flèche avance. Variantes : --solid (action principale) et --on-dark.
*/
.button {
  --button-text: var(--ps-ink);
  --button-border: var(--ps-line-strong);
  --button-bg: transparent;
  --button-fill: var(--ps-violet-600);
  --button-text-hover: var(--ps-white);

  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.7rem 1.15rem 0.7rem 1.5rem;
  overflow: hidden;
  border: 1px solid var(--button-border);
  border-radius: var(--ps-radius-pill);
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--ps-duration-hover) var(--ps-ease), border-color var(--ps-duration-hover) var(--ps-ease);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--button-fill);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--ps-duration-hover) var(--ps-ease);
}

.button:hover,
.button:focus-visible {
  border-color: var(--button-fill);
  color: var(--button-text-hover);
}

.button:hover::before,
.button:focus-visible::before {
  transform: scaleX(1);
}

.button__arrow {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: -0.4rem;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: 0.85rem;
  transition: transform var(--ps-duration-hover) var(--ps-ease), background-color var(--ps-duration-hover) var(--ps-ease);
}

.button:hover .button__arrow,
.button:focus-visible .button__arrow {
  transform: translateX(3px);
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.button--solid {
  --button-text: var(--ps-on-strong);
  --button-border: var(--ps-strong);
  --button-bg: var(--ps-strong);
}

.button--light {
  --button-text: var(--ps-aubergine-950);
  --button-border: var(--ps-lavender-300);
  --button-bg: var(--ps-lavender-300);
  --button-fill: var(--ps-white);
  --button-text-hover: var(--ps-aubergine-950);
}

/* Surlignage au pinceau dans un texte courant. */
.highlight {
  position: relative;
  z-index: 0;
  /* Le pinceau est dessiné d'un seul tenant : l'expression ne doit pas se couper. */
  white-space: nowrap;
  padding: 0 0.1em;
  background: none;
  color: inherit;
}

.highlight::before {
  content: "";
  position: absolute;
  inset: 0.15em -0.15em 0;
  z-index: -1;
  background: var(--ps-lavender-300);
  -webkit-mask: url("../img/brush-stroke.svg") center / 100% 100% no-repeat;
  mask: url("../img/brush-stroke.svg") center / 100% 100% no-repeat;
  transform: rotate(-1deg);
}

[data-reveal] .highlight::before {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 600ms var(--ps-ease) 250ms;
}

[data-reveal].is-revealed .highlight::before {
  clip-path: inset(0 0 0 0);
}

.button--wide {
  width: 100%;
}

/* Bouton d'envoi principal sur WhatsApp : violet plein, l'aubergine glisse au survol. */
.button--whatsapp {
  --button-text: var(--ps-white);
  --button-border: var(--ps-violet-600);
  --button-bg: var(--ps-violet-600);
  --button-fill: var(--ps-aubergine-900);
  --button-text-hover: var(--ps-white);
}

.button--on-dark {
  --button-text: var(--ps-lavender-100);
  --button-border: rgba(237, 230, 245, 0.4);
  --button-fill: var(--ps-lavender-300);
  --button-text-hover: var(--ps-aubergine-950);
}

/* Lien d'action : souligné en permanence, la flèche avance au survol comme sur les boutons. */
.text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.2rem;
  color: var(--ps-ink);
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: color var(--ps-transition);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--ps-accent);
}

.text-link .icon {
  transition: transform var(--ps-transition);
}

.text-link:hover .icon:last-child,
.text-link:focus-visible .icon:last-child {
  transform: translateX(3px);
}

/*
  Liens de liste : le trait se dessine sous le texte seulement (pas sous l'icône).
  Leur couleur au survol est réglée avec chaque composant (violet, ou lavande sur fond sombre).
*/
:is(.site-footer__link:not(.site-footer__contact), .breadcrumb-nav a, .cart-line__name),
:is(.site-footer__contact, .product__help-link, .topbar__link, .footer-cta__phone) > span {
  padding-bottom: 1px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
  transition: background-size var(--ps-transition);
}

:is(.site-footer__link:not(.site-footer__contact), .breadcrumb-nav a, .cart-line__name):is(:hover, :focus-visible),
.site-footer__link.active,
:is(.site-footer__contact, .product__help-link, .topbar__link, .footer-cta__phone):is(:hover, :focus-visible) > span {
  background-size: 100% 1px;
}

/* Zone tactile agrandie sans toucher au soulignement ni à l'alignement du texte. */
.text-link::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: var(--ps-tap);
  transform: translateY(-50%);
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1100;
  padding: 0.6rem 1rem;
  border-radius: var(--ps-radius-pill);
  background: var(--ps-strong);
  color: var(--ps-on-strong);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/*
  Changement de page : un voile lavande balaie l'écran de gauche à droite.
  L'ancienne page s'efface par la gauche, la nouvelle la suit avec un léger retard ;
  l'écart entre les deux laisse voir le fond lavande. Sans prise en charge des
  transitions entre documents, la page s'affiche normalement.
*/
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* Entre deux pages : l'ancienne s'efface, la nouvelle apparaît en fondu en remontant à peine. */
::view-transition-old(root) {
  animation: page-fade-out 180ms ease-out both;
}

::view-transition-new(root) {
  animation: page-fade-in 320ms ease-out both;
}

@keyframes page-fade-out {
  to { opacity: 0; }
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* Apparition au défilement (voir js/ui/reveal.js). --reveal-delay permet de décaler une série.
   Les cartes à image ont leur propre dévoilement (components.css et home.css). */
[data-reveal] {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity var(--ps-duration-reveal) var(--ps-ease) var(--reveal-delay, 0ms),
    transform var(--ps-duration-reveal) var(--ps-ease) var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* En-tête de section : titre à gauche, lien à droite sur grand écran. */
.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-head__title {
  margin-bottom: 0.75rem;
  font-size: var(--ps-text-h2);
}

/* Sans texte d'introduction, le titre s'aligne sur le lien voisin. */
.section-head__title:last-child {
  margin-bottom: 0;
}

.section-head__intro {
  max-width: 34rem;
  margin: 0;
  font-size: var(--ps-text-lead);
}

