/* ============================================================================
 * DOMINANTS.CO LIVE — Wide Layout, consolidated (v10, 2026-12-04)
 * ----------------------------------------------------------------------------
 * Replaces wide-layout-live-v1..v9, which nginx injected as eight separate
 * stylesheets. What each contributed, and why it is or is not here:
 *
 *   v1  phpFox shell (.holder, #header, #content_holder, #main_content)
 *       DROPPED — verified live: zero occurrences of any of those selectors.
 *       The site is MetaFox; this file was dead weight on every page load.
 *   v2  container cap (min(96vw,1800px)) — DROPPED, v4 already overrode it.
 *       Its layoutSlot rules and hero spacing are kept below.
 *   v3  header lockup + profile overflow guard — KEPT.
 *   v4  full-bleed canvas + layout slot flex — KEPT (corrected, see §1).
 *   v5  profile hero width — KEPT for the hero itself; its blanket
 *       `> div { width:100% }` is DROPPED (see §4 — it is what flattened the
 *       member directory's name column to 0px).
 *   v6  never injected by nginx at all — dead file, DROPPED entirely.
 *   v7  cover chain + identity shell — cover KEPT; the identity
 *       `> div` chain is DROPPED and replaced (see §3 — it is what collapsed
 *       the profile identity block to 0px).
 *   v8  cover height lock — KEPT.
 *   v9  feed badge sizing — KEPT verbatim.
 *
 * Principle: widen SHELLS (block wrappers). Never force width:100% on a flex
 * child — in a flex row that starves its siblings to zero.
 * ========================================================================== */

/* --- shared ---------------------------------------------------------------- */
:root {
  --dom-gold: #D4AF37;
  --dom-wide-gutter: clamp(12px, 1.2vw, 24px);
}

/* §1 — Full-bleed canvas for the app's content pages.
 * Only max-width/min-width are relaxed; the inner Grid fills on its own, so
 * nothing here forces a width onto a child. */
body:has([data-testid="userProfileHeader"], [data-testid="itemFeed"], [data-testid="blockStatusComposer"], [data-testid="itemViewItemUser"], [data-testid*="Story"], [data-testid*="story"]) [data-testid="container.main"] {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  padding-inline: var(--dom-wide-gutter) !important;
}
body:has([data-testid="userProfileHeader"], [data-testid="itemFeed"], [data-testid="blockStatusComposer"], [data-testid="itemViewItemUser"], [data-testid*="Story"], [data-testid*="story"]) [data-testid="container.main"] > * {
  max-width: none !important;
  min-width: 0 !important;
}

/* Main / side columns, where the layout uses them (home, feed). */
body:has([data-testid="itemViewItemUser"]) [data-testid="layoutSlotMain"] {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
body:has([data-testid="itemViewItemUser"]) [data-testid="layoutSlotSide"] {
  flex: 0 0 clamp(280px, 19vw, 350px) !important;
  min-width: 0 !important;
}
@media (max-width: 860px) {
  body:has([data-testid="itemViewItemUser"]) [data-testid="layoutSlotSide"] { flex-basis: 100% !important; }
}
/* Breathing room under the profile hero. */
body:has([data-testid="itemViewItemUser"]) [data-testid="layoutSlotMain"] > div:first-child {
  margin-bottom: clamp(18px, 2vw, 30px) !important;
}

/* §2 — Header lockup, and keep an oversized hero child inside the viewport. */
[data-testid="appbar"] [data-testid="linkLogo"] { margin-left: clamp(12px, 1.6vw, 28px) !important; }
[data-testid="appbar"] [data-testid="linkLogo"]::after { letter-spacing: .30em; }
body:has([data-testid="itemViewItemUser"]) [data-testid="container.main"] { overflow-x: clip !important; }
@media (max-width: 719px) {
  [data-testid="appbar"] [data-testid="linkLogo"] { margin-left: 10px !important; }
}

/* §3 — PROFILE IDENTITY ROW — the actual bug this revision fixes.
 *
 * The row is a flex container with exactly two children:
 *     [ avatar + name + badge + description ]   flex: 1 1 0%
 *     [ Edit Profile / Feature / Activity ]     flex: 0 1 auto
 *
 * v7 matched BOTH with `.MuiBox-root:has(...) > div { width:100% !important }`.
 * A flex sibling forced to width:100% claims the whole line, so the identity
 * child resolved to 0px and its contents overflowed — which is why the
 * description rendered as "Owner of Dominants.c..." beside a vast empty gap.
 * Measured on /KING at 1792px: identity 0px / actions 1726px.
 *
 * The shell is widened (it is a block), then flex is simply allowed to work. */
[data-testid="userProfileHeader"] .MuiBox-root:has(> div > div > div > [data-testid="viewProfileInfo"]),
[data-testid="userProfileHeader"] .MuiBox-root:has(> div > div > [data-testid="menuProfile"]) {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}
/* The identity side takes the free space ... */
[data-testid="userProfileHeader"] div:has(> div > [data-testid="profileHeaderAvatar"]) > div:has(> [data-testid="profileHeaderAvatar"]) {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
}
/* ... and the actions side takes exactly what it needs. */
[data-testid="userProfileHeader"] div:has(> div > [data-testid="profileHeaderAvatar"]) > div:not(:has([data-testid="profileHeaderAvatar"])) {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
}
/* Let the name/description use the room it now has. */
[data-testid="userProfileHeader"] [data-testid="viewProfileInfo"] {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* §4 — Profile hero shell.
 * v5 also carried `[data-testid="itemViewItemUser"] > div { width:100% }`,
 * which hit every row of the member directory (a three-child flex row) and
 * collapsed its name column. Only the hero element itself is widened here. */
body:has([data-testid="itemViewItemUser"]) [data-testid="itemViewItemUser"] {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
}

/* §5 — Cover photo: full hero width at a locked height, all layers in step. */
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2),
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div,
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div,
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div > div {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}
[data-testid="userProfileHeader"] .MuiUserCoverPhoto-imageCover {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 320px !important;
  object-fit: cover !important;
}
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"],
[data-testid="userProfileHeader"] .MuiUserCoverPhoto-root,
[data-testid="userProfileHeader"] .MuiUserCoverPhoto-bgBlur,
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2),
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div,
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div,
[data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div > div {
  height: 320px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
[data-testid="userProfileHeader"] .MuiUserCoverPhoto-bgBlur {
  background-size: cover !important;
  background-position: center !important;
}
@media (max-width: 860px) {
  [data-testid="userProfileHeader"] .MuiUserCoverPhoto-imageCover,
  [data-testid="userProfileHeader"] [data-testid="imageProfileCover"],
  [data-testid="userProfileHeader"] .MuiUserCoverPhoto-root,
  [data-testid="userProfileHeader"] .MuiUserCoverPhoto-bgBlur,
  [data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2),
  [data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div,
  [data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div,
  [data-testid="userProfileHeader"] [data-testid="imageProfileCover"] > div:nth-child(2) > div > div > div {
    height: clamp(210px, 42vw, 320px) !important;
  }
}

/* §6 — Profile tab bar spans the hero. */
[data-testid="userProfileHeader"] [data-testid="menuProfile"] {
  width: 100% !important;
  max-width: none !important;
}

/* §8 — PROFILE BIO.
 * MetaFox clamps the header bio to 2 lines (its own -webkit-line-clamp on the
 * Typography block). Measured on /KING at a 555px bio column: the bio is 4
 * lines, and the clamp costs ~22.5px per line of header height:
 *     clamp 2 -> bio 45px, header 494px (truncated)
 *     clamp 3 -> bio 68px, header 517px (truncated)
 *     clamp 4 -> bio 90px, header 539px (complete)
 * Desktop has the room, so it gets 4 and most bios read in full; narrow screens
 * keep 3, where +45px of header would push the content too far down. The
 * breakpoint matches the 860px one used elsewhere in this file.
 *
 * Targeted structurally - a DIV Typography inside viewProfileInfo, which is the
 * bio and nothing else (verified: exactly one match). Deliberately NOT keyed on
 * the Emotion class (ltr-xxxxxx): those are generated and get recycled across
 * unrelated components, which has broken sitewide styling here before.
 * Applies on every profile section because the header is the same shell. */
[data-testid="userProfileHeader"] [data-testid="viewProfileInfo"] div.MuiTypography-root {
  -webkit-line-clamp: 4 !important;
}
@media (max-width: 860px) {
  [data-testid="userProfileHeader"] [data-testid="viewProfileInfo"] div.MuiTypography-root {
    -webkit-line-clamp: 3 !important;
  }
}

/* §7 — Feed header badge stays a compact badge (carried over from v9). */
[data-testid="feedHeaderHeadline"] .doms-badge--feed {
  width: 48px !important; height: 48px !important;
  min-width: 48px !important; min-height: 48px !important;
  flex: 0 0 48px !important;
  display: inline-flex !important;
  align-items: center !important; justify-content: center !important;
}
[data-testid="feedHeaderHeadline"] .doms-badge--feed img {
  width: 48px !important; height: 48px !important;
  max-width: 48px !important; max-height: 48px !important;
  object-fit: contain !important;
}
[data-testid="feedHeaderHeadline"] { min-height: 48px !important; height: auto !important; }
