/* 
 * MenoGrace Base CSS
 * Core styles, variables, and foundation elements
 * Version: 1.0.0
 */

/* ===================================================
   CSS CUSTOM PROPERTIES (VARIABLES) - DEPRECATED
   Use design-system.css for unified variables
   =================================================== */

/* UNIFIED DESIGN SYSTEM VARIABLES */
:root {
    /* PRIMARY COLOR PALETTE */
    --primary-dark: #5A3A2A;
    --primary-light: #8B6F47;
    --accent-warm: #C8A882;
    --accent-secondary: #D4A574;
    --accent-highlight: #E8D5C4;
    
    /* NEUTRAL COLORS */
    --white: #FFFFFF;
    --off-white: #FEFEFE;
    --light-gray: #F5F5F5;
    --medium-gray: #888888;
    --dark-gray: #666666;
    --text-dark: #333333;
    --text-light: #555555;
    
    /* STATUS COLORS */
    --success: #28a745;
    --warning: #ffc107;
    --error: #dc3545;
    --info: #17a2b8;
    
    /* LEGACY COMPATIBILITY */
    --background-light: #F8F4F0;
    --background-accent: #E8DDD4;
    --text-primary: var(--primary-dark);
    --text-secondary: var(--dark-gray);
    --text-muted: var(--medium-gray);
    --border-light: rgba(200, 168, 130, 0.2);
    
    /* TYPOGRAPHY */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;
    --line-height-normal: 1.5;
    
    /* SPACING */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;
    
    /* LEGACY SPACING */
    --space-1: var(--spacing-xs);
    --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 */
    --container-max-width: 1200px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --touch-min: 44px;
    
    /* Shadows */
    --shadow-sm: 0 4px 15px rgba(200, 168, 130, 0.3);
    --shadow-md: 0 8px 25px rgba(200, 168, 130, 0.4);
    --shadow-lg: 0 15px 50px rgba(200, 168, 130, 0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===================================================
   CSS RESET & NORMALIZE
   =================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================================
   TYPOGRAPHY
   =================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--accent-warm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover, a:focus {
    color: var(--primary-dark);
}

strong, b {
    font-weight: 600;
    color: var(--text-primary);
}

em {
    font-style: italic;
    color: var(--accent-warm);
}

/* ===================================================
   LAYOUT COMPONENTS
   =================================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-16) 0;
}

.section--sm { padding: var(--space-12) 0; }
.section--lg { padding: calc(var(--space-16) * 1.5) 0; }

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-8);
}

.grid--2col { grid-template-columns: 1fr 1fr; }
.grid--3col { grid-template-columns: repeat(3, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

@media (max-width: 768px) {
    .grid--2col,
    .grid--3col {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex--center { align-items: center; justify-content: center; }
.flex--between { justify-content: space-between; }
.flex--column { flex-direction: column; }

/* ===================================================
   UTILITY CLASSES
   =================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.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); }

.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;
}

/* ===================================================
   ACCESSIBILITY
   =================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html { scroll-behavior: auto; }
}

/* Focus styles */
:focus {
    outline: 2px solid var(--accent-warm);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-secondary: #000;
        --border-light: #000;
    }
}

/* ===================================================
   PRINT STYLES
   =================================================== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    .no-print {
        display: none !important;
    }
}