/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Refined Color Palette */
:root {
  /* Core Colours */
  --color-base: #F6F5F2;
  --color-primary-text: #121212;
  --color-secondary-text: #8A8A8A;
  
  /* Accent Colours */
  --color-olive: #9BAA8F;
  --color-sand: #E5E3DF;
  
  /* Legacy color names for compatibility */
  --color-sage: #9BAA8F;
  --color-terracotta: #9BAA8F;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

/* Base Styles */
body {
  background-color: var(--color-base);
  color: var(--color-primary-text);
  font-family: var(--font-body);
  font-weight: 400;
}

/* Typography - Clean & Minimal Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-primary-text);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.3;
  font-weight: 500;
}

h2 {
  font-size: 1.875rem;
  line-height: 1.4;
  font-weight: 500;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.5;
  font-weight: 500;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 500;
}

h5 {
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 500;
}

h6 {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
}

p, li, span {
  font-family: var(--font-body);
  color: var(--color-primary-text);
  line-height: 1.7;
  font-weight: 400;
}

/* Links */
a {
  color: var(--color-primary-text);
  transition: color 0.3s ease;
}

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

/* Buttons & CTAs */
.btn-primary,
button[class*="bg-blue"] {
  background-color: var(--color-olive) !important;
  color: var(--color-base) !important;
  border: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary:hover,
button[class*="bg-blue"]:hover {
  background-color: var(--color-primary-text) !important;
  transform: translateY(-2px);
}

/* Cards & Containers */
.card,
[class*="bg-white"] {
  background-color: var(--color-base) !important;
  border: 1px solid var(--color-sand);
}

[class*="bg-gray-50"],
[class*="bg-gray-100"] {
  background-color: var(--color-sand) !important;
}

/* Borders */
[class*="border-gray"] {
  border-color: var(--color-sand) !important;
}

/* Text Colors Override */
[class*="text-gray-600"],
[class*="text-gray-500"] {
  color: var(--color-secondary-text) !important;
}

[class*="text-gray-700"],
[class*="text-gray-800"],
[class*="text-gray-900"] {
  color: var(--color-primary-text) !important;
}

[class*="text-blue"],
.text-sage,
.text-terracotta {
  color: var(--color-olive) !important;
}

/* Background Colors */
.bg-sage,
.bg-terracotta {
  background-color: var(--color-olive) !important;
}

.bg-sand {
  background-color: var(--color-sand) !important;
}

.bg-base {
  background-color: var(--color-base) !important;
}

/* Border Colors */
.border-sage,
.border-terracotta {
  border-color: var(--color-olive) !important;
}

.border-sand {
  border-color: var(--color-sand) !important;
}

/* Navigation */
nav {
  background-color: var(--color-base) !important;
  border-bottom: 1px solid var(--color-sand) !important;
}

nav a {
  color: var(--color-primary-text);
  font-family: var(--font-body);
  font-weight: 500;
}

nav a:hover {
  color: var(--color-olive) !important;
}

/* Footer */
footer {
  background-color: var(--color-sand) !important;
  border-top: 1px solid var(--color-sand);
}

footer h3 {
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
}

footer p,
footer a,
footer li {
  color: var(--color-primary-text);
}

footer a:hover {
  color: var(--color-olive) !important;
}

/* FAQ Page Specific */
.faq-item {
  background-color: var(--color-base) !important;
  border: 1px solid var(--color-sand) !important;
}

.faq-item h3 {
  font-size: 1.125rem;
  font-weight: 500;
}

.faq-item:hover {
  border-color: var(--color-olive) !important;
  box-shadow: 0 4px 12px rgba(155, 170, 143, 0.1);
}

/* Glossary Page Specific Styling */
.glossary-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.glossary-container h1 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.glossary-container > p {
  text-align: center;
  color: var(--color-secondary-text);
  margin-bottom: 3rem;
  font-size: 1.125rem;
}

/* Glossary alphabet navigation */
.glossary-container nav {
  background-color: transparent !important;
  border: none !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  padding: 0;
}

.glossary-container nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background-color: var(--color-sand);
  color: var(--color-primary-text);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.glossary-container nav a:hover {
  background-color: var(--color-olive);
  color: var(--color-base);
  transform: translateY(-2px);
}

/* Glossary letter sections */
.glossary-container > div > h2 {
  font-size: 2rem;
  color: var(--color-olive);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-sand);
}

.glossary-container > div > h2:first-of-type {
  margin-top: 0;
}

/* Glossary term list */
.glossary-container ul {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.glossary-container ul li {
  margin-bottom: 0;
}

.glossary-container ul li a {
  display: block;
  padding: 1rem 1.5rem;
  background-color: var(--color-base);
  border: 1px solid var(--color-sand);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--color-primary-text);
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.glossary-container ul li a:hover {
  background-color: var(--color-sand);
  border-color: var(--color-olive);
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(155, 170, 143, 0.15);
}

/* Glossary term detail page */
.glossary-term-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.glossary-term-detail h1 {
  color: var(--color-olive);
  margin-bottom: 1.5rem;
  font-size: 2.25rem;
}

.glossary-term-detail p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-primary-text);
  margin-bottom: 1.5rem;
}

/* Gradients Override */
[class*="bg-gradient"],
.hero-gradient {
  background: linear-gradient(135deg, var(--color-olive) 0%, var(--color-primary-text) 100%) !important;
}

/* Hero Sections */
.hero-section,
[class*="from-blue"] {
  background: var(--color-base) !important;
}

/* Shadows - Softer */
[class*="shadow"] {
  box-shadow: 0 1px 4px rgba(18, 18, 18, 0.06) !important;
}

[class*="shadow-lg"] {
  box-shadow: 0 2px 8px rgba(18, 18, 18, 0.08) !important;
}

[class*="shadow-xl"] {
  box-shadow: 0 4px 12px rgba(18, 18, 18, 0.1) !important;
}

/* Icons & SVG */
svg {
  color: var(--color-olive);
}

/* Hover States */
.hover-accent:hover {
  color: var(--color-olive) !important;
}

/* Blog Post Styles */
.blog-post h1,
.blog-post h2,
.blog-post h3 {
  font-family: var(--font-display);
  color: var(--color-primary-text);
  font-weight: 500;
}

.blog-post h1 {
  font-size: 2rem;
}

.blog-post h2 {
  font-size: 1.75rem;
}

.blog-post h3 {
  font-size: 1.375rem;
}

.blog-post p {
  font-family: var(--font-body);
  color: var(--color-primary-text);
  line-height: 1.8;
  font-weight: 400;
}

.blog-post a {
  color: var(--color-olive);
  text-decoration: underline;
  text-decoration-color: var(--color-olive);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.blog-post a:hover {
  color: var(--color-primary-text);
}

/* Quote Blocks */
blockquote {
  border-left: 3px solid var(--color-olive);
  background-color: var(--color-sand);
  padding: 1.5rem;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-primary-text);
  font-weight: 400;
}

/* Code Blocks */
code, pre {
  background-color: var(--color-sand);
  color: var(--color-primary-text);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
}

/* Input Fields */
input, textarea, select {
  background-color: var(--color-base) !important;
  border: 1px solid var(--color-sand) !important;
  color: var(--color-primary-text) !important;
  font-family: var(--font-body);
  font-weight: 400;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-olive) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(155, 170, 143, 0.1);
}

/* Tags & Badges */
.tag, .badge {
  background-color: var(--color-sand);
  color: var(--color-primary-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

/* Dividers */
hr {
  border-color: var(--color-sand);
  opacity: 0.5;
}

/* Image Captions */
figcaption {
  font-family: var(--font-body);
  color: var(--color-secondary-text);
  font-size: 0.875rem;
  font-style: italic;
  font-weight: 400;
}

/* Loading States */
.loading {
  color: var(--color-olive);
}

/* Selection */
::selection {
  background-color: var(--color-olive);
  color: var(--color-base);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-base);
}

::-webkit-scrollbar-thumb {
  background: var(--color-sand);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-olive);
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  h4 {
    font-size: 1.125rem;
  }
  
  .glossary-container h1 {
    font-size: 2rem;
  }
  
  .glossary-container > div > h2 {
    font-size: 1.5rem;
  }
}

/* Animation Tweaks */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

/* Utility Classes */
.text-sage,
.text-olive {
  color: var(--color-olive) !important;
}

.text-terracotta {
  color: var(--color-olive) !important;
}

.bg-olive {
  background-color: var(--color-olive) !important;
}

/* Font Weight Overrides for Sophistication */
strong, b {
  font-weight: 500;
}

/* Clean Button Styles */
button, .button {
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Smooth Transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Clean, Professional Aesthetic */
.gradient-bg {
  background: linear-gradient(135deg, var(--color-base) 0%, #EEECEA 100%);
}

/* Sophisticated hover effects */
.fact-number {
  background-color: var(--color-olive) !important;
}

.fact-card:hover .fact-number {
  background-color: var(--color-primary-text) !important;
}