/* ===========================================
   CHURCH WEBSITE - DESIGN SYSTEM
   =========================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Color Palette - Elegant Church Theme (Navy & Gold) */
  --color-primary: #1a3a52;
  --color-primary-dark: #0f2438;
  --color-primary-light: #2a5278;
  --color-accent: #d4a574;
  --color-accent-light: #e6b887;
  --color-accent-dark: #b88d5f;

  /* Backgrounds */
  --bg-light: #f7f9fc;
  --bg-cream: #faf8f5;
  --bg-white: #ffffff;
  --bg-dark: #0a1929;
  --bg-overlay: rgba(26, 58, 82, 0.75);

  /* Text Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #767676;
  --text-light: #ffffff;
  --text-accent: var(--color-accent);

  /* Borders & Shadows */
  --border-light: #e8e6e3;
  --border-medium: #d1cfc9;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-scripture: 'EB Garamond', Georgia, serif;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --container-max: 1280px;
  --sidebar-width: 320px;
  --nav-height: 64px;
  --content-width: calc(100% - var(--sidebar-width) - var(--space-2xl));

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100000;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  color: #fff;
}

/* --- CSS Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Use defaults for overflow to ensure standard browser scrolling */
}

body {
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  /* Nuclear fix: prevent any overflow hiding on body */
  overflow: visible !important;
}

/* Accessibility: Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  background-color: var(--bg-light);
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 1;
  transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
}

/* Scripture Styling */
.scripture {
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.9;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.scripture-reference {
  display: block;
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: var(--space-md);
  text-align: right;
  letter-spacing: 0.5px;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xl);
  padding: var(--space-2xl) 0;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

/* Spacing Utilities */
.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mt-2xl {
  margin-top: var(--space-2xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.mb-2xl {
  margin-bottom: var(--space-2xl);
}

.py-sm {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.py-md {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.py-lg {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.py-xl {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.py-2xl {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.py-3xl {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--color-accent);
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
  .sidebar {
    width: 100%;
    order: 2;
  }

  .main-content {
    order: 1;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .container {
    padding: 0 20px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-wrapper {
    padding: 50px 0;
    gap: 30px;
  }
}

/* Footer styles are in components.css — single source of truth */