/*
 * ALINERO DIGITAL — thème du site (agence digitale, fond clair).
 * Toutes les couleurs et polices se règlent ICI, une seule fois pour toutes les pages.
 * Les pages utilisent ces valeurs à travers Tailwind : bg-fond, bg-creme, text-texte, bg-accent, border-ligne…
 */

/* Même ordre de couches que Tailwind : nos composants passent après la remise à zéro et avant les utilitaires. */
@layer theme, base, components, utilities;

/* Polices hébergées sur le site (licence SIL Open Font License, voir assets/polices/LICENCES.txt) :
   aucune requête vers Google, page plus rapide. Sous-ensemble « latin » (français complet). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../polices/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../polices/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../polices/instrument-serif-italique.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Fonds */
  --fond: #fffbf5;      /* blanc chaud */
  --creme: #fff3e0;     /* sections en alternance */
  --blanc: #ffffff;     /* cartes */
  --ligne: #ede4d6;     /* bordures */

  /* Textes */
  --texte: #17130e;     /* titres */
  --doux: #554c41;      /* paragraphes */
  --discret: #74695c;   /* petites mentions (contraste ≥ 4,5:1 sur tous les fonds clairs) */

  /* Couleur de la marque (choisie le 25/11/2026) */
  --accent: #f6a00b;
  --accent-fonce: #e08b00;   /* survol des boutons */
  --accent-pale: #ffe9c2;    /* fonds d'icônes, étiquettes */
  --accent-encre: #17130e;   /* texte posé sur la couleur de la marque */
  --accent-texte: #a85f00;   /* la couleur de la marque en texte lisible sur fond clair */

  /* Polices (hébergées sur le site, déclarées plus haut) */
  --police-texte: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-titre: "Bricolage Grotesque", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --police-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;

  color-scheme: light;
}

@layer base {
  html {
    -webkit-text-size-adjust: 100%;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  /* Les ancres ne passent pas sous l'en-tête fixe. */
  [id] {
    scroll-margin-top: 6.5rem;
  }

  ::selection {
    background: var(--accent-pale);
    color: var(--texte);
  }

  :focus-visible {
    outline: 2px solid var(--texte);
    outline-offset: 3px;
    border-radius: 0.4rem;
  }
}

@layer components {
  /* Mot mis en valeur dans les titres : italique élégant, surligné à la couleur de la marque. */
  .mot-cle {
    font-family: var(--police-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.005em;
    padding: 0 0.1em;
    background-image: linear-gradient(transparent 64%, var(--accent) 64%, var(--accent) 90%, transparent 90%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  /* Logo (en texte, identique au fichier marque/alinero-digital-logo.svg) : « Alinero » + « digital » en italique surligné.
     La taille se règle sur le lien (font-size) ; tout le reste suit. */
  .logo-texte {
    display: inline-block;
    font-family: var(--police-titre);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--texte);
    white-space: nowrap;
  }

  .logo-texte em {
    font-family: var(--police-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.13em;
    letter-spacing: -0.01em;
    padding: 0 0.06em;
    background-image: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%);
  }

  /* Boutons */
  .btn-principal,
  .btn-secondaire,
  .btn-sombre {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 9999px;
    padding: 0.9rem 1.55rem;
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  }

  .btn-principal {
    background: var(--accent);
    color: var(--accent-encre);
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent-fonce) 80%, transparent);
  }

  .btn-principal:hover {
    background: var(--accent-fonce);
    transform: translateY(-1px);
  }

  .btn-secondaire {
    border: 1.5px solid color-mix(in srgb, var(--texte) 18%, transparent);
    background: var(--blanc);
    color: var(--texte);
  }

  .btn-secondaire:hover {
    border-color: var(--texte);
    transform: translateY(-1px);
  }

  .btn-sombre {
    background: var(--texte);
    color: var(--blanc);
  }

  .btn-sombre:hover {
    background: #000;
    transform: translateY(-1px);
  }

  .btn-principal svg,
  .btn-secondaire svg,
  .btn-sombre svg {
    width: 1rem;
    height: 1rem;
    flex: none;
    transition: transform 0.2s;
  }

  .btn-principal:hover svg,
  .btn-secondaire:hover svg,
  .btn-sombre:hover svg {
    transform: translateX(3px);
  }

  /* Étiquette (petite pastille au-dessus des titres) */
  .etiquette {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid var(--ligne);
    border-radius: 9999px;
    background: var(--blanc);
    padding: 0.42rem 0.95rem 0.42rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--texte);
    box-shadow: 0 6px 16px -12px rgb(23 19 14 / 0.4);
  }

  .etiquette::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: none;
    border-radius: 9999px;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-pale);
  }

  /* Cartes */
  .carte {
    position: relative;
    border: 1px solid var(--ligne);
    border-radius: 1.75rem;
    background: var(--blanc);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  }

  .carte-survol:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--ligne));
    box-shadow: 0 24px 50px -30px rgb(23 19 14 / 0.35);
  }

  .icone {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.1rem;
    background: var(--accent-pale);
    color: var(--texte);
  }

  .icone svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* Listes à coches */
  .coches li {
    position: relative;
    padding-left: 1.9rem;
  }

  .coches li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317130e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 0.8rem no-repeat;
  }

  /* Fenêtre de navigateur et téléphone (illustrations) */
  .fenetre {
    overflow: hidden;
    border: 1px solid var(--ligne);
    border-radius: 1.4rem;
    background: var(--blanc);
    box-shadow: 0 40px 80px -40px rgb(23 19 14 / 0.45);
  }

  .telephone {
    border-radius: 2.2rem;
    padding: 0.4rem;
    background: #17130e;
    box-shadow: 0 35px 70px -30px rgb(23 19 14 / 0.6);
  }

  .telephone .ecran {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 18.5;
    border-radius: 1.85rem;
    background: var(--blanc);
  }

  @media (max-width: 639px) {
    .telephone {
      border-radius: 1.5rem;
      padding: 0.28rem;
    }

    .telephone .ecran {
      border-radius: 1.25rem;
    }
  }

  /* Autocollant rond qui tourne doucement */
  .autocollant {
    display: grid;
    place-items: center;
    border-radius: 9999px;
    background: var(--texte);
    color: var(--blanc);
    box-shadow: 0 20px 40px -20px rgb(23 19 14 / 0.6);
  }

  .autocollant .texte-rond {
    width: 100%;
    height: 100%;
    grid-area: 1 / 1;
    font-family: var(--police-texte);
  }

  .autocollant .centre {
    grid-area: 1 / 1;
  }

  @media (prefers-reduced-motion: no-preference) {
    .autocollant .texte-rond {
      animation: tourner 18s linear infinite;
    }
  }

  @keyframes tourner {
    to {
      transform: rotate(360deg);
    }
  }

  /* Bandeau défilant */
  .defilant {
    display: flex;
    width: max-content;
  }

  @media (prefers-reduced-motion: no-preference) {
    .defilant {
      animation: defiler 38s linear infinite;
    }
  }

  @keyframes defiler {
    to {
      transform: translateX(-50%);
    }
  }

  /* Questions fréquentes */
  .faq summary {
    list-style: none;
    cursor: pointer;
  }

  .faq summary::-webkit-details-marker {
    display: none;
  }

  .faq .signe {
    transition: transform 0.25s, background-color 0.25s;
  }

  .faq details[open] .signe {
    transform: rotate(45deg);
    background: var(--accent);
    border-color: var(--accent);
  }

  /* Champs du formulaire */
  .champ {
    width: 100%;
    border: 1.5px solid var(--ligne);
    border-radius: 1rem;
    background: var(--fond);
    padding: 0.85rem 1rem;
    color: var(--texte);
    font-size: 0.97rem;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  }

  .champ::placeholder {
    color: var(--discret);
  }

  .champ:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--blanc);
    box-shadow: 0 0 0 4px var(--accent-pale);
  }

  select.champ {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23554c41' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.95rem center;
    background-size: 1rem;
    padding-right: 2.6rem;
  }

  /* Étiquette de catégorie du blog */
  .categorie {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: var(--accent-pale);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--texte);
    white-space: nowrap;
  }

  .categorie-active {
    background: var(--texte);
    color: var(--blanc);
  }

  /* Piège à robots du formulaire : hors de l'écran, jamais vu ni atteint au clavier par un visiteur */
  .piege {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* Message d'erreur du formulaire */
  .etat-erreur {
    color: #b42318;
    font-weight: 600;
  }

  /* En-tête : fond blanc et ombre légère une fois la page défilée */
  .entete-barre {
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
  }

  .entete-defile .entete-barre {
    background-color: rgb(255 255 255 / 0.92);
    border-color: var(--ligne);
    box-shadow: 0 18px 40px -28px rgb(23 19 14 / 0.45);
  }

  /* Apparition douce au défilement (seulement si JavaScript tourne et sans « réduire les animations ») */
  @media (prefers-reduced-motion: no-preference) {
    .js [data-apparition] {
      opacity: 0;
      transform: translateY(18px);
      transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .js [data-apparition].est-visible {
      opacity: 1;
      transform: none;
    }
  }
}

/* Texte des articles du blog et des pages de service (plugin Typography de Tailwind, aux couleurs du site).
   Hors des couches, exprès : le plugin Typography passe après nos composants, ces réglages doivent gagner. */
.texte-long {
  --tw-prose-body: var(--doux);
  --tw-prose-headings: var(--texte);
  --tw-prose-lead: var(--doux);
  --tw-prose-links: var(--texte);
  --tw-prose-bold: var(--texte);
  --tw-prose-counters: var(--accent-texte);
  --tw-prose-bullets: var(--accent);
  --tw-prose-hr: var(--ligne);
  --tw-prose-quotes: var(--texte);
  --tw-prose-quote-borders: var(--accent);
  --tw-prose-captions: var(--discret);
  --tw-prose-code: var(--texte);
  --tw-prose-th-borders: var(--ligne);
  --tw-prose-td-borders: var(--ligne);
  font-size: 1.075rem;
  line-height: 1.75;
}

.texte-long :where(h2, h3, h4) {
  font-family: var(--police-titre);
  font-weight: 800;
  letter-spacing: -0.025em;
  scroll-margin-top: 6.5rem;
}

.texte-long :where(a) {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.texte-long :where(a):hover {
  color: var(--accent-texte);
}

.texte-long :where(blockquote) {
  font-style: normal;
  background: var(--creme);
  border-radius: 0 1rem 1rem 0;
  padding: 0.75rem 1.25rem;
}

/* Pas de guillemets anglais automatiques autour des citations (le texte écrit les siens s'il en faut). */
.texte-long blockquote p::before,
.texte-long blockquote p::after {
  content: none;
}

