/*
 * SIRH O2 — Base CSS
 * Reset minimaliste + styles de base
 * Inspiré de la philosophie Lucca Prisme : sobre, beaucoup de blanc, transitions douces.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ------------------------------------------------------------------ */
/* RESET                                                                */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--color-neutral-800);
  background-color: var(--color-neutral-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

a {
  color: var(--color-primary-600);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary-700);
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* TYPOGRAPHIE                                                          */
/* ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-neutral-900);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
  line-height: var(--line-height-relaxed);
  color: var(--color-neutral-700);
}

small {
  font-size: var(--font-size-sm);
  color: var(--color-neutral-500);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-neutral-100);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.125rem 0.375rem;
}

pre {
  padding: var(--space-4);
  overflow-x: auto;
}

strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-800);
}

/* ------------------------------------------------------------------ */
/* SÉPARATEURS                                                          */
/* ------------------------------------------------------------------ */

hr {
  border: none;
  border-top: 1px solid var(--color-neutral-200);
  margin: var(--space-6) 0;
}

/* ------------------------------------------------------------------ */
/* BOUTONS DE BASE                                                      */
/* ------------------------------------------------------------------ */

button {
  cursor: pointer;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-base);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ------------------------------------------------------------------ */
/* FOCUS ACCESSIBLE                                                     */
/* ------------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------ */
/* UTILITAIRES DE BASE                                                  */
/* ------------------------------------------------------------------ */

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-muted {
  color: var(--color-neutral-500);
  font-size: var(--font-size-sm);
}

.text-sm   { font-size: var(--font-size-sm); }
.text-xs   { font-size: var(--font-size-xs); }
.text-lg   { font-size: var(--font-size-lg); }
.font-medium   { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }

/* ------------------------------------------------------------------ */
/* INDICATEUR HTMX                                                     */
/* ------------------------------------------------------------------ */

.htmx-indicator {
  opacity: 0;
  transition: opacity var(--transition-base);
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

.htmx-request.htmx-indicator {
  opacity: 1;
}
