/**
 * §8.0.6 Platform-wide responsive layout — every page.
 * Fluid containers; Flexbox/Grid; typography via clamp(); no fixed pixel layout.
 * Load from control_plane_skeleton, portal_base, base_marketing (and any other base).
 * RUNMYCAMPUS_SINGLE_EXECUTION_SOURCE_OF_TRUTH.md §8.0.6; CONTROL_PLANE_AND_MARKETING_UX_OVERHAUL.
 */

/* Root typography scale by viewport (when not overridden by design-tokens) */
html {
  font-size: clamp(14px, 2vw, 16px);
  overflow-x: clip;
}
body {
  min-width: 0;
  overflow-x: clip;
}

/* Fluid page wrappers — no fixed width */
#cp-main-content,
#main-content,
.mkt-main,
main[role="main"],
.cp-shell-content .container-fluid,
[data-surface="control-plane"] main,
[data-surface="tenant"] main {
  max-width: 100%;
  width: 100%;
  min-width: 0;
}

/* Containers: fluid */
.container,
.container-fluid {
  width: 100%;
  max-width: 100%;
  padding-left: clamp(0.75rem, 2vw, 1rem);
  padding-right: clamp(0.75rem, 2vw, 1rem);
}

/* Typography scale in main content (components may override) */
#cp-main-content h1, #cp-main-content .h1,
#main-content h1, #main-content .h1,
main h1, main .h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
#cp-main-content h2, #cp-main-content .h2,
#main-content h2, #main-content .h2,
main h2, main .h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

/* Images: scale properly everywhere */
img:not([width])[height],
img[width][height] {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* §8.0.11 Content max-widths — use class instead of inline px (token-aligned) */
.content-max-960 { max-width: min(960px, 100%); }
.content-max-1200 { max-width: min(1200px, 100%); }
.content-max-640 { max-width: min(640px, 100%); }
.content-max-520 { max-width: min(520px, 100%); }

/* Grid/Flex children: prevent overflow */
.row,
.d-flex,
.d-grid,
[class*="grid-"],
[class*="col-"] {
  min-width: 0;
}

/* Sidebar + main: flex so main can shrink */
.cp-layout,
.d-flex.flex-grow-1 {
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
