/* Forumax FSE layout isolation (block themes) */
.forumax-fse {
  
  #frmx-bbpress-main {
    .frmx-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0;
      margin-right: -15px;
      margin-left: -15px;
      align-items: flex-start;
      max-width: 100%;
      box-sizing: border-box;

    }
    .community-post {
      padding: 15px 30px;
    }

    .frmx-row > [class*="frmx-col"] {
      flex-shrink: 0;
      min-width: 0;
      box-sizing: border-box;
      padding-right: 15px;
      padding-left: 15px;
    }

    /* main column takes remaining space */
    .frmx-col-lg-8 {
      flex: 1 1 0%;
    }

    /* sidebar column fixed width - no overflow:hidden so widgets do not get clipped */
    .frmx-col-lg-4 {
      flex: 0 0 280px;
      max-width: 280px;
      width: 280px;
    }

    /* Ensure sidebar widgets stack vertically and text stays contained */
    .forum-sidebar .widget {
      width: 100%;
      max-width: 100%;
      overflow: visible;

    }

    /* Stats widget (dl/dt/dd) layout for block themes */
    .forum-sidebar .widget_display_stats {
      dl {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 12px;
        row-gap: 8px;
        margin: 0;
      }

      dt,
      dd {
        margin: 0;
        font-size: 16px;
        font-weight: 500;
      }

      dd {
        text-align: right;
      }
    }

    /* Reset list spacing for sidebar widgets */
    .forum-sidebar ul {
      margin: 0;
      padding-left: 0;
      list-style: none;
    }

    .forum-sidebar li {
      list-style: none;
      display: flex;
      align-items: center;
    }

    .forum-sidebar .widget_display_views {
      .bbp-views-widget {
        margin: 0;
        padding: 0;
        list-style: none;
      }

      .bbp-views-widget li {
        display: block;
        margin: 0;
        padding: 12px 0 10px;
        border-bottom: 1px solid var(--black_50);
      }

      .bbp-view-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: var(--black_700);
        font-size: 16px;
        font-weight: 400;
        line-height: 1.5;
        text-decoration: none;
        padding: 0 2px 0 0;
        transition: all 0.2s ease;

        &::after {
          content: "\203A";
          color: var(--black_350);
          font-size: 15px;
          line-height: 1;
        }

        &:hover,
        &:focus {
          color: var(--bbpc_brand_color);
        }
      }
    }

    .forum-sidebar .widget_bbpress_forum_topic_info_widget {
      .forumax-topic-info-widget {
        margin: 0;
        padding: 0;
        list-style: none;
      }

      .forumax-topic-info-widget li {
        display: grid;
        grid-template-columns: minmax(78px, auto) 1fr;
        column-gap: 12px;
        align-items: start;
        margin: 0;
        padding: 11px 0;
        border-bottom: 1px solid var(--black_50);
      }

      .forumax-topic-info-label {
        color: var(--black_700);
        font-size: 14px;
        font-weight: 500;
        line-height: 1.5;
        letter-spacing: 0.01em;
      }

      .forumax-topic-info-value {
        min-width: 0;
        color: var(--black_600);
        font-size: 14px;
        font-weight: 400;
        line-height: 1.5;
        overflow-wrap: anywhere;
        word-break: break-word;

        a {
          color: var(--black_700);
          text-decoration: none;

          &:hover {
            color: var(--bbpc_brand_color);
            text-decoration: underline;
          }
        }
      }
    }

    /* Forum thumbnail size (block themes can shrink it) */
    .community-post .post-content .author-avatar.forum-icon {
      width: 40px;
    }

    .community-post .post-content .author-avatar.forum-icon img {
      height: auto;
    }

    .load-forum{
      .community-posts-wrapper{
        .meta{
          img{
            height: auto;
          }
        }
      }
    }

    /* Responsive: stack on mobile */
    @media (max-width: 768px) {
      .frmx-row {
        flex-direction: column;
      }

      .frmx-col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
      }
    }

    /* Outer page padding */
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Hello Elementor theme - forum archive page */
.frmx-forum-archive {
  padding: 40px 20px;

  .entry-title {
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
  }
}
