/**
 * BibleLearn Main Stylesheet
 * Imports modular CSS files for better organization
 */

/* Import modular CSS files */
@import url('_variables.css');
@import url('_base.css');
@import url('_layout.css');

/* Legacy variables (kept for backward compatibility) */
:root {
  --c-primary: #1c4a85;
  --c-accent: #a31c0c;
  --c-bg: #f8f9fa;
  --c-text: #333;
  --fs-h1: 2.5rem;
  --fs-h2: 2rem;
  --fs-body: 1rem;
  --ff-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Ensure flex items don't shrink below content size */
.flex > * {
  flex-shrink: 0;
}

/* Header */
.header {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  padding: 1rem 0;
  flex-wrap: nowrap;
}

@media (max-width: 767px) {
  .header-inner {
    flex-wrap: wrap;
  }
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  order: -2; /* Ensure logo appears first (before nav) */
}

.logo img {
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-list a {
  text-decoration: none;
  color: var(--c-text);
  padding: 0.5rem;
  transition: color 0.3s;
  display: block;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--c-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--c-text-inverse);
  /* Ensure text has proper contrast against backgrounds */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-alt {
  background-image: linear-gradient(rgba(28, 74, 133, 0.75), rgba(46, 90, 143, 0.75)), url('/assets/images/james-PT-gOmCUlCY-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 30vh;
  position: relative;
}

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

.content-intro {
  max-width: 720px;
  margin: auto;
  text-align: center;
}

.py-3 {
  padding: 3rem 0;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-title {
  font-size: var(--fs-h1);
  margin-bottom: 1rem;
  /* Improved readability */
  font-weight: 700;
  line-height: 1.1;
  /* Better contrast */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
  /* Better readability */
  line-height: 1.4;
  max-width: 600px;
  margin: 0 auto;
  /* Improved contrast */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-features {
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

.hero-link {
  color: inherit;
  text-decoration: underline;
  margin: 0 0.25rem;
}

.hero-link:hover {
  opacity: 0.8;
}

/* Sections */
.section-title {
  font-size: var(--fs-h2);
  margin-bottom: 2rem;
  color: var(--c-primary);
  font-weight: 700;
  /* Ensure headings are always readable */
  text-shadow: none;
}

.features-section {
  padding: 4rem 0;
  background: #ffffff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Ensure main content areas have light backgrounds */
main {
  background: #ffffff;
}

main > section {
  background: #ffffff;
}

/* Ensure headings are always dark and readable */
h1, h2, h3, h4, h5, h6 {
  color: #1a1a1a;
  font-weight: 700;
}

.feature-text {
  margin-top: 1rem;
}

.team-section {
  padding: 4rem 0;
}

.faq-section {
  padding: 4rem 0;
}

.book-index {
  padding: 4rem 0;
}

.cta-section {
  padding: 4rem 0;
}

.grid {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

/* Features */
.feature-card {
  padding: 2.5rem 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.8);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  border-color: rgba(28, 74, 133, 0.1);
}

.feature-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 500;
}

.feature-link:hover {
  text-decoration: underline;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(28, 74, 133, 0.25);
  border: 3px solid rgba(255,255,255,0.2);
}

.feature-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: 22px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: translateY(-8px) scale(1.1) rotate(5deg);
  box-shadow: 0 16px 40px rgba(28, 74, 133, 0.4);
}

.feature-card:hover .feature-icon::after {
  opacity: 0.3;
}

/* Book Icon - Simple stacked rectangles */
.icon-book::before {
  content: '';
  width: 24px;
  height: 18px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  box-shadow: 6px 0 0 -2px #fff, 0 6px 0 -2px #fff, 6px 6px 0 -2px #fff;
}

.icon-book::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 2px;
  background: var(--c-primary);
  border-radius: 1px;
  box-shadow: 0 4px 0 var(--c-primary), 0 8px 0 var(--c-primary);
}

/* Calendar Icon - Box with lines */
.icon-calendar::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2.5px solid #fff;
  border-radius: 3px;
  position: relative;
}

.icon-calendar::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 3px 0 #fff, 0 6px 0 #fff;
}

/* Globe Icon - Circle with lines */
.icon-globe::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  position: relative;
}

.icon-globe::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 0 0 1.5px var(--c-primary), 0 0 0 3px #fff;
}

/* Video Icon - Play button in box */
.icon-video::before {
  content: '';
  width: 24px;
  height: 18px;
  border: 2.5px solid #fff;
  border-radius: 3px;
  position: relative;
}

.icon-video::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-left: 6px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* Community Icon - Three circles */
.icon-community::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 18px;
  left: 18px;
  box-shadow: 18px 0 0 #fff, 0 18px 0 #fff, 18px 18px 0 #fff;
}

.icon-community::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 5px 0 #fff, 0 10px 0 #fff;
}

/* Device Icon - Phone shape */
.icon-device::before {
  content: '';
  width: 18px;
  height: 28px;
  border: 2.5px solid #fff;
  border-radius: 3px;
  position: relative;
}

.icon-device::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

.feature-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #fff;
  padding: 4rem 0 2rem;
  margin-top: 6rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-pattern" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.03)"/><path d="M0 40 L40 0" stroke="rgba(255,255,255,0.02)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-pattern)"/></svg>');
  pointer-events: none;
}

.footer-inner {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
}

.footer-left p {
  color: #a0aec0;
  margin: 0;
  line-height: 1.6;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #e2e8f0;
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.footer-nav a:hover {
  color: #63b3ed;
  transform: translateY(-2px);
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  transition: width 0.3s ease;
}

.footer-nav a:hover::after {
  width: 100%;
}

.footer-list {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

/* =====================================================
   MOBILE & ACCESSIBILITY OPTIMIZATIONS
   ===================================================== */

/* Prevent text size adjustment on orientation change (iOS) */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scrolling for iOS */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
  .btn-primary,
  .btn-outline,
  .feature-link,
  .step-link {
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Improved tap targets */
  .nav-list a,
  .footer-nav a {
    padding: 1rem 0.5rem;
    margin: 0 -0.5rem;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero {
    background: linear-gradient(135deg, #000 0%, #333 100%);
  }

  .feature-card,
  .step-card,
  .testimonial-card {
    border: 2px solid #000;
  }
}

/* Focus visible enhancements */
*:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Enhanced loading states */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Prevent pull-to-refresh on Android Chrome */
body {
  overscroll-behavior-y: contain;
}

/* Better tap highlighting for mobile */
* {
  -webkit-tap-highlight-color: rgba(28, 74, 133, 0.2);
  tap-highlight-color: rgba(28, 74, 133, 0.2);
}

/* Disable tap highlight for specific elements */
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: rgba(28, 74, 133, 0.2);
}

/* iOS specific: Prevent elastic scrolling on body */
@supports (-webkit-touch-callout: none) {
  body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  main {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

/* Android Chrome: Better momentum scrolling */
@media (hover: none) and (pointer: coarse) {
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Prevent double-tap zoom on buttons and links */
  button,
  a,
  input[type="button"],
  input[type="submit"] {
    touch-action: manipulation;
  }
}

/* =====================================================
   MOBILE OPTIMIZATION - Multiple Breakpoints
   ===================================================== */

/* Extra Small Devices (phones, < 480px) */
@media (max-width: 479px) {
  :root {
    --fs-h1: 1.8rem;
    --fs-h2: 1.5rem;
  }

  .container {
    padding: 0 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  .logo img {
    height: 32px;
    max-width: 150px;
  }

  .nav-list {
    padding: 0.75rem 0;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .nav-list a {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .hero {
    padding: 1.5rem 0.75rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    text-align: center;
  }

  .hero-title {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.4;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .features-section,
  .team-section,
  .faq-section,
  .book-index,
  .cta-section {
    padding: 2rem 0;
  }

  .features-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .feature-card,
  .card {
    padding: 1rem;
  }

  .feature-icon {
    font-size: 2rem;
  }

  .feature-title {
    font-size: 1.125rem;
  }

  .team-card img {
    height: 200px;
    object-fit: cover;
  }

  .btn-primary,
  .btn-outline {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-primary:last-child,
  .btn-outline:last-child {
    margin-bottom: 0;
  }

  input,
  textarea,
  button[type="submit"] {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  input,
  textarea {
    padding: 0.875rem;
    min-height: 44px;
  }

  /* Table optimization for study.html - horizontal scroll */
  .table-wrapper {
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    position: relative;
  }

  .table-wrapper::before {
    content: '← Scroll horizontally →';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.7;
  }

  /* Hide scroll hint after user scrolls */
  .table-wrapper.scrolling::before {
    opacity: 0;
    transition: opacity 0.3s;
  }

  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }

  .table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--c-primary);
    border-radius: 4px;
  }

  .reading-plan-table {
    font-size: 0.9rem;
    min-width: 700px;
    line-height: 1.4;
  }

  .reading-plan-table th,
  .reading-plan-table td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
    /* Better contrast for table content */
    color: var(--c-text);
  }

  .reading-plan-table td:nth-child(4) {
    white-space: normal;
    max-width: 200px;
  }

  /* Card view for table rows on very small screens (optional enhancement) */
  .reading-plan-table-card-view {
    display: none;
  }

  /* Details/summary optimization */
  details {
    margin-bottom: 1rem;
  }

  summary {
    padding: 0.875rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  /* Footer mobile optimization */
  .footer {
    padding: 1.5rem 0;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .footer-left {
    text-align: center;
    margin-bottom: 1rem;
  }
}

/* Small Devices (phones, 480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  :root {
    --fs-h1: 2rem;
    --fs-h2: 1.75rem;
  }

  .container {
    padding: 0 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .hero {
    padding: 2rem 1rem;
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .btn-primary,
  .btn-outline {
    width: auto;
    margin-right: 0.5rem;
    margin-bottom: 0;
    min-height: 44px;
    padding: 0.875rem 1.5rem;
  }

  /* Table optimizations for small screens */
  .table-wrapper {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .reading-plan-table {
    font-size: 0.85rem;
    min-width: 650px;
  }

  .reading-plan-table th,
  .reading-plan-table td {
    padding: 0.6rem 0.5rem;
  }
}

/* Medium Devices (tablets, 768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .hero {
    padding: 3rem 2rem;
    padding-top: max(3rem, env(safe-area-inset-top));
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }

  .reading-plan-table {
    font-size: 0.9rem;
  }
}

/* Large Devices (desktops, > 1024px) - No changes needed, default styles work */

/* =====================================================
   MOBILE NAVIGATION ENHANCEMENT
   ===================================================== */

@media (max-width: 767px) {
  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem 0;
    z-index: 1000;
    border-top: 1px solid #eee;
  }

  .nav-list.open {
    display: flex;
  }

  .nav-list a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
  }

  .nav-list a:hover,
  .nav-list a[aria-current="page"] {
    background-color: #f8f9fa;
    color: var(--c-primary);
  }

  .nav-toggle {
    display: block;
    background: none;
    border: 2px solid var(--c-primary);
    border-radius: 4px;
    color: var(--c-primary);
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px; /* Minimum touch target */
    min-height: 44px;
  }

  .nav-toggle:hover {
    background-color: var(--c-primary);
    color: #fff;
  }

  .nav-toggle.active {
    background-color: var(--c-primary);
    color: #fff;
  }
}

/* =====================================================
   TOUCH OPTIMIZATION
   ===================================================== */

/* Improve touch targets for mobile */
@media (max-width: 767px) {
  button,
  .btn-primary,
  .btn-outline,
  a[role="button"],
  input[type="submit"],
  summary {
    min-height: 44px; /* Apple recommended minimum touch target */
    min-width: 44px;
  }

  /* Better spacing for touch */
  .card,
  .feature-card {
    margin-bottom: 1rem;
  }

  /* Optimize link spacing */
  .nav-list a,
  .footer-list a {
    display: block;
    padding: 0.875rem 1rem;
  }
}

/* =====================================================
   MOBILE TYPOGRAPHY OPTIMIZATION
   ===================================================== */

@media (max-width: 767px) {
  body {
    font-size: 18px; /* Larger base font size for better mobile readability */
    line-height: 1.6;
    /* Improved text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
  }

  p {
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* Improve readability for long text */
  .feature-text,
  .card p,
  .step-text,
  .testimonial-text {
    line-height: 1.6;
    font-size: 1rem;
  }

  /* Better spacing for readability */
  .section-title {
    margin-bottom: 1.5rem;
  }
}

/* =====================================================
   MOBILE FORM OPTIMIZATION
   ===================================================== */

@media (max-width: 767px) {
  form {
    margin: 0;
  }

  input,
  textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s ease;
    /* Prevent zoom on focus (iOS) */
    -webkit-appearance: none;
    appearance: none;
    /* Better mobile keyboard handling */
    inputmode: text;
  }

  /* Optimize input types for mobile keyboards */
  input[type="email"] {
    inputmode: email;
    autocomplete: email;
  }

  input[type="tel"] {
    inputmode: tel;
    autocomplete: tel;
  }

  input[type="url"] {
    inputmode: url;
    autocomplete: url;
  }

  input[type="search"] {
    inputmode: search;
  }

  input:focus,
  textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(28, 74, 133, 0.1);
    /* Prevent zoom on focus (iOS Safari) */
    font-size: 16px;
  }

  button[type="submit"],
  .btn-primary,
  .btn-outline {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    /* Prevent double-tap zoom */
    touch-action: manipulation;
  }
}

/* =====================================================
   MOBILE IMAGE OPTIMIZATION
   ===================================================== */

@media (max-width: 767px) {
  img {
    max-width: 100%;
    height: auto;
    /* Prevent layout shift */
    display: block;
  }

  /* Lazy loading hint for better performance */
  img[loading="lazy"] {
    background-color: #f0f0f0;
    min-height: 200px;
  }

  /* Optimize background images for mobile */
  .hero-home,
  .hero-bible,
  .hero-community,
  .how-it-works-section,
  .final-cta-section {
    background-attachment: scroll; /* Prevent fixed attachment on mobile */
    background-size: cover;
    background-position: center;
  }

  /* Reduce image quality hints for faster loading */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* =====================================================
   MOBILE ACCESSIBILITY IMPROVEMENTS
   ===================================================== */

@media (max-width: 767px) {
  /* Improve focus indicators for keyboard navigation */
  button:focus,
  a:focus,
  input:focus,
  textarea:focus,
  select:focus,
  summary:focus {
    outline: 3px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Enhanced focus for interactive elements */
  .btn-primary:focus,
  .btn-outline:focus,
  .nav-list a:focus {
    outline: 4px solid var(--c-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(28, 74, 133, 0.2);
  }
}

/* =====================================================
   PERFORMANCE OPTIMIZATIONS
   ===================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Optimize for high contrast mode */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid #000;
  }

  .btn-primary {
    border: 2px solid #000;
  }

  .btn-outline {
    border: 3px solid var(--c-primary);
  }
}

/* ---------------------------------------------------------------
   NEW COMPONENTS – cards, testimonials, map wrapper, form styles
   --------------------------------------------------------------- */

/* Card base (used for feature, resource, team, etc.) */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 1.5rem;
  transition: transform .2s;
}
.card:hover { transform:translateY(-4px); }

/* Team card image (optional, keep image ratio) */
.team-card {
  margin: 0;
  overflow: hidden;
}
.team-card img {
  width: 100%;
  height: auto;
  border-radius: 8px 8px 0 0;
  display: block;
}

/* CTA button variants (already used but re‑declare for clarity) */
.btn-primary {
  background: var(--c-accent);
  color: #fff;
}
.btn-primary:hover { background: #a31c0c; }
.btn-outline {
  border: 2px solid var(--c-primary);
  color: var(--c-primary);
  background: transparent;
  transition: all 0.2s ease;
}
.btn-outline:hover {
  background: var(--c-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(28, 74, 133, 0.3);
}
.btn-outline:active {
  transform: translateY(0);
}

/* Forms – simple styling */
input, textarea {
  width: 100%;
  padding: 1rem;
  margin: 0.5rem 0 1rem;
  border: 2px solid var(--c-border);
  border-radius: 6px;
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.4;
  /* Better accessibility */
  min-height: 44px;
  color: var(--c-text);
  background: var(--c-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(28, 74, 133, 0.1);
}
/* Form labels - improved accessibility */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--c-text);
  font-size: 1rem;
}

button[type="submit"] {
  background: var(--c-accent);
  color: var(--c-text-inverse);
  border: none;
  padding: 1rem 2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  /* Better contrast and accessibility */
  transition: background-color 0.2s ease, transform 0.1s ease;
}
button[type="submit"]:hover {
  background: var(--c-accent-dark);
  transform: translateY(-1px);
}
button[type="submit"]:focus {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

/* Testimonial carousel (static grid, but you can later add JS slider) */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

/* Map wrapper – maintain 16:9 aspect ratio */
.map-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.map-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -----------------------------------------------------------------
   Dark‑mode tweaks for cards and forms (optional)
   ----------------------------------------------------------------- */
/* Dark mode disabled - using light theme for better readability */
/* If dark mode is needed in the future, ensure proper contrast ratios */
/*
@media (prefers-color-scheme: dark) {
  ... dark mode styles ...
}
*/

/* =====================================================
   UTILITY CLASSES FOR INLINE STYLE REPLACEMENT
   ===================================================== */

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.ml-1 { margin-left: 1rem; }
.disc-list { list-style: disc inside; }
.team-grid { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
  gap: 2rem; 
}
.faq-grid { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
  gap: 1.5rem; 
}
.py-4 { padding: 4rem 0; }
.mx-auto { margin: 0 auto; }
.fs-h1 { font-size: var(--fs-h1); }
.max-w-600 { max-width: 600px; }
.max-w-720 { max-width: 720px; }
.p-1 { padding: 1rem; }
.fw-600 { font-weight: 600; }
.text-primary { color: var(--c-primary); }
.m-0 { margin: 0; }
.gap-1-5 { gap: 1.5rem; }
.py-3 { padding: 3rem 0; }
.mt-1-5 { margin-top: 1.5rem; }
.justify-center { justify-content: center; }

/* Page-specific hero variants */
.hero-about {
  background: #222;
  min-height: 40vh;
}
.hero-about .hero-content {
  text-align: center;
  color: #fff;
}

/* Reusable hero badge (about, contact, etc.) */
.hero-badge {
  display: inline-block;
  font-size: var(--fs-small, 0.875rem);
  font-weight: var(--fw-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--spacing-sm, 0.5rem);
  padding: var(--spacing-xs, 0.25rem) var(--spacing-md, 1rem);
  border-radius: var(--radius-full, 9999px);
}
.hero-about .hero-badge,
.hero-alt .hero-badge,
.hero-community .hero-badge,
.hero-bible .hero-badge {
  color: var(--c-primary, #1c4a85);
  background: rgba(255, 255, 255, 0.95);
}
.page-hero .hero-subtitle {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
.hero-community {
  background-image: linear-gradient(rgba(28, 74, 133, 0.75), rgba(46, 90, 143, 0.75)), url('/assets/images/jon-tyson-YtYNavix3pw-unsplash.jpg');
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 50vh;
  position: relative;
}
.hero-community .hero-content {
  text-align: center;
  color: #fff;
}

.hero-bible {
  background-image: linear-gradient(rgba(28, 74, 133, 0.7), rgba(46, 90, 143, 0.7)), url('/assets/images/neal-e-johnson-oQC81OHcl4Q-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 30vh;
}

/* =====================================================
   MOBILE JAVASCRIPT ENHANCEMENTS
   ===================================================== */

/* Error styling for form validation */
input.error,
textarea.error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

/* Touch feedback for mobile */
@media (hover: none) and (pointer: coarse) {
  button:active,
  .btn-primary:active,
  .btn-outline:active,
  summary:active,
  a:active {
    opacity: 0.7;
    transform: scale(0.98);
    transition: opacity 0.1s, transform 0.1s;
  }

  /* Enhanced touch targets */
  button,
  .btn-primary,
  .btn-outline,
  a[role="button"],
  input[type="submit"],
  input[type="button"],
  summary {
    -webkit-tap-highlight-color: rgba(28, 74, 133, 0.2);
    tap-highlight-color: rgba(28, 74, 133, 0.2);
    /* Prevent double-tap zoom */
    touch-action: manipulation;
  }
  
  /* Better scrolling performance on mobile */
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Optimize images for mobile */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--c-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}


/* Viewport height fix for mobile browsers */
:root {
  --vh: 100vh;
  /* Safe area insets for notched devices */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

/* Touch active state for better feedback */
.touch-device .touch-active {
  opacity: 0.7;
  transform: scale(0.98);
  transition: opacity 0.1s, transform 0.1s;
}

/* Base hero min-height - overridden by specific hero classes */
.hero:not(.hero-home):not(.hero-bible):not(.hero-about):not(.hero-community) {
  min-height: calc(var(--vh) * 0.4); /* Use CSS custom property for mobile viewport height */
}

@media (min-width: 768px) {
  .hero:not(.hero-home):not(.hero-bible):not(.hero-about):not(.hero-community) {
    min-height: 60vh; /* Revert to fixed height on desktop */
  }
}

/* Lazy loading placeholder */
img.lazy {
  background-color: #f0f0f0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.lazy.loaded {
  opacity: 1;
}

/* Improve focus indicators for mobile */
@media (max-width: 767px) {
  button:focus,
  a:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 3px solid var(--c-primary);
    outline-offset: 2px;
  }
}

/* Prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
  width: 100%;
  /* Safe area insets for notched devices */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* Prevent text selection on UI elements (optional) */
  -webkit-user-select: none;
  user-select: none;
}

/* Allow text selection in content areas */
p, li, span, h1, h2, h3, h4, h5, h6, a, input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Safe area insets for header and footer */
.header {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.footer {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Better text rendering on mobile */
@media (max-width: 767px) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Improve text selection on mobile */
    -webkit-tap-highlight-color: rgba(28, 74, 133, 0.1);
    tap-highlight-color: rgba(28, 74, 133, 0.1);
  }

  /* Better link spacing for touch */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
  }

  /* Improve readability of long text blocks */
  p, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* =====================================================
   FOCUS MANAGEMENT AND ACCESSIBILITY
   ===================================================== */

/* Focus visible styles for keyboard navigation */
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.nav-list a:focus-visible,
.faq-item summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(28, 74, 133, 0.2);
}

/* Focus styles for older browsers */
.btn-primary:focus,
.btn-outline:focus,
.nav-list a:focus,
.faq-item summary:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

/* High contrast focus for better visibility */
@media (prefers-contrast: high) {
  .btn-primary:focus-visible,
  .btn-outline:focus-visible,
  .nav-list a:focus-visible,
  .faq-item summary:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 3px solid #fff;
    box-shadow: 0 0 0 5px #000;
  }
}

/* =====================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ===================================================== */

/* GPU acceleration for smooth animations on mobile */
@media (max-width: 767px) {
  .feature-card,
  .book-card,
  .testimonial-card,
  .team-card,
  .step-card,
  .btn-primary,
  .btn-outline {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
  }
  
  /* Optimize repaints on mobile */
  .header {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
}

/* =====================================================
   PERFORMANCE OPTIMIZATIONS
   ===================================================== */

/* CSS containment for better performance */
.feature-card,
.book-card,
.testimonial-card,
.team-card,
.step-card {
  contain: layout style paint;
}

/* Will-change for animated elements - only when needed */
.feature-card,
.book-card,
.testimonial-card,
.step-card {
  will-change: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover,
.book-card:hover,
.testimonial-card:hover,
.step-card:hover {
  will-change: transform;
}

/* Aspect ratio for consistent layouts - icons are emoji/text, not images */

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
  .nav-toggle,
  .hero-home::before,
  iframe,
  .btn-primary,
  .btn-outline {
    display: none !important;
  }

  .hero-home {
    background: none !important;
    color: #000 !important;
    padding: 2rem 0 !important;
  }

  .hero-title {
    color: #000 !important;
    text-shadow: none !important;
  }

  .hero-subtitle {
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  .footer {
    margin-top: 2rem !important;
    border-top: 1px solid #000 !important;
  }
}

/* =====================================================
   LANDING PAGE ENHANCEMENTS
   ===================================================== */

/* Hero Home Enhancements */
.hero-home {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(rgba(28, 74, 133, 0.7), rgba(46, 90, 143, 0.7)), url('/assets/images/jon-tyson-YtYNavix3pw-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 70vh;
}

/* Hero content positioning is handled by base .hero-content class */

.hero-home .hero-title {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-home .hero-subtitle {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-home .btn-primary,
.hero-home .btn-outline {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.hero-home .btn-outline {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  color: #fff;
}

.hero-trust {
  margin-top: 2rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.hero-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
  z-index: 1;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.hero-trust {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.hero-trust li {
  margin: 0;
  padding: 0;
}

/* Stats Section */
.stats-section {
  padding: 3rem 0;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.stats-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  margin: 0;
  padding: 0;
}

.stat-item {
  padding: 1rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  font-size: 1.1rem;
  color: #666;
}

/* How It Works Section */
.how-it-works-section {
  padding: 5rem 0;
  background-image: linear-gradient(rgba(28, 74, 133, 0.85), rgba(46, 90, 143, 0.85)), url('/assets/images/susanne-zschaubitz-tCswqg5297w-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.how-it-works-section .container {
  position: relative;
  z-index: 2;
}

.how-it-works-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.how-it-works-section > .container > p {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(28,74,133,0.2), transparent);
  z-index: 0;
}

.step-card {
  background: #fff;
  padding: 3rem 2rem 2rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  text-align: center;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.step-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.step-card:nth-child(2) {
  transform: translateY(20px);
}

.step-card:nth-child(2):hover {
  transform: translateY(-12px) scale(1.02) translateY(20px);
}

.step-number {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(28, 74, 133, 0.3);
  border: 4px solid #fff;
  z-index: 2;
}

.step-icon {
  font-size: 5rem;
  margin: 2rem 0 1.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

.step-card:hover .step-icon {
  transform: scale(1.1);
}

.step-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--c-primary);
  font-weight: 700;
  position: relative;
}

.step-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  transition: width 0.3s ease;
}

.step-card:hover .step-title::after {
  width: 60px;
}

.step-text {
  color: #4a5568;
  line-height: 1.7;
  font-size: 1.05rem;
  margin: 0;
}

/* Popular Books Section */
.popular-books-section {
  padding: 5rem 0;
}

.popular-books-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.popular-books-section > .container > p {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: #666;
  text-align: center;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.book-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.book-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.book-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--c-primary);
}

.book-subtitle {
  color: #999;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.book-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.book-link {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.book-link:hover {
  color: var(--c-accent);
}

/* Testimonials Section */
.testimonials-section {
  padding: 6rem 0;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 50%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

.testimonials-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1" fill="rgba(28,74,133,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  pointer-events: none;
}

.testimonials-section .section-title {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.testimonials-section > .container > p {
  max-width: 700px;
  margin: 0 auto 4rem;
  font-size: 1.25rem;
  color: #4a5568;
  text-align: center;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.testimonial-card {
  background: #fff;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 20px 20px 0 0;
}

.testimonial-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.testimonial-quote {
  font-size: 4rem;
  color: var(--c-primary);
  opacity: 0.1;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: Georgia, serif;
  transform: rotate(180deg);
  transition: all 0.3s ease;
}

.testimonial-card:hover .testimonial-quote {
  opacity: 0.2;
  transform: rotate(180deg) scale(1.1);
}

.testimonial-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #4a5568;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  font-style: italic;
  padding-left: 1rem;
  border-left: 4px solid rgba(28, 74, 133, 0.1);
}

.testimonial-author {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(28, 74, 133, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-name {
  font-weight: 700;
  color: var(--c-primary);
  font-size: 1.1rem;
  margin: 0;
}

.author-location {
  font-size: 0.95rem;
  color: #718096;
  margin: 0;
  position: relative;
}

.author-location::before {
  content: '📍';
  margin-right: 0.25rem;
}

.faq-section {
  padding: 6rem 0;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.faq-section .section-title {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.faq-section .text-center {
  max-width: 700px;
  margin: 0 auto 4rem;
  font-size: 1.25rem;
  color: #4a5568;
  line-height: 1.6;
}

.faq-grid {
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(255,255,255,0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.faq-item:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.faq-item:hover::before {
  opacity: 1;
}
}

.faq-item summary {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  min-height: 44px;
  /* Better accessibility */
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.faq-item summary:hover,
.faq-item summary:focus {
  background-color: rgba(28, 74, 133, 0.05);
}

.faq-item summary span:last-child {
  font-size: 1.5rem;
}

.faq-item p {
  margin-top: 1rem;
  color: #666;
  line-height: 1.7;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.faq-item a {
  color: var(--c-primary);
}

/* Final CTA section */
.final-cta-section {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  color: #fff;
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.final-cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cta-pattern" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/><path d="M0 0 L60 60 M60 0 L0 60" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23cta-pattern)"/></svg>');
  pointer-events: none;
}

.final-cta-section .section-title {
  font-size: 3.5rem;
  margin-bottom: 2rem;
  color: #fff;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.final-cta-section .text-center {
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.4rem;
  opacity: 0.95;
  line-height: 1.7;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.cta-buttons {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.final-cta-section .btn-primary {
  font-size: 1.3rem;
  padding: 1.5rem 3rem;
  background: #fff;
  color: var(--c-primary);
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.final-cta-section .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(28,74,133,0.1), transparent);
  transition: left 0.6s;
}

.final-cta-section .btn-primary:hover::before {
  left: 100%;
}

.final-cta-section .btn-primary:hover {
  background: #f8fafc;
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}

.final-cta-section .btn-outline {
  font-size: 1.3rem;
  padding: 1.5rem 3rem;
  border: 3px solid rgba(255,255,255,0.8);
  color: #fff;
  background: transparent;
  backdrop-filter: blur(10px);
  font-weight: 700;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.final-cta-section .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(255,255,255,0.2);
}

.final-cta-section .cta-note {
  margin-top: 3rem;
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Bible page specific styles */
.hero-bible .hero-content {
  color: #fff;
}

/* Community page specific styles */
.hero-community {
  background-image: linear-gradient(rgba(28, 74, 133, 0.75), rgba(46, 90, 143, 0.75)), url('/assets/images/jon-tyson-YtYNavix3pw-unsplash.jpg');
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  min-height: 50vh;
}

.hero-community .hero-content {
  color: #fff;
}

.community-live-stream .grid {
  justify-content: center;
  margin-top: 1.5rem;
}

.community-discord,
.community-forum,
.community-volunteer {
  text-align: center;
  margin-top: 1rem;
}

.community-local-groups .grid {
  justify-content: center;
  margin-top: 1rem;
}

.community-map iframe {
  border: 0;
}

.community-testimonials .testimonials-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Contact page specific styles */
.hero-alt.contact-hero-section,
section.hero.hero-alt:has(.contact-hero) {
  background-image: linear-gradient(rgba(28, 74, 133, 0.75), rgba(46, 90, 143, 0.75)), url('/assets/images/neal-e-johnson-oQC81OHcl4Q-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.contact-hero .hero-content {
  color: #fff;
}

.contact-form-title {
  text-align: center;
}

#contact-form {
  max-width: 600px;
  margin: auto;
}

#form-errors {
  color: #d32f2f;
  margin-bottom: 1rem;
  display: none;
}

#form-success {
  color: #4caf50;
  margin-bottom: 1rem;
  display: none;
}

.contact-form-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.contact-form-legend {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-get-in-touch-section {
  padding: 3rem 0;
}

.contact-get-in-touch-title {
  text-align: center;
}

.contact-email-link {
  text-align: center;
  margin-top: 1rem;
}

.contact-map-container {
  margin-top: 2rem;
  text-align: center;
}

.contact-map iframe {
  border: 0;
}

/* Donate page specific styles */
.donate-page {
  padding-bottom: var(--spacing-3xl, 4rem);
}

.donate-hero {
  text-align: center;
  padding: var(--spacing-2xl, 2rem) var(--spacing-md, 1rem) var(--spacing-2xl, 2.5rem);
  background: linear-gradient(180deg, rgba(28, 74, 133, 0.06) 0%, transparent 100%);
  border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}

.donate-hero-badge {
  display: inline-block;
  font-size: var(--fs-small, 0.875rem);
  font-weight: var(--fw-semibold, 600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-primary, #1c4a85);
  margin: 0 0 var(--spacing-sm, 0.5rem);
  padding: var(--spacing-xs, 0.25rem) var(--spacing-md, 1rem);
  background: rgba(28, 74, 133, 0.12);
  border-radius: var(--radius-full, 9999px);
}

.donate-hero-title {
  font-size: clamp(1.75rem, 4vw, var(--fs-h1, 2.5rem));
  margin: 0 0 var(--spacing-md, 0.75rem);
  color: var(--c-primary, #1c4a85);
  line-height: var(--lh-tight, 1.2);
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
}

.donate-hero-text {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--c-text, #333);
}

/* Impact / where your gift goes */
.donate-impact {
  margin-top: var(--spacing-2xl, 2rem);
  padding: var(--spacing-xl, 2rem) 0;
}

.donate-section-title--center {
  text-align: center;
}

.donate-impact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg, 1.5rem);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.donate-impact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md, 1rem);
  padding: var(--spacing-sm, 0.5rem) 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-text, #333);
}

.donate-impact-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.donate-trust {
  text-align: center;
  font-size: var(--fs-small, 0.875rem);
  color: var(--c-text-muted, #666);
  max-width: 28rem;
  margin: 0 auto;
}

.donate-section-title {
  font-size: var(--fs-h2, 2rem);
  margin: 2rem 0 0.5rem;
  color: var(--c-primary, #1c4a85);
}

.donate-section-intro {
  margin-bottom: 1.5rem;
  color: var(--c-text, #333);
}

.donate-products-loading {
  text-align: center;
  padding: 2rem;
  color: var(--c-text, #333);
}

.donate-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.donate-product-card {
  border: 1px solid var(--c-border-light, #e0e0e0);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--c-bg, #fff);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-normal, 0.2s ease), border-color var(--transition-fast, 0.15s ease);
}

.donate-product-card:hover {
  box-shadow: var(--shadow-md, 0 2px 10px rgba(0,0,0,0.1));
  border-color: rgba(28, 74, 133, 0.2);
}

.donate-product-card-image {
  aspect-ratio: 1;
  background: #f5f5f5;
  overflow: hidden;
}

.donate-product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.donate-product-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.donate-product-card-title {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
  color: var(--c-text, #333);
}

.donate-product-card-price {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

.donate-product-card .btn-primary {
  margin-top: auto;
  width: 100%;
}

.donate-checkout-section {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e0e0e0;
}

.donate-checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 1rem 0;
}

@media (min-width: 768px) {
  .donate-checkout-layout {
    grid-template-columns: 280px 1fr;
  }
}

.donate-checkout-summary {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  height: fit-content;
}

.donate-checkout-summary h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.donate-checkout-summary img {
  max-width: 120px;
  height: auto;
  border-radius: 4px;
  margin: 0.5rem 0;
}

.donate-checkout-form label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.donate-checkout-form input,
.donate-checkout-form select {
  width: 100%;
  max-width: 24rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.donate-checkout-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1rem;
}

.donate-checkout-form legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.donate-checkout-total {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f0f4f8;
  border-radius: 6px;
  font-size: 1rem;
}

.donate-checkout-total strong {
  color: var(--c-primary, #1c4a85);
}

.donate-variant-wrap {
  margin-bottom: 1rem;
}

.donate-variant-wrap label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.donate-variant-wrap select {
  width: 100%;
  max-width: 20rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.donate-back-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--c-primary, #1c4a85);
  text-decoration: none;
}

.donate-back-link:hover {
  text-decoration: underline;
}

.donate-direct {
  margin-top: 2.5rem;
  padding: 2rem var(--spacing-md, 1rem);
  padding-top: 2rem;
  border-top: 1px solid var(--c-border-light, #e0e0e0);
  text-align: center;
  background: var(--c-bg-alt, #f8f9fa);
  border-radius: var(--radius-lg, 12px);
}

.donate-direct-intro {
  max-width: 36rem;
  margin: 0 auto var(--spacing-lg, 1rem);
  color: var(--c-text, #333);
  line-height: 1.6;
}

.donate-direct-note {
  margin-top: var(--spacing-md, 1rem);
  font-size: var(--fs-small, 0.875rem);
  color: var(--c-text-muted, #666);
}

.donate-cta-primary {
  display: inline-block;
  padding: var(--spacing-md, 1rem) var(--spacing-xl, 2rem);
  font-size: 1.1rem;
}

.donate-products-empty,
.donate-products-error {
  text-align: center;
  padding: 1.5rem;
  color: var(--c-text, #333);
}

.donate-title-container {
  text-align: center;
}

.paypal-button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.donate-other-ways {
  margin-top: 3rem;
  text-align: center;
  padding: var(--spacing-xl, 2rem) 0;
}

.donate-other-ways-list {
  list-style: none;
  padding: 0;
  margin: 0 auto var(--spacing-lg, 1rem);
  max-width: 32rem;
  text-align: left;
}

.donate-other-ways-list li {
  padding: var(--spacing-sm, 0.5rem) 0;
  line-height: 1.5;
  color: var(--c-text, #333);
}

.donate-other-ways-list a {
  color: var(--c-primary, #1c4a85);
  text-decoration: none;
}

.donate-other-ways-list a:hover {
  text-decoration: underline;
}

.donate-other-ways-contact {
  margin: 0;
  font-size: var(--fs-small, 0.875rem);
  color: var(--c-text-muted, #666);
}

.donate-methods {
  text-align: center;
  padding: var(--spacing-md, 1rem) 0;
}

.donate-note {
  margin-bottom: 1.5rem;
  color: var(--c-text);
}

.donate-thank-you-banner {
  margin: 0 auto var(--spacing-md, 1rem);
  padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
  max-width: var(--container-max-width, 1200px);
  background: #d4edda;
  color: #155724;
  border-radius: var(--radius-md, 8px);
  text-align: center;
  font-weight: 500;
  border: 1px solid rgba(21, 87, 36, 0.2);
}

/* Form error and success messages */
.form-error {
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f8d7da;
  color: #721c24;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
}

.form-success {
  padding: 1rem;
  margin-bottom: 1rem;
  background: #d4edda;
  color: #155724;
  border-radius: 6px;
  border: 1px solid #c3e6cb;
}

/* Community page placeholders */
.community-discord-info,
.live-stream-placeholder,
.forum-placeholder,
.community-map-placeholder {
  text-align: center;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.community-note {
  margin-bottom: 1.5rem;
  color: var(--c-text);
}

/* Community: Prayer Wall */
.community-prayer-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 767px) {
  .community-prayer-section {
    grid-template-columns: 1fr;
  }
}
.community-prayer-form-wrap,
.community-prayer-list-wrap {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
}
.community-form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}
.community-form label:first-of-type { margin-top: 0; }
.community-form input,
.community-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
.community-form textarea { min-height: 100px; resize: vertical; }
.community-form button { margin-top: 1rem; }
.optional { font-weight: normal; color: #666; font-size: 0.9em; }
.prayer-requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
}
.prayer-request-card {
  background: #fff;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid #e0e0e0;
}
.prayer-request-text { margin: 0 0 0.5rem; line-height: 1.4; }
.prayer-request-meta { margin: 0; font-size: 0.9rem; color: #666; }
.prayer-request-date { font-style: italic; }
.community-prayer-empty,
.community-prayer-loading { margin: 0; color: #666; }

/* Community: Newsletter */
.community-newsletter-form {
  max-width: 480px;
  margin: 0 auto;
}
.newsletter-form-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.newsletter-form-inner input {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
}
.newsletter-form-inner button { flex-shrink: 0; }
.community-newsletter-form .form-error,
.community-newsletter-form .form-success { margin-bottom: 1rem; }

/* Resources page book notes */
.book-note {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Study page specific styles */
.study-hero .hero-content {
  color: #fff;
}

.study-plan-section {
  padding: 3rem 0;
}

.study-plan-title {
  text-align: center;
}

/* Table wrapper for horizontal scrolling on mobile */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1rem;
  padding: 0 1rem;
  position: relative;
  scroll-behavior: smooth;
}

.table-wrapper.scrolling {
  cursor: grabbing;
}

.table-wrapper.scrolling * {
  pointer-events: none;
}

.reading-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 600px; /* Minimum width for table readability */
}

.reading-plan-table thead {
  background: var(--c-primary);
  color: #fff;
}

.reading-plan-table th,
.reading-plan-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.reading-plan-table th {
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.reading-plan-table tbody tr:hover {
  background-color: #f8f9fa;
}

.reading-plan-table a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.reading-plan-table a:hover {
  color: var(--c-accent);
  text-decoration: underline;
}

.study-cta-section {
  padding: 3rem 0;
  text-align: center;
}

/* Create icons page specific styles */
.upload-instruction-primary {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.upload-instruction-secondary {
  color: #666;
}

.preview-container {
  display: none;
}

.download-all-btn-group {
  display: none;
}

.tips-list {
  list-style: disc;
  margin-left: 1.5rem;
}

/* Privacy page specific styles */
.privacy-main {
  padding: 4rem 0;
}

.privacy-title {
  font-size: var(--fs-h1);
  text-align: center;
  margin-bottom: 2rem;
}

.privacy-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.privacy-intro-text {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.privacy-last-updated {
  font-size: 0.95rem;
  color: #888;
}

.privacy-contact-box {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.privacy-footer-note {
  border-top: 1px solid #eee;
  margin-top: 3rem;
  padding-top: 2rem;
  text-align: center;
  color: #666;
}

/* Resources page specific styles */
.resources-hero {
  background-image: url('/assets/images/james-PT-gOmCUlCY-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.resources-hero-content {
  color: #fff;
}

.resources-videos-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.resources-podcasts-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.resources-tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.resources-books-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.resources-subscribe-cta {
  padding: 3rem 0;
  text-align: center;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  max-width: 480px;
  margin: 1.5rem auto 0;
}

.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--c-primary);
}

.subscribe-form .form-feedback {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
}

.subscribe-form .form-success.form-feedback,
.subscribe-form .form-feedback.form-success {
  color: #155724;
  background: #d4edda;
  padding: 0.75rem;
  border-radius: 6px;
}

.subscribe-form .form-error.form-feedback,
.subscribe-form .form-feedback.form-error {
  color: #721c24;
  background: #f8d7da;
  padding: 0.75rem;
  border-radius: 6px;
}

.subscribe-form .form-feedback[style*="display: block"] {
  display: block !important;
}

/* Leviticus Law Reference (Resources page) */
.leviticus-law-reference {
  margin-top: 1rem;
}

.leviticus-law-reference .leviticus-loading,
.leviticus-law-reference .leviticus-law-error {
  color: #666;
  font-style: italic;
}

.leviticus-law-heading {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--c-primary, #1c4a85);
}

.leviticus-law-heading:first-child {
  margin-top: 0;
}

.leviticus-law-heading--section {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

.leviticus-law-subheading {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  color: #444;
}

.leviticus-law-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.5rem 0;
}

.leviticus-law-item {
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
  border-left: 3px solid transparent;
}

.leviticus-law-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  vertical-align: middle;
}

.leviticus-law-type--obligation {
  background: #e8f0f8;
  color: #1c4a85;
}

.leviticus-law-type--permission {
  background: #e8f5e9;
  color: #2e7d32;
}

.leviticus-law-type--prohibition {
  background: #ffebee;
  color: #c62828;
}

.leviticus-law-type--conditional {
  background: #fff3e0;
  color: #e65100;
}

.leviticus-law-text {
  vertical-align: middle;
}

.leviticus-law-cite {
  display: inline;
  font-size: 0.85em;
  color: #666;
  font-style: normal;
}

/* Legal pages (Terms, Privacy) – hero and prose wrapper */
.legal-hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--c-border-light, #eee);
}

.legal-intro {
  font-size: 1.1rem;
  color: var(--c-text-muted, #666);
  max-width: 36rem;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.legal-prose {
  max-width: 48rem;
  margin: 0 auto;
}

.legal-prose h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: var(--fs-h3, 1.5rem);
  color: var(--c-primary, #1c4a85);
}

.legal-prose h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: var(--fs-h4, 1.25rem);
}

.legal-prose p,
.legal-prose ul {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Terms page specific styles */
.terms-main {
  padding: 4rem 0;
}

.terms-title {
  font-size: var(--fs-h1);
  text-align: center;
  margin-bottom: 1rem;
}

.terms-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.terms-intro-text {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.terms-last-updated {
  font-size: 0.95rem;
  color: #888;
}

.terms-contact-box {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.terms-footer-note {
  border-top: 1px solid #eee;
  margin-top: 3rem;
  padding-top: 2rem;
  text-align: center;
  color: #666;
}

/* FAQ Section Enhancements */
.faq-section {
  padding: 5rem 0;
}

.faq-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.faq-section > .container > p {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: #666;
  text-align: center;
}

.faq-grid {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

.faq-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.faq-item summary {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  transition: transform 0.3s;
}

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

.faq-item p {
  margin-top: 1rem;
  color: #666;
  line-height: 1.7;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.faq-item a {
  color: var(--c-primary);
  text-decoration: none;
}

.faq-item a:hover {
  text-decoration: underline;
}

/* Final CTA Section */
.final-cta-section {
  padding: 5rem 0;
  background-image: linear-gradient(rgba(28, 74, 133, 0.85), rgba(46, 90, 143, 0.85)), url('/assets/images/susanne-zschaubitz-tCswqg5297w-unsplash.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
  position: relative;
}

.final-cta-section .container {
  position: relative;
  z-index: 2;
}

.final-cta-section .section-title {
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.final-cta-section > .container > p {
  max-width: 700px;
  margin: 0 auto 2rem;
  font-size: 1.3rem;
  opacity: 0.95;
  line-height: 1.7;
}

.final-cta-section .btn-primary {
  font-size: 1.2rem;
  padding: 1.2rem 2.5rem;
  background: #fff;
  color: var(--c-primary);
}

.final-cta-section .btn-outline {
  font-size: 1.2rem;
  padding: 1.2rem 2.5rem;
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
}

.final-cta-section > .container > p:last-of-type {
  margin-top: 2rem;
  font-size: 1rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile Responsive for New Sections */
@media (max-width: 767px) {
  .hero-home .hero-title {
    font-size: 2.25rem;
    line-height: 1.1;
  }

  .hero-home .hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta .btn-primary,
  .hero-cta .btn-outline {
    width: 100%;
    margin: 0.5rem 0;
  }

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

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .faq-item summary {
    font-size: 1rem;
    padding-right: 1rem;
  }

  .final-cta-section {
    padding: 3rem 0;
  }

  .final-cta-section .section-title {
    font-size: 1.75rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-buttons .btn-primary,
  .cta-buttons .btn-outline {
    width: 100%;
    margin: 0.5rem 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* Index page specific styles */
.hero-subtitle {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta .btn-primary,
.hero-cta .btn-outline {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.hero-cta .btn-outline {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  color: #fff;
}

.hero-trust {
  margin-top: 2rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.stats-section {
  padding: 3rem 0;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-label {
  font-size: 1.1rem;
  color: #666;
}

.features-section {
  padding: 5rem 0;
}

.features-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
}

.how-it-works-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.how-it-works-section .text-center {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.step-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  position: relative;
}

.step-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-primary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.step-icon {
  font-size: 4rem;
  margin: 1.5rem 0 1rem;
}

.step-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--c-primary);
}

.step-text {
  color: #666;
  line-height: 1.6;
}

.how-it-works-section .btn-primary {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.popular-books-section {
  padding: 5rem 0;
}

.popular-books-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.popular-books-section .text-center {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: #666;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.book-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.book-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.book-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--c-primary);
}

.book-subtitle {
  color: #999;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.book-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.book-link {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 600;
}

.popular-books-section .btn-outline {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.testimonials-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.testimonials-section .section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.testimonials-section .text-center {
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: #666;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  position: relative;
}

.testimonial-quote {
  font-size: 3rem;
  color: var(--c-primary);
  opacity: 0.2;
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.testimonial-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.author-name {
  font-weight: 600;
  color: var(--c-primary);
}

.author-location {
  font-size: 0.9rem;
  color: #999;
}
/* =====================================================
   QR CODE LOGIN STYLES
   ===================================================== */

.login-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}

.login-container {
  max-width: 500px;
  width: 100%;
  background: white;
  border-radius: 16px;
  padding: 3rem 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.qr-code-wrapper {
  text-align: center;
  margin: 2rem 0;
}

.qr-code-container {
  position: relative;
  display: inline-block;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.qr-canvas {
  display: none;
  max-width: 100%;
  height: auto;
}

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #666;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--c-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.qr-instructions {
  font-size: 1rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.qr-expires {
  font-size: 0.9rem;
  color: #666;
}

.qr-expires span {
  font-weight: 600;
  color: var(--c-accent);
}

.login-status {
  margin: 1.5rem 0;
  min-height: 50px;
}

.status-message {
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.95rem;
  display: none;
}

.status-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.manual-code-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.manual-code-section details {
  cursor: pointer;
}

.manual-code-section summary {
  color: var(--c-primary);
  font-weight: 500;
  padding: 0.5rem 0;
  list-style: none;
}

.manual-code-section summary::-webkit-details-marker {
  display: none;
}

.manual-code-section summary::before {
  content: '? ';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.3s;
}

.manual-code-section details[open] summary::before {
  transform: rotate(90deg);
}

.manual-code-form {
  margin-top: 1rem;
}

.manual-code-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

.manual-code-form input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.5rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-family: 'Courier New', monospace;
}

.manual-code-form input:focus {
  outline: none;
  border-color: var(--c-primary);
}

.logged-in-state {
  text-align: center;
  padding: 2rem 0;
}

.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-message svg {
  color: #28a745;
  width: 64px;
  height: 64px;
}

.success-message h2 {
  color: #333;
  margin: 0;
}

.success-message p {
  color: #666;
  margin: 0;
}

@media (max-width: 767px) {
  .login-container {
    padding: 2rem 1.5rem;
  }

  .qr-code-container {
    padding: 1rem;
  }

  .qr-canvas {
    max-width: 280px;
  }
}

/* ============================================
   RESPONSIVE IMAGES & WEBP OPTIMIZATION
   ============================================ */

/* Picture element styling */
picture {
  display: block;
  width: 100%;
  height: auto;
}

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

/* Responsive image containers */
.responsive-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.responsive-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lazy loading image styles */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Blur-up placeholder for lazy images */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

img[loading="lazy"].loaded {
  background: none;
  animation: none;
}

/* Image optimization for slow connections */
.slow-connection img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.slow-connection picture source[type="image/webp"] {
  display: none; /* Disable WebP on slow connections */
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Print styles for images */
@media print {
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  picture {
    page-break-inside: avoid;
  }
}

/* ========================================
   STUDY GROUPS STYLES
   ======================================== */

.groups-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.groups-filters .filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.groups-filters .filter-btn:hover,
.groups-filters .filter-btn.active {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.group-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #f0f0f0;
}

.group-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.group-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.group-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 0.5rem 0;
  text-decoration: none;
}

.group-title:hover {
  color: var(--c-primary);
}

.group-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-type.online {
  background: #e8f5e8;
  color: #2e7d32;
}

.group-type.local {
  background: #e3f2fd;
  color: #1565c0;
}

.group-type.book-study {
  background: #f3e5f5;
  color: #6a1b9a;
}

.group-type.reading-plan {
  background: #fff3e0;
  color: #ef6c00;
}

.group-details {
  margin-bottom: 1rem;
}

.group-description {
  color: #666;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.group-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: #888;
}

.group-schedule,
.group-size,
.group-duration {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.group-actions {
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.group-actions .btn-outline {
  width: 100%;
}

.groups-types-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.group-type-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.group-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.group-type-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--c-text);
}

.group-type-description {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.group-features {
  text-align: left;
  margin-top: 1rem;
}

.group-features li {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  position: relative;
}

.group-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4caf50;
  font-weight: bold;
}

.leadership-resources-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.resource-card {
  text-align: center;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-2px);
}

.resource-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.resource-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--c-text);
}

.resource-card p {
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.resource-link {
  color: var(--c-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.resource-link:hover {
  color: var(--c-accent);
}

/* ========================================
   DISCUSSION FORUMS STYLES
   ======================================== */

.forum-search-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.forum-search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.forum-search-bar input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.forum-search-bar input:focus {
  outline: none;
  border-color: var(--c-primary);
}

.search-btn {
  padding: 0.75rem 1.5rem;
  background: var(--c-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.search-btn:hover {
  background: #2c5aa0;
}

.forum-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.forum-category-section {
  margin-bottom: 3rem;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 2rem;
  text-align: center;
}

.forums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.forum-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #f0f0f0;
  position: relative;
}

.forum-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.forum-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.forum-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.forum-info {
  flex: 1;
}

.forum-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 0.25rem 0;
  text-decoration: none;
  display: block;
}

.forum-title:hover {
  color: var(--c-primary);
}

.forum-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.forum-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
}

.forum-threads,
.forum-last-activity {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.forum-preview {
  padding-top: 1rem;
  border-top: 1px solid #f5f5f5;
}

.preview-post {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.preview-post .post-time {
  color: #999;
  font-size: 0.8rem;
  margin-left: 1rem;
}

.thread-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.thread-filters .filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.thread-filters .filter-btn:hover,
.thread-filters .filter-btn.active {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.threads-list {
  margin-bottom: 2rem;
}

.threads-list--empty {
  padding: 2rem;
  text-align: center;
  background: var(--c-bg-alt, #f8f9fa);
  border-radius: var(--radius-md, 8px);
}

.forum-empty-message {
  margin: 0;
  color: var(--c-text, #333);
  line-height: 1.6;
}

.book-stats-note {
  margin: 0.5rem 0 0;
  font-size: var(--fs-small, 0.875rem);
  color: var(--c-text-muted, #666);
}

.thread-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  border: 1px solid #f0f0f0;
}

.thread-card:hover {
  transform: translateY(-1px);
}

.thread-card.pinned {
  border-left: 4px solid var(--c-accent);
  background: linear-gradient(135deg, #fff5f5 0%, white 100%);
}

.thread-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thread-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.thread-info {
  flex: 1;
}

.thread-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 0.5rem 0;
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.thread-title:hover {
  color: var(--c-primary);
}

.thread-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.thread-author,
.thread-time,
.thread-category {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-category {
  background: #f0f0f0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.thread-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
}

.replies-count,
.views-count,
.last-reply {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.thread-preview {
  color: #666;
  line-height: 1.5;
  font-size: 0.9rem;
}

.forum-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover:not(.disabled) {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-weight: 500;
  color: #666;
}

.book-forum-header {
  background: linear-gradient(135deg, var(--c-primary) 0%, #2c5aa0 100%);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-radius: 8px;
}

.book-header-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.book-icon-large {
  font-size: 4rem;
  text-align: center;
}

.book-info {
  max-width: 600px;
}

.book-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.book-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin: 0 0 1rem 0;
}

.book-description {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.book-stats {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
}

.book-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.book-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.new-thread-form {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--c-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.related-resources-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.forum-rules-reminder {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--c-primary);
}

.forum-rules-reminder h3 {
  margin: 0 0 1rem 0;
  color: var(--c-primary);
}

.forum-rules-reminder ul {
  margin: 0;
  padding-left: 1.5rem;
}

.forum-rules-reminder li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .book-header-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .book-icon-large {
    font-size: 3rem;
  }

  .book-title {
    font-size: 1.8rem;
  }

  .forum-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-btn {
    align-self: flex-end;
    width: auto;
  }

  .forums-grid,
  .groups-grid {
    grid-template-columns: 1fr;
  }

  .thread-meta {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }

  .thread-stats {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn-primary,
  .form-actions .btn-outline {
    width: 100%;
  }
}

/* ---------------------------------------------------------------
   Social (Feed, Profile, Posts)
   --------------------------------------------------------------- */
.social-main {
  padding-bottom: 3rem;
}

.hero-social {
  background: linear-gradient(135deg, var(--c-primary) 0%, #2e5a8f 100%);
  min-height: 28vh;
  padding: 2rem 1rem;
}

.hero-social .hero-title {
  color: #fff;
  margin-bottom: 0.5rem;
}

.hero-social .hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
}

.social-feed-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .social-feed-layout {
    grid-template-columns: 1fr;
  }
}

.social-sidebar {
  position: sticky;
  top: 5rem;
}

.social-user-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.social-user-card .social-user-card-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--c-text);
}

.social-user-card .social-user-card-name {
  font-weight: 600;
}

.social-login-prompt {
  margin: 0;
  font-size: 0.95rem;
  color: var(--c-text);
}

.social-feed-center {
  min-width: 0;
}

.social-composer-wrap {
  margin-bottom: 1.5rem;
}

.social-composer {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
}

.social-composer textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.social-composer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-verse-input {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.social-error {
  color: #a31c0c;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.social-feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-feed-empty {
  text-align: center;
  color: #666;
  padding: 2rem;
  margin: 0;
}

.social-load-more {
  text-align: center;
  margin-top: 1.5rem;
}

.social-post-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  transition: box-shadow 0.2s;
}

.social-post-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.social-post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.social-post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--c-text);
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.social-post-author:hover {
  color: var(--c-primary);
}

.social-post-header time {
  font-size: 0.85rem;
  color: #666;
}

.social-post-delete {
  margin-left: auto;
  font-size: 0.85rem;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.social-post-delete:hover {
  color: #a31c0c;
}

.social-post-body {
  margin-bottom: 0.75rem;
}

.social-post-content {
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.social-post-verse {
  margin: 0;
  font-size: 0.95rem;
  color: var(--c-primary);
  font-style: italic;
}

.social-post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.social-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  padding: 0.25rem 0;
}

.social-action-btn:hover {
  color: var(--c-primary);
}

.social-like.is-liked,
.social-action-icon {
  color: var(--c-accent);
}

.social-post-comments {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.social-comments-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.social-comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.social-comment:last-child {
  border-bottom: none;
}

.social-comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.social-comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.social-comment-time {
  font-size: 0.8rem;
  color: #666;
  margin-left: auto;
}

.social-comment-content {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  padding-left: 2rem;
}

.social-comment-form {
  margin-top: 0.75rem;
}

.social-comment-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  min-height: 60px;
}

.social-avatar,
.social-avatar-initial {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
}

.social-avatar-sm,
.social-avatar-initial.social-avatar-sm { width: 24px; height: 24px; font-size: 0.7rem; }
.social-avatar-md,
.social-avatar-initial.social-avatar-md { width: 36px; height: 36px; }
.social-avatar-lg,
.social-avatar-initial.social-avatar-lg { width: 80px; height: 80px; font-size: 1.75rem; }

.social-profile-header {
  padding: 2rem 0;
}

.social-profile-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
}

.social-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.social-profile-info {
  flex: 1;
  min-width: 0;
}

.social-profile-name {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.social-profile-bio {
  margin: 0 0 1rem;
  color: #555;
  line-height: 1.5;
}

.social-profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #666;
}

.social-profile-actions {
  display: flex;
  gap: 0.75rem;
}

.social-edit-profile {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.social-edit-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.social-edit-form input,
.social-edit-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-family: inherit;
}

.social-profile-posts {
  padding-top: 1rem;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
}

.btn-ghost:hover {
  color: var(--c-primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

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

/* Search page */
.search-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.search-form button {
  flex-shrink: 0;
}
.search-results-list,
.all-books-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-results-list li,
.all-books-list li {
  margin-bottom: 0.5rem;
}
.search-results-list a,
.all-books-list a {
  color: var(--c-primary);
  text-decoration: none;
}
.search-results-list a:hover,
.all-books-list a:hover {
  text-decoration: underline;
}
.search-message {
  color: var(--c-text);
  margin-bottom: 1.5rem;
}
#search-all-books {
  margin-top: 2rem;
}
#search-all-books .section-title {
  margin-bottom: 1rem;
}
.hero-search {
  min-height: 20vh;
}
.all-books-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
}
