/* Global fixes for layout shifts and horizontal overflow */

/* CSS Custom Properties for Dark Mode */
:root {
  --color-background-light: #f3f4f6;
  --color-background-dark: #111827;
  --color-surface-light: #ffffff;
  --color-surface-dark: #1f2937;
  --color-text-light: #1f2937;
  --color-text-dark: #f9fafb;
}

/* Fixed Header - Ensure header stays on top with smooth animation */
header[id="stickyHeader"] {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  will-change: transform !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
}

/* Reserve layout space for the fixed header */
#header-spacer {
  width: 100%;
  display: block;
}

/* Hero Section base position */
.hero-container {
  position: relative;
  z-index: 0;
}

/* Box sizing reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Reset default margins and padding */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Reserve scrollbar space to avoid page jump - ONLY RIGHT SIDE */
html {
  scrollbar-gutter: stable;
}

/* Material Symbols Outlined */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
}

/* Prevent horizontal scrollbars caused by wide elements */
@supports (overflow: clip) {
  html, body { 
    overflow-x: clip; 
  }
}

/* Media elements should not overflow their containers */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Long content should wrap instead of forcing horizontal scroll */
pre, code, kbd, samp {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tables should adapt to container width */
table {
  width: 100%;
  border-collapse: collapse;
}

/* Utility: prevent accidental negative margins causing bleed */
.overflow-clip-x {
  overflow-x: clip;
}
