/* ============================================
   SHARED TYPOGRAPHY & FONT SYSTEM
   ============================================ */

:root {
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --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;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
}

/* Color system */
:root {
  --color-primary: #667eea;
  --color-primary-600: #4f46e5;
  --color-accent: #764ba2;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-muted: #6b7280;
}

/* Import Inter font if not already included */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Enforce the shared font across the entire site to avoid per-page differences */
html, body, * {
  font-family: var(--font-family-base) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: #1f2937;
}

/* ============================================
   HEADING STYLES (Standardized)
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

h1 {
  font-size: var(--font-size-3xl);
}

.text-4xl.page-title {
  font-size: 2.25rem !important;
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 1rem;
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

h5 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

h6 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

/* ============================================
   PARAGRAPH & TEXT STYLES
   ============================================ */

p {
  margin: 0;
  padding: 0;
  font-size: var(--font-size-base);
  line-height: 1.6;
}

.text-xs {
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

.text-sm {
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.text-lg {
  font-size: var(--font-size-lg);
  line-height: 1.5;
}

.text-xl {
  font-size: var(--font-size-xl);
  line-height: 1.5;
}

.text-2xl {
  font-size: var(--font-size-2xl);
  line-height: 1.5;
}

.text-3xl {
  font-size: var(--font-size-3xl);
  line-height: 1.2;
}

/* ============================================
   FONT WEIGHT UTILITIES
   ============================================ */

.font-normal {
  font-weight: var(--font-weight-normal);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-extrabold {
  font-weight: var(--font-weight-extrabold);
}

/* ============================================
   GRADIENT TEXT (Used for page titles)
   ============================================ */

.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* Page Title (Large Heading with Gradient) */
.page-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-extrabold);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* ============================================
   FORM & INPUT TEXT
   ============================================ */

label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: #374151;
  display: block;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.5;
}

/* ============================================
   BUTTON TEXT
   ============================================ */

button {
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
}

/* ============================================
   CODE & MONOSPACE (if needed)
   ============================================ */

code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  overflow-x: auto;
}

/* ============================================
   LINK STYLES
   ============================================ */

a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE FONT SCALING (Optional)
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .page-title {
    font-size: 1.875rem;
  }
}

/* ==========================
   Layout & Spacing Utilities
   Ensures consistent gutters and spacing around page tiles/cards
   ========================== */

:root {
  --site-max-width: 72rem; /* 1152px (approx 6xl) */
  --site-gutter: 1rem; /* 16px */
  --section-gap: 2rem; /* 32px */
}

.site-container {
  max-width: var(--site-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-gutter);
  padding-right: var(--site-gutter);
}

/* Generic spacing for major cards/sections used across pages */
.card, .card-modern, .rounded-xl.shadow-lg, .bg-white.p-6.rounded-xl.shadow-lg {
  margin-bottom: var(--section-gap) !important;
  padding: 1.5rem !important;
}

/* Ensure consistent inner padding for the larger header cards */
.rounded-xl.shadow-lg > header, .card > header {
  padding: 0;
}

@media (max-width: 640px) {
  .site-container { padding-left: 0.75rem; padding-right: 0.75rem; }
}
