/**
 * Unified Template CSS Variables
 *
 * This file provides a standardized set of CSS custom properties
 * that all templates should use. This enables:
 * - Consistent theming across templates
 * - Easy theme customization via JavaScript
 * - Live preview color/font changes
 *
 * Usage: @import '../_shared/variables.css';
 * Then override :root variables in your template's style.css
 */

/* ============================================================================
   BASE RESET & DEFAULTS
   ============================================================================ */

:root {
  /* -------------------------------------------------------------------------
     COLORS
     ------------------------------------------------------------------------- */

  /* Primary brand color - main accent, buttons, links */
  --color-primary: #c86635;

  /* Secondary accent - highlights, hover states */
  --color-accent: #d4893e;

  /* Backgrounds */
  --color-background: #fdfbf9;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;

  /* Text colors */
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-text-light: #999999;

  /* Borders and dividers */
  --color-border: #e5e5e5;
  --color-border-light: #f0f0f0;

  /* Status colors */
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  /* Overlay */
  --color-overlay: rgba(0, 0, 0, 0.5);

  /* -------------------------------------------------------------------------
     TYPOGRAPHY
     ------------------------------------------------------------------------- */

  /* Font families */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-heading);
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

  /* Font sizes - using fluid typography */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
  --text-5xl: clamp(3rem, 2rem + 5vw, 4rem);

  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* -------------------------------------------------------------------------
     SPACING
     ------------------------------------------------------------------------- */

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

  /* Section spacing */
  --section-padding-y: clamp(3rem, 5vw, 6rem);
  --section-padding-x: clamp(1rem, 5vw, 2rem);

  /* -------------------------------------------------------------------------
     LAYOUT
     ------------------------------------------------------------------------- */

  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  --container-max: var(--container-xl);

  --page-padding: clamp(1rem, 5vw, 2rem);

  /* -------------------------------------------------------------------------
     BORDERS & SHAPES
     ------------------------------------------------------------------------- */

  --radius-none: 0;
  --radius-sm: 0.125rem;  /* 2px */
  --radius-md: 0.375rem;  /* 6px */
  --radius-lg: 0.5rem;    /* 8px */
  --radius-xl: 0.75rem;   /* 12px */
  --radius-2xl: 1rem;     /* 16px */
  --radius-3xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  --border-width: 1px;
  --border-width-2: 2px;

  /* -------------------------------------------------------------------------
     SHADOWS
     ------------------------------------------------------------------------- */

  --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 -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* -------------------------------------------------------------------------
     TRANSITIONS
     ------------------------------------------------------------------------- */

  --transition-fast: 150ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;

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

  /* -------------------------------------------------------------------------
     Z-INDEX
     ------------------------------------------------------------------------- */

  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-background);
}

/* ============================================================================
   TYPOGRAPHY UTILITIES
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin: 0;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0 0 var(--spacing-4);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast) var(--ease-default);
}

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

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
}

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* ============================================================================
   BILINGUAL SUPPORT
   ============================================================================ */

/* Default: show Polish, hide English */
.lang-en { display: none; }
.lang-pl { display: inline; }

/* When body has data-lang="en" */
body[data-lang="en"] .lang-en { display: inline; }
body[data-lang="en"] .lang-pl { display: none; }

/* Block-level variants */
.lang-block-en { display: none; }
.lang-block-pl { display: block; }

body[data-lang="en"] .lang-block-en { display: block; }
body[data-lang="en"] .lang-block-pl { display: none; }

/* ============================================================================
   ANIMATION UTILITIES
   ============================================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) var(--ease-out) forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-normal) var(--ease-out) forwards;
}

.animate-fade-in-down {
  animation: fadeInDown var(--transition-normal) var(--ease-out) forwards;
}

/* Stagger animations for lists */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp var(--transition-normal) var(--ease-out) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 100ms; }
.stagger-children > *:nth-child(3) { animation-delay: 200ms; }
.stagger-children > *:nth-child(4) { animation-delay: 300ms; }
.stagger-children > *:nth-child(5) { animation-delay: 400ms; }

/* ============================================================================
   LOADING STATES
   ============================================================================ */

/* Skeleton loading placeholder */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-surface) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Content loaded state */
[data-key]:not(.content-loaded) {
  /* Optional: show skeleton until content is loaded */
}

[data-key].content-loaded {
  animation: fadeIn var(--transition-fast) var(--ease-out);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (for reference)
   ============================================================================ */

/*
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  Usage:
  @media (min-width: 640px) { }   // sm
  @media (min-width: 768px) { }   // md
  @media (min-width: 1024px) { }  // lg
  @media (min-width: 1280px) { }  // xl
*/

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }

  a {
    color: inherit;
    text-decoration: underline;
  }

  /* Show full URLs for links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
