/* ========================================
   Styles de base
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-background);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Gestion du focus pour l'accessibilité */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* Boutons de base */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-fast);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Liens */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-md);
}

/* Utilitaires */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Support du touch pour les appareils mobiles */
@media (hover: none) and (pointer: coarse) {
    button,
    a,
    .hotspot {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Animations de chargement */
.loading {
    opacity: 0;
    animation: fadeIn var(--transition-normal) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ========================================
   Utilitaires de texte - Surlignage
   ======================================== */

/* Classe de base pour le surlignage */
.highlight {
    background: linear-gradient(to top, rgba(139, 92, 246, 0.35) 50%, transparent 50%);
    padding: 0 0.2em;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    position: relative;
    display: inline;
}

/* Variante violette (comme dans l'exemple) */
.highlight-purple {
    background: linear-gradient(to top, rgba(139, 92, 246, 0.35) 50%, transparent 50%);
}

/* Variante bleue (couleur primaire) */
.highlight-primary {
    background: linear-gradient(to top, rgba(59, 130, 246, 0.35) 50%, transparent 50%);
}

/* Variante orange/ambre (couleur d'accent) */
.highlight-accent {
    background: linear-gradient(to top, rgba(245, 158, 11, 0.35) 50%, transparent 50%);
}

/* Variante verte (succès) */
.highlight-success {
    background: linear-gradient(to top, rgba(34, 197, 94, 0.35) 50%, transparent 50%);
}

/* Variante rose */
.highlight-pink {
    background: linear-gradient(to top, rgba(236, 72, 153, 0.35) 50%, transparent 50%);
}

/* Variante cyan */
.highlight-cyan {
    background: linear-gradient(to top, rgba(6, 182, 212, 0.35) 50%, transparent 50%);
}

/* Version plus intense (plus opaque) */
.highlight-strong {
    padding: 0 0.3em;
}

.highlight-strong.highlight-purple {
    background: linear-gradient(to top, rgba(139, 92, 246, 0.5) 50%, transparent 50%);
}

.highlight-strong.highlight-primary {
    background: linear-gradient(to top, rgba(59, 130, 246, 0.5) 50%, transparent 50%);
}

.highlight-strong.highlight-accent {
    background: linear-gradient(to top, rgba(245, 158, 11, 0.5) 50%, transparent 50%);
}

.highlight-strong.highlight-success {
    background: linear-gradient(to top, rgba(34, 197, 94, 0.5) 50%, transparent 50%);
}

.highlight-strong.highlight-pink {
    background: linear-gradient(to top, rgba(236, 72, 153, 0.5) 50%, transparent 50%);
}

.highlight-strong.highlight-cyan {
    background: linear-gradient(to top, rgba(6, 182, 212, 0.5) 50%, transparent 50%);
}
