/* AD-RP: messaggi delle discussioni (template postbit_classic sid 1). Autore a sinistra, messaggio a destra;
   da telefono l'autore diventa una riga compatta sopra il messaggio. Usa le variabili del tema (chiaro e scuro). */

#posts .post.classic.adrp-pb,
.post.classic.adrp-pb {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    margin: 0 0 16px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius, 16px);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---------------------------------------------------------------- autore */
.post.classic.adrp-pb .post_author.adrp-pb-autore {
    grid-row: 1 / span 2;
    float: none;
    width: auto;
    margin: 0;
    padding: 22px 18px;
    border: 0;
    border-right: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
.post.classic.adrp-pb .author_avatar { float: none; margin: 0; padding: 0; }
.post.classic.adrp-pb .author_avatar img {
    width: 104px !important;
    height: 104px !important;
    max-width: none !important;
    object-fit: cover;
    border-radius: 22px;
    border: 3px solid var(--surface);
    box-shadow: 0 6px 18px rgba(20, 30, 60, .16);
}
.post.classic.adrp-pb .adrp-pb-info { float: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; width: 100%; }
.post.classic.adrp-pb .adrp-pb-nome { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.post.classic.adrp-pb .adrp-pb-nome a:link, .post.classic.adrp-pb .adrp-pb-nome a:visited { text-decoration: none; }
.post.classic.adrp-pb .adrp-pb-stato:empty { display: none; }
.post.classic.adrp-pb .adrp-pb-titolo { font-size: 13px; color: var(--muted); }
.post.classic.adrp-pb .adrp-pb-gruppo { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.post.classic.adrp-pb .adrp-pb-gruppo:empty { display: none; }
.post.classic.adrp-pb .adrp-pb-gruppo img { max-width: 100%; }

.post.classic.adrp-pb .author_statistics.adrp-pb-statistiche {
    float: none;
    width: 100%;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    font-size: 13px;
    color: var(--muted);
}
.adrp-pb-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.adrp-pb-stat > div { padding: 8px 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.adrp-pb-stat > div.largo { grid-column: 1 / -1; }
.adrp-pb-stat dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.adrp-pb-stat dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- messaggio */
.post.classic.adrp-pb .post_content.adrp-pb-contenuto {
    float: none;
    width: auto;
    margin: 0;
    padding: 18px 24px 8px;
    border: 0;
    min-width: 0;
}
.post.classic.adrp-pb .post_head.adrp-pb-testa {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}
.post.classic.adrp-pb .post_head.adrp-pb-testa > div:first-child { order: 2; margin-left: auto; float: none; }
.post.classic.adrp-pb .post_head .post_date { color: var(--muted); }
.post.classic.adrp-pb .post_body { padding: 0; font-size: 15.5px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.post.classic.adrp-pb .post_body img { max-width: 100%; height: auto; border-radius: 10px; }
.post.classic.adrp-pb .signature { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13.5px; color: var(--muted); }
.post.classic.adrp-pb .post_meta { padding: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- pulsanti */
.post.classic.adrp-pb .post_controls.adrp-pb-azioni {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 10px 24px 16px;
    border: 0;
    background: transparent;
    clear: none;
}
.post.classic.adrp-pb .postbit_buttons { float: none; display: flex; flex-wrap: wrap; gap: 6px; }
.post.classic.adrp-pb .postbit_buttons > a:link, .post.classic.adrp-pb .postbit_buttons > a:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s, transform .15s, background-color .15s;
}
.post.classic.adrp-pb .postbit_buttons > a:hover { border-color: var(--accent, #2e9bff); transform: translateY(-1px); text-decoration: none; }

/* ---------------------------------------------------------------- telefono */
@media (max-width: 760px) {
    #posts .post.classic.adrp-pb, .post.classic.adrp-pb { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; border-radius: 14px; }
    .post.classic.adrp-pb .post_author.adrp-pb-autore {
        grid-row: auto;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .post.classic.adrp-pb .author_avatar img { width: 46px !important; height: 46px !important; border-radius: 14px; border-width: 2px; }
    .post.classic.adrp-pb .adrp-pb-info { align-items: flex-start; gap: 1px; width: auto; min-width: 0; }
    .post.classic.adrp-pb .adrp-pb-nome { font-size: 15.5px; }
    .post.classic.adrp-pb .adrp-pb-gruppo { justify-content: flex-start; }
    .post.classic.adrp-pb .author_statistics.adrp-pb-statistiche { display: none; }
    .post.classic.adrp-pb .post_content.adrp-pb-contenuto { padding: 14px 14px 6px; }
    .post.classic.adrp-pb .post_body { font-size: 15px; }
    .post.classic.adrp-pb .post_controls.adrp-pb-azioni { grid-column: 1; padding: 8px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .post.classic.adrp-pb .postbit_buttons > a { transition: none; }
}

/* il tema di base imposta il riempimento di .post_content con piu' forza: qui vince il nostro */
#posts .post.classic.adrp-pb .post_content.adrp-pb-contenuto { padding: 18px 24px 8px !important; }
#posts .post.classic.adrp-pb .post_head.adrp-pb-testa { padding: 0 0 12px !important; margin: 0 0 12px !important; }
#posts .post.classic.adrp-pb .post_body { padding: 0 !important; }
@media (max-width: 760px) {
    #posts .post.classic.adrp-pb .post_content.adrp-pb-contenuto { padding: 14px 14px 6px !important; }
}
