/* 
 * My Poultry Farm - Master Typography & Variables
 * Consistent beautiful fonts across all pages
 * Version: 2.0
 */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */

/* Primary Font Stack - Professional & Beautiful */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Libre+Baskerville:wght@400;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
  /* === COLORS === */
  /* Primary Colors - Poultry Green Theme */
  --primary: #2C5F2D;
  --primary-light: #4A8B4D;
  --primary-dark: #1B3F1C;
  --primary-50: rgba(44, 95, 45, 0.05);
  --primary-100: rgba(44, 95, 45, 0.1);
  
  /* Accent Colors */
  --accent: #FF9500;
  --accent-light: #FFB84D;
  --accent-dark: #E68600;
  
  /* Text Colors */
  --text-dark: #1A1A1A;
  --text-medium: #4A4A4A;
  --text-light: #6B6B6B;
  --text-lighter: #9CA3AF;
  
  /* Background Colors */
  --white: #FFFFFF;
  --bg-light: #FAFAFA;
  --bg-cream: #FFF8F0;
  --bg-dark: #F5F5F5;
  
  /* Border & Divider */
  --border: #E5E5E5;
  --border-dark: #D1D5DB;
  
  /* Semantic Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* === TYPOGRAPHY === */
  /* Font Families */
  --font-display: 'Libre Baskerville', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Font Sizes - Fluid Typography */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* 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-xs: 0.5rem;    /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 2rem;      /* 32px */
  --spacing-lg: 4rem;      /* 64px */
  --spacing-xl: 6rem;      /* 96px */
  --spacing-2xl: 8rem;     /* 128px */
  
  /* === LAYOUT === */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* === BORDER RADIUS === */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  /* === 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 -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms 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
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-dark);
  background-color: var(--bg-light);
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-dark);
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, var(--text-5xl));
  font-weight: var(--font-bold);
  line-height: var(--leading-none);
}

h2 {
  font-size: clamp(1.75rem, 4vw, var(--text-4xl));
}

h3 {
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, var(--text-2xl));
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

/* Paragraphs */
p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: 1em;
  color: var(--text-medium);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Strong & Bold */
strong, b {
  font-weight: var(--font-bold);
  color: var(--text-dark);
}

/* Emphasis */
em, i {
  font-style: italic;
}

/* Small Text */
small {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* Code */
code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-dark);
  padding: 0.25em 0.5em;
  border-radius: var(--radius-sm);
}

pre {
  padding: 1em;
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

/* Lists */
ul, ol {
  font-family: var(--font-body);
  line-height: var(--leading-relaxed);
  margin-bottom: 1em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

/* Blockquotes */
blockquote {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  border-left: 4px solid var(--primary);
  padding-left: 1.5em;
  margin: 2em 0;
  color: var(--text-medium);
}

/* ============================================
   CONTAINER
   ============================================ */

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

@media (max-width: 768px) {
  .container {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Font Families */
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); }

/* Font Sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

/* Font Weights */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.font-extrabold { font-weight: var(--font-extrabold); }

/* Text Colors */
.text-dark { color: var(--text-dark); }
.text-medium { color: var(--text-medium); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-white { color: var(--white); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   FORM ELEMENTS (BEAUTIFUL INPUTS)
   ============================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-dark);
  background-color: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-lighter);
  font-weight: var(--font-normal);
}

/* Buttons */
button,
.button {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: var(--leading-normal);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Labels */
label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: var(--tracking-wide);
}

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

@media print {
  * {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  
  body {
    font-family: Georgia, serif;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    font-family: Georgia, serif;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Visually Hidden (Screen Reader Only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--white);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}

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

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
