/* ================================================================
   STYLES-BASE.CSS — Culture Civique
   Styles communs à TOUTES les pages du site
   ================================================================ */

/* ----------------------------------------------------------------
   1. VARIABLES
   ---------------------------------------------------------------- */
   :root {
    --deep-blue: #102B44;
    --soft-blue: #244E78;
    --lighter-blue: #3D72A4;
    --accent-cyan: #5CC9BE;
    --accent-orange: #FF8A65;
    --text-white: #F0F4F8;
    --text-muted: #A3C7DD;
    --card-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Variables spécifiques quiz (utilisées par styles-quiz.css et index.html)
   Déclarées ici pour centraliser toutes les variables */
:root {
    --success: #66BB6A;
    --error: #EF5350;
    --success-check: #5CC9BE;
}


/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: var(--deep-blue);
    font-size: 17px;
}

body {
    background: linear-gradient(180deg, var(--deep-blue) 0%, var(--soft-blue) 100%);
    background-attachment: fixed;
    color: var(--text-white);
    min-height: 100vh;
    padding: 20px;
}


/* ----------------------------------------------------------------
   3. TYPOGRAPHIE
   ---------------------------------------------------------------- */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--text-white);
}

p {
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 15px;
}

strong {
    color: var(--text-white);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s;
}

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


/* ----------------------------------------------------------------
   4. GLASS CARD (base commune)
   ---------------------------------------------------------------- */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}


/* ----------------------------------------------------------------
   5. BOUTON RETOUR (harmonisé toutes pages)
   ---------------------------------------------------------------- */
.back-btn {
    display: inline-block;
    padding: 6px 16px;
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    border-radius: 50px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-white);
    color: var(--text-white);
    text-decoration: none;
}


/* ----------------------------------------------------------------
   6. FOOTER
   ---------------------------------------------------------------- */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 40px;
}

footer p {
    margin-bottom: 5px;
}

footer a {
    color: var(--accent-cyan);
}


/* ----------------------------------------------------------------
   7. ACCESSIBILITÉ (RGAA)
   ---------------------------------------------------------------- */

/* Contenu invisible visuellement mais accessible aux lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Skip link — visible uniquement au focus clavier */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-cyan);
    color: var(--deep-blue);
    padding: 10px 20px;
    border-radius: 0 0 12px 12px;
    font-weight: bold;
    font-size: 0.95em;
    z-index: 10000;
    transition: top 0.2s ease;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    color: var(--deep-blue);
    text-decoration: none;
}

/* Focus visible pour navigation clavier */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.back-btn:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Cache le outline au clic souris (esthétique) */
:focus:not(:focus-visible) {
    outline: none;
}

/* Affiche le outline uniquement pour navigation clavier */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}


/* ----------------------------------------------------------------
   8. UTILITAIRES
   ---------------------------------------------------------------- */
.hidden {
    display: none !important;
}


/* ----------------------------------------------------------------
   9. RESPONSIVE (base commune)
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    body {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
    }
}


/* ----------------------------------------------------------------
   10. EXPLICATION DÉPLIABLE (récapitulatif quiz)
   ---------------------------------------------------------------- */
   .explain-toggle {
    display: block;
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    font-size: 1em;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s;
}

.explain-toggle:hover {
    color: var(--text-white);
}

.explain-toggle.open {
    color: var(--text-white);
}

.explain-content {
    margin-top: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 3px solid var(--accent-cyan);
}

.explain-content p {
    color: var(--text-muted);
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
}


/* ----------------------------------------------------------------
   11. TABLEAU DE PROGRESSION (résultats quiz)
   ---------------------------------------------------------------- */
   .progress-dashboard {
    margin-top: 20px;
    text-align: left;
}

.progress-dashboard h3 {
    font-size: 0.95em;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-align: center;
}

.theme-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.theme-label {
    font-size: 0.8em;
    color: var(--text-muted);
    width: 120px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-label.active {
    color: var(--accent-cyan);
    font-weight: 600;
}

.theme-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.theme-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.theme-count {
    font-size: 0.75em;
    color: var(--text-muted);
    width: 45px;
    text-align: right;
    flex-shrink: 0;
}

.save-notice {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 15px;
    font-style: italic;
    text-align: center;
}


/* ----------------------------------------------------------------
   12. RÉDUCTION DES ANIMATIONS (RGAA 13.8)
   ---------------------------------------------------------------- */
   @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}