/* Covozi v1.69 — public Creator Profile nav cleanup + Broadcast content-width repair.
 *
 * The v1.67/v1.68 public creator shell deliberately nests every feature page
 * inside a centred 1280px rail with a 226px creator-navigation column. The
 * legacy Broadcast feed/reader still assumed its old near-full-viewport canvas
 * and created a second internal sidebar. On populated feeds that double split
 * starved the featured Broadcast body and clipped/wrapped the story unnaturally.
 * This final layer makes Broadcast internals container-safe inside the common
 * Creator Profile shell without changing Broadcast data, permissions or Studio.
 */

/* Public Broadcast feed: the creator-profile rail already provides navigation.
 * Give the Broadcast story the full feature-column width and move contextual
 * Broadcast cards below it instead of creating another narrow right rail. */
@media (min-width: 901px) {
  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__main,
  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card,
  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card__body {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card--featured {
    grid-template-columns: minmax(320px, 42%) minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card h3,
  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card h3 a,
  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card__excerpt {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__sidebar {
    position: static !important;
    top: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: stretch !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__sidebar > * {
    min-width: 0 !important;
    height: 100% !important;
  }

  /* Reader pages had the same historical nested-sidebar assumption. Keep the
   * article full-width and place creator/related/explore cards below it. */
  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__article,
  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__content {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__sidebar {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__sidebar > * {
    min-width: 0 !important;
    height: 100% !important;
  }
}

/* Near the desktop/tablet boundary a split featured card would still become
 * unnecessarily dense even after removing the Broadcast sidebar. Stack its
 * visual and story vertically until the feature column is comfortably wide. */
@media (min-width: 901px) and (max-width: 1180px) {
  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card--featured {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card__visual--featured {
    min-height: 280px !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__sidebar,
  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__sidebar {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Existing <=900px public-shell rules own tablet/phone navigation. Preserve the
 * no-horizontal-scroll contract and ensure Broadcast internals remain one column. */
@media (max-width: 900px) {
  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__layout,
  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__layout,
  body.stanloop-broadcast-shell-feed .stanloop-broadcasts__sidebar,
  body.stanloop-broadcast-shell-reader .stanloop-broadcast-published__sidebar {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.stanloop-broadcast-shell-feed .stanloop-broadcast-feed-card--featured {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
