:root {
    --brand: #3b7d3a;
    --ink: #1c231e;
    --muted: #6b6f72;
    --bg: #F7F7F7;
    --card: #fff;
    --border: #E5E5E5;
    --radius: 26px;
    --radius-sm: 10px;
    --shadow: 0 8px 28px rgba(0, 0, 0, .06);
    --ring: 0 0 0 3px rgba(59, 125, 58, .15);
}

/* Base bbPress + formulaires */
.bbp-wrap,
.bbp-forum-content,
.bbp-replies,
.bbp-topic-content,
.rh-form {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--ink);
}

.rh-composer {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin: 0 0 20px;
}



.rh-form .rh-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.rh-form .rh-legend {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
}

.rh-field {
    margin-bottom: 12px;
}

.rh-field label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.rh-input,
#bbp_topic_title,
#bbp_reply_title,
.wp-editor-area {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fcfdfc;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
}

.rh-input:focus,
#bbp_topic_title:focus,
#bbp_reply_title:focus,
.wp-editor-area:focus {
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.rh-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.rh-hint {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

/* Boutons */
.rh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    font-weight: 600;
}

.rh-btn--primary {
    background: var(--brand);
    color: #fff;
}

.rh-btn--primary:hover {
    filter: brightness(.98);
}

.rh-btn--ghost {
    background: #eef4ef;
    color: var(--brand);
}

.rh-btn--subtle {
    background: #eef2ee;
    color: #1c231e;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
}

/* Cartes génériques */
.rh-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.rh-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rh-card-title {
    margin: 0;
    font-weight: 800;
    line-height: 1.25;
}

.rh-card-title a {
    color: var(--ink);
    text-decoration: none;
}

.rh-card-title a:hover {
    text-decoration: underline;
}

.rh-meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

/* Chips */
.rh-chip {
    margin-left: auto;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef5ef;
    color: #2d5a2d;
    font-size: 12px;
    font-weight: 600;
}

/* === LISTE EN COLONNE + CARTE TOPIC AVEC IMAGE GAUCHE === */
.rh-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 980px;
    margin: 0 auto;
}

.rh-card.rh-card--topic {
    padding: 18px;
}

.rh-card-head--topic {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.rh-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rh-user img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.rh-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.rh-user-name {
    font-weight: 700;
}

.rh-user-time {
    font-size: 12px;
    color: var(--muted);
}

.rh-user img.avatar,
.bbp-author-avatar img,
.rh-card-head img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.rh-user-name {
    font-weight: 700;
}

.rh-user-time {
    font-size: 12px;
    color: var(--muted);
}

/* Corps 2 colonnes : image / texte */
.rh-card-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

.rh-card-media img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.rh-card-media--placeholder {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eef4ef;
    font-size: 28px;
    color: #2d5a2d;
}

.rh-card-text p {
    margin: 0;
    color: var(--ink);
}

.rh-card-actions {
    display: flex;
    justify-content: flex-end;
}

/* Taille titres dans les cartes de liste */
.rh-card--topic .rh-card-title {
    font-size: 20px;
}

/* Réponses / sujets par défaut (fallback) */
.bbp-body .type-topic,
.bbp-body .type-reply {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin: 0 0 12px;
}

/* Pagination */
.bbp-pagination {
    margin: 16px 0;
}

.bbp-pagination-links a,
.bbp-pagination-links span {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-right: 6px;
    color: var(--ink);
    text-decoration: none;
}

.bbp-pagination-links .current {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* États vides */
.rh-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fafcfb;
}

/* Accessibilité */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* TinyMCE / éditeur */
.wp-editor-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fcfdfc;
}

.wp-editor-tools,
.quicktags-toolbar {
    background: #f8faf8;
    border-bottom: 1px solid var(--border);
}

.mce-top-part,
.mce-container,
.mce-stack-layout-item {
    border-color: var(--border) !important;
}

::placeholder {
    color: color-mix(in srgb, var(--ink) 40%, transparent);
}

/* Composer sticky (uniquement quand on ajoute .is-sticky via PHP) */
.bbpress .rh-composer {
    position: relative;
}

@media (min-width:1024px) {
    .bbpress .rh-composer.is-sticky {
        position: sticky;
        top: 16px;
        z-index: 3;
    }
}

/* Breadcrumb / notices */
.bbp-breadcrumb,
.bbp-topic-tags {
    color: var(--muted);
}

.bbp-template-notice {
    border: 1px solid var(--border);
    background: #fafcfb;
    color: var(--ink);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width:900px) {
    .rh-card-body {
        grid-template-columns: 1fr;
    }

    .rh-card-media img,
    .rh-card-media--placeholder {
        height: 200px;
    }
}

@media (max-width:640px) {
    .rh-actions {
        flex-wrap: wrap;
    }

    .rh-hint {
        width: 100%;
        margin-left: 0;
        margin-top: 6px;
    }
}

$shortcodes = [
  'bbp-forum-index','bbp-topic-index','bbp-single-forum','bbp-single-topic',
  'bbp-single-reply','bbp-search','bbp-register','bbp-login','bbp-lost-pass',
  'rh_forum_recent',      // déjà présent
  'rh_forum_composer'     // <= AJOUT
];


/* Dark mode soft (facultatif) */
@media (prefers-color-scheme: dark) {
    :root {
        --card: #191919;
        --ink: #FFFFFF;
        --muted: #9aa09c;
        --border: #363636;
        --bg: #0b0c0b;
    }

    .rh-chip {
        background: #143218;
        color: #b7e0c0;
    }
}

