/* CodeLinSoft Nova — bbPress role PNG badges */
.cls-role-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  max-width:100%;
  line-height:1;
}

.cls-role-badge__img {
  display:block;
  width:auto!important;
  height:auto!important;
  max-width:140px;
  max-height:30px;
  aspect-ratio:auto;
  object-fit:contain;
  object-position:center;
}

.cls-role-badge--text {
  font:inherit;
  color:inherit;
}

/* Topic and reply author rail. */
.cls-post-card__author .cls-role-badge {
  margin:4px auto 2px;
  width:100%;
}
.cls-post-card__author .cls-role-badge__img {
  max-width:118px;
  max-height:32px;
}

/* User profile header/stat cards. */
.cls-profile-card__meta .cls-role-badge__img,
.cls-profile-role .cls-role-badge__img,
.k-stat .cls-role-badge__img {
  max-width:138px;
  max-height:32px;
}

/* Hover user card. */
.bbp-userpop__badges .cls-role-badge__img {
  max-width:112px;
  max-height:26px;
}

@media (max-width: 767px) {
  .cls-role-badge__img {
    max-width:124px;
    max-height:28px;
  }

  .cls-post-card__author .cls-role-badge {
    width:auto;
    margin:2px 0;
  }

  .cls-post-card__author .cls-role-badge__img {
    max-width:110px;
    max-height:26px;
  }
}


/* Nova 4.9.28 — exact username colour configured per bbPress role. */
.cls-role-user-color {
  color: var(--cls-user-role-color, inherit) !important;
}
a.cls-role-user-color:hover,
a.cls-role-user-color:focus-visible {
  color: var(--cls-user-role-color, inherit) !important;
}

/* Nova 4.9.29 — configured role colour is authoritative. */
#bbpress-forums .cls-role-user-color[style],
.bbp-tabs-bar .cls-role-user-color[style] {
  color: var(--cls-user-role-color) !important;
}
#bbpress-forums a.cls-role-user-color[style]:hover,
#bbpress-forums a.cls-role-user-color[style]:focus-visible,
.bbp-tabs-bar a.cls-role-user-color[style]:hover,
.bbp-tabs-bar a.cls-role-user-color[style]:focus-visible {
  color: var(--cls-user-role-color) !important;
}


/* Nova 4.9.32 — profile role badge sits directly below the username. */
body.cls-bbp-unified .cls-profile-card__role-row {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  margin:6px 0 4px;
  line-height:1;
}

body.cls-bbp-unified .cls-profile-card__role-row .cls-role-badge {
  display:inline-flex;
  width:auto;
  max-width:100%;
  margin:0;
}

body.cls-bbp-unified .cls-profile-card__role-row .cls-role-badge__img {
  display:block;
  width:auto!important;
  height:auto!important;
  max-width:138px;
  max-height:32px;
  object-fit:contain;
  object-position:left center;
}

@media (max-width: 767px) {
  body.cls-bbp-unified .cls-profile-card__role-row {
    margin:5px 0 3px;
  }

  body.cls-bbp-unified .cls-profile-card__role-row .cls-role-badge__img {
    max-width:120px;
    max-height:28px;
  }
}


/* ==========================================================================
   Nova 4.9.34 — topic/reply mobile: targhetta sempre sotto il nome autore.
   ========================================================================== */
@media (max-width: 760px) {
  body.cls-bbp-unified .cls-post-card__author {
    display:grid!important;
    grid-template-columns:52px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:10px!important;
    row-gap:5px!important;
    align-items:start!important;
    text-align:left!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-post-card__avatar {
    grid-column:1!important;
    grid-row:1 / span 2!important;
    align-self:start!important;
    justify-self:start!important;
    margin:0!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-post-card__author-name {
    grid-column:2!important;
    grid-row:1!important;
    align-self:end!important;
    justify-self:start!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    line-height:1.2!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-role-badge {
    grid-column:2!important;
    grid-row:2!important;
    align-self:start!important;
    justify-self:start!important;
    width:auto!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-role-badge__img {
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:118px!important;
    max-height:28px!important;
    margin:0!important;
    object-fit:contain!important;
    object-position:left center!important;
  }

  body.cls-bbp-unified .cls-post-card__author > small {
    display:none!important;
  }
}


/* ==========================================================================
   Nova 4.9.39 — live Online/Offline presence badge.
   ========================================================================== */
.cls-user-presence {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:max-content;
  max-width:100%;
  min-height:23px;
  padding:4px 8px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  line-height:1;
  letter-spacing:.02em;
  white-space:nowrap;
}

.cls-user-presence__dot {
  display:block;
  flex:0 0 7px;
  width:7px;
  height:7px;
  border-radius:50%;
}

.cls-user-presence--online {
  border-color:#c8efda;
  background:#eafaf1;
  color:#188752;
}

.cls-user-presence--online .cls-user-presence__dot {
  background:#20c875;
  box-shadow:0 0 0 3px rgba(32,200,117,.13);
}

.cls-user-presence--offline {
  border-color:#e0e7ed;
  background:#f3f6f8;
  color:#66798c;
}

.cls-user-presence--offline .cls-user-presence__dot {
  background:#98a7b5;
}

.cls-profile-card__presence-row {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  margin:2px 0 3px;
}

.cls-post-card__author .cls-user-presence {
  margin:3px auto 2px;
}

/* Dynamic profile avatar dot follows the same live state. */
.cls-profile-online-dot[data-presence-state="online"],
.cls-profile-online-dot.is-online {
  background:#20c875!important;
}

.cls-profile-online-dot[data-presence-state="offline"],
.cls-profile-online-dot.is-offline {
  background:#98a7b5!important;
  box-shadow:0 0 0 4px #fff!important;
}

@media (max-width:760px) {
  body.cls-bbp-unified .cls-post-card__author {
    grid-template-rows:auto auto auto!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-post-card__avatar {
    grid-row:1 / span 3!important;
  }

  body.cls-bbp-unified .cls-post-card__author .cls-post-card__presence {
    grid-column:2!important;
    grid-row:3!important;
    align-self:start!important;
    justify-self:start!important;
    margin:0!important;
  }

  body.cls-bbp-unified .cls-profile-card__presence-row {
    margin-top:2px;
  }

  .cls-user-presence {
    min-height:21px;
    padding:3px 7px;
    font-size:9.5px;
  }
}
