/*
 * ContentKit CSS Variables (Design Tokens)
 * 
 * This file contains all CSS custom properties used across the site.
 * Include this file when using component partials outside of main.css context.
 * 
 * Usage: <link rel="stylesheet" href="{% static 'css/components/_variables.css' %}">
 */

:root {
    /* Color Palette - Orange & Purple accent */
    --color-primary: #e67e22;
    --color-primary-light: #f39c12;
    --color-primary-dark: #d35400;
    --color-secondary: #9b59b6;
    --color-secondary-light: #a569bd;
    --color-secondary-dark: #7d3c98;
    --color-accent: #e67e22;
    --color-accent-light: #f39c12;
    --color-accent-dark: #d35400;
    
    /* Semantic Colors */
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-error: #e74c3c;
    --color-info: #3498db;
    
    /* Dark Mode (Default) */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --bg-card: #1f2937;
    --bg-input: #2d3748;
    
    --text-primary: #f8f9fa;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #1a1a2e;
    
    --border-color: #374151;
    --border-light: #4b5563;
    
    /* Links */
    --link-color: #f39c12;
    --link-hover: #e67e22;
    --link-visited: #a569bd;
    --link-external: #3498db;
    /* The ↗ marker appended to ck-link--external links: " ↗" or none. */
    --ck-link-external-marker: " ↗";
    
    /* Typography */
    --font-family-base: 'Atkinson Hyperlegible', 'Segoe UI', 'SF Pro Text', 'BBC Reith Sans', Verdana, system-ui, -apple-system, sans-serif;
    --font-family-heading: 'Atkinson Hyperlegible', 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    --line-height-base: 1.7;
    --line-height-heading: 1.3;
    --letter-spacing-heading: 0em;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);

    /* Global component tokens (mcp-site-management 15) */
    --ck-radius: 0.5rem;
    --ck-border-color: #374151;
    --ck-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --ck-product-card-ratio: 1 / 1;
    --ck-product-card-fit: cover;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Focus ring for accessibility */
    --focus-ring: 0 0 0 3px rgba(230, 126, 34, 0.5);
    --focus-ring-offset: 2px;
    
    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
}

/* Dark appearance contrast overrides. Keep the legacy root defaults for compatibility. */
:root:where([data-theme="dark"]) {
    color-scheme: dark;
    --color-primary: #e88630;
    --color-primary-dark: #e1894f;
    --color-secondary: #bc8fce;
    --color-secondary-light: #bc8fce;
    --color-secondary-dark: #b692c5;
    --color-accent: #e88630;
    --color-accent-dark: #e1894f;
    --color-success: #36b46b;
    --color-error: #ee7f73;
    --color-info: #51a7e0;
    --link-hover: #e88630;
    --link-visited: #bc8fce;
    --link-external: #51a7e0;
    --text-inverse: #000000;
    --border-color: #79808a;
    --border-light: #79808b;
    --focus-ring: 0 0 0 3px #f39c12;
}

/* Light Mode */
:root:where([data-theme="light"]) {
    color-scheme: light;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #5f6c7e;
    --text-inverse: #ffffff;
    
    --border-color: #84888c;
    --border-light: #828890;
    
    --link-color: #b64800;
    --link-hover: #a15818;
    --link-visited: #7d3c98;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --color-primary: #a15818;
    --color-primary-light: #955f0b;
    --color-primary-dark: #b64800;
    --color-secondary: #8e52a7;
    --color-secondary-light: #89579d;
    --color-secondary-dark: #7d3c98;
    --color-accent: #a15818;
    --color-accent-light: #955f0b;
    --color-accent-dark: #b64800;
    --color-success: #1b7a43;
    --color-warning: #955f0b;
    --color-error: #bd3e31;
    --color-info: #2670a1;
    --link-external: #2670a1;
    --focus-ring: 0 0 0 3px #b64800;
}

/* High Contrast Mode */
:root[data-contrast="high"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-card: #0a0a0a;
    
    --text-primary: #ffffff;
    --text-secondary: #f0f0f0;
    --text-muted: #d0d0d0;
    
    --border-color: #ffffff;
    --border-light: #cccccc;
    
    --link-color: #ffcc00;
    --link-hover: #ffdd44;
    --link-visited: #ff99ff;
    --bg-input: #0a0a0a;
    --text-inverse: #000000;
    --link-external: #ff99ff;
    --focus-ring: 0 0 0 3px #ffcc00;
    --color-primary: #ffcc00;
    --color-primary-light: #ffcc00;
    --color-primary-dark: #ffcc00;
    --color-secondary: #ff99ff;
    --color-secondary-light: #ff99ff;
    --color-secondary-dark: #ff99ff;
    --color-accent: #ffcc00;
    --color-accent-light: #ffcc00;
    --color-accent-dark: #ffcc00;
}

:root[data-theme="light"][data-contrast="high"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e0e0e0;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-primary: #000000;
    --text-secondary: #1a1a1a;
    --text-muted: #333333;
    --border-color: #000000;
    --border-light: #333333;
    --link-color: #0000cc;
    --link-hover: #0000ff;
    --link-visited: #660066;
    --color-primary: #000099;
    --text-inverse: #ffffff;
    --link-external: #660066;
    --focus-ring: 0 0 0 3px #000099;
    --color-primary-light: #000099;
    --color-primary-dark: #000099;
    --color-secondary: #660066;
    --color-secondary-light: #660066;
    --color-secondary-dark: #660066;
    --color-accent: #000099;
    --color-accent-light: #000099;
    --color-accent-dark: #000099;
}
