/* The recovered theme lays out cForumRow/ipsDataItem rows with
   display:table-cell columns, and positions the last-poster avatar via a
   float + negative-left-margin trick (an li gets margin-left:50px, then
   .ipsUserPhoto floats left with margin-left:-50px to sit in that gutter).
   That combination doesn't hold up with our markup -- the avatar ends up
   overlapping the stats badge in the previous column instead of sitting in
   its own cell. Flexbox gives the same visual result (icon | title+meta |
   stats | avatar+byline) without depending on that float math. */

.ipsDataItem.ipsDataItem_responsivePhoto {
  display: flex;
  align-items: center;
  gap: var(--sp-3, 12px);
}

.ipsDataItem.ipsDataItem_responsivePhoto > .ipsDataItem_icon {
  display: block;
  flex: 0 0 auto;
}

.ipsDataItem.ipsDataItem_responsivePhoto > .ipsDataItem_main {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.ipsDataItem.ipsDataItem_responsivePhoto > .ipsDataItem_stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  width: auto;
}

/* The theme's own rule (.cForumRow .ipsDataItem_stats dl) draws the boxed
   number badge, but its padding (var(--sp-4) var(--sp-2)) is taller than
   it is wide, and <dd> carries a default 40px left margin from the
   browser's UA stylesheet -- together that stretched the badge into a wide
   rectangle and pushed "topics" out of line with the number above it. */
.ipsDataItem.ipsDataItem_responsivePhoto .ipsDataItem_stats dl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin: 0;
  padding: 0;
  text-align: center;
}

.ipsDataItem.ipsDataItem_responsivePhoto .ipsDataItem_stats dt,
.ipsDataItem.ipsDataItem_responsivePhoto .ipsDataItem_stats dd {
  margin: 0;
}

.ipsDataItem.ipsDataItem_responsivePhoto > .ipsDataItem_lastPoster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ipsDataItem.ipsDataItem_responsivePhoto > .ipsDataItem_lastPoster li {
  display: block;
  margin: 0 !important;
}

.ipsDataItem.ipsDataItem_responsivePhoto .ipsUserPhoto {
  float: none !important;
  margin: 0 !important;
  display: block !important;
}

/* Forum index cleanup: one quiet list, not nested cards and counters. */
#forumGroups > .cForumRow.ipsBox {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#forumGroups > .cForumRow.ipsBox:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

#forumGroups .cForumTitle {
  padding: 0 0 14px;
  background: transparent;
}

#forumGroups .ipsDataList {
  overflow: hidden;
  background: rgb(var(--theme-area_background));
  border: 0;
  border-radius: 0;
}

#forumGroups .ipsDataItem.cForumRow {
  margin: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

#forumGroups .ipsDataItem.cForumRow:last-child {
  border-bottom: 0;
}

#forumGroups .ipsDataItem.cForumRow:hover {
  background: rgba(255, 255, 255, 0.025);
  transform: none;
  box-shadow: none;
}

#forumGroups .ipsItemStatus.ipsItemStatus_large.ipsItemStatus_read {
  opacity: 1;
  color: #fff;
  background: var(--theme-dynamic-gradient-primary);
  box-shadow: 0 6px 16px rgba(var(--theme-dynamic-color-1), 0.22);
}

#forumGroups .ipsDataItem.cForumRow:hover .ipsItemStatus_large {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 9px 20px rgba(var(--theme-dynamic-color-1), 0.3);
}

#forumGroups .ipsDataItem_stats dl,
#forumGroups .ipsDataItem_stats dl:hover {
  width: 64px;
  height: auto;
  min-height: 52px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#forumGroups .ipsDataItem_stats_number {
  font-size: 1rem;
}

#forumGroups .ipsDataItem_lastPoster {
  width: 280px;
  min-width: 0;
}

.forum-last-topic {
  min-width: 0;
}

.forum-last-topic-title {
  display: block;
  overflow: hidden;
  color: rgb(var(--theme-text_color));
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-last-topic-title:hover {
  color: rgb(var(--theme-dynamic-color-link));
}

.forum-last-topic-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: .82rem;
}

.forum-last-topic-empty {
  width: 280px;
}

@media (max-width: 979px) {
  #forumGroups .ipsDataItem_lastPoster,
  .forum-last-topic-empty {
    width: 230px;
  }
}

@media (max-width: 767px) {
  #forumGroups .ipsDataItem.ipsDataItem_responsivePhoto {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #forumGroups .ipsDataItem_main {
    width: calc(100% - 58px);
  }

  #forumGroups .ipsDataItem_stats {
    display: none;
  }

  #forumGroups .ipsDataItem_lastPoster {
    width: 100%;
    padding-left: 52px;
  }

  .forum-last-topic-empty {
    width: 100%;
  }
}
