/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── RESET & VARIABLES ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:      #f2f1ec;
    --surface: #ffffff;
    --border:  #e4e3dd;
    --border-h:#c8c7c0;
    --text:    #1a1a18;
    --muted:   #6b6b64;
    --label:   #9a9a92;
    --radius:  12px;
    --mono:    'DM Mono', 'Fira Code', 'Consolas', monospace;
    --sans:    'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --shadow:  0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-h:0 4px 20px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
}

html, body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}

/* ── TITRES DE PAGE ── */
h1 {
    font-family: var(--sans);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 i { font-size: 1.5rem; }

/* ── BOUTONS CTAN / GITHUB ── */
.ctan-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.ctan-button:hover {
    border-color: var(--border-h);
    box-shadow: var(--shadow-h);
    transform: translateY(-1px);
    color: var(--text);
}

/* ── GRILLES ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 14px;
    margin: 1.5rem auto;
    max-width: 1100px;
}

.packages-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

/* ── TUILE / CARD ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-h);
    transform: translateY(-2px);
    border-color: var(--border-h);
    text-decoration: none;
    color: var(--text);
}

/* Ligne du haut : icône + flèche */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: #eeede8;
    color: #666;
    flex-shrink: 0;
}

.card-arrow {
    font-size: 13px;
    color: #ccc;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    margin-top: 2px;
}
.card:hover .card-arrow {
    color: #999;
    transform: translate(1px, -1px);
}

/* Label catégorie */
.card-cat {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--label);
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

/* Titre */
.card h3 {
    font-family: var(--mono);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
    word-break: break-all;
}

/* Description */
.card p {
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

/* ── COULEURS PAR CATÉGORIE ── */
/* Graphiques — bleu */
.card.graphiques .card-icon-wrap,
.graphiques-page .card .card-icon-wrap   { background: #deeeff; color: #007BFF; }
.graphiques-page .card:hover             { border-left: 3px solid #007BFF; }

/* Jeux — rouge */
.card.jeux .card-icon-wrap,
.jeux-page .card .card-icon-wrap         { background: #fce8ea; color: #dc3545; }
.jeux-page .card:hover                   { border-left: 3px solid #dc3545; }

/* Maths — vert */
.card.maths .card-icon-wrap,
.maths-page .card .card-icon-wrap        { background: #d8f3df; color: #28a745; }
.maths-page .card:hover                  { border-left: 3px solid #28a745; }

/* Outils — violet */
.card.outils .card-icon-wrap,
.outils-page .card .card-icon-wrap       { background: #ede8f8; color: #6f42c1; }
.outils-page .card:hover                 { border-left: 3px solid #6f42c1; }

/* Tous — brun */
.card.tous .card-icon-wrap               { background: #f0e8e8; color: #614747; }
.tous-page .card .card-icon-wrap         { background: #f0e8e8; color: #614747; }
.tous-page .card:hover                   { border-left: 3px solid #614747; }

/* Fun */
.card.fun .card-icon-wrap                { background: #f5f5d0; color: #7a7a00; }

/* Package page — bordeaux */
.package-page .card .card-icon-wrap      { background: #f4e8f2; color: #6A0D55; }
.package-page .card:hover                { border-left: 3px solid #6A0D55; }

/* Tuile retour (accueil) */
.card-back .card-icon-wrap { background: #f0f0ec; color: #888; }

/* ── SECTION NEWS (index) ── */
.news-section {
    max-width: 1100px;
    margin: 32px auto;
    padding: 22px 26px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 3px solid #ffc107;
    box-shadow: var(--shadow);
}
.news-section h2 {
    font-family: var(--sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}
.news-content {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.65;
}

/* ── FOOTER ── */
.site-footer {
    background: transparent;
    padding: 20px 0 16px;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 48px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--label);
}
.footer-content p { margin: 3px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    body { padding: 1.2rem 1rem 0; }
    h1 { font-size: 1.4rem; }
    .grid, .packages-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
