/* Load after the site's presentation styles. Shared content edges without
   changing backgrounds, image crops, typography, or station/player behavior. */
:root {
  --layout-max: 1400px;
  --layout-gutter: clamp(12px, 3.5%, 56px);
  --layout-inset: max(var(--layout-gutter), calc((100% - var(--layout-max)) / 2));
}

/* Containing-block percentages, rather than vw, account for scrollbars.
   Include the live dashboard selector so its breakpoint overrides inherit
   these same boundaries. Decorative backgrounds remain full width. */
body > .top,
body > .flag,
body .mast,
body > .network-footer,
body:has(#home) > .top,
body:has(#home) .mast,
body:has(#home) > .network-footer {
  padding-inline: var(--layout-inset);
}

body .broadcast,
body .player:not([data-usable]),
body:not(:has(#home)) .player,
body #station-nav,
body:has(#home) .broadcast {
  width: auto;
  max-width: none;
  margin-inline: var(--layout-inset);
}

/* The live desktop dashboard owns a fixed, 500px playback overlay. Leave its
   dimensions/offsets alone; only align that player when it returns to flow. */
@media (max-width: 1099px), (max-height: 749px) {
  body:has(#home) .player {
    width: auto;
    max-width: none;
    margin-inline: var(--layout-inset);
  }
}

/* The illustrated footer needs its existing tablet arrangement before the
   desktop dashboard begins at 1100px; four narrow panels squeeze the artwork. */
@media (min-width: 1001px) and (max-width: 1099px) {
  body > .network-footer:has(.footer-scene) { grid-template-columns: 1fr 1fr; }
  .network-footer:has(.footer-scene) section:not(.bunker-footer) {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .network-footer:has(.footer-scene) h2,
  .network-footer:has(.footer-scene) p,
  .network-footer:has(.footer-scene) a { grid-column: 2; }
}
