/**
 * Global Base Styles
 * Design tokens and foundational CSS
 */

:root {
  /* Colors */
  --color-primary: #668fc3;
  --color-primary-dark: #365A8C;
  --color-secondary: #475569;
  --color-accent-blue: #06b6d4;
  --color-accent-grey: #f2f2f2;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-text: #111722;
  --color-text-light: #64748b;
  --color-border: #cbd5e1;
  --color-background: #ffffff;
  --color-background-alt: #f8fafc;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Width */
  --width-xs: 4rem;
  --width-sm: 8rem;
  --width-md: 12rem;
  --width-lg: 16rem;
  --width-xl: 20rem;
  
  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Inter', var(--font-base);
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Container */
  --container-max: 100vw;
  --container-padding: 0;

 /* Block Container */
  --block-container-max: 95vw;
  --block-container-contain: 75rem;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); }


/* Container */
.container {
  max-width: var(--block-container-contain);
  padding: 0 var(--container-padding);
  margin-inline-start: auto;
  margin-inline-end: auto;
}

#block-modern-minimal-atomic-content {
  max-width: var(--block-container-contain);
  margin: 0 auto;
  padding: 0 var(--space-4);
  box-sizing: border-box;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.node--type-article #block-modern-minimal-atomic-content {
  max-width: var(--block-container-contain);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Card item wrapper for contextual links */
.card-item-wrapper {
  position: relative;
  display: flex;
  width: 100%;
}

/* Ensure contextual links appear above cards */
.card-item-wrapper .contextual {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

/* ============================================
   Mobile Content Padding
   ============================================ */

@media (max-width: 768px) {
  /* Add padding to non-layout-builder content */
  .site-main > div > #block-modern-minimal-atomic-page-title,
  .site-main > div > #block-modern-minimal-atomic-local-tasks,
  .site-main > div > #block-modern-minimal-atomic-content,
  .site-main > div > [data-drupal-messages] {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    box-sizing: border-box;
  }

  /* Pad the content region wrapper on non-layout-builder pages */
  body:not(.layout-builder-enabled) .site-main > div {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    box-sizing: border-box;
  }
}

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