/* Import de la typographie Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* Variables de couleurs (Mode Clair par défaut) */
:root {
    --bg-color: #f7f7f9;
    --card-bg: #ffffff;
    --text-main: #1c1c1e;
    --text-muted: #8e8e93;
    --accent: #007aff;
    --border-radius: 16px;
}

/* Variables de couleurs (Mode Sombre automatique) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --card-bg: #1c1c1e;
        --text-main: #f5f5f7;
        --text-muted: #8e8e93;
        --accent: #0a84ff;
    }
}

/* Réinitialisation globale */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Structure principale et halo lumineux */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 1;
}

body::before {
    content: "";
    position: fixed;
    top: -15%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0,122,255,0.06) 0%, rgba(247,247,249,0) 70%);
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    animation: floatGlow 8s ease-in-out infinite alternate;
}

@media (prefers-color-scheme: dark) {
    body::before {
        background: radial-gradient(circle, rgba(10,132,255,0.12) 0%, rgba(0,0,0,0) 70%);
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Animations d'apparition */
@keyframes floatGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(5%, 8%); }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* En-tête */
header {
    margin-top: 40px;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease forwards;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.signature {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

/* Grille des liens sociaux (Bento UI) */
.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.1s forwards;
}

.social-button {
    background-color: var(--card-bg);
    color: var(--text-main);
    text-decoration: none;
    padding: 16px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s ease;
}

.social-button:active {
    transform: scale(0.98);
}

/* Tailles et alignements des SVG dans les boutons sociaux */
.social-icon {
    width: 22px;
    height: 22px;
    color: var(--text-main);
}

.chevron-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.social-button:hover .chevron-icon {
    transform: translateX(3px);
}

/* Titre de la section Blog */
.blog-header {
    margin-top: 50px;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.15s forwards;
}

.blog-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* Filtres de navigation */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.filter-chip {
    background-color: var(--card-bg);
    color: var(--text-main);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    font-family: inherit;
}

.filter-chip.active {
    background-color: var(--text-main);
    color: var(--bg-color);
}

/* Conteneur du blog */
#blog-container {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.3s forwards;
}

/* Cartes des articles */
.article-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* Conteneur et Badges des catégories */
.category-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.article-category {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #b45309; 
    background-color: #fef3c7; 
    padding: 4px 8px;
    border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
    .article-category {
        color: #fcd34d;
        background-color: rgba(245, 158, 11, 0.15);
    }
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.article-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Mise en forme du contenu de l'article */
.article-content {
    font-size: 1rem;
    color: var(--text-main);
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(142, 142, 147, 0.2);
    cursor: text;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.article-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 16px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-muted);
    background-color: rgba(142, 142, 147, 0.05);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

.hidden {
    display: none;
}

/* Bouton Charger Plus */
.load-more {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    margin-bottom: 24px;
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid rgba(142, 142, 147, 0.3);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.load-more:hover {
    background-color: rgba(142, 142, 147, 0.05);
}

.load-more:active {
    transform: scale(0.98);
}

.load-more.hidden {
    display: none;
}

/* Bouton Flottant Remonter (Figé) */
.back-to-top {
    position: fixed;
    /* Comportement par défaut sur ordinateur */
    bottom: 40px; 
    right: 40px;
    width: 44px;
    height: 44px;
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 1px solid rgba(142, 142, 147, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
}

@media (max-width: 640px) {
    .back-to-top {
        /* On annule le bottom pour utiliser le top */
        bottom: auto;
        /* On fige la position par rapport au haut de l'écran avec la nouvelle unité svh */
        top: calc(100vh - 90px); /* Solution de repli pour anciens navigateurs */
        top: calc(100svh - 90px); /* Fige le bouton sur les navigateurs mobiles modernes */
        right: 20px;
    }
}

/* Footer minimaliste */
footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(142, 142, 147, 0.2);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.4s forwards;
    margin-bottom: 80px; 
}

footer a {
    color: var(--text-muted);
    text-decoration: underline;
}