:root {
    /* --- Variables Injectées --- */
    --font-main: 'Inter', sans-serif;
    --color-bg: #FAF6F2;
    --color-text: #4D3D33;
    --color-text-muted: #9A8B82;
    --color-accent: #7FA9C9;
    --color-accent-hover: #93BBD9;
    --color-border: #EBE3DB;
    --color-surface: #FFFFFF;
    --color-text-inverted: #FFFFFF;
    --color-surface-translucent: rgba(255, 255, 255, 0.5);
    --color-breadcrumb-tag: rgba(0, 0, 0, 0.03);
    --color-shadow: rgba(0, 0, 0, 0.1);
    --hero-overlay-color: rgba(77, 61, 51, 0.5);
    --profile-shape-color: rgba(127, 169, 201, 0.1);
    
    /* --- Variables Design System --- */
    --radius-soft: 16px;
    --radius-pill: 50px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Texture de fond */
.background-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('https://www.transparenttextures.com/patterns/recycled-paper.png');
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
img { max-width: 100%; display: block; }

/* Conteneur principal */
.container, .main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--color-surface-translucent);
    backdrop-filter: blur(10px);
    border-bottom: 1px dashed var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--color-text);
}
.logo img { height: 36px; width: auto; }

.main-nav { display: flex; gap: 30px; }

.nav-link {
    font-weight: 600;
    color: var(--color-text-muted);
    position: relative;
    padding: 5px 0;
}
.nav-link:hover, .nav-link.active { color: var(--color-text); }

/* Indicateur actif */
.nav-link.active::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    margin: 4px auto 0;
}

.cta-button {
    background-color: var(--color-accent);
    color: var(--color-text-inverted);
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}
.cta-button:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
}

/* =========================================
   HERO SECTION (HOME)
   ========================================= */
.hero {
    position: relative;
    text-align: center;
    padding: 80px 20px;
    margin: 40px 0 60px;
    /* Forme organique "Oeil" / "Feuille" */
    border-radius: 50% 50% 50% 50% / 60% 65% 40% 45%;
    overflow: hidden;
    color: var(--color-text-inverted);
    background-color: var(--color-accent);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
    .hero { border-radius: 45% 55% 60% 40% / 65% 50% 50% 35%; }
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background-color: var(--hero-overlay-color);
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}
.hero__content h1 { font-size: 3rem; font-weight: 800; margin-bottom: 10px; line-height: 1.1; }
.hero__content p { font-size: 1.2rem; opacity: 0.95; }

/* Breadcrumb */
.breadcrumb { margin: 20px 0; font-size: 0.9rem; color: var(--color-text-muted); }
.breadcrumb-item:hover { color: var(--color-accent); text-decoration: underline; }

/* =========================================
   PAGE D'ACCUEIL : LES BULLES ORGANIQUES
   ========================================= */

/* Grille des bulles */
.forum-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px; /* Espace large pour respirer */
    margin-bottom: 60px;
    
    background: transparent;
    border: none;
    padding: 0;
}

/* Titre de la catégorie */
.forum-section > a {
    grid-column: 1 / -1;
    margin-bottom: 10px;
    background: transparent;
    border: none;
    padding: 0 10px;
}

.forum-header {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
}

/* --- L'ITEM "BULLE" --- */
.forum-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 3rem 2rem;
    min-height: 250px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    box-shadow: var(--shadow-soft);
    z-index: 1;
}

/* Variations de formes (Blobs) */
.forum-item:nth-child(4n+1) { border-radius: 50% 50% 50% 50% / 60% 65% 40% 45%; }
.forum-item:nth-child(4n+2) { border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%; }
.forum-item:nth-child(4n+3) { border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%; }
.forum-item:nth-child(4n+4) { border-radius: 45% 55% 55% 45% / 55% 45% 40% 60%; }

/* Effet Hover */
.forum-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-hover);
    z-index: 10;
    background-color: #fff;
}

/* Contenu de la bulle */
.forum-subject {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 20px;
    order: 1;
}

.forum-avatar { display: none; } /* On cache l'avatar pour le style épuré */

.forum-author {
    order: 3;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: auto;
}

.forum-messages {
    order: 4;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    opacity: 0.8;
    margin-top: 5px;
}
.forum-messages::before { content: "• "; margin-right: 5px; }

.forum-last-message { display: none; }

/* =========================================
   PAGE PROFIL (USER) - HEADER PRESERVÉ
   ========================================= */
/* --- PAGE USER & FORMULAIRES --- */
.profile-header {
    position: relative;
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 4rem;
    border-radius: 45% 55% 60% 40% / 65% 50% 50% 35%;
    overflow: hidden;
    background-color: var(--color-surface-translucent);
    border: 1px solid var(--color-border);
}

.profile-header__shape {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    background-color: var(--profile-shape-color);
    border-radius: 68% 32% 57% 43% / 44% 52% 48% 56%;
    transform: translate(-50%, -50%);
    animation: morph 12s infinite ease-in-out alternate;
    z-index: 1;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--color-surface);
    box-shadow: 0 5px 15px var(--color-shadow);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 800;
    position: relative;
    z-index: 2;
}
.profile-meta { color: var(--color-text-muted); font-weight: 600; margin-top: 0.25rem; position: relative; z-index: 2; }

.profile-stats {
    display: flex; justify-content: center; gap: 1rem;
    margin-top: 1.5rem; font-weight: 600;
    position: relative; z-index: 2;
}
.stat-separator { width: 1px; height: 16px; background-color: var(--color-border); }

/* --- SECTION ACTIVITÉ (Category-Section Refaite) --- */
.category-section {
    margin-bottom: 60px;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--color-border);
    color: var(--color-text);
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* On style les divs d'activité comme des cartes propres (pas de blobs ici) */
.thread-list > div {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 25px;
    border-radius: var(--radius-soft);
    transition: transform 0.2s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

/* Petite barre colorée au survol */
.thread-list > div::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; 
    background: var(--color-border); transition: 0.2s;
}

.thread-list > div:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-soft);
}
.thread-list > div:hover::before { background: var(--color-accent); }

.comment-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.comment-thread-title a {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}
.comment-thread-title a:hover { color: var(--color-accent); }

.comment {
    margin-top: 15px;
    font-style: italic;
    color: var(--color-text-muted);
    line-height: 1.6;
    padding-left: 15px;
    border-left: 2px solid var(--color-border);
}

/* =========================================
   PAGE THREAD (POSTS)
   ========================================= */
.thread-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin: 40px 0 50px;
}

.post-list { display: flex; flex-direction: column; gap: 30px; }

.post-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-soft);
    padding: 30px;
    display: flex;
    gap: 30px;
}

.post-author {
    flex-shrink: 0; width: 140px; text-align: center;
    border-right: 1px dashed var(--color-border); padding-right: 20px;
}
.author-avatar {
    width: 80px; height: 80px; border-radius: 50%; margin-bottom: 10px;
    border: 3px solid var(--color-bg);
}
.author-name { display: block; font-weight: 700; color: var(--color-text); margin-bottom: 5px; }
.author-role {
    font-size: 0.75rem; color: var(--color-text-inverted);
    text-transform: uppercase; font-weight: 700; letter-spacing: 1px;
    background: var(--color-accent); padding: 4px 10px; border-radius: 12px;
}

.post-content { flex-grow: 1; }
.post-date {
    font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 15px;
    border-bottom: 1px dotted var(--color-border); padding-bottom: 10px; display: block;
}

/* =========================================
   FOOTER & ANIMATIONS
   ========================================= */
.site-footer {
    text-align: center; padding: 40px 0; margin-top: 60px;
    border-top: 1px dotted var(--color-border);
}
.site-footer .logo { justify-content: center; font-size: 1.4rem; margin-bottom: 15px; }
.site-footer p { color: var(--color-text-muted); font-size: 0.9rem; }

.footer-nav { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.footer-nav a { color: var(--color-text-muted); font-weight: 600; }
.footer-nav a:hover { color: var(--color-text); }

@keyframes morph {
    0% { border-radius: 68% 32% 57% 43% / 44% 52% 48% 56%; }
    100% { border-radius: 35% 65% 62% 38% / 54% 41% 59% 46%; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .site-header { padding: 15px 20px; flex-direction: column; gap: 15px; }
    .main-nav { gap: 15px; font-size: 0.9rem; }
    
    /* On simplifie les bulles sur mobile pour gagner de la place */
    .forum-section { grid-template-columns: 1fr; gap: 20px; }
    .forum-item { border-radius: 20px !important; padding: 30px 20px; min-height: auto; }
    
    .post-item { flex-direction: column; }
    .post-author { 
        width: 100%; border-right: none; border-bottom: 1px dashed var(--color-border);
        padding-bottom: 20px; margin-bottom: 20px;
        display: flex; align-items: center; gap: 20px; text-align: left;
    }
    .author-avatar { width: 60px; height: 60px; margin: 0; }
}