/*
 * V9.437 — rifiniture finali conversazioni e editor amministrativo.
 * Caricato per ultimo nel frontend e nel pannello admin.
 */

/* Stato vuoto della conversazione: mai più testo attaccato ai bordi. */
:is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-height: 118px !important;
  margin: 0 !important;
  padding: 24px 18px 30px !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-bottom: 1px solid var(--slr-ui-line-soft, var(--slr-social-line, #d9dee3)) !important;
  background: var(--slr-ui-surface, #fff) !important;
  color: var(--slr-ui-text, #111820) !important;
  text-align: left !important;
  line-height: 1.45 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty strong {
  display: block !important;
  margin: 0 !important;
  color: var(--slr-ui-text, #111820) !important;
  font-size: 16px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty span {
  display: block !important;
  margin: 0 !important;
  color: var(--slr-ui-muted, #66727d) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}
html[data-slr-theme="night"]
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty {
  background: var(--slr-ui-surface, #0d1115) !important;
  color: var(--slr-ui-text, #f4f5f6) !important;
}
html[data-slr-theme="night"]
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty strong {
  color: var(--slr-ui-text, #f4f5f6) !important;
}
html[data-slr-theme="night"]
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
  .slr-community-thread-results > .slr-comments-empty span {
  color: var(--slr-ui-muted, #9aa3ad) !important;
}

/*
 * Editor articoli admin: il foglio di scrittura resta volutamente bianco
 * anche nel tema Notte, come un foglio editoriale reale. Tutti i blocchi
 * formattati ereditano quindi un contrasto certo e prevedibile.
 */
html[data-slr-theme] body.admin-shell .admin-content .rich-editor {
  background: #fff !important;
  color: #17191d !important;
  caret-color: #17191d !important;
  color-scheme: light !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor > *:not(.admin-editor-social-embed),
html[data-slr-theme] body.admin-shell .admin-content .rich-editor > *:not(.admin-editor-social-embed) * {
  color: #17191d !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor :is(h2, h3) {
  color: #17191d !important;
  opacity: 1 !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor :is(p, li) {
  color: #252930 !important;
  opacity: 1 !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor blockquote {
  border-left-color: #a50035 !important;
  color: #545a64 !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor a {
  color: #821a38 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 2px !important;
}
html[data-slr-theme] body.admin-shell .admin-content .rich-editor:empty::before {
  color: #9299a5 !important;
}

@media (max-width: 760px) {
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
    .slr-community-thread-results > .slr-comments-empty {
    min-height: 104px !important;
    padding: 20px 14px 24px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
    .slr-community-thread-results > .slr-comments-empty strong {
    font-size: 15px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread)
    .slr-community-thread-results > .slr-comments-empty span {
    font-size: 12px !important;
  }
}


/* --------------------------------------------------------------------------
   V9.438 — flusso commenti definitivo in stile X.
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .slr-community-immersive-side {
    grid-template-rows: auto auto auto minmax(0, 1fr) !important;
    border-left: 0 !important;
  }
  .slr-community-immersive-thread .slr-comment-replies {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: 0 !important;
  }
  .slr-community-immersive-thread .slr-comment-replies > .slr-comment-item {
    padding-left: 0 !important;
  }
  .slr-community-immersive-side .slr-community-inline-composer.is-immersive {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px 14px 10px !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--slr-ui-line-soft, #d9dee3) !important;
    background: var(--slr-ui-surface, #fff) !important;
  }
  .slr-community-immersive-side .slr-community-inline-compose {
    display: block !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  .slr-community-immersive-side .slr-community-inline-compose > label {
    margin-bottom: 2px !important;
  }
  .slr-community-immersive-side .slr-comment-composer-text-shell {
    display: block !important;
    min-height: 44px !important;
    max-height: 150px !important;
    overflow: auto !important;
  }
  .slr-community-immersive-side textarea[data-comment-composer-body] {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    max-height: 130px !important;
    margin: 0 !important;
    padding: 4px 0 7px !important;
    overflow-y: auto !important;
  }
  .slr-community-immersive-side .slr-comment-composer-footer {
    position: static !important;
    inset: auto !important;
    z-index: 1 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    margin: 4px 0 0 !important;
    padding: 6px 0 0 !important;
    overflow: visible !important;
    border-top: 0 !important;
    background: transparent !important;
  }
  .slr-community-immersive-side .slr-comment-composer-footer .slr-comment-modal-tools {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    gap: 2px !important;
  }
  .slr-community-immersive-side .slr-comment-composer-footer > button[type="submit"] {
    position: static !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 88px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 17px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #101820 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-weight: 850 !important;
    line-height: 1 !important;
  }
  .slr-community-immersive-side .slr-comment-composer-footer > button[type="submit"]:disabled {
    opacity: .38 !important;
    cursor: not-allowed !important;
  }
  html[data-slr-theme="night"] .slr-community-immersive-side .slr-comment-composer-footer > button[type="submit"] {
    background: #f4c542 !important;
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
  }
}
[data-community-comment-open],
[data-community-comment-reply-open] {
  position: relative;
  z-index: 2;
}


/* --------------------------------------------------------------------------
   V9.497 HF5 — risposte piatte in stile X.
   Il server ora rende ogni risposta come riga sorella. Queste regole sono
   anche un fallback per eventuale HTML già presente in cache: niente linea
   verticale e nessun rientro progressivo a ogni livello.
   -------------------------------------------------------------------------- */
:is(.slr-community-thread-panel, .slr-community-immersive-thread, .slr-community-modal-thread) .slr-comment-replies,
body.slr-social-article-page .slr-comment-replies {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-left: 0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread, .slr-community-modal-thread) .slr-comment-replies > .slr-comment-item,
body.slr-social-article-page .slr-comment-replies > .slr-comment-item {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
  border-left: 0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread, .slr-community-modal-thread) .slr-comment-list.is-flat-thread > .slr-comment-item.is-reply,
body.slr-social-article-page .slr-comment-list.is-flat-thread > .slr-comment-item.is-reply {
  margin-left: 0 !important;
  border-left: 0 !important;
}
