/* ==========================================================================
   base.css — Reset, design tokens, typographie, grille, utilitaires
   Site Alès Peinture — peintre en bâtiment à Alès.
   Système de design issu d'un atelier de reconstruction de baselarea.swiss :
   palette et métriques typographiques relevées sur le CSS de production de
   ce site, puis réemployées ici.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette (extraite du CSS d'origine) */
  --black: #151515;
  --black-2: #221f20;
  --black-3: #313131;
  --cream-1: #f9f6f3;
  --cream-2: #f5f0eb;
  --cream-3: #efe9e3;
  --cream-4: #eae1d9;
  --beige: #d5cbc3;
  --grey: #8b847a;
  --accent: #ff0000;
  --accent-soft: #ffecec;
  --accent-soft-2: #ffc9c9;
  --green: #2fd384;
  --white: #fff;

  /* Typographie */
  --font-display: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-accent: "Bricolage Grotesque", "Inter", sans-serif;

  /* Rythme */
  --container-max: 1600px;
  --gutter: clamp(20px, 4vw, 60px);
  --section-y: clamp(60px, 8vw, 140px);
  --radius: 8px;
  --radius-lg: 16px;

  /* Header */
  --header-h: 74px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.2s var(--ease);
  --t: 0.3s ease-in-out;
  --t-slow: 0.6s var(--ease);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--white);
  color: var(--black);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

address { font-style: normal; }

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

::selection {
  background: var(--black);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   3. Typographie
   Échelle fluide reproduisant les métriques d'origine
   (hero : 140px / line-height .9 / letter-spacing -2.8px)
   -------------------------------------------------------------------------- */
.h0, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}

.h0 {
  font-size: clamp(46px, 8.4vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.h1 {
  font-size: clamp(42px, 7.6vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: clamp(32px, 4.6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.h3 {
  font-size: clamp(26px, 3.1vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.h4 {
  font-size: clamp(21px, 1.9vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.h5 {
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.h6 {
  font-size: clamp(17px, 1.25vw, 21px);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.lead {
  font-family: var(--font-accent);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.5;
  letter-spacing: -0.022em;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

.rich p + p { margin-top: 1.1em; }
.rich strong { font-weight: 600; }
.rich a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast);
}
.rich a:hover { color: var(--accent); }
.rich ul {
  list-style: none;
  margin-top: 1.1em;
  display: grid;
  gap: 10px;
}
.rich ul li {
  position: relative;
  padding-left: 26px;
}
.rich ul + p { margin-top: 1.1em; }
.rich ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Layout : container & grille 12 colonnes
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 1100px; }

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
}

/* Colonnes mobile-first */
.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }

@media (min-width: 768px) {
  .col-md-3 { grid-column: span 3; }
  .col-md-4 { grid-column: span 4; }
  .col-md-5 { grid-column: span 5; }
  .col-md-6 { grid-column: span 6; }
  .col-md-7 { grid-column: span 7; }
  .col-md-8 { grid-column: span 8; }
}

@media (min-width: 992px) {
  .col-lg-3 { grid-column: span 3; }
  .col-lg-4 { grid-column: span 4; }
  .col-lg-5 { grid-column: span 5; }
  .col-lg-6 { grid-column: span 6; }
  .col-lg-7 { grid-column: span 7; }
  .col-lg-8 { grid-column: span 8; }
}

.block { position: relative; }
.block--pad { padding-block: var(--section-y); }

/* Fonds alternés */
.bg-white { background-color: var(--white); }
.bg-cream { background-color: var(--cream-1); }
.bg-cream-2 { background-color: var(--cream-2); }
.bg-cream-3 { background-color: var(--cream-3); }
.bg-cream-4 { background-color: var(--cream-4); }
.bg-black { background-color: var(--black); color: var(--white); }

/* --------------------------------------------------------------------------
   5. Boutons & liens fléchés
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--black);
  --btn-fg: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 26px;
  border-radius: 100px;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: background-color var(--t), color var(--t), transform var(--t);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
  background-color: var(--accent);
  color: var(--white);
}

.btn:active { transform: translateY(0); }

.btn__icon {
  width: 15px;
  height: 15px;
  flex: none;
  transition: transform var(--t);
}

.btn:hover .btn__icon { transform: translateX(4px); }

.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--black);
}
.btn--light:hover { --btn-fg: var(--white); }

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--black);
  border: 1px solid currentColor;
}

.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn--sm { padding: 11px 20px; font-size: 14px; }

/* Lien texte avec flèche */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  transition: color var(--t-fast);
}
.arrow-link svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  transition: transform var(--t);
}
.arrow-link:hover { color: var(--accent); }
.arrow-link:hover svg { transform: translateX(4px); }

/* Lien souligné animé */
.underline-link {
  position: relative;
  display: inline-block;
}
.underline-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-slow);
}
.underline-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Étiquette de catégorie */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--beige);
  background-color: var(--white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color var(--t), border-color var(--t);
}
.tag:hover,
.tag.is-active {
  background-color: var(--accent-soft);
  border-color: var(--accent-soft-2);
}

/* --------------------------------------------------------------------------
   6. Utilitaires
   -------------------------------------------------------------------------- */
/* Placeholder à remplacer par une vraie donnée d'entreprise.
   Supprimer cette règle (ou la classe) une fois toutes les valeurs renseignées.
   Repérer les occurrences restantes : rg "À REMPLACER" *.html */
.todo {
  background-color: #fff3bf;
  color: #6b4e00;
  border-radius: 3px;
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Piège à robots : le champ doit être invisible pour un humain mais rester
   dans le DOM et soumis avec le formulaire. On évite display:none, que certains
   robots détectent, au profit d'un décalage hors écran. */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--black);
  color: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top var(--t);
}
.skip-link:focus { top: 0; }

.media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ratio {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--cream-3);
}
.ratio > img,
.ratio > picture > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ratio--16-9 { aspect-ratio: 16 / 9; }
.ratio--4-3 { aspect-ratio: 4 / 3; }
.ratio--3-2 { aspect-ratio: 3 / 2; }
.ratio--1-1 { aspect-ratio: 1 / 1; }
.ratio--portrait { aspect-ratio: 3 / 4; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 64px);
}

.divider {
  height: 1px;
  border: 0;
  margin: 0;
  background-color: var(--beige);
}

/* --------------------------------------------------------------------------
   7. Animations d'apparition
   Reproduit `fadeUp .8s ease forwards` du thème d'origine.
   -------------------------------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* Élément à révéler au scroll (activé par reveal.js) */
.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.animate.is-visible {
  opacity: 1;
  transform: none;
}

/* Décalage en cascade pour les listes de cartes */
.animate[data-delay="1"] { transition-delay: 0.1s; }
.animate[data-delay="2"] { transition-delay: 0.2s; }
.animate[data-delay="3"] { transition-delay: 0.3s; }
.animate[data-delay="4"] { transition-delay: 0.4s; }

/* Animation immédiate au chargement (hero) */
.fade-up {
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) forwards;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .animate { opacity: 1; transform: none; }
  .fade-up { opacity: 1; }
}
