/*
Theme Name: Mon Theme Minimal
Author: Toto
Version: 1.0
Description: Thème minimaliste avec support Markdown complet.
*/

:root {
    --border: #3c3c3c;
    --bg: #1e1e1e;
    --accent: #007acc;
    
    --hr-width: auto;
    --hr-height: 1px;
    --hr-padding: 0;
    --hr-margin: 20px auto;
    --hr-color: auto;
    --hr-bgcolor: #333;
    --hr-color-night: auto;
    --hr-bgcolor-night: #333;
}

@media (prefers-color-scheme: dark) {
    :root {
        --border: #555555;
        --bg: #121212;
        --accent: #0098ff;
    }
}

body.night-mode {
    --border: #555555;
    --bg: #121212;
    --accent: #0098ff;
}

/* --- Styles de base du thème --- */
body {
    font-family: sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
    background: #fdfdfd;
}

header {
    border-bottom: 1px solid #eee;
    margin-bottom: 40px;
    padding-bottom: 20px;
}

/* --- Styles MyParsedown (VOS STYLES) --- */

h1{font-size:2em;padding-bottom:.7em;margin-bottom:1em;}
h2{font-size:1.5em;border-bottom:1px solid #eee;padding-bottom:.6em;margin-top:1em;}
.titreCentre {border-bottom:2px solid #ddd; text-align: center;}
h3{font-size:1.2em}


/* --- Cible chaque article présent dans la liste de la page d'accueil */
main article {
    border-bottom: 2px solid #eaeaea; /* Crée une ligne grise de séparation */
    padding-bottom: 40px;             /* Espace entre le texte et la ligne */
    margin-bottom: 40px;              /* Espace entre la ligne et l'article suivant */
}

/* --- Optionnel : Supprime la ligne de séparation sous le tout dernier article de la page */
main article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 1. Surlignage (==texte==) */
mark {
    background-color: #fff176;
    color: #212121;
    padding: 0 4px;
    border-radius: 2px;
}

/* 2. Souligné (++texte++) */
u {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 3. Exposant et Indice */
sup, sub {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* 4. Notes de bas de page */
.footnotes {
    font-size: 0.9em;
    border-top: 1px solid #eee;
    margin-top: 40px;
    padding-top: 20px;
    color: #666;
}

.footnote-ref {
    text-decoration: none;
    font-weight: bold;
    padding: 0 2px;
}

.footnote-backref {
    text-decoration: none;
    margin-left: 5px;
}

/* --- Tableaux Markdown --- */
table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    border: 1px solid #e0e0e0;
}

th {
    background-color: #f5f5f5;
    font-weight: 700;
    text-align: left;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
}

/* Espacement entre chaque groupe de définition */
/*
dl {
    margin-bottom: 1.5em;
}
*/
/* Le terme (ex: HTML) */
/*
dt {
    font-size: 1.1em;
    margin-bottom: 0.2em;
}
*/
/* Les définitions avec retrait et sans puce par défaut (on a mis un tiret dans le JS) */
/*
dd {
    margin-left: 20px;
    margin-bottom: 0.1em;
    color: #444;
}
*/
/* --- Séparation entre les définitions [cite: 52] --- */
/*
.def-block-simple, 
.def-block-multiple {
    margin-bottom: 2em; /* Espace net entre les blocs Markdown et HTML 
    line-height: 1.5;
}
*/
/* --- CAS 1 : Retrait ligne unique (4 espaces) --- */
/*
.def-block-simple {
    padding-left: 4ch;
    text-indent: -4ch;
}
*/
/* --- CAS 2 : Retrait lignes multiples --- */
/*
.term-line {
    font-weight: normal; /* Pas de gras par défaut [cite: 52] 
    margin-bottom: 0.2em;
}
*/
/*
.desc-line {
    padding-left: 4ch;   /* Retrait global pour les lignes avec tiret 
    text-indent: -1ch;  /* Aligne le texte sous lui-même, pas sous le tiret 
    margin-bottom: 0.1em;
}
*/

/* ==========================================================================
   Configuration MyParsedown : Lignes horizontales personnalisées
   ========================================================================== */
/**//*
.myp-hr {
    border: none;
    height: var(--hr-height, 1px);
    background-color: var(--hr-color, #333);
    width: var(--hr-width, 100%);
    margin: var(--hr-margin, 20px auto);
}
*//**/
/* Variante pointillée */
/**//*
.myp-hr.myp-hr-dashed {
    background-color: transparent;
    border-top: var(--hr-height, 1px) dashed var(--hr-color, #333);
}
*//**/
    /* Déclaration et valeurs de base des variables */
/*
.myp-hr {
    --hr-width: 100%;
    --hr-margin: 20px auto;
    --hr-color: #333;
    --hr-height: 1px;

    border: none;
    height: var(--hr-height);
    background-color: var(--hr-color);
    width: var(--hr-width);
    margin: var(--hr-margin);
}

.myp-hr.myp-hr-dashed {
    background-color: transparent;
    border-top: var(--hr-height) dashed var(--hr-color);
}
*/
.myp-hr {
    box-sizing: border-box;
    border: var(--hr-border, none);
    width: var(--hr-width, auto);
    height: var(--hr-height, 1px);
    padding: var(--hr-padding, 0);
    margin: var(--hr-margin, 20px auto);
    color: var(--hr-color, auto);
    background-color: var(--hr-bgcolor, #333);
}

.myp-hr-dashed {
    background-color: transparent !important;
    border-bottom: var(--hr-height, 1px) dashed var(--hr-bgcolor, #333);
}

@media (prefers-color-scheme: dark) {
    .myp-hr {
        color: var(--hr-color-night, auto);
        background-color: var(--hr-bgcolor-night, #333);
    }

    .myp-hr-dashed {
        border-bottom-color: var(--hr-bgcolor-night, #333);
    }
}

body.night-mode .myp-hr {
    color: var(--hr-color-night, auto);
    background-color: var(--hr-bgcolor-night, #333);
}

body.night-mode .myp-hr-dashed {
    border-bottom-color: var(--hr-bgcolor-night, #333);
}
/* --- CAS 1 : Bloc Simple (DIV) --- */
.def-block-simple {
    padding-left: 4ch;
    text-indent: -4ch;
    margin-bottom: 2em;
    line-height: 1.5;
}

/* --- CAS 2 : Bloc Multiple (DL) --- */
.def-block-multiple {
    margin-bottom: 2em;
}

.term-line {
    font-weight: normal;
    margin-bottom: 0.2em;
    display: block; /* Nécessaire pour DT */
}

.desc-line {
    /* On applique EXACTEMENT ton retrait sur le DD */
    margin-left: 0;        /* IMPORTANT : On vire la marge par défaut du navigateur */
    padding-left: 4ch;     /* Ton retrait global */
    text-indent: -1.2ch;   /* Ton retrait négatif pour le tiret */
    
    margin-bottom: 0.1em;
    line-height: 1.5;
    display: block;
    color: #444;
}

tbody tr:nth-child(even) { background-color: #fafafa; }
tbody tr:hover { background-color: #f1f1f1; transition: background-color 0.2s ease; }

@media screen and (max-width: 600px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}