@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Marcellus+SC&display=swap');

:root {
    --font-header: 'Marcellus SC', serif;
    --font-body: 'IM Fell English', serif;
    --color-parchment: #f8fafc;
    --color-ink-primary: #1e293b;
    --color-ink-secondary: #64748b;
    --color-brass-dark: #475569;
    --color-brass-light: #94a3b8;
    --border-ornate: 5px solid var(--color-brass-dark);
}

body {
    font-family: var(--font-body);
    background-color: var(--color-parchment);
    background-image: url('https://www.transparenttextures.com/patterns/old-paper-cascades.png');
    color: var(--color-ink-primary);
    line-height: 1.6;
    margin: 0;
    font-size: 18px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* Liens globaux */
a {
    color: var(--color-brass-dark);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-ink-primary);
}

/* Typographie Titres */
h1, h2, h3, h4 {
    font-family: var(--font-header);
    color: var(--color-ink-primary);
    margin-top: 0;
    text-transform: uppercase;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

/* --- Header Principal --- */
.main-header {
    background-color: rgba(138, 108, 63, 0.05); /* Teinte basée sur le laiton */
    border-bottom: 3px double var(--color-brass-dark);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    height: 55px;
    filter: sepia(0.5); /* Effet vieilli pour coller au thème */
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-family: var(--font-header);
    font-size: 1.2rem;
    color: var(--color-ink-primary);
    border-bottom: 1px solid transparent;
}

.main-nav a:hover {
    border-bottom-color: var(--color-brass-dark);
}

/* Boutons */
.user-actions {
    display: flex;
    gap: 1rem;
}

.button {
    font-family: var(--font-header);
    text-transform: uppercase;
    padding: 10px 20px;
    border: 2px solid var(--color-brass-dark);
    background: linear-gradient(to bottom, var(--color-brass-light), var(--color-brass-dark));
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    box-shadow: inset 0px 1px 0px var(--color-brass-light), 2px 2px 3px rgba(0,0,0,0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.button:hover {
    filter: brightness(1.1);
    color: #fff;
}

.button-secondary {
    background: transparent;
    border: 2px solid var(--color-brass-dark);
    color: var(--color-brass-dark);
    text-shadow: none;
    box-shadow: none;
}

.button-secondary:hover {
    background: rgba(138, 108, 63, 0.1);
    color: var(--color-ink-primary);
}

/* --- Bannière & Fil d'Ariane --- */
.hero-banner {
    border: var(--border-ornate);
    padding: 5px;
    background-color: var(--color-ink-primary); /* Cadre sombre autour de l'image */
    margin-bottom: 2rem;
}

.hero-banner img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    filter: sepia(0.2);
}

.page-header h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--color-brass-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.breadcrumb {
    font-family: var(--font-header);
    margin-bottom: 2rem;
    font-size: 1rem;
    color: var(--color-ink-secondary);
    border-bottom: 1px dashed var(--color-brass-light);
    padding-bottom: 10px;
}

.breadcrumb-separator {
    margin: 0 0.75rem;
    color: var(--color-brass-dark);
}

/* --- Section Forum (Liste des sujets) --- */
.forum-section {
    margin-bottom: 3rem;
    border: 1px solid var(--color-brass-light);
    background: rgba(255, 255, 255, 0.2);
}

.forum-header.breadcrumb-item {
    /* Adaptation du h2 dans le lien */
    display: block;
    background: linear-gradient(to right, rgba(138, 108, 63, 0.15), transparent);
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.6rem;
    color: var(--color-ink-primary);
    border-bottom: 2px solid var(--color-brass-dark);
}

.forum-item {
    display: grid;
    /* Avatar | Sujet | Auteur | Messages | Dernier Message */
    grid-template-columns: 60px 1fr 140px 100px 220px;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-brass-light);
    transition: background 0.2s;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-item:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.forum-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-brass-dark);
    padding: 2px;
}

.forum-subject {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--color-ink-primary);
    line-height: 1.3;
}

.forum-subject:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-brass-dark);
}

.forum-author, .forum-messages, .forum-last-message {
    font-size: 0.9rem;
    color: var(--color-ink-secondary);
}

.forum-author a {
    font-family: var(--font-header);
}

.forum-last-message {
    text-align: right;
    font-style: italic;
    font-size: 0.85rem;
}

/* --- Page Thread (Messages) --- */
.post {
    display: flex;
    padding: 1.5rem;
    border: 1px solid var(--color-brass-light);
    background: rgba(138, 108, 63, 0.03);
    margin-bottom: 1.5rem;
    box-shadow: 2px 2px 0px rgba(138, 108, 63, 0.1);
}

.post-author {
    flex: 0 0 160px;
    text-align: center;
    border-right: 1px dashed var(--color-brass-dark);
    padding-right: 1.5rem;
}

.author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px double var(--color-brass-dark);
    margin-bottom: 0.5rem;
}

.author-name {
    font-family: var(--font-header);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.author-meta {
    font-size: 0.85rem;
    color: var(--color-ink-secondary);
    font-style: italic;
}

.post-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-brass-dark);
    font-family: var(--font-header);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(138, 108, 63, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.post-content {
    font-size: 1.1rem;
    text-align: justify;
}

/* Formulaire de réponse */
.reply-form {
    padding: 2rem;
    border: var(--border-ornate);
    background: rgba(255, 255, 255, 0.3);
    margin-top: 2rem;
}

.reply-form textarea {
    width: 100%;
    min-height: 150px;
    background-color: #fff;
    border: 1px solid var(--color-brass-dark);
    color: var(--color-ink-primary);
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    box-sizing: border-box;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* --- Page Profil (User) --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.4);
    border: var(--border-ornate);
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-header .author-avatar {
    width: 130px;
    height: 130px;
}

.profile-header h2 {
    font-size: 2.8rem;
    border-bottom: 2px solid var(--color-brass-dark);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.profile-header p {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.profile-header strong {
    color: var(--color-brass-dark);
    font-family: var(--font-header);
}

.widget {
    border: 1px solid var(--color-brass-light);
    background: rgba(138, 108, 63, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-brass-light);
}

/* Liste des commentaires dans le profil */
.widget div {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(138, 108, 63, 0.3);
}

.widget div:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.comment-thread-title a {
    font-family: var(--font-header);
    font-size: 1.1rem;
    color: var(--color-ink-primary);
    display: block;
    margin-bottom: 0.3rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--color-brass-dark);
    font-family: var(--font-header);
    margin-bottom: 0.5rem;
}

.comment {
    font-style: italic;
    color: var(--color-ink-secondary);
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-left: 3px solid var(--color-brass-dark);
}

/* --- Pagination --- */
.pagination {
    margin: 2rem 0;
    text-align: center;
}

/* --- Footer --- */
.main-footer {
    background-color: rgba(92, 74, 61, 0.1); /* Dérivé ink-secondary */
    border-top: 1px solid var(--color-brass-light);
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-header);
    font-size: 0.95rem;
    color: var(--color-ink-secondary);
}

.footer-links a {
    margin-left: 1.5rem;
    color: var(--color-ink-secondary);
}

.footer-links a:hover {
    color: var(--color-brass-dark);
}

/* --- Responsive --- */
@media (max-width: 850px) {
    .forum-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        text-align: center;
        gap: 0.5rem;
    }
    .forum-avatar { margin: 0 auto; }
    .forum-last-message { text-align: center; }

    .post { flex-direction: column; }
    .post-author { 
        border-right: none; 
        border-bottom: 1px dashed var(--color-brass-dark);
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}