main {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 16px;
}

main > section {
    flex: 1;
    min-width: 0;
}

main > aside {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    main > aside {
        width: 100%;
    }
}

/* === Forum section === */
.forum-category h2 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.forum-category h2 span {
    font-size: 14px;
    font-weight: 400;
    color: #999;
}

.forum-category hr {
    border: none;
    border-top: 1px solid #EAE0D6;
    margin-bottom: 12px;
}

.topics-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid #EAE0D6;
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.15s;
}

.topic:hover {
    border-color: #7B4F2E;
    cursor: pointer;
}

.topic-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.topic-info {
    flex: 1;
    min-width: 0;
}

.topic-pinned {
    display: inline-block;
    font-size: 11px;
    color: #7B4F2E;
    background-color: rgba(123, 79, 46, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 4px;
}

.topic-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.topic-author {
    font-size: 12px;
    color: #999;
}

.topic-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.topic-stats span {
    font-size: 12px;
    color: #888;
}

/* === Aside === */
.aside-container {
    background-color: white;
    border: 1px solid #EAE0D6;
    border-radius: 10px;
    padding: 16px;
    overflow: hidden;
}

.aside-title {
    background-color: rgba(123, 79, 46, 0.08);
    border-bottom: 1px solid #EAE0D6;
    margin: -16px -16px 14px;
    padding: 10px 16px;
}

.aside-title h3 {
    font-size: 14px;
    font-weight: 600;
    color: #7B4F2E;
}

/* Tabs */
.aside-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.aside-tab-btn {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #EAE0D6;
    border-radius: 20px;
    background: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.aside-tab-btn.active,
.aside-tab-btn:hover {
    background-color: #7B4F2E;
    color: white;
    border-color: #7B4F2E;
}

/* Member list */
.aside-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #EAE0D6;
    text-decoration: none;
    transition: background-color 0.15s;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 0;
}

.aside-member:hover {
    background-color: #FAFAF8;
}

.aside-member:last-child {
    border-bottom: none;
}

.aside-rank span {
    display: block;
    width: 18px;
    font-size: 13px;
    font-weight: 700;
    color: #7B4F2E;
    text-align: center;
}

.aside-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.aside-avatar img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.aside-user-info > span {
    font-size: 13px;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aside-user-info > div {
    display: flex;
    gap: 10px;
    margin-top: 3px;
}

.aside-user-info > div > span {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #aaa;
}

.aside-user-info > div > span i {
    font-size: 10px;
}

.aside-user-info > div > span:nth-child(1) i { color: #e57373; }
.aside-user-info > div > span:nth-child(2) i { color: #64b5f6; }
.aside-user-info > div > span:nth-child(3) i { color: var(--main-brown); }

.aside-badge span {
    font-size: 11px;
    background-color: rgba(123, 79, 46, 0.1);
    color: #7B4F2E;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Topics list */
.aside-topic {
    padding: 8px 0;
    border-bottom: 1px solid #EAE0D6;
}

.aside-topic:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aside-topic h3 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aside-topic {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #EAE0D6;
    text-decoration: none;
}

.aside-topic:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.aside-topic:hover .aside-topic-body h4 {
    color: var(--main-brown);
}

.aside-topic-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.aside-topic-body {
    flex: 1;
    min-width: 0;
}

.aside-topic-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.aside-topic-body > span {
    font-size: 11px;
    color: #aaa;
}

.aside-topic-stats {
    display: flex;
    gap: 8px;
}

.aside-topic-stats span {
    font-size: 11px;
    color: #aaa;
}

/* === Footer === */
footer {
    border-top: 1px solid #EAE0D6;
    background-color: white;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    gap: 48px;
}

.footer-brand {
    flex: 1;
}

.footer-logo {
    font-size: 22px;
    font-weight: 700;
    color: #7B4F2E;
    font-family: serif;
    display: block;
    margin-bottom: 8px;
}

.footer-brand p {
    font-size: 13px;
    color: #999;
}

.footer-col h3 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col ul a {
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col ul a:hover {
    color: #7B4F2E;
}

.footer-bottom {
    border-top: 1px solid #EAE0D6;
    padding: 14px 16px;
    text-align: center;
}

.footer-bottom span {
    font-size: 12px;
    color: #bbb;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        gap: 24px;
    }
}

/* ── Page post ── */
.post-article {
    background: white;
    border: 1px solid #EAE0D6;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #EAE0D6;
    flex-shrink: 0;
}

.post-author-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.post-date {
    display: block;
    font-size: 12px;
    color: #aaa;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-body {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ── Commentaires ── */
.comments-section {
    background: white;
    border: 1px solid #EAE0D6;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comments-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding-bottom: 14px;
    border-bottom: 1px solid #EAE0D6;
    margin: 0;
}

#comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #EAE0D6;
    flex-shrink: 0;
    display: block;
}

.comment-content {
    flex: 1;
    background: #FAFAF8;
    border: 1px solid #EAE0D6;
    border-radius: 10px;
    padding: 12px 16px;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.comment-date {
    font-size: 11px;
    color: #bbb;
}

.comment-body {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
}

/* ── Formulaire commentaire ── */
.comment-form {
    border-top: 1px solid #EAE0D6;
    padding-top: 20px;
}

.comment-form-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-form-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #EAE0D6;
    display: block;
    flex-shrink: 0;
}

.comment-form-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form-fields textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #EAE0D6;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #FAFAF8;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, background-color 0.15s;
    box-sizing: border-box;
    min-height: 80px;
}

.comment-form-fields textarea:focus {
    border-color: var(--main-brown);
    background: white;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}

.comment-submit-btn {
    padding: 8px 20px;
    background-color: var(--main-brown);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.comment-submit-btn:hover {
    opacity: 0.88;
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Bouton like ── */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #EAE0D6;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.like-btn:hover {
    border-color: #e57373;
    color: #e57373;
}

.like-btn.liked {
    border-color: #e57373;
    color: #e57373;
}

.like-btn i {
    font-size: 13px;
    transition: transform 0.15s;
}

.like-btn.liked i {
    color: #e57373;
}

@keyframes like-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.45); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.like-btn.like-pop i {
    animation: like-pop 0.35s ease forwards;
}

.post-like-row {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #EAE0D6;
}

/* ── Bouton supprimer le post (admin) ── */
.post-delete-admin {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-delete-post {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: none;
    border: 1px solid #e57373;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #e57373;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-delete-post:hover {
    background: #e57373;
    color: #fff;
}

/* ── Actions sous un commentaire ── */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-toggle-reply {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--main-brown);
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s;
}

.btn-toggle-reply:hover {
    opacity: 0.7;
}

.toggle-replies-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.toggle-replies-btn:hover {
    color: #666;
}

.btn-delete {
    background: none;
    border: none;
    font-size: 12px;
    color: #ddd;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
    margin-left: auto;
}

.btn-delete:hover {
    color: #e57373;
}

/* ── Formulaire de réponse inline ── */
.reply-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: #F5F2EF;
    border-radius: 8px;
    border: 1px solid #EAE0D6;
}

.reply-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #EAE0D6;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    background: white;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.reply-form textarea:focus {
    border-color: var(--main-brown);
}

.reply-form button[type="submit"] {
    align-self: flex-end;
    padding: 6px 16px;
    background-color: var(--main-brown);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.reply-form button[type="submit"]:hover {
    opacity: 0.88;
}

/* ── Réponses imbriquées ── */
.comment-replies {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 16px;
    border-left: 2px solid #EAE0D6;
}

.comment-reply .comment-content {
    background: #F5F2EF;
}

.comment-login-prompt {
    font-size: 13px;
    color: #999;
    text-align: center;
    border-top: 1px solid #EAE0D6;
    padding-top: 16px;
    margin: 0;
}

.comment-login-prompt a {
    color: var(--main-brown);
    font-weight: 600;
    text-decoration: none;
}

/* ── Page sous-catégorie ── */
.subcategory-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.subcategory-back {
    font-size: 13px;
    color: var(--main-brown);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.subcategory-back:hover {
    text-decoration: underline;
}

.subcategory-header h2 {
    flex: 1;
    margin: 0;
}

.subcategory-count {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
}

.subcategory-empty {
    font-size: 14px;
    color: #aaa;
    text-align: center;
    padding: 32px 0;
}

/* ── Voir plus ── */
.voir-plus-btn {
    display: block;
    width: fit-content;
    margin: 8px 0 20px auto;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--main-brown);
    border: 1px solid var(--main-brown);
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.voir-plus-btn:hover {
    background-color: var(--main-brown);
    color: white;
}

/* ── Page création de post ── */
#create-section {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 16px;
    width: 100%;
}

.create-card {
    background: white;
    border: 1px solid #EAE0D6;
    border-radius: 12px;
    overflow: hidden;
}

.create-card-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #EAE0D6;
}

.create-card-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}

.create-card-header p {
    font-size: 13px;
    color: #999;
}

.create-form {
    padding: 24px 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.create-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.create-field label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.create-field input,
.create-field textarea,
.create-field select {
    padding: 10px 14px;
    border: 1px solid #EAE0D6;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: #FAFAF8;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
}

.create-field textarea {
    resize: vertical;
    min-height: 160px;
}

.create-field input:focus,
.create-field textarea:focus,
.create-field select:focus {
    border-color: var(--main-brown);
    background-color: white;
}

.create-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.create-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.create-btn-cancel {
    font-size: 14px;
    color: #999;
    text-decoration: none;
    padding: 9px 18px;
    border: 1px solid #EAE0D6;
    border-radius: 8px;
    transition: border-color 0.15s, color 0.15s;
}

.create-btn-cancel:hover {
    border-color: #ccc;
    color: #666;
}

.create-btn-submit {
    padding: 9px 24px;
    background-color: var(--main-brown);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.create-btn-submit:hover {
    opacity: 0.88;
}

@media (max-width: 600px) {
    .create-row {
        grid-template-columns: 1fr;
    }

    .create-card-header,
    .create-form {
        padding-left: 20px;
        padding-right: 20px;
    }
}