/* =========================
   Variables
   ========================= */

:root {
    --bg: #1A202E;
    --fg: #e6e6eb;

    --red-soft: #e06c75;
    --yellow-soft: #e5c07b;
    --green-soft: #B9E57B;
    --cyan-soft: #7BE5C9;
    --muted: #9aa0a6;
}

/* =========================
   Layout
   ========================= */

body {
    background: var(--bg);
    color: var(--fg);
    font-family: "FiraCode Nerd Font", monospace;
    font-size: clamp(11px, 1.5vw, 16px);
    line-height: 1.9;
    margin: 0;
}



div#content {
    max-width: 80em;
    margin: auto;
    padding: 1.5rem;
}

/* =========================
   Titres
   ========================= */

h1 {
    font-size: clamp(26px, 4.5vw, 36px);
    color: var(--fg);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 3px solid var(--red-soft);
}

h2 {
    font-size: clamp(24px, 4.5vw, 32px);
    color: var(--fg);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-left: 5px solid var(--yellow-soft);
    padding-left: 0.6rem;
}

h3 {
    font-size: clamp(20px, 4vw, 28px);
    color: var(--fg);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-left: 5px solid var(--green-soft);
    padding-left: 0.6rem;
}

h4 {
    font-size: clamp(18px, 3.5vw, 24px);
    color: var(--fg);
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    border-left: 5px solid var(--cyan-soft);
    padding-left: 0.6rem;
}

/* =========================
   Texte
   ========================= */

p {
    margin: 0.5rem 0 1rem 0;
    line-height: 1.9 !important;
}

ul, ol {
    margin-left: 1.5rem;
}

li {
    margin: 0.3rem 0;
}

/* =========================
   Liens
   ========================= */

a {
    color: #46ACE3;
    text-decoration: none;
    word-break: break-word;
}

a::before {
    content: "»";
    opacity: 0.6;
}

/* =========================
   Code
   ========================= */

code {
    font-family: "FiraCode Nerd Font", monospace;
    font-size: 0.9em;
    background: #0f1117;
    padding: 0.15em 0.35em;
    border-radius: 4px;
}

pre {
    background: #0f1117;
    padding: 1.1rem;

    overflow-x: auto;
    border-radius: 6px;
    font-size: 0.9em;
}

pre.src::before {
    display: inline !important;
    margin-top: 14px;
    color: var(--fg) !important;
    background-color: transparent !important;
}




pre .org-keyword {
    color: #BA68B8 ;
}

pre .org-type {
    color: #CC9343;

}

pre .org-function-name {
    color: #84C779;

}

pre .org-string {
    color: #DE71A0 ;
}

pre code {
    background: none;
    padding: 0;
}

 pre.src-c:before { content: 'C'; }
 pre.src-cpp:before { content: 'C++'; }




/* =========================
   Tables
   ========================= */

table {
    margin: 1rem auto;
    border-collapse: collapse;
    display: block;
    max-width: fit-content;
    overflow-x: auto;
    margin: 0 auto;
}

th, td {
    border: 1px solid #fafafa77;
    padding: 0.5rem 0.75rem;
}

th {
    background: #0f1117;
    font-weight: 600;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 768px) {
    div#content {
        padding: 1rem;
    }

    /* aa */
    h1, h2, h3, h4 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
        line-height: 1.9;
    }

    div#content {
        padding: 0.75rem;
    }

    h1 {
        font-size: 22px;
        border-bottom-width: 2px;
    }

    h2 {
        font-size: 20px;
        border-left-width: 3px;
        padding-left: 0.4rem;
    }

    h3 {
        font-size: 18px;
        border-left-width: 3px;
        padding-left: 0.4rem;
    }

    h4 {
        font-size: 16px;
        border-left-width: 3px;
        padding-left: 0.4rem;
    }

    pre, code {
        font-size: 0.85em;
    }
}

/* =========================
   Images responsive
   ========================= */
img {
    max-width: 100%;   /* l'image ne dépassera jamais la largeur du conteneur */
    height: auto;      /* conserve les proportions */
    display: block;    /* permet margin auto pour centrer */
    margin: 0.5rem auto; /* centrer et un peu d'espace vertical */
    border-radius: 6px;  /* optionnel : arrondir les coins comme tes blocs code */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* optionnel : un petit effet visuel */
}

/* Si tu veux cibler seulement les images dans le contenu */
div#content img {
    max-width: 100%;
    height: auto;
}


div.def {
    background-color: #2C354A;
    border-radius: 6px;
    padding: 1px 20px;
    margin: 10px 0;
}

div.def p:first-child::before {
    content: "Définition : ";
    font-weight: bold;
}
