/* ──────────────────────────────────────────────────────────────────────────
   M2 — SFB public polish
   Small fixes that need to run on logged-in AND logged-out forum views.
   Loaded unconditionally from SfbIntegration::enqueue_audio_assets().
   ──────────────────────────────────────────────────────────────────────── */

/* 1) Post-card author avatar — defend against theme `img { height: auto }`
      rules (and any non-square source PFP — e.g. a wide YT-thumbnail-shaped
      upload) that defeat the square avatar box. Without this the image
      renders at its natural ratio inside the 50px-wide slot, leaving empty
      space at the bottom of the avatar circle that reads as "clipped."

      Specificity is bumped past SFB's `#sf-primary .sf-user-last-info-header
      .common-post-header img.user-image` (1,3,1) by chaining the
      `body`, `#sf-primary` and class selectors, and every dimension /
      object-fit declaration is !important so a stray theme rule like
      `img { height: auto !important }` cannot win. */
body #sf-primary .common-post-header img.user-image,
body #sf-primary .sf-main-feed .common-post-header img.user-image,
body #sf-primary .sf-user-last-info-header.common-post-header img.user-image,
body .common-post-header img.user-image {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center center !important;
    flex-shrink: 0 !important;
}

/* Mobile: SFB shrinks main-feed avatars to 35×35 at ≤700px (line 3491 in
   smart-forum-public.css). Match that so we don't blow out the layout. */
@media (max-width: 700px) {
    body #sf-primary .sf-main-feed .common-post-header img.user-image {
        width: 35px !important;
        height: 35px !important;
        min-width: 35px !important;
        min-height: 35px !important;
        max-width: 35px !important;
        max-height: 35px !important;
    }
}

/* Popover avatar (#sf-user-pop-avatar) — same defense for the floating
   profile card that opens when an avatar is clicked. */
body #sf-user-popover #sf-user-pop-avatar {
    width: 57px !important;
    height: 57px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* 2) Single-post (.single-sftopic) width — when the right sidebar is hidden
      (default state on forums set to nosidebar / minimized; body lacks
      .sf-open-widget) the post + comments column is capped narrow, leaving
      a wide dead zone on the right. Three nested constraints all need to
      relax together:
        - .sf-poster-content-left.sf-grid-view: width: var(--sf-category-grid-width)
            (line 491 + media query 1336 in smart-forum-public.css)
        - .sf-post-loop: max-width: var(--sf_middle_section_width) (~874px)
            (line 1087 in smart-forum-public.css)
        - .sf-poster-content-row.sf-show-column: justify-content: center
            (line 486) — fine, but combined with hard-width child = dead zone */
body:not(.sf-open-widget).single-sftopic #sf-primary .sf-poster-content-left.sf-grid-view,
body:not(.sf-open-widget).single-sftopic #sf-primary .sf-poster-content-left.sf-list-view,
body:not(.sf-open-widget).single-sftopic #sf-primary .sf-poster-content-left {
    width: 100% !important;
    max-width: min(1200px, 100%) !important;
}

body:not(.sf-open-widget).single-sftopic #sf-primary .sf-post-loop {
    max-width: 100% !important;
}
