/* ==========================================================================
   TibCal.com — Global Styles & Design System Tokens
   ========================================================================== */

:root {
  /* Color Palette — Trustworthy & High Contrast */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-secondary: #475569;
  --color-secondary-hover: #334155;
  
  --color-text-main: #0f172a;
  --color-text-muted: #475569;
  --color-text-light: #64748b;
  
  --color-bg-body: #f8fafc;
  --color-bg-surface: #ffffff;
  --color-bg-subtle: #f1f5f9;
  
  --color-border: #cbd5e1;
  --color-border-light: #e2e8f0;
  
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  
  /* Focus Indicator for Accessibility */
  --focus-ring-color: #2563eb;
  --focus-ring-offset: 2px;
  --focus-ring-width: 3px;

  /* Typography Stack */
  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;

  /* Spacing Scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* Borders & Shadows */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Layout Container */
  --container-max-width: 1200px;
}

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

html {
  font-family: var(--font-family-base);
  font-size: 100%;
  line-height: var(--line-height-normal);
  color: var(--color-text-main);
  background-color: var(--color-bg-body);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--color-bg-body);
}

main {
  flex: 1 0 auto;
}

/* Accessibility Focus Outline */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-primary);
  color: #ffffff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: top 0.2s ease-in-out;
}

.skip-link:focus {
  top: 1rem;
}

/* Container Utility */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* Page Section Layout Utilities */
.page-container {
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
}

.section-block {
  margin-bottom: var(--space-8);
}

.section-block-lg {
  margin-bottom: var(--space-12);
}

/* Headings Base */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-main);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-size-3xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--font-size-2xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--font-size-xl); margin-bottom: var(--space-2); }
h4 { font-size: var(--font-size-lg); margin-bottom: var(--space-2); }

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-hover);
}

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