:root {
    --primary-orange: #ff6a00;
    --secondary-yellow: #FFE066;
    --text-primary: #222;
    --text-secondary: #555;
    --text-light: #777;
    --bg-cream: #fff2beff;
    --color-terminale: #ff9800;
    --bg-terminale: #fff3e0;
    --color-prepa: #d32f2f;
    --bg-prepa: #ffebee;
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;

    --font-main: 'Poppins', sans-serif;
    --font-serif: 'Merriweather', serif;
}

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

body {
    font-family: var(--font-main);
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-cream);
    min-height: 100vh;
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    /* Conteneur blanc comme sur Icare */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    margin-top: 40px;
    margin-bottom: 40px;
}

/* --- HEADER ARTICLE --- */
.article-header {
    text-align: center;
    margin-bottom: 50px;
}

.category-tag {
    background: rgba(255, 106, 0, 0.1);
    color: var(--primary-orange);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 106, 0, 0.2);
    display: inline-block;
    margin-bottom: 20px;
    text-transform: uppercase;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 25px;
    color: var(--text-primary);
    /* Optionnel : petit dégradé subtil sur le titre */
    background: linear-gradient(45deg, #bf360c, #f57c00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.meta-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 20px;
}

/* --- IMAGES & FIGURES --- */
.hero-img-container {
    margin: 40px auto;
    /* Center the container */
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    position: relative;
    background: transparent;
    /* Remove black background */
    max-width: 800px;
    /* Limit container width */
}

.hero-img-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.hero-img-container:hover img {
    transform: scale(1.02);
}

.caption {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.white-card-container {
    background: white;
    padding: 15px;
    margin: 30px auto;
    /* Center the container */
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dark-caption {
    color: #333;
    background: transparent;
    position: relative;
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 0;
    width: auto;
    bottom: auto;
}

/* --- TYPOGRAPHIE CONTENU --- */
.intro {
    background: #fff8e1;
    /* Jaune très pâle Icare */
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    border-left: 5px solid var(--secondary-yellow);
    font-size: 1.15rem;
    font-family: var(--font-serif);
    color: var(--text-primary);
    line-height: 1.9;
}

p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    /* Texte gris foncé lisible */
}

h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 50px 0 25px;
    border-bottom: 3px solid var(--primary-orange);
    display: inline-block;
    padding-bottom: 10px;
}

h2::after {
    content: none;
}

/* On retire le trait fin du design précédent */

/* --- BOITES D'INFORMATION (TECHNIQUE) --- */
.tech-box {
    background: #e3f2fd;
    /* Bleu très pâle (Style Icare) */
    border-left: 5px solid #1976d2;
    padding: 25px;
    margin: 30px 0;
    border-radius: var(--border-radius);
}

.tech-box h4 {
    color: #0d47a1;
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.tech-box p {
    color: #37474f;
    margin-bottom: 0;
}

/* --- NIVEAUX DE LECTURE (ADAPTÉS LIGHT) --- */

/* Niveau Terminale (Orange) */
.level-terminale {
    background: var(--bg-terminale);
    border: 1px solid #ffe0b2;
    border-left: 5px solid var(--color-terminale);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 40px 0;
    box-shadow: var(--shadow-light);
}

.level-terminale h3 {
    color: #e65100;
    /* Orange foncé pour le texte */
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-terminale p {
    color: #4e342e;
}

.level-terminale img {
    max-width: 100%;
    height: auto;
}

/* Niveau Prépa (Rouge) */
.level-prepa {
    background: var(--bg-prepa);
    border: 1px solid #ffcdd2;
    border-left: 5px solid var(--color-prepa);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 40px 0;
    box-shadow: var(--shadow-light);
}

.level-prepa h3 {
    color: #b71c1c;
    /* Rouge foncé pour le texte */
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-prepa p {
    color: #3e2723;
}

/* --- ANIMATION --- */
.wave-animation {
    height: 120px;
    background: #fafafa;
    /* Fond clair */
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    margin: 40px 0;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: transparent;
    border: 2px solid var(--primary-orange);
    border-radius: 50%;
    animation: rippleEffect 3s infinite linear;
    opacity: 0;
}

.ripple:nth-child(2) {
    animation-delay: 1s;
}

.ripple:nth-child(3) {
    animation-delay: 2s;
}

@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
        border-width: 4px;
    }

    100% {
        width: 500px;
        height: 500px;
        opacity: 0;
        border-width: 0px;
    }
}

/* --- QUIZ --- */
.quiz-container {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-top: 60px;
    border-top: 5px solid var(--primary-orange);
    box-shadow: var(--shadow-medium);
}

.quiz-container h3 {
    color: var(--text-primary);
}

.quiz-option {
    background: #f8fafc;
    padding: 15px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #f1f5f9;
    font-weight: 500;
    color: var(--text-secondary);
}

.quiz-option:hover {
    background: #fff3e0;
    border-color: var(--primary-orange);
}

.quiz-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.quiz-option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.feedback-msg {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    min-height: 25px;
}

/* --- NAVIGATION FOOTER --- */
.article-navigation {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 20px;
}

.btn-miga {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-orange), #ff9500);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
    transition: all 0.3s ease;
    border: none;
    margin: 0;
}

.btn-miga:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 123, 0, 0.4);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .article-header h1 {
        font-size: 2rem;
    }

    .meta-info {
        flex-direction: column;
        gap: 10px;
        font-size: 0.9rem;
    }

    .hero-img-container {
        margin: 20px -20px;
        border-radius: 0;
        width: calc(100% + 40px);
        max-width: none;
    }

    .container {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: var(--border-radius);
        /* Keep border radius if possible, or 0 if full width desired. Keeping consistent with Astrophoto */
    }

    h2 {
        font-size: 1.5rem;
        margin-top: 30px;
    }

    .intro {
        padding: 20px;
        font-size: 1rem;
    }

    .tech-box,
    .level-terminale,
    .level-prepa {
        padding: 20px;
        margin: 20px 0;
        overflow-x: auto;
        max-width: 100%;
    }

    .article-navigation {
        flex-direction: column;
        gap: 20px;
    }

    .btn-miga {
        width: 100%;
        justify-content: center;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix for buttons and overflow */
    .btn-miga {
        white-space: nowrap;
    }

    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.7rem;
    }
}

/* --- ANIMATION TROUS NOIRS (PURE CSS) --- */
.bh-container {
    margin: 40px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    background: #050505;
    /* Fond spatial très sombre */
    position: relative;
    border: 1px solid #333;
}

.bh-space {
    height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Le système qui tourne */
.binary-system {
    width: 100px;
    height: 100px;
    position: absolute;
    animation: orbit 2s linear infinite;
    z-index: 10;
}

/* Les trous noirs individuels */
.black-hole {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 30% 30%, #444, #000 60%);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.4);
    /* Lueur d'accrétion subtile */
}

.bh-left {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.bh-right {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Les ondes (Cercles qui s'agrandissent) */
.grav-wave {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
}

/* Animation des ondes avec délais */
.w1 {
    animation: ripple 3s linear infinite;
    animation-delay: 0s;
}

.w2 {
    animation: ripple 3s linear infinite;
    animation-delay: 1s;
}

.w3 {
    animation: ripple 3s linear infinite;
    animation-delay: 2s;
}

/* --- KEYFRAMES --- */
@keyframes orbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes ripple {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.8;
        border-color: rgba(255, 106, 0, 0.6);
        /* Début orange intense */
    }

    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
        border-color: rgba(255, 255, 255, 0);
    }
}