/*
 * utilities.css — Classes d'aide atomiques. Pas de !important abusif.
 */

/* ── Accessibilité ───────────────────────────────────────────────── */

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

.sr-only:focus,
.visually-hidden:focus {
	position:   static;
	width:      auto;
	height:     auto;
	padding:    inherit;
	margin:     0;
	overflow:   visible;
	clip:       auto;
	white-space: normal;
}

/* ── Affichage ───────────────────────────────────────────────────── */

.d-none   { display: none;         }
.d-block  { display: block;        }
.d-flex   { display: flex;         }
.d-grid   { display: grid;         }
.d-inline { display: inline;       }
.d-inline-flex  { display: inline-flex;  }
.d-inline-block { display: inline-block; }

@media (max-width: 767px)  { .hide-mobile  { display: none; } }
@media (min-width: 768px)  { .hide-desktop { display: none; } }

/* ── Flexbox ─────────────────────────────────────────────────────── */

.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Texte ───────────────────────────────────────────────────────── */

.text-left    { text-align: left;   }
.text-center  { text-align: center; }
.text-right   { text-align: right;  }

.text-xs   { font-size: var(--text-xs);   }
.text-sm   { font-size: var(--text-sm);   }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md);   }
.text-lg   { font-size: var(--text-lg);   }
.text-xl   { font-size: var(--text-xl);   }
.text-2xl  { font-size: var(--text-2xl);  }

.fw-regular { font-weight: var(--fw-regular); }
.fw-medium  { font-weight: var(--fw-medium);  }
.fw-semi    { font-weight: var(--fw-semi);    }
.fw-bold    { font-weight: var(--fw-bold);    }

.text-red    { color: var(--accent);      }
.text-muted  { color: var(--fg-muted);   }
.text-fg     { color: var(--fg);         }
.text-white  { color: #fff;              }
.text-green  { color: var(--bw-green);  }
.text-orange { color: var(--bw-orange); }
.text-blue   { color: var(--bw-blue);   }

.text-mono  { font-family: var(--font-mono); }
.text-upper { text-transform: uppercase; letter-spacing: 0.06em; }
.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.italic { font-style: italic; }
.underline { text-decoration: underline; text-underline-offset: 3px; }

/* ── Espacements ─────────────────────────────────────────────────── */

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-0 { padding-top: 0; }
.pt-4 { padding-top: var(--space-4); }
.pt-8 { padding-top: var(--space-8); }

.pb-0 { padding-bottom: 0; }
.pb-4 { padding-bottom: var(--space-4); }
.pb-8 { padding-bottom: var(--space-8); }

/* ── Couleurs de fond ────────────────────────────────────────────── */

.bg-surface { background: var(--surface); }
.bg-red     { background: var(--accent);  color: #fff; }
.bg-dark    { background: var(--bw-anthracite); color: #e8eaed; }
.bg-white   { background: var(--bg); }

/* ── Borders ─────────────────────────────────────────────────────── */

.border     { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

/* ── Overflow ────────────────────────────────────────────────────── */

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

/* ── Largeur/hauteur ─────────────────────────────────────────────── */

.w-full { width: 100%; }
.max-w-prose { max-width: 65ch; }
