/* community-note.css — avviso "tono educato + linee guida" vicino ai box di scrittura.
   Markup: includes/community-note.php (spx_cnote). Classi raddoppiate: vincono sui moduli. */
.cnote.cnote {
    display: flex; align-items: flex-start; gap: 9px;
    box-sizing: border-box; width: 100%; margin: 0 0 12px; padding: 9px 13px;
    border: 1px solid #e2dff3; border-radius: 12px; background: #fbfaff; color: #5a5774;
    font-size: 13px; font-weight: 400; line-height: 1.5; text-align: left;
}
.cnote.cnote .cnote__ic { flex: none; width: 17px; height: 17px; min-width: 17px; margin: 1px 0 0; color: #534ab7; }
.cnote__tx { flex: 1; min-width: 0; }
.cnote.cnote a {
    color: #534ab7; font-weight: 600; text-decoration: underline;
    text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.cnote.cnote a:hover { text-decoration-thickness: 2px; }
.cnote.cnote a:focus-visible { outline: 2px solid #534ab7; outline-offset: 2px; border-radius: 3px; }

/* Riga senza sfondo */
.cnote--line.cnote--line, .cnote--focus.cnote--focus { padding: 0; border: 0; background: none; font-size: 12.5px; }
.cnote--line.cnote--line .cnote__ic, .cnote--focus.cnote--focus .cnote__ic { width: 15px; height: 15px; min-width: 15px; margin-top: 2px; }
.hub-cform .cnote.cnote { grid-column: 1 / -1; margin: 0; }
.bday-dlg__in .cnote.cnote { margin: 0; }

/* Solo mentre si scrive nell'elemento precedente (bacheca: un box per post) */
.cnote--focus.cnote--focus { display: none; margin: 8px 0 0; padding-left: 40px; }
:focus-within + .cnote--focus.cnote--focus,
.cnote--focus.cnote--focus:focus-within,
.cnote--focus.cnote--focus:hover { display: flex; }

/* Chat: sopra la barra di scrittura, colori del tema chat */
.cnote--chat.cnote--chat {
    flex: none; margin: 0; padding: 6px 16px; border: 0; border-radius: 0; border-top: 1px solid var(--chat-line, #e6e4f1);
    background: var(--chat-panel, #fff); color: var(--chat-mut, #5a5774); font-size: 12px; line-height: 1.4;
}
.cnote--chat.cnote--chat .cnote__ic { width: 14px; height: 14px; min-width: 14px; }

@media (max-width: 560px) {
    .cnote.cnote { padding: 8px 11px; font-size: 12.5px; }
    .cnote--line.cnote--line { padding: 0; font-size: 12px; }
    .cnote--focus.cnote--focus { padding: 0 0 0 40px; font-size: 12px; }
    .cnote--chat.cnote--chat { padding: 5px 12px; font-size: 11.5px; }
}

/* Tema scuro (/mobile) */
html[data-theme="dark"] .cnote.cnote { border-color: #322e4a; background: #1a1828; color: #b0acc9; }
html[data-theme="dark"] .cnote.cnote .cnote__ic, html[data-theme="dark"] .cnote.cnote a { color: #a49cf5; }
html[data-theme="dark"] .cnote--line.cnote--line, html[data-theme="dark"] .cnote--focus.cnote--focus { background: none; }
html[data-theme="dark"] .cnote--chat.cnote--chat { background: var(--chat-panel, #1a1828); color: var(--chat-mut, #b0acc9); }

/* Pulsante "Segnala" (assets/js/community-note.js) */
.cnr-btn.cnr-btn {
    display: inline-flex; align-items: center; gap: 5px; min-height: 28px; margin: 4px 0 0; padding: 2px 8px;
    border: 0; border-radius: 999px; background: none; color: #6b6885; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.cnr-btn.cnr-btn svg { flex: none; width: 14px; height: 14px; min-width: 14px; }
.cnr-btn.cnr-btn:hover { background: #fdecec; color: #b3262c; }
.cnr-btn.cnr-btn:focus-visible { outline: 2px solid #534ab7; outline-offset: 2px; }
.cnr-btn.cnr-btn[disabled] { background: none; color: #14865a; cursor: default; }
.pfw-c__tools .cnr-btn.cnr-btn, .qa-actions .cnr-btn.cnr-btn, .crx-qa__acts .cnr-btn.cnr-btn { margin: 0; }

/* Finestra di segnalazione */
.cnr-dlg { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0; border: 0; border-radius: 18px; background: #fff; color: #1b1930; box-shadow: 0 24px 60px rgba(27, 25, 48, .28); }
.cnr-dlg::backdrop { background: rgba(20, 18, 42, .5); }
.cnr-dlg__in { padding: 22px; }
.cnr-dlg .cnr-dlg__t { margin: 0 0 6px; padding: 0; border: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: inherit; }
.cnr-dlg .cnr-dlg__d { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: #5a5774; }
.cnr-dlg__list { display: grid; gap: 2px; margin: 0 0 12px; }
.cnr-dlg__opt { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; cursor: pointer; }
.cnr-dlg__opt:hover { background: #f4f3fa; }
.cnr-dlg__opt input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: #534ab7; }
.cnr-dlg__ta { box-sizing: border-box; width: 100%; padding: 10px 12px; border: 1px solid #d2cfe5; border-radius: 12px; background: #fff; color: inherit; font: inherit; font-size: 16px; resize: vertical; }
.cnr-dlg__ta:focus { outline: 2px solid #534ab7; outline-offset: 0; border-color: transparent; }
.cnr-dlg .cnr-dlg__msg { margin: 8px 0 0; font-size: 13.5px; color: #b3262c; }
.cnr-dlg .cnr-dlg__ok { margin: 4px 0 16px; font-size: 15px; font-weight: 600; }
.cnr-dlg .cnr-dlg__gl { display: inline-block; margin: 10px 0 0; font-size: 13px; font-weight: 600; color: #534ab7; text-decoration: underline; text-underline-offset: 2px; }
.cnr-dlg__act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.cnr-dlg__b, .cnt-box__b { min-height: 42px; padding: 0 18px; border: 1px solid #d2cfe5; border-radius: 999px; background: #fff; color: #1b1930; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cnr-dlg__b:hover, .cnt-box__b:hover { border-color: #534ab7; }
.cnr-dlg__b--pri, .cnt-box__b--pri { border-color: #534ab7; background: #534ab7; color: #fff; }
.cnr-dlg__b--pri:hover, .cnt-box__b--pri:hover { background: #463ea3; }
.cnr-dlg__b:focus-visible, .cnt-box__b:focus-visible { outline: 2px solid #534ab7; outline-offset: 2px; }
.cnr-dlg__b[disabled] { opacity: .55; cursor: default; }

/* "Vuoi rileggerlo prima di pubblicare?" */
.cnt-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; box-sizing: border-box; width: 100%; margin: 10px 0; padding: 13px 15px; border: 1px solid #ecd9ae; border-radius: 14px; background: #fdf7e8; color: #4b3a12; text-align: left; }
.cnt-box__tx { flex: 1 1 260px; min-width: 0; font-size: 13.5px; line-height: 1.5; }
.cnt-box__tx b { display: block; font-size: 14.5px; }
.cnt-box__tx a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cnt-box__act { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-main > .cnt-box { flex: none; width: auto; margin: 8px 12px; }
@media (max-width: 560px) {
    .cnr-btn.cnr-btn { min-height: 34px; }
    .cnt-box__act { width: 100%; }
    .cnt-box__b, .cnr-dlg__b { flex: 1 1 auto; min-height: 44px; }
}
.pfw-c__body + .cnr-btn.cnr-btn, .sdx-citem__body + .cnr-btn.cnr-btn, .sndg-cm__body + .cnr-btn.cnr-btn, .crx-qa__body + .cnr-btn.cnr-btn, .rv-m-ugc__body + .cnr-btn.cnr-btn { margin-left: -8px; }

/* Menu "⋯" dei commenti */
.cnm { position: relative; display: inline-flex; align-self: center; vertical-align: middle; }
.cnm__b.cnm__b.cnm__b { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; min-width: 34px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: none; color: #6b6885; cursor: pointer; }
.cnm__b.cnm__b.cnm__b svg { flex: none; width: 18px; height: 18px; min-width: 18px; }
.cnm__b.cnm__b.cnm__b:hover, .cnm.is-open .cnm__b.cnm__b.cnm__b { background: #efedf8; color: #1b1930; }
.cnm__b.cnm__b.cnm__b:focus-visible { outline: 2px solid #534ab7; outline-offset: 2px; }
.cnm__m { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; display: grid; min-width: 190px; max-width: min(280px, calc(100vw - 32px)); padding: 6px; border: 1px solid #e2dff3; border-radius: 14px; background: #fff; box-shadow: 0 12px 34px rgba(27, 25, 48, .18); }
.cnm__m[hidden] { display: none; }
.cnm--r .cnm__m { left: auto; right: 0; }
.cnm--up .cnm__m { top: auto; bottom: calc(100% + 4px); }
.cnm__m .cnm__i.cnm__i.cnm__i { display: flex; align-items: center; justify-content: flex-start; gap: 9px; width: 100%; height: auto; min-height: 40px; margin: 0; padding: 8px 12px; border: 0; border-radius: 9px; background: none; color: #1b1930; font: inherit; font-size: 14px; font-weight: 500; text-align: left; opacity: 1; cursor: pointer; }
.cnm__m .cnm__i.cnm__i.cnm__i:hover, .cnm__m .cnm__i.cnm__i.cnm__i:focus-visible { background: #f4f3fa; outline: none; }
.cnm__m .cnm__i.cnm__i.cnm__i:focus-visible { box-shadow: inset 0 0 0 2px #534ab7; }
.cnm__m .cnm__i.cnm__i.cnm__i[disabled] { color: #14865a; cursor: default; }
.cnm__m .cnm__i[hidden], .cnm__m .cnm__i[style*="none"] { display: none !important; }
@media (max-width: 560px) {
    .cnm__b.cnm__b.cnm__b { width: 40px; height: 36px; }
    .cnm__m .cnm__i.cnm__i.cnm__i { min-height: 44px; }
}

/* Conferma breve e messaggio */
.cnr-dlg--sm { width: min(360px, calc(100% - 32px)); }
.cnt-toast { position: fixed; left: 50%; bottom: 90px; z-index: 10095; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px; background: #1b1930; color: #fff; font-size: 14px; font-weight: 500; line-height: 1.4; transform: translateX(-50%); }

/* Chi scrive spesso vede solo la riga */
html.cnote-lite .cnote.cnote:not(.cnote--chat):not(.cnote--focus) { margin-bottom: 8px; padding: 0 2px; border: 0; background: none; font-size: 12.5px; }
html.cnote-lite .cnote.cnote:not(.cnote--chat) .cnote__ic { width: 15px; height: 15px; min-width: 15px; margin-top: 2px; }
.cnm.is-open { z-index: 61; }
.sdx-citem__body + .cnm, .sndg-cm__body + .cnm, .pfw-c__body + .cnm, .crx-qa__body + .cnm, .rv-m-ugc__body + .cnm { margin-left: -8px; }
.sdx-citem__body + .cnm, .sndg-cm__body + .cnm, .pfw-c__body + .cnm, .crx-qa__body + .cnm, .rv-m-ugc__body + .cnm { align-self: flex-start; }
