/* V9.436 — dettaglio post, conversazioni e azioni social coerenti. */

.slr-community-single-column > .slr-community-post.is-single {
  border-bottom: 1px solid var(--slr-ui-line-soft, var(--slr-social-line, #d9dee3));
}

.slr-community-inline-composer {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--slr-ui-line-soft, var(--slr-social-line, #d9dee3));
  background: var(--slr-ui-surface, #fff);
  color: var(--slr-ui-text, #111820);
}
.slr-community-inline-composer.is-login,
.slr-community-inline-composer.is-restricted {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.slr-community-inline-composer.is-login strong,
.slr-community-inline-composer.is-restricted strong { font-size: 15px; }
.slr-community-inline-composer.is-login span,
.slr-community-inline-composer.is-restricted span { color: var(--slr-ui-muted, #5f6b76); }
.slr-community-inline-composer.is-login a {
  margin-left: auto;
  border-radius: 999px;
  padding: 9px 15px;
  background: #101820;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.slr-community-inline-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #a50035;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.slr-community-inline-avatar img { width: 100%; height: 100%; object-fit: cover; }
.slr-community-inline-compose { min-width: 0; }
.slr-community-inline-compose > label {
  display: block;
  margin: 0 0 4px;
  color: var(--slr-ui-muted, #5f6b76);
  font-size: 13px;
}
.slr-community-inline-compose .slr-comment-composer-text-shell { min-height: 60px; }
.slr-community-inline-compose textarea {
  min-height: 60px !important;
  max-height: 220px;
  padding: 4px 0 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  resize: vertical;
}
.slr-community-inline-compose .slr-comment-composer-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--slr-ui-line-soft, #d9dee3);
}

.slr-community-thread-panel {
  width: 100%;
  min-width: 0;
  background: var(--slr-ui-surface, #fff);
  color: var(--slr-ui-text, #111820);
}
.slr-community-thread-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 12px !important;
  border: 0 !important;
  background: transparent !important;
}
.slr-community-thread-header > div { min-width: 0; }
.slr-community-thread-header span {
  display: block;
  color: var(--slr-ui-muted, #5f6b76);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.slr-community-thread-header h2 {
  margin: 3px 0 0 !important;
  color: var(--slr-ui-text, #111820) !important;
  font-size: 22px !important;
  line-height: 1.1;
}
.slr-community-thread-header b {
  color: var(--slr-ui-muted, #5f6b76);
  font-size: 14px;
}
.slr-community-comment-sort {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  border-top: 1px solid var(--slr-ui-line-soft, #d9dee3);
  border-bottom: 1px solid var(--slr-ui-line-soft, #d9dee3);
  background: var(--slr-ui-surface, #fff);
}
.slr-community-comment-sort button {
  position: relative;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--slr-ui-muted, #5f6b76);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.slr-community-comment-sort button::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
}
.slr-community-comment-sort button:hover,
.slr-community-comment-sort button:focus-visible,
.slr-community-comment-sort button.is-active,
.slr-community-comment-sort button[aria-pressed="true"] {
  color: #a50035;
  background: rgba(0,0,0,.035);
}
.slr-community-comment-sort button.is-active::after,
.slr-community-comment-sort button[aria-pressed="true"]::after { background: #a50035; }
.slr-community-thread-panel.is-loading { opacity: .72; cursor: progress; }
.slr-community-thread-results { min-height: 84px; }
.slr-community-thread-loading,
.slr-community-thread-error {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 24px;
  color: var(--slr-ui-muted, #5f6b76);
  text-align: center;
}
.slr-community-thread-error button {
  margin-top: 10px;
  border: 1px solid var(--slr-ui-line-soft, #d9dee3);
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: inherit;
  font-weight: 800;
}

/* La stessa riga sociale viene usata nella pagina e nel pannello immersivo. */
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-list {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-item {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 0 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 15px 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--slr-ui-line-soft, #d9dee3) !important;
  border-radius: 0 !important;
  background: var(--slr-ui-surface, #fff) !important;
  color: var(--slr-ui-text, #111820) !important;
  box-shadow: none !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-avatar {
  grid-column: 1;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  display: grid !important;
  place-items: center;
  overflow: hidden !important;
  border: 1px solid var(--slr-ui-line-soft, #d9dee3) !important;
  border-radius: 50% !important;
  background: var(--slr-ui-elevated, #f0f2f4) !important;
  color: var(--slr-ui-text, #111820) !important;
  font-size: 11px;
  font-weight: 900;
  aspect-ratio: 1;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-avatar img,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-avatar picture,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-avatar picture img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  transform: none !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-main {
  grid-column: 2;
  min-width: 0;
  color: var(--slr-ui-text, #111820) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-main > header {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0 0 5px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--slr-ui-muted, #5f6b76) !important;
  font-size: 12px;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-author-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-author-link strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--slr-ui-text, #111820) !important;
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-body {
  margin: 0 !important;
  color: var(--slr-ui-text, #111820) !important;
  font-size: 14px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-media {
  width: min(100%, 520px) !important;
  margin: 10px 0 4px !important;
  overflow: hidden;
  border: 1px solid var(--slr-ui-line-soft, #d9dee3) !important;
  border-radius: 14px !important;
  background: var(--slr-ui-subtle, #f2f4f6) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-media img {
  width: 100% !important;
  height: auto !important;
  max-height: 520px !important;
  object-fit: contain !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-actions {
  width: 100%;
  max-width: 430px;
  margin: 9px 0 0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-replies {
  grid-column: 2 / -1 !important;
  width: 100%;
  min-width: 0;
  margin: 12px 0 0 !important;
  padding: 0 0 0 12px !important;
  border-left: 2px solid var(--slr-ui-line-soft, #d9dee3) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-replies > .slr-comment-item {
  grid-template-columns: 36px minmax(0, 1fr) !important;
  padding: 11px 0 11px 10px !important;
  border-bottom: 0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-replies .slr-comment-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
}

/* Modalità immersiva: viene aperta soltanto dal dettaglio post su desktop. */
.slr-community-immersive-viewer {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: stretch;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease;
}
.slr-community-immersive-viewer.is-open { opacity: 1; visibility: visible; }
.slr-community-immersive-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0,0,0,.88);
}
.slr-community-immersive-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  width: 100%;
  height: 100dvh;
  background: #050607;
}
.slr-community-immersive-media {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #050607;
}
.slr-community-immersive-media > img,
.slr-community-immersive-media > video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
}
.slr-community-immersive-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.slr-community-immersive-side {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--slr-ui-surface, #fff);
  color: var(--slr-ui-text, #111820);
  border-left: 1px solid var(--slr-ui-line-soft, #d9dee3);
}
.slr-community-immersive-side > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slr-ui-line-soft, #d9dee3);
}
.slr-community-immersive-side > header > button {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 24px;
}
.slr-community-immersive-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.slr-community-immersive-author > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #a50035;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.slr-community-immersive-author img { width: 100%; height: 100%; object-fit: cover; }
.slr-community-immersive-author div { min-width: 0; display: grid; }
.slr-community-immersive-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slr-community-immersive-author small { color: var(--slr-ui-muted, #5f6b76); }
.slr-community-immersive-body {
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slr-ui-line-soft, #d9dee3);
  font-size: 14px;
  line-height: 1.45;
}
.slr-community-immersive-thread {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.slr-community-immersive-thread .slr-community-thread-header { padding: 12px 14px 8px !important; }
.slr-community-immersive-thread .slr-community-thread-header span { display: none; }
.slr-community-immersive-thread .slr-community-thread-header h2 { font-size: 18px !important; }
.slr-community-immersive-thread .slr-community-comment-sort button { min-height: 42px; }
.slr-community-immersive-side .slr-community-inline-composer.is-immersive {
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 12px 14px;
  border-top: 1px solid var(--slr-ui-line-soft, #d9dee3);
  border-bottom: 0;
}
.slr-community-immersive-side .slr-community-inline-avatar { width: 38px; height: 38px; }
.slr-community-immersive-side .slr-comment-composer-text-shell { min-height: 42px; }
.slr-community-immersive-side textarea { min-height: 42px !important; }
body.slr-community-immersive-open { overflow: hidden !important; }

html[data-slr-theme="night"] .slr-community-comment-sort button:hover,
html[data-slr-theme="night"] .slr-community-comment-sort button:focus-visible,
html[data-slr-theme="night"] .slr-community-comment-sort button.is-active,
html[data-slr-theme="night"] .slr-community-comment-sort button[aria-pressed="true"] {
  color: #f4c542;
  background: rgba(255,255,255,.045);
}
html[data-slr-theme="night"] .slr-community-comment-sort button.is-active::after,
html[data-slr-theme="night"] .slr-community-comment-sort button[aria-pressed="true"]::after { background: #f4c542; }
html[data-slr-theme="night"] :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-item,
html[data-slr-theme="night"] .slr-community-inline-composer,
html[data-slr-theme="night"] .slr-community-comment-sort,
html[data-slr-theme="night"] .slr-community-immersive-side {
  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-comment-author-link strong,
html[data-slr-theme="night"] :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-body,
html[data-slr-theme="night"] :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-main {
  color: var(--slr-ui-text, #f4f5f6) !important;
}
html[data-slr-theme="night"] .slr-community-inline-composer.is-login a {
  background: #f4c542;
  color: #111;
}

@media (max-width: 1023px) {
  .slr-community-immersive-viewer { display: none !important; }
}

@media (max-width: 760px) {
  .slr-community-single-header { position: sticky; top: 0; z-index: 25; }
  .slr-community-inline-composer {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 14px;
  }
  .slr-community-inline-avatar { width: 40px; height: 40px; }
  .slr-community-inline-compose > label { font-size: 12px; }
  .slr-community-thread-header { padding: 14px 14px 10px !important; }
  .slr-community-thread-header h2 { font-size: 20px !important; }
  .slr-community-comment-sort button { min-height: 46px; font-size: 12px; }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-item {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 0 10px !important;
    padding: 13px 14px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-author-link strong { font-size: 13px; }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-body { font-size: 14px; }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-replies { padding-left: 8px !important; }
}

/* V9.436 — azioni delle risposte identiche a post e articoli. */
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-actions.slr-social-post-actions {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 520px !important;
  min-width: 0 !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.slr-social-post-action {
  appearance: none !important;
  -webkit-appearance: none !important;
  min-width: 0 !important;
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--slr-ui-muted, #66727d) !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 550 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  cursor: pointer;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.slr-social-post-action.is-views {
  cursor: default;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action-icon.slr-social-action-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  flex: 0 0 32px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: currentColor !important;
  box-shadow: none !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-actions svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  margin: 0 !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action-count.slr-social-action-count {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  color: currentColor !important;
  font-size: 12px !important;
  line-height: 1 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action-count[hidden] {
  display: none !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-comments:hover,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-views:hover,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-bookmark:hover,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-share:hover {
  color: #1d9bf0 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-comments:hover .slr-comment-action-icon,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-bookmark:hover .slr-comment-action-icon,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-share:hover .slr-comment-action-icon {
  background: rgba(29, 155, 240, .12) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-repost:hover,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-repost.is-active {
  color: #00ba7c !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-repost:hover .slr-comment-action-icon,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-repost.is-active .slr-comment-action-icon {
  background: rgba(0, 186, 124, .12) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-like:hover,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-like.is-active {
  color: #f91880 !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-like:hover .slr-comment-action-icon,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-like.is-active .slr-comment-action-icon {
  background: rgba(249, 24, 128, .12) !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-like.is-active svg,
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.is-bookmark.is-active svg {
  fill: currentColor !important;
}
:is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action:focus-visible {
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
  border-radius: 999px !important;
}

@media (max-width: 760px) {
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-actions.slr-social-post-actions {
    max-width: none !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action.slr-social-post-action {
    justify-content: center !important;
    gap: 1px !important;
    min-height: 36px !important;
    font-size: 10px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action-icon.slr-social-action-icon {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    flex-basis: 29px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-actions svg {
    width: 17px !important;
    height: 17px !important;
  }
  :is(.slr-community-thread-panel, .slr-community-immersive-thread) .slr-comment-action-count.slr-social-action-count {
    font-size: 10px !important;
  }
}
