/**
 * Projection Finder Blog - Style Guide
 * =====================================
 * Aesthetic: Refined Technical Editorial
 * For GIS professionals who value precision and clarity
 *
 * Last updated: January 2025
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Primary Palette - Electric Blue */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  /* Legacy teal (being phased out) */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  /* Neutral Palette - Warm Slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Warm Background Tones */
  --cream-50: #fefdfb;
  --cream-100: #fdfcf9;
  --warm-white: #fffffe;

  /* Accent Colors */
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --rose-500: #f43f5e;
  --rose-100: #ffe4e6;

  /* Typography Scale (Perfect Fourth - 1.333) */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.333rem;     /* ~21px */
  --text-2xl: 1.777rem;    /* ~28px */
  --text-3xl: 2.369rem;    /* ~38px */
  --text-4xl: 3.157rem;    /* ~50px */

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  /* Shadows - Refined, warm-tinted */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-blue: 0 4px 14px -3px rgba(37, 99, 235, 0.25);
  --shadow-blue-lg: 0 8px 20px -4px rgba(37, 99, 235, 0.3);

  /* Legacy shadows */
  --shadow-teal: 0 4px 14px -3px rgba(13, 148, 136, 0.25);
  --shadow-teal-lg: 0 8px 20px -4px rgba(13, 148, 136, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Content Width */
  --content-width: 720px;
  --wide-width: 900px;
  --max-width: 1200px;
}


/* ============================================
   2. TYPOGRAPHY
   ============================================ */

/*
 * Font Stack:
 * - Headlines: Instrument Serif (distinctive, editorial feel)
 * - Body: Source Sans 3 (highly readable, professional)
 * - Code: JetBrains Mono (excellent for code)
 *
 * Alternative if Instrument Serif feels too editorial:
 * - Headlines: DM Sans (geometric, modern)
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;1,400&display=swap');

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for sticky header */
}

body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--slate-700);
  background-color: #ffffff;
  /* Precision grid pattern - matches main app */
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}


/* ============================================
   3. HEADER
   ============================================ */

header {
  background-color: rgba(255, 255, 255, 0.85);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--transition-base);
}

header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--slate-800);
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: translateX(2px);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--slate-900);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-900);
  transition: transform var(--transition-fast);
}

.logo:hover .logo-icon {
  transform: scale(1.05);
}

.logo-text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--slate-900);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background var(--transition-fast);
}

.cta-btn:hover {
  background: var(--slate-800);
}


/* ============================================
   4. ARTICLE STRUCTURE
   ============================================ */

article {
  padding: var(--space-12) 0 var(--space-20);
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Breadcrumb */
.breadcrumb {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-sm);
  color: var(--slate-500);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb a {
  color: var(--slate-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--blue-600);
}

.breadcrumb span {
  color: var(--slate-400);
}


/* ============================================
   5. TYPOGRAPHY - HEADINGS
   ============================================ */

h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
  font-weight: 400;
  color: var(--slate-900);
  line-height: 1.15;
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
  /* Subtle text shadow for depth */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--slate-800);
  margin: var(--space-16) 0 var(--space-5);
  letter-spacing: -0.01em;
  line-height: 1.25;
  position: relative;
  padding-left: var(--space-5);
  scroll-margin-top: 80px;
}

/* Decorative accent line for h2 */
h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: linear-gradient(180deg, var(--blue-400) 0%, var(--blue-600) 100%);
  border-radius: 2px;
}

h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--slate-800);
  margin: var(--space-10) 0 var(--space-4);
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}

h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--slate-700);
  margin: var(--space-8) 0 var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ============================================
   6. TYPOGRAPHY - BODY
   ============================================ */

p {
  margin-bottom: var(--space-5);
  color: var(--slate-600);
}

/* Lead paragraph (first after h1) */
article > .container > p:first-of-type {
  font-size: var(--text-xl);
  color: var(--slate-700);
  line-height: 1.6;
}

strong {
  font-weight: 600;
  color: var(--slate-700);
}

em {
  font-style: italic;
}

/* Article meta */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: var(--slate-500);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--slate-200);
}

.meta span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.meta svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}


/* ============================================
   7. LINKS
   ============================================ */

a {
  color: var(--blue-600);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: all var(--transition-fast);
}

a:hover {
  color: var(--blue-700);
  text-decoration-color: var(--blue-600);
}

/* External link indicator */
a[target="_blank"]::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'/%3E%3C/svg%3E");
  background-size: contain;
  opacity: 0.6;
  vertical-align: middle;
}

/* Don't show external link icon on image links or footer logo */
footer a[target="_blank"]::after,
a[target="_blank"]:has(img)::after {
  display: none;
}


/* ============================================
   8. LISTS
   ============================================ */

ul, ol {
  margin-bottom: var(--space-6);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-3);
  color: var(--slate-600);
  padding-left: var(--space-2);
}

ul li::marker {
  color: var(--blue-500);
}

ol li::marker {
  color: var(--blue-600);
  font-weight: 600;
}

/* Nested lists */
li ul, li ol {
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
}


/* ============================================
   9. CODE & PREFORMATTED
   ============================================ */

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: linear-gradient(135deg, var(--slate-100) 0%, var(--slate-50) 100%);
  color: var(--blue-700);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
  font-variant-ligatures: none;
}

pre {
  position: relative;
  background: linear-gradient(145deg, var(--slate-800) 0%, var(--slate-900) 100%);
  color: var(--slate-100);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-6) 0 var(--space-8);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  line-height: 1.7;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid var(--slate-700);
}

/* Code block header accent */
pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-400) 0%, var(--blue-600) 50%, var(--amber-500) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Scrollbar for code blocks */
pre::-webkit-scrollbar {
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: var(--slate-700);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: var(--slate-500);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}


/* ============================================
   10. TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--space-6) 0 var(--space-8);
  font-size: var(--text-base);
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}

thead {
  background: linear-gradient(180deg, var(--slate-50) 0%, var(--slate-100) 100%);
}

th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--slate-700);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--slate-200);
}

td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-600);
  transition: background var(--transition-fast);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--blue-50);
}

/* First column emphasis */
td:first-child {
  font-weight: 500;
  color: var(--slate-700);
}


/* ============================================
   11. INFO BOXES / CALLOUTS
   ============================================ */

.info-box {
  position: relative;
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--cream-100) 100%);
  border: 1px solid var(--blue-200);
  border-left: 4px solid var(--blue-500);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-8) 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.info-box::before {
  content: '💡';
  position: absolute;
  top: -12px;
  left: var(--space-4);
  background: var(--cream-50);
  padding: 0 var(--space-2);
  font-size: var(--text-lg);
}

.info-box p {
  margin: 0;
  color: var(--slate-700);
}

.info-box strong {
  color: var(--blue-700);
}

/* Warning variant */
.info-box.warning {
  background: linear-gradient(135deg, var(--amber-100) 0%, var(--cream-100) 100%);
  border-color: var(--amber-500);
  border-left-color: var(--amber-500);
}

.info-box.warning::before {
  content: '⚠️';
}


/* ============================================
   12. CTA BOX
   ============================================ */

.cta-box {
  position: relative;
  background: var(--warm-white);
  border: 2px solid var(--blue-500);
  color: var(--slate-800);
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-xl);
  margin: var(--space-12) 0;
  text-align: center;
  overflow: hidden;
}

/* Decorative background pattern - subtle grid */
.cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Globe decoration */
.cta-box::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.1)' stroke-width='0.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418'/%3E%3C/svg%3E");
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
}

.cta-box h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  color: var(--slate-900);
  margin: 0 0 var(--space-3);
  font-size: var(--text-2xl);
  font-weight: 400;
  position: relative;
}

.cta-box h3::before {
  display: none; /* Remove the accent line on CTA h3 */
}

.cta-box p {
  color: var(--slate-600);
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
  position: relative;
}

.cta-box .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--blue-600);
  color: white;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  position: relative;
  transition: all var(--transition-fast);
}

.cta-box .btn:hover {
  background: var(--blue-700);
}

.cta-box .btn::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.cta-box .btn:hover::after {
  transform: translateX(4px);
}


/* ============================================
   13. TABLE OF CONTENTS
   ============================================ */

.toc {
  background: var(--warm-white);
  border: 1px solid var(--slate-200);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  margin: var(--space-8) 0 var(--space-10);
  box-shadow: var(--shadow-sm);
}

.toc h4 {
  margin: 0 0 var(--space-4);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-500);
}

.toc ol {
  margin: 0;
  padding-left: var(--space-5);
  counter-reset: toc-counter;
  list-style: none;
}

.toc li {
  counter-increment: toc-counter;
  margin-bottom: var(--space-2);
  padding-left: 0;
}

.toc li::before {
  content: counter(toc-counter) ".";
  color: var(--blue-500);
  font-weight: 600;
  margin-right: var(--space-2);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-sm);
}

.toc a {
  text-decoration: none;
  color: var(--slate-600);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
}

.toc a:hover {
  color: var(--blue-600);
  padding-left: var(--space-2);
}


/* ============================================
   14. FAQ SECTION
   ============================================ */

.faq-item {
  background: var(--warm-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--blue-300);
  box-shadow: var(--shadow-md);
}

.faq-question {
  padding: var(--space-5) var(--space-6);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--slate-800);
  background: linear-gradient(180deg, var(--slate-50) 0%, var(--warm-white) 100%);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
  user-select: none;
}

.faq-question:hover {
  background: var(--blue-50);
  color: var(--blue-700);
}

.faq-question::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--blue-500);
  font-weight: 400;
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--slate-100);
  background: var(--warm-white);
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-answer p {
  margin: 0;
  color: var(--slate-600);
}


/* ============================================
   15. FOOTER
   ============================================ */

footer {
  background-color: rgba(255, 255, 255, 0.85);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
  padding: var(--space-12) 0;
  text-align: center;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-logo {
  height: 36px;
  margin-bottom: var(--space-4);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer-logo:hover {
  opacity: 1;
}

footer p {
  color: var(--slate-500);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

footer a {
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}


/* ============================================
   16. ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* Fade in on page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

article {
  animation: fadeInUp 0.6s ease-out;
}

h1 {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.meta {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Smooth anchor scroll highlight */
:target {
  scroll-margin-top: 100px;
}

h2:target,
h3:target {
  animation: highlightPulse 1s ease-out;
}

@keyframes highlightPulse {
  0%, 100% {
    background: transparent;
  }
  30% {
    background: var(--blue-100);
  }
}


/* ============================================
   17. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  :root {
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
  }

  .container {
    padding: 0 var(--space-5);
  }

  .header-inner {
    flex-direction: column;
    gap: var(--space-4);
  }

  h2 {
    margin-top: var(--space-12);
  }

  .meta {
    flex-direction: column;
    gap: var(--space-2);
  }

  pre {
    padding: var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
  }

  table {
    font-size: var(--text-sm);
  }

  th, td {
    padding: var(--space-3);
  }

  .cta-box {
    padding: var(--space-8) var(--space-5);
  }

  .cta-box::after {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    font-size: var(--text-base);
  }

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

  h2 {
    font-size: var(--text-xl);
    padding-left: var(--space-4);
  }

  .toc {
    padding: var(--space-5);
  }

  .faq-question {
    padding: var(--space-4);
  }

  .faq-answer {
    padding: var(--space-4);
  }
}


/* ============================================
   18. PRINT STYLES
   ============================================ */

@media print {
  header,
  .cta-box,
  .cta-btn,
  footer {
    display: none !important;
  }

  body {
    background: white;
    font-size: 12pt;
  }

  article {
    padding: 0;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  pre, table {
    page-break-inside: avoid;
  }

  a::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }
}


/* ============================================
   19. UTILITY CLASSES
   ============================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.teal-text,
.blue-text {
  color: var(--blue-600);
}

/* Tag/badge styling */
.tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue-100) 0%, var(--blue-50) 100%);
  color: var(--blue-700);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--blue-200);
}


/* ============================================
   20. BLOG INDEX PAGE
   ============================================ */

.blog-index {
  padding: 80px 0 100px;
}

.blog-index-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  text-align: center;
}

.blog-index-subtitle {
  text-align: center;
  color: var(--slate-600);
  margin-bottom: 56px;
  font-size: 1.25rem;
}

.blog-grid {
  display: grid;
  gap: 24px;
}

.blog-card {
  background: var(--warm-white);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.2s;
}

.blog-card:hover {
  border-color: var(--blue-500);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.blog-card .tag {
  margin-bottom: 12px;
}

.blog-card h2 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0 0 10px;
  padding-left: 0;
}

.blog-card h2::before {
  display: none;
}

.blog-card h2 a {
  color: var(--slate-800);
  text-decoration: none;
}

.blog-card h2 a:hover {
  color: var(--blue-600);
}

.blog-card p {
  color: var(--slate-600);
  font-size: 1.0625rem;
  margin-bottom: 14px;
  line-height: 1.6;
}

.blog-card .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--slate-500);
}

.copyright {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .blog-index-title {
    font-size: 2.25rem;
  }
}
