/* ============================================================================
   GLOBAL STYLESHEET - IP Services Project
   ============================================================================
   Research-site optimized layout following mobile-first principles
   - 8pt spacing system (0.5rem base)
   - Consistent breakpoints:  600px, 900px, 1200px, 1600px
   - BEM-inspired naming for clarity
   - Accessible by default
   ============================================================================ */

/* ============================================================================
   DEV MODE:  DISABLE CONTENT LINKS (Keep Sidebar Navigation)
   ============================================================================ 
   Disables all internal links EXCEPT:
   - Sidebar navigation (for page switching)
   - External links (http://, mailto:, tel: )
   - Scroll-spy navigation
   
   TO RE-ENABLE:  Comment out or delete this entire section
   ============================================================================ */

/* Disable main content area links (not sidebar or external) */
/* main a:not([href^="http"]):not([href^="https://"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"]),
article a:not([href^="http"]):not([href^="https://"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"]),
.observablehq a:not([href^="http"]):not([href^="https://"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"]) {
  pointer-events: none !important;
  cursor: default !important;
  color: var(--theme-foreground-muted) !important;
  text-decoration: none !important;
  opacity: 0.5 !important;
} */

/* Disable scroll-spy internal links (but not the navigation dots themselves) */
/* .scroll-spy a[href^="#"] {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
} */


/* Disable SVG/chart links (wheel, sankey, contents, linkages) */
/* svg a,
svg [onclick],
svg [role="link"],
svg text[style*="cursor: pointer"],
svg g[style*="cursor: pointer"] {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.5 !important;
} */

/* Wheel chart links (override above rules) */ 
/* #wheel-mount svg a, 
#wheel-mount svg [onclick],
#wheel-mount svg [role="link"],
#wheel-mount svg text[style*="cursor: pointer"],
#wheel-mount svg g[style*="cursor: pointer"],
#wheel-mount svg path[style*="cursor: pointer"],
#wheel-mount svg circle[style*="cursor: pointer"],
#wheel-mount [style*="cursor: pointer"] {
  pointer-events: auto !important;
  cursor: pointer !important;
  opacity: 1 !important;
}  */

/* Disable Observable chart interactive elements (except wheel) */
/* #sankey-chart a:not([href^="http"]):not([href^="https://"]),
.toc-svg-container a:not([href^="http"]):not([href^="https://"]),
.toc-container a:not([href^="http"]):not([href^="https://"]) {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.5 ! important;
} */


/* Optional: Visual indicator that links are disabled */
/* main a:not([href^="http"]):not([href^="https://"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"])::after,
article a:not([href^="http"]):not([href^="https://"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="#"])::after {
  content: " 🚫";
  font-size: 0.7em;
  opacity: 0.4;
  margin-left: 2px;
} */

/* Hide the indicator on hover to reduce clutter */
/* main a:hover::after,
article a:hover::after {
  display: none;
} */

/* END DEV MODE - Delete this section when ready for production */
/* ============================================================================ */


/* ============================================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================ */
:root {
  /* Spacing scale (8pt grid system) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Layout */
  --max-width-narrow: 680px;
  --max-width-medium: 900px;
  --max-width-wide: 1200px;
  --max-width-full: 1400px;
  
  /* Borders */
  --border-radius-sm: 0.5rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  --border-width:  1px;
  
  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.16);
  
  /* Typography */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.65;
  
  /* Transitions */
  --transition-fast:  0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s ease;
}

/* ============================================================================
   2. RESET & BASE STYLES
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  text-rendering: optimizeLegibility;
  line-height: var(--line-height-normal);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

/* ============================================================================
   3. TYPOGRAPHY
   ============================================================================ */
a {
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast);
}

a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--theme-foreground-focus) 60%, transparent);
  outline-offset: var(--space-2);
  border-radius: var(--border-radius-sm);
}

/* ============================================================================
   4. LAYOUT CONTAINERS
   ============================================================================ */
.page-center {
  width: 100%;
  max-width:  var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.page-center > * {
  margin-left: auto;
  margin-right: auto;
}

/* Width utilities */
.narrow {
  max-width: var(--max-width-narrow);
  padding: 0 var(--space-4);
  margin-left: auto;
  margin-right: auto;
}

.medium {
  max-width: var(--max-width-medium);
  padding: 0 var(--space-4);
  margin-left: auto;
  margin-right: auto;
}

.wide {
  max-width:  var(--max-width-wide);
  padding: 0 var(--space-4);
  margin-left: auto;
  margin-right: auto;
}

.full {
  max-width:  var(--max-width-full);
  padding: 0 var(--space-6);
  margin-left: auto;
  margin-right: auto;
}

/* Section spacing */
.section {
  padding: var(--space-12) 0;
}

@media (max-width: 900px) {
  .page-center,
  .narrow,
  .medium,
  .wide {
    padding: 0 var(--space-3);
  }
  
  .full {
    padding: 0 var(--space-4);
  }
  
  .section {
    padding: var(--space-8) 0;
  }
}

/* ============================================================================
   5. CARDS & CONTAINERS
   ============================================================================ */
.card {
  background: var(--theme-background-alt);
  border-radius: var(--border-radius-lg);
  border: var(--border-width) solid color-mix(in srgb, var(--theme-foreground-faintest) 50%, transparent);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card--compact {
  padding: var(--space-4);
}

.card--spacious {
  padding: var(--space-8);
}

/* ============================================================================
   6. BUTTONS
   ============================================================================ */
.btn,
.button,
.button-landing,
.button-final {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--theme-foreground-focus);
  color: #fff ! important;
  border-radius: var(--border-radius-sm);
  text-decoration: none ! important;
  font-weight: 600;
  font-size: 1. 075rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), 
              box-shadow var(--transition-fast), 
              filter var(--transition-fast);
  box-shadow: var(--shadow-md);
  user-select: none;
  text-align: center;
}

.btn:hover,
.btn:focus,
.button:hover,
.button:focus,
.button-landing:hover,
.button-landing:focus,
.button-final:hover,
.button-final:focus {
  filter: brightness(0.95);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.btn:active,
.button:active,
.button-landing:active,
.button-final:active {
  transform: translateY(0) scale(0.98);
}

/* Button variants */
.btn--secondary {
  background: var(--theme-background-alt);
  color: var(--theme-foreground) !important;
  border:  var(--border-width) solid var(--theme-foreground-faint);
}

/* ============================================================================
   7. GRID SYSTEM
   ============================================================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--4 {
  grid-template-columns:  repeat(auto-fit, minmax(240px, 1fr));
}

@media (max-width: 900px) {
  .grid {
    gap: var(--space-4);
  }
  
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   8. TABLES
   ============================================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
}

th, td {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--theme-foreground-faintest);
  text-align: left;
}

thead th {
  border-bottom: 2px solid var(--theme-foreground-faint);
  font-weight: 600;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--theme-background-alt) 50%, transparent);
}

/* ============================================================================
   9. CODE BLOCKS
   ============================================================================ */
pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 
               "Liberation Mono", "Courier New", monospace;
}

pre {
  background: var(--theme-background-alt);
  border: var(--border-width) solid var(--theme-foreground-faintest);
  border-radius: var(--border-radius-sm);
  padding: var(--space-4);
  overflow-x: auto;
  line-height: var(--line-height-relaxed);
}

code {
  background: color-mix(in srgb, var(--theme-background-alt) 80%, transparent);
  padding: 0.125rem 0.375rem;
  border-radius:  0.25rem;
  font-size:  0.9em;
}

pre code {
  background: none;
  padding: 0;
}

/* ============================================================================
   10. UTILITY CLASSES
   ============================================================================ */

/* Spacing utilities */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top:  var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom:  var(--space-8); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

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

/* ============================================================================
   11. RESPONSIVE UTILITIES
   ============================================================================ */
@media (max-width: 600px) {
  .hide-mobile { display: none ! important; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 901px) {
  .hide-desktop { display: none !important; }
}

/* ============================================================================
   12. PRINT STYLES
   ============================================================================ */
@media print {
  .no-print {
    display: none !important;
  }
  
  a {
    text-decoration: underline;
  }
  
  .card {
    box-shadow: none;
    border: var(--border-width) solid #000;
  }
}