/*
 * base.css — Reset, typographie, boutons, formulaires, utilitaires
 */

/* ---------------------------------------------------------------
   Reset & Box model
--------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sa-font-sans);
  font-size: var(--sa-text-base);
  line-height: var(--sa-leading-normal);
  color: var(--sa-slate);
  background-color: var(--sa-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
}

/* ---------------------------------------------------------------
   Typographie
--------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sa-font-serif);
  font-weight: var(--sa-weight-regular);
  line-height: var(--sa-leading-tight);
  color: var(--sa-ink);
}

h1 { font-size: clamp(var(--sa-text-3xl), 5vw, var(--sa-text-5xl)); }
h2 { font-size: clamp(var(--sa-text-2xl), 3.5vw, var(--sa-text-4xl)); }
h3 { font-size: clamp(var(--sa-text-xl),  2.5vw, var(--sa-text-2xl)); }
h4 { font-size: var(--sa-text-xl); }
h5 { font-size: var(--sa-text-lg); font-family: var(--sa-font-sans); font-weight: var(--sa-weight-semibold); }
h6 { font-size: var(--sa-text-base); font-family: var(--sa-font-sans); font-weight: var(--sa-weight-semibold); }

p {
  max-width: 68ch;
  line-height: var(--sa-leading-normal);
}

p + p { margin-top: var(--sa-space-4); }

strong { font-weight: var(--sa-weight-semibold); color: var(--sa-ink); }
em     { font-style: italic; }

small  { font-size: var(--sa-text-sm); }

/* Eyebrow label */
.eyebrow {
  display: inline-block;
  font-family: var(--sa-font-sans);
  font-size: var(--sa-text-xs);
  font-weight: var(--sa-weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sa-gold);
  margin-bottom: var(--sa-space-3);
}

.text-muted  { color: var(--sa-muted); }
.text-ink    { color: var(--sa-ink); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: var(--sa-text-sm); }
.text-lg     { font-size: var(--sa-text-lg); }

/* ---------------------------------------------------------------
   Liens
--------------------------------------------------------------- */
.link {
  color: var(--sa-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--sa-transition-fast);
}
.link:hover { color: var(--sa-gold); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sa-space-2);
  color: var(--sa-ink);
  font-size: var(--sa-text-sm);
  font-weight: var(--sa-weight-medium);
  transition: gap var(--sa-transition-fast), color var(--sa-transition-fast);
}
.link-arrow::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: width var(--sa-transition-fast);
}
.link-arrow:hover { color: var(--sa-gold); gap: var(--sa-space-3); }
.link-arrow:hover::after { width: 22px; }

/* ---------------------------------------------------------------
   Boutons
--------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sa-space-2);
  padding: var(--sa-space-3) var(--sa-space-6);
  font-family: var(--sa-font-sans);
  font-size: var(--sa-text-sm);
  font-weight: var(--sa-weight-medium);
  line-height: 1;
  border-radius: var(--sa-radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--sa-transition-fast),
    color var(--sa-transition-fast),
    border-color var(--sa-transition-fast),
    box-shadow var(--sa-transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--sa-gold); outline-offset: 3px; }

/* Primaire */
.btn-primary {
  background: var(--sa-ink);
  color: #fff;
  border-color: var(--sa-ink);
}
.btn-primary:hover {
  background: var(--sa-ink-mid);
  border-color: var(--sa-ink-mid);
}

/* Secondaire / outline */
.btn-outline {
  background: transparent;
  color: var(--sa-ink);
  border-color: var(--sa-border-mid);
}
.btn-outline:hover {
  background: var(--sa-surface);
  border-color: var(--sa-ink);
  box-shadow: var(--sa-shadow-sm);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--sa-slate);
  border-color: var(--sa-border);
}
.btn-ghost:hover {
  background: var(--sa-bg-alt);
  color: var(--sa-ink);
  border-color: var(--sa-border-mid);
}

/* Tailles */
.btn-sm { padding: var(--sa-space-2) var(--sa-space-4); font-size: var(--sa-text-xs); }
.btn-lg { padding: var(--sa-space-4) var(--sa-space-8); font-size: var(--sa-text-base); }

/* ---------------------------------------------------------------
   Formulaires
--------------------------------------------------------------- */
.sa-input,
.sa-select,
.sa-textarea {
  width: 100%;
  padding: var(--sa-space-3) var(--sa-space-4);
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius);
  color: var(--sa-ink);
  font-size: var(--sa-text-sm);
  transition: border-color var(--sa-transition-fast), box-shadow var(--sa-transition-fast);
  appearance: none;
}
.sa-input:focus,
.sa-select:focus,
.sa-textarea:focus {
  outline: none;
  border-color: var(--sa-ink-mid);
  box-shadow: 0 0 0 3px rgba(45, 65, 96, 0.12);
}
.sa-input::placeholder,
.sa-textarea::placeholder {
  color: var(--sa-muted);
}

label {
  display: block;
  font-size: var(--sa-text-sm);
  font-weight: var(--sa-weight-medium);
  color: var(--sa-ink);
  margin-bottom: var(--sa-space-2);
}

/* ---------------------------------------------------------------
   Accessibilité
--------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sa-space-4);
  z-index: 9999;
  padding: var(--sa-space-2) var(--sa-space-4);
  background: var(--sa-ink);
  color: #fff;
  border-radius: 0 0 var(--sa-radius) var(--sa-radius);
  font-size: var(--sa-text-sm);
  font-weight: var(--sa-weight-medium);
  text-decoration: none;
  transition: top var(--sa-transition-fast);
}
.skip-link:focus { top: 0; }

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

/* ---------------------------------------------------------------
   Reveal animation (déclenché par JS via IntersectionObserver)
--------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------
   Utilitaires divers
--------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--sa-border);
  border: none;
  margin: var(--sa-space-8) 0;
}

.empty-state {
  padding: var(--sa-space-16) var(--sa-space-6);
  text-align: center;
  color: var(--sa-muted);
  font-size: var(--sa-text-sm);
}
