/**
 * DS Block Library - CSS Custom Properties (Design Tokens)
 *
 * These variables define the visual foundation for all blocks.
 * Based on the Figma design system specifications.
 */

:root {
    /* ================================================
       GREYSCALE PALETTE
       Based on neutral grey scale from designs
       ================================================ */
    --ds-white: #ffffff;
    --ds-grey-50: #f5f5f5;
    --ds-grey-100: #e5e5e5;
    --ds-grey-200: #d4d4d4;
    --ds-grey-300: #a3a3a3;
    --ds-grey-400: #737373;
    --ds-grey-500: #525252;
    --ds-grey-600: #404040;
    --ds-grey-700: #262626;
    --ds-grey-800: #171717;
    --ds-black: #000000;

    /* ================================================
       SEMANTIC COLORS
       ================================================ */
    --ds-background-light: var(--ds-white);
    --ds-background-dark: var(--ds-grey-800);
    --ds-background-darker: var(--ds-black);
    --ds-background-muted: var(--ds-grey-50);

    --ds-text-primary: var(--ds-grey-800);
    --ds-text-secondary: var(--ds-grey-500);
    --ds-text-muted: var(--ds-grey-400);
    --ds-text-inverse: var(--ds-white);

    --ds-border-light: var(--ds-grey-200);
    --ds-border-medium: var(--ds-grey-300);
    --ds-border-dark: var(--ds-grey-600);

    /* ================================================
       TYPOGRAPHY SCALE
       Fluid typography with clamp() for responsive sizing
       ================================================ */
    --ds-text-xs: 0.75rem;      /* 12px */
    --ds-text-sm: 0.875rem;     /* 14px */
    --ds-text-base: 1rem;       /* 16px */
    --ds-text-lg: 1.125rem;     /* 18px */
    --ds-text-xl: 1.25rem;      /* 20px */
    --ds-text-2xl: 1.5rem;      /* 24px */
    --ds-text-3xl: 1.875rem;    /* 30px */
    --ds-text-4xl: 2.25rem;     /* 36px */
    --ds-text-5xl: 3rem;        /* 48px */
    --ds-text-6xl: 3.75rem;     /* 60px */
    --ds-text-7xl: 4.5rem;      /* 72px */

    /* Fluid heading sizes */
    --ds-heading-hero: clamp(2.25rem, 5vw + 1rem, 4.5rem);
    --ds-heading-section: clamp(1.875rem, 4vw + 0.5rem, 3rem);
    --ds-heading-subsection: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
    --ds-heading-card: clamp(1.125rem, 2vw + 0.5rem, 1.5rem);

    /* ================================================
       FONT FAMILIES
       ================================================ */
    /* Sans-serif options */
    --ds-font-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-lato: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-poppins: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-roboto: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-font-montserrat: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-open-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-font-raleway: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Serif options */
    --ds-font-cormorant: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --ds-font-playfair: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --ds-font-butler: 'Butler', Georgia, 'Times New Roman', serif;
    --ds-font-merriweather: 'Merriweather', Georgia, 'Times New Roman', serif;

    /* Default assignments */
    --ds-font-heading: var(--ds-font-playfair);
    --ds-font-body: var(--ds-font-inter);
    --ds-font-inherit: inherit;

    /* ================================================
       TYPOGRAPHY COLOR SCHEMES
       Light text for dark backgrounds, dark text for light backgrounds
       ================================================ */
    /* Light on Dark (for dark backgrounds) */
    /* NOTE: --ds-heading-color-dark and --ds-body-color-dark are set by Global Typography */
    --ds-muted-color-dark: rgba(255, 255, 255, 0.6);

    /* Dark on Light (for light backgrounds) */
    /* NOTE: --ds-heading-color-light and --ds-body-color-light are set by Global Typography */
    --ds-muted-color-light: var(--ds-grey-500);

    /* ================================================
       FONT WEIGHTS
       ================================================ */
    --ds-weight-normal: 400;
    --ds-weight-medium: 500;
    --ds-weight-semibold: 600;
    --ds-weight-bold: 700;

    /* ================================================
       LINE HEIGHTS
       ================================================ */
    --ds-leading-none: 1;
    --ds-leading-tight: 1.2;
    --ds-leading-snug: 1.375;
    --ds-leading-normal: 1.5;
    --ds-leading-relaxed: 1.625;
    --ds-leading-loose: 2;

    /* ================================================
       LETTER SPACING
       ================================================ */
    --ds-tracking-tighter: -0.05em;
    --ds-tracking-tight: -0.025em;
    --ds-tracking-normal: 0;
    --ds-tracking-wide: 0.025em;
    --ds-tracking-wider: 0.05em;
    --ds-tracking-widest: 0.1em;

    /* ================================================
       SPACING SCALE
       Based on 4px/8px grid
       ================================================ */
    --ds-space-0: 0;
    --ds-space-px: 1px;
    --ds-space-0-5: 0.125rem;   /* 2px */
    --ds-space-1: 0.25rem;      /* 4px */
    --ds-space-1-5: 0.375rem;   /* 6px */
    --ds-space-2: 0.5rem;       /* 8px */
    --ds-space-2-5: 0.625rem;   /* 10px */
    --ds-space-3: 0.75rem;      /* 12px */
    --ds-space-3-5: 0.875rem;   /* 14px */
    --ds-space-4: 1rem;         /* 16px */
    --ds-space-5: 1.25rem;      /* 20px */
    --ds-space-6: 1.5rem;       /* 24px */
    --ds-space-7: 1.75rem;      /* 28px */
    --ds-space-8: 2rem;         /* 32px */
    --ds-space-9: 2.25rem;      /* 36px */
    --ds-space-10: 2.5rem;      /* 40px */
    --ds-space-11: 2.75rem;     /* 44px */
    --ds-space-12: 3rem;        /* 48px */
    --ds-space-14: 3.5rem;      /* 56px */
    --ds-space-16: 4rem;        /* 64px */
    --ds-space-20: 5rem;        /* 80px */
    --ds-space-24: 6rem;        /* 96px */
    --ds-space-28: 7rem;        /* 112px */
    --ds-space-32: 8rem;        /* 128px */

    /* Semantic spacing */
    --ds-space-xs: var(--ds-space-2);
    --ds-space-sm: var(--ds-space-4);
    --ds-space-md: var(--ds-space-6);
    --ds-space-lg: var(--ds-space-8);
    --ds-space-xl: var(--ds-space-12);
    --ds-space-2xl: var(--ds-space-16);
    --ds-space-3xl: var(--ds-space-24);

    /* Section padding */
    --ds-section-padding-y: var(--ds-space-20);
    --ds-section-padding-y-mobile: var(--ds-space-12);
    --ds-section-padding-x: var(--ds-space-6);

    /* ================================================
       BORDER RADIUS
       ================================================ */
    --ds-radius-none: 0;
    --ds-radius-sm: 0.25rem;    /* 4px */
    --ds-radius-md: 0.5rem;     /* 8px */
    --ds-radius-lg: 0.75rem;    /* 12px */
    --ds-radius-xl: 1rem;       /* 16px */
    --ds-radius-2xl: 1.5rem;    /* 24px */
    --ds-radius-full: 9999px;

    /* ================================================
       SHADOWS
       ================================================ */
    --ds-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --ds-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --ds-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ds-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --ds-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --ds-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --ds-shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    --ds-shadow-none: 0 0 #0000;

    /* ================================================
       CONTAINER / MAX WIDTHS
       ================================================ */
    --ds-max-width-xs: 20rem;       /* 320px */
    --ds-max-width-sm: 24rem;       /* 384px */
    --ds-max-width-md: 28rem;       /* 448px */
    --ds-max-width-lg: 32rem;       /* 512px */
    --ds-max-width-xl: 36rem;       /* 576px */
    --ds-max-width-2xl: 42rem;      /* 672px */
    --ds-max-width-3xl: 48rem;      /* 768px */
    --ds-max-width-4xl: 56rem;      /* 896px */
    --ds-max-width-5xl: 64rem;      /* 1024px */
    --ds-max-width-6xl: 72rem;      /* 1152px */
    --ds-max-width-7xl: 80rem;      /* 1280px */
    --ds-max-width-full: 100%;
    --ds-max-width-prose: 65ch;

    /* Container widths */
    --ds-container-sm: 640px;
    --ds-container-md: 768px;
    --ds-container-lg: 1024px;
    --ds-container-xl: 1280px;
    --ds-container-2xl: 1440px;

    /* ================================================
       TRANSITIONS
       ================================================ */
    --ds-transition-none: none;
    --ds-transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ds-transition-colors: color, background-color, border-color, text-decoration-color, fill, stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ds-transition-opacity: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ds-transition-shadow: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --ds-transition-transform: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);

    --ds-duration-75: 75ms;
    --ds-duration-100: 100ms;
    --ds-duration-150: 150ms;
    --ds-duration-200: 200ms;
    --ds-duration-300: 300ms;
    --ds-duration-500: 500ms;
    --ds-duration-700: 700ms;
    --ds-duration-1000: 1000ms;

    --ds-ease-linear: linear;
    --ds-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ds-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ds-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ================================================
       Z-INDEX SCALE
       ================================================ */
    --ds-z-0: 0;
    --ds-z-10: 10;
    --ds-z-20: 20;
    --ds-z-30: 30;
    --ds-z-40: 40;
    --ds-z-50: 50;
    --ds-z-auto: auto;

    /* ================================================
       ASPECT RATIOS
       ================================================ */
    --ds-aspect-square: 1 / 1;
    --ds-aspect-video: 16 / 9;
    --ds-aspect-portrait: 3 / 4;
    --ds-aspect-landscape: 4 / 3;

    /* ================================================
       BUTTON STYLES
       ================================================ */
    --ds-btn-padding-x: var(--ds-space-6);
    --ds-btn-padding-y: var(--ds-space-3);
    --ds-btn-padding-x-sm: var(--ds-space-4);
    --ds-btn-padding-y-sm: var(--ds-space-2);
    --ds-btn-padding-x-lg: var(--ds-space-8);
    --ds-btn-padding-y-lg: var(--ds-space-4);
    --ds-btn-radius: var(--ds-radius-sm);
    --ds-btn-font-size: var(--ds-text-sm);
    --ds-btn-font-weight: var(--ds-weight-medium);
    --ds-btn-line-height: 1.5;

    /* Primary button */
    --ds-btn-primary-bg: var(--ds-grey-800);
    --ds-btn-primary-text: var(--ds-white);
    --ds-btn-primary-border: var(--ds-grey-800);
    --ds-btn-primary-hover-bg: var(--ds-grey-700);
    --ds-btn-primary-hover-border: var(--ds-grey-700);

    /* Secondary button */
    --ds-btn-secondary-bg: transparent;
    --ds-btn-secondary-text: var(--ds-grey-800);
    --ds-btn-secondary-border: var(--ds-grey-800);
    --ds-btn-secondary-hover-bg: var(--ds-grey-800);
    --ds-btn-secondary-hover-text: var(--ds-white);

    /* Inverse button (for dark backgrounds) */
    --ds-btn-inverse-bg: var(--ds-white);
    --ds-btn-inverse-text: var(--ds-grey-800);
    --ds-btn-inverse-border: var(--ds-white);
    --ds-btn-inverse-hover-bg: var(--ds-grey-100);

    /* ================================================
       PREHOOK / BADGE STYLES
       ================================================ */
    --ds-prehook-padding-x: var(--ds-space-3);
    --ds-prehook-padding-y: var(--ds-space-1-5);
    /* --ds-prehook-font-size: set by global typography settings */
    /* --ds-prehook-font-weight: set by global typography settings */
    --ds-prehook-letter-spacing: var(--ds-tracking-wider);
    --ds-prehook-text-transform: none;
    --ds-prehook-radius: var(--ds-radius-full);

    /* ================================================
       CARD STYLES
       ================================================ */
    --ds-card-padding: var(--ds-space-6);
    --ds-card-radius: var(--ds-radius-lg);
    --ds-card-shadow: var(--ds-shadow-md);
    --ds-card-border: 1px solid var(--ds-border-light);

    /* ================================================
       OVERLAY OPACITY
       ================================================ */
    --ds-overlay-light: rgba(255, 255, 255, 0.8);
    --ds-overlay-dark: rgba(0, 0, 0, 0.6);
    --ds-overlay-darker: rgba(0, 0, 0, 0.8);
}

/* ================================================
   DARK MODE OVERRIDES (optional)
   ================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        /* Uncomment to enable automatic dark mode */
        /* --ds-background-light: var(--ds-grey-800);
        --ds-text-primary: var(--ds-white);
        --ds-text-secondary: var(--ds-grey-300); */
    }
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */
@media (max-width: 768px) {
    :root {
        --ds-section-padding-y: var(--ds-space-12);
        --ds-section-padding-x: var(--ds-space-4);
    }
}
