/* ==========================================================================
   SILVIA VILLEGAS MISSIONARY WEBSITE — CORE DESIGN SYSTEM & TOKENS
   ========================================================================== */

:root {
  /* Color Palette — Brand & Theme */
  --color-forest: #23483A;
  --color-forest-dark: #173228;
  --color-forest-light: #2E5B4A;
  --color-earth: #8A6548;
  --color-earth-dark: #6C4D35;
  --color-earth-light: #A88162;
  --color-sand: #E8DDC9;
  --color-sand-light: #F4ECE1;
  --color-sand-muted: #DDD0BA;
  --color-offwhite: #FAF9F6;
  --color-white: #FFFFFF;
  --color-dark: #1C2420;
  --color-dark-muted: #3D4A44;
  --color-gray-light: #EAE6DF;
  --color-accent: #C88A35;
  --color-accent-hover: #B27727;
  --color-accent-light: #FFF5E5;

  /* Typography System */
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing Scale */
  --space-xs: 0.25rem;  /* 4px */
  --space-sm: 0.5rem;   /* 8px */
  --space-md: 1rem;     /* 16px */
  --space-lg: 1.5rem;   /* 24px */
  --space-xl: 2.5rem;   /* 40px */
  --space-2xl: 4rem;    /* 64px */
  --space-3xl: 6rem;    /* 96px */

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(28, 36, 32, 0.06);
  --shadow-md: 0 4px 20px rgba(28, 36, 32, 0.1);
  --shadow-lg: 0 12px 36px rgba(28, 36, 32, 0.14);
  --shadow-accent: 0 6px 24px rgba(200, 138, 53, 0.25);

  /* Layout Container */
  --container-max: 1200px;
  --container-narrow: 800px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-offwhite);
  color: var(--color-dark);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Rules */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  color: var(--color-forest-dark);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.8vw, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: 1.15rem;
}

p {
  color: var(--color-dark-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-forest);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-3xl) 0;
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }
}

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

.section-bg-forest {
  background-color: var(--color-forest);
  color: var(--color-offwhite);
}

.section-bg-forest h1,
.section-bg-forest h2,
.section-bg-forest h3,
.section-bg-forest h4 {
  color: var(--color-offwhite);
}

.section-bg-forest p {
  color: rgba(250, 249, 246, 0.88);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-2xl) auto;
}

.section-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-earth);
  margin-bottom: var(--space-xs);
  display: block;
}

.section-bg-forest .section-subtitle {
  color: var(--color-accent);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 992px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flexible Alignment */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Scripture Editorial Badge */
.scripture-box {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-md) var(--space-lg);
  background-color: rgba(232, 221, 201, 0.35);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-lg) 0;
  font-style: italic;
}

.scripture-box p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-forest-dark);
  line-height: 1.6;
}

.scripture-box cite {
  display: block;
  margin-top: var(--space-xs);
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-earth-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--color-forest);
  color: var(--color-offwhite);
}

.btn-secondary:hover {
  background-color: var(--color-forest-dark);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-forest);
  color: var(--color-forest);
}

.btn-outline:hover {
  background-color: var(--color-forest);
  color: var(--color-offwhite);
  transform: translateY(-2px);
}

.btn-outline-light {
  background-color: transparent;
  border-color: var(--color-offwhite);
  color: var(--color-offwhite);
}

.btn-outline-light:hover {
  background-color: var(--color-offwhite);
  color: var(--color-forest);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-forest-dark);
  color: var(--color-offwhite);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: fadeIn 0.3s forwards;
}

@media (max-width: 640px) {
  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 5rem;
  }
}
