/**
 * ENCUENTRA TU SALMO — Design System & Stylesheet
 * Palette: Obsidian Black, Slate Grey, Pure White, Crimson Red.
 * Accessible (WCAG AAA), ultra-fast, fully responsive, zero render-blocking web fonts.
 */

:root {
  /* Color Palette - Light Mode */
  --bg-body: #F9FAFB;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F3F4F6;
  --bg-subtle: #F3F4F6;
  --bg-hero: linear-gradient(135deg, #09090B 0%, #18181B 60%, #27272A 100%);
  --bg-hero-text: #FFFFFF;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --text-inverted: #FFFFFF;

  --color-black: #09090B;
  --color-grey-dark: #27272A;
  --color-grey-mid: #71717A;
  --color-grey-light: #E5E7EB;
  --color-white: #FFFFFF;

  --accent-red: #DC2626;
  --accent-red-hover: #B91C1C;
  --accent-red-light: #FEE2E2;
  --accent-red-glow: rgba(220, 38, 38, 0.25);

  --border-color: #E5E7EB;
  --border-subtle: #F3F4F6;
  --border-focus: #DC2626;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.09), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-red: 0 4px 14px rgba(220, 38, 38, 0.25);

  --logo-text-main: #111827;
  --logo-text-accent: #DC2626;
  --logo-text-sub: #6B7280;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Cambria", "Times New Roman", Times, serif;

  --container-max: 1200px;
  --header-height: 76px;
}

/* Dark Mode Palette */
[data-theme="dark"] {
  --bg-body: #09090B;
  --bg-surface: #121214;
  --bg-card: #18181B;
  --bg-card-hover: #222226;
  --bg-subtle: #1F1F23;
  --bg-hero: linear-gradient(135deg, #000000 0%, #0F0F12 60%, #18181B 100%);
  --bg-hero-text: #F9FAFB;

  --text-primary: #FFFFFF;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;
  --text-inverted: #09090B;

  --border-color: #27272A;
  --border-subtle: #1C1C20;
  --border-focus: #EF4444;

  --accent-red: #EF4444;
  --accent-red-hover: #DC2626;
  --accent-red-light: rgba(239, 68, 68, 0.18);
  --accent-red-glow: rgba(239, 68, 68, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 10px 22px rgba(0, 0, 0, 0.85);
  --shadow-red: 0 4px 16px rgba(239, 68, 68, 0.35);

  --logo-text-main: #FFFFFF;
  --logo-text-accent: #EF4444;
  --logo-text-sub: #9CA3AF;
}

/* CSS Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--accent-red);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover, a:focus-visible {
  color: var(--accent-red-hover);
  text-decoration: underline;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  background: var(--accent-red);
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 9999;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img, .brand-logo-svg {
  height: 46px;
  width: auto;
  max-width: 230px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-red);
  background-color: var(--bg-subtle);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--border-color);
  transform: rotate(12deg);
}

.mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.mobile-drawer-header {
  display: none;
}

.menu-backdrop {
  display: none;
}

/* Hero Section */
.hero-section {
  background: var(--bg-hero);
  color: var(--bg-hero-text);
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(220, 38, 38, 0.18);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #FCA5A5;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.5px;
  color: #FFFFFF;
}

.hero-title span {
  color: var(--accent-red);
}

.hero-description {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #E2E8F0;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.hero-image-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-image-wrap:hover img {
  transform: scale(1.02);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
}

.btn:hover, .btn:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-red) 0%, #991B1B 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-red);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #EF4444 0%, var(--accent-red) 100%);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline-white {
  background-color: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
}

/* Interactive Psalm Finder Tool */
.tool-section {
  padding: 4.5rem 0;
  background-color: var(--bg-body);
}

.tool-card-wrapper {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.tool-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.step-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-pill.active {
  color: var(--accent-red);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.step-pill.active .step-num {
  background-color: var(--accent-red);
  color: #FFFFFF;
  border-color: var(--accent-red);
}

.step-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.choice-btn:hover {
  background-color: var(--border-color);
  border-color: var(--accent-red);
  transform: translateY(-2px);
}

.choice-btn.selected {
  background-color: var(--accent-red);
  color: #FFFFFF;
  border-color: var(--accent-red);
  box-shadow: var(--shadow-red);
}

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

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Recommendation Results */
.recommendation-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.recommendation-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-red);
}

.rec-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rec-badge-number {
  background-color: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.rec-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.rec-title a {
  color: var(--text-primary);
}

.rec-title a:hover {
  color: var(--accent-red);
}

.rec-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.theme-badge {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
}

.rec-reason {
  background-color: var(--bg-subtle);
  border-left: 3px solid var(--accent-red);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.rec-reason strong {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.25rem;
}

.rec-summary {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.rec-verse-preview {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.15rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.verse-ref {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: normal;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Feature Cards Grid (Homepage Categories) */
.section-features {
  padding: 4.5rem 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Feature Card Media (Jesus in Black & Red WebP) */
.feature-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
  background-color: #18181B;
}

.feature-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.feature-card:hover .feature-card-media img {
  transform: scale(1.05);
}

.feature-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

/* 10 Distinct Situation Card Colors */
.card-ansiedad {
  border-top: 4px solid #0EA5E9;
}
.card-ansiedad .feature-card-badge {
  background: rgba(14, 165, 233, 0.15);
  color: #0284C7;
  border: 1px solid rgba(14, 165, 233, 0.3);
}
.card-ansiedad:hover { border-color: #0EA5E9; }

.card-miedo {
  border-top: 4px solid #DC2626;
}
.card-miedo .feature-card-badge {
  background: rgba(220, 38, 38, 0.15);
  color: #DC2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.card-miedo:hover { border-color: #DC2626; }

.card-dormir {
  border-top: 4px solid #6366F1;
}
.card-dormir .feature-card-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.card-dormir:hover { border-color: #6366F1; }

.card-tristeza {
  border-top: 4px solid #8B5CF6;
}
.card-tristeza .feature-card-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #7C3AED;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.card-tristeza:hover { border-color: #8B5CF6; }

.card-proteccion {
  border-top: 4px solid #D97706;
}
.card-proteccion .feature-card-badge {
  background: rgba(217, 119, 6, 0.15);
  color: #B45309;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.card-proteccion:hover { border-color: #D97706; }

.card-familia {
  border-top: 4px solid #10B981;
}
.card-familia .feature-card-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.card-familia:hover { border-color: #10B981; }

.card-paz {
  border-top: 4px solid #06B6D4;
}
.card-paz .feature-card-badge {
  background: rgba(6, 182, 212, 0.15);
  color: #0891B2;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.card-paz:hover { border-color: #06B6D4; }

.card-esperanza {
  border-top: 4px solid #F43F5E;
}
.card-esperanza .feature-card-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #E11D48;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.card-esperanza:hover { border-color: #F43F5E; }

.card-gracias {
  border-top: 4px solid #EA580C;
}
.card-gracias .feature-card-badge {
  background: rgba(234, 88, 12, 0.15);
  color: #C2410C;
  border: 1px solid rgba(234, 88, 12, 0.3);
}
.card-gracias:hover { border-color: #EA580C; }

.card-dificiles {
  border-top: 4px solid #991B1B;
}
.card-dificiles .feature-card-badge {
  background: rgba(153, 27, 27, 0.15);
  color: #991B1B;
  border: 1px solid rgba(153, 27, 27, 0.3);
}
.card-dificiles:hover { border-color: #991B1B; }

[data-theme="dark"] .card-ansiedad .feature-card-badge { color: #38BDF8; }
[data-theme="dark"] .card-miedo .feature-card-badge { color: #F87171; }
[data-theme="dark"] .card-dormir .feature-card-badge { color: #818CF8; }
[data-theme="dark"] .card-tristeza .feature-card-badge { color: #A78BFA; }
[data-theme="dark"] .card-proteccion .feature-card-badge { color: #FBBF24; }
[data-theme="dark"] .card-familia .feature-card-badge { color: #34D399; }
[data-theme="dark"] .card-paz .feature-card-badge { color: #22D3EE; }
[data-theme="dark"] .card-esperanza .feature-card-badge { color: #FB7185; }
[data-theme="dark"] .card-gracias .feature-card-badge { color: #FB923C; }
[data-theme="dark"] .card-dificiles .feature-card-badge { color: #F87171; }

.feature-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.feature-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.feature-card-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-red);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.2s ease;
}

.feature-card-link:hover {
  transform: translateX(3px);
  text-decoration: underline;
}

/* Explore 150 Psalms Grid */
.search-bar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
  background-color: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.search-input-wrap {
  flex-grow: 1;
  position: relative;
  min-width: 260px;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.psalms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.psalm-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.psalm-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.psalm-card-num {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-red);
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.psalm-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.psalm-card-title a {
  color: var(--text-primary);
}

.psalm-card-title a:hover {
  color: var(--accent-red);
}

.psalm-card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.psalm-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* Single Psalm Page Layout */
.psalm-page-header {
  background: var(--bg-hero);
  color: var(--bg-hero-text);
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.psalm-page-header h1 {
  font-size: clamp(2.2rem, 5vw, 3.25rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #FFFFFF;
}

.psalm-subtitle {
  font-size: 1.2rem;
  color: #E2E8F0;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.psalm-meta-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.psalm-pill {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #F8FAFC;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Quick Action Toolbar */
.psalm-quick-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}

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

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background-color: var(--border-color);
}

/* Reading Experience & Verses */
.reading-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.verses-block {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 3rem;
  position: relative;
}

.verses-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.version-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background-color: var(--accent-red-light);
  color: var(--accent-red);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.verses-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.verse-item {
  font-family: var(--font-serif);
  font-size: var(--reading-font-size, 1.15rem);
  line-height: var(--reading-line-height, 1.85);
  color: var(--text-primary);
  display: flex;
  gap: 0.85rem;
}

.verse-num {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-red);
  user-select: none;
  min-width: 24px;
  padding-top: 0.2rem;
}

.verse-text {
  flex-grow: 1;
}

.text-attribution {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Editorial Commentary Sections */
.editorial-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.editorial-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.editorial-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.editorial-text p {
  margin-bottom: 1.25rem;
}

.editorial-text p:last-child {
  margin-bottom: 0;
}

.prayer-box {
  background-color: var(--bg-subtle);
  border-left: 4px solid var(--accent-red);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin-top: 1rem;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.reflection-question-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.question-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-red);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Navigation between Psalms */
.psalm-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0;
}

.psalm-nav-card {
  flex: 1;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.psalm-nav-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-2px);
  text-decoration: none;
}

.nav-direction {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.nav-target-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* FAQ Accordion */
.faq-section {
  padding: 4rem 0;
  background-color: var(--bg-body);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item.active {
  border-color: var(--accent-red);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--accent-red);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  padding-bottom: 1.25rem;
}

.faq-answer p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Site Footer */
.site-footer {
  background-color: #09090B;
  color: #E2E8F0;
  padding: 4.5rem 0 2rem;
  margin-top: auto;
  border-top: 1px solid #27272A;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand .brand-logo-img, .footer-brand .brand-logo-svg {
  height: 42px;
  width: auto;
  margin-bottom: 1.25rem;
}

.footer-tagline {
  color: #9CA3AF;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #9CA3AF;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: #18181B;
  border: 1px solid #27272A;
  color: #D1D5DB;
  transition: all 0.2s ease;
}

.social-icon-btn:hover {
  background-color: var(--accent-red);
  color: #FFFFFF;
  border-color: var(--accent-red);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid #27272A;
  font-size: 0.85rem;
  color: #71717A;
  gap: 1rem;
}

/* Toast Notifications */
.psalm-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #18181B;
  color: #FFFFFF;
  border-left: 4px solid var(--accent-red);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.psalm-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-red);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  margin: 1.5rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   RESPONSIVE DESIGN & MOBILE FIXES (320px - 1024px)
   ======================================================== */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-image-wrap {
    max-width: 680px;
    margin: 0 auto;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 68px;
  }

  /* Robust Off-Canvas Drawer (z-index: 1010, no blur lock) */
  .primary-nav {
    position: fixed;
    top: 0;
    right: -320px;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.25rem 2rem;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.45);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1010;
    overflow-y: auto;
  }

  .primary-nav.open {
    right: 0;
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .nav-link {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.75rem 0.65rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Clean backdrop without blur filter, lower z-index than header & drawer */
  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1005;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .tool-card-wrapper {
    padding: 1.5rem 1rem;
  }

  .tool-title {
    font-size: 1.6rem;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .psalm-pagination {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    gap: 0.5rem;
  }

  .brand-logo-img, .brand-logo-svg {
    height: 38px;
    max-width: 175px;
  }

  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-toggle {
    width: 40px;
    height: 40px;
  }

  .hero-section {
    padding: 2.75rem 0 2.25rem;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

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

  .verses-block, .editorial-block {
    padding: 1.5rem 1rem;
  }

  .reading-container {
    padding: 2rem 0.85rem 3rem;
  }
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .theme-toggle-btn, .mobile-menu-toggle,
  .psalm-quick-toolbar, .rec-actions, .faq-section, .psalm-toast,
  .search-bar-wrap, .menu-backdrop, .mobile-drawer-header {
    display: none !important;
  }
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .container, .reading-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .verses-block, .editorial-block {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .verse-item {
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }
  a[href]::after {
    content: "" !important;
  }
}
