/*
 * TMW Accounting - Base Styles
 * CSS Custom Properties (Design Tokens), Reset, and Foundation Styles
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */
:root {
  /* Colors - Corporate Design */
  --clr-primary: #1E3242;
  --clr-secondary: #63B22F;
  --clr-secondary-2: #E1E5DC;
  --clr-accent: #3ABFF0;
  --clr-text: #1E3242;
  --clr-bg: #FFFFFF;
  --clr-bg-light: #F8F9FA;
  --clr-border: #E0E0E0;
  
  /* Typography */
  --font-family: "Futura", "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.8;
  
  /* Spacing - Consistent spacing scale */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Transitions */
  --transition-base: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;
  
  /* Layout */
  --max-width-content: 1280px;
  --max-width-text: 720px;
  
  /* Z-index scale */
  --z-nav: 1000;
  --z-modal: 2000;
}

/* ========================================
   RESET & NORMALIZE
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-base);
  color: var(--clr-text);
  background-color: var(--clr-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  color: var(--clr-primary);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--clr-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

a:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

ul, ol {
  list-style-position: inside;
  margin-bottom: var(--spacing-md);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

strong {
  font-weight: var(--font-weight-bold);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--clr-secondary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: calc(var(--z-nav) + 1);
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 0;
}

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

/* Focus styles for keyboard navigation - WCAG AA compliant */
*:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container--narrow {
  max-width: var(--max-width-text);
}

.section {
  padding: var(--spacing-3xl) 0;
}

.section--sm {
  padding: var(--spacing-2xl) 0;
}

.section--lg {
  padding: calc(var(--spacing-3xl) * 1.5) 0;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --font-size-4xl: 2.5rem;
    --font-size-3xl: 2rem;
    --font-size-2xl: 1.75rem;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --spacing-3xl: 4rem;
  }
  
  .section {
    padding: var(--spacing-2xl) 0;
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
    --spacing-2xl: 2.5rem;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
}
