/* ==========================================================================
   The Bible Online - Production Stylesheet
   Designed for Christian Standard Bible (CSB) Digital Sanctuary
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Lora', 'Merriweather', Georgia, serif;
  --font-display: 'Cinzel', 'Lora', Georgia, serif;

  /* Theme Light (Default) */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FBF9F5;
  --bg-warm: #F5EFEB;
  --bg-card: #FFFFFF;
  --text-main: #2D3748;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-color: #E8E2D9;
  --primary: #1A365D;
  --primary-hover: #0F2341;
  --secondary: #2B6CB0;
  --gold: #B7791F;
  --gold-hover: #975A16;
  --gold-bg: #FEFCBF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* Sepia (Parchment) Theme */
body.theme-sepia {
  --bg-primary: #F7F1E5;
  --bg-secondary: #EFE6D5;
  --bg-warm: #E5DAC4;
  --bg-card: #FAF6EE;
  --text-main: #3E3224;
  --text-muted: #72624D;
  --text-light: #9C8972;
  --border-color: #DFD3BE;
  --primary: #5A3E26;
  --primary-hover: #3E2917;
  --gold: #8C5B14;
}

/* Dark Theme */
body.theme-dark {
  --bg-primary: #131517;
  --bg-secondary: #1C1F22;
  --bg-warm: #22262B;
  --bg-card: #1C1F22;
  --text-main: #E2E8F0;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  --border-color: #2D3748;
  --primary: #63B3ED;
  --primary-hover: #90CDF4;
  --gold: #ECC94B;
  --gold-bg: rgba(236, 201, 75, 0.15);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.max-w-600 { max-width: 600px; margin-left: auto; margin-right: auto; }
.max-w-700 { max-width: 700px; margin-left: auto; margin-right: auto; }
.max-w-800 { max-width: 800px; margin-left: auto; margin-right: auto; }

/* Typography */
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-italic { font-style: italic; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-md { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-primary { color: var(--primary); }
.text-white { color: #FFFFFF; }

.leading-relaxed { line-height: 1.8; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }

/* Utilities Flex & Grid */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 2rem; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1rem;
}
.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 1rem;
}
.col-lg-8 {
  flex: 0 0 66.666%;
  max-width: 66.666%;
  padding: 0 1rem;
}
.col-lg-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding: 0 1rem;
}

@media (max-width: 900px) {
  .col-md-6, .col-lg-8, .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }

.bg-warm { background-color: var(--bg-warm); }
.bg-white { background-color: var(--bg-card); }
.bg-light { background-color: var(--bg-secondary); }
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.rounded { border-radius: var(--radius-md); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF !important;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}
.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-gold {
  background-color: var(--gold);
  color: #FFFFFF !important;
}
.btn-gold:hover {
  background-color: var(--gold-hover);
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; }

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background: var(--border-color);
}

.badge-gold {
  background-color: var(--gold-bg);
  color: var(--gold);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(183, 121, 31, 0.2);
}
.badge-neutral {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

/* Header & Navigation */
.top-scripture-bar {
  background-color: var(--primary);
  color: rgba(255,255,255,0.9);
  padding: 0.4rem 0;
}
.theme-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.theme-btn:hover { background: rgba(255,255,255,0.2); }

.site-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-cross {
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
  letter-spacing: 0.02em;
}
body.theme-dark .brand-name { color: #FFFFFF; }
.brand-badge {
  background: var(--gold);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.main-nav ul { list-style: none; }
.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 0.4rem 0;
}
.nav-link:hover { color: var(--gold); }
.highlight-mood {
  color: var(--gold) !important;
  font-weight: 600;
}

.search-form-mini {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
  padding: 0.2rem 0.6rem;
}
.search-form-mini input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  color: var(--text-main);
  width: 180px;
}
.search-form-mini button {
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-toggle {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-main);
}
@media (min-width: 900px) { .d-none-desktop { display: none !important; } }
@media (max-width: 899px) { .d-none-mobile { display: none !important; } }

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: -4px 0 15px rgba(0,0,0,0.15);
  z-index: 999;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.mobile-drawer.open { right: 0; }
.close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-main); }
.mobile-links { list-style: none; }
.mobile-links li { border-bottom: 1px solid var(--border-color); }
.mobile-links a { display: block; padding: 0.85rem 0.5rem; font-weight: 500; }

/* Breadcrumb */
.breadcrumb-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  font-size: 0.8rem;
}
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.5rem;
}
.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-light);
}
.breadcrumb-item.active { color: var(--text-muted); }

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-primary) 100%);
}
.hero-badge {
  display: inline-block;
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(183, 121, 31, 0.2);
}
.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 1.2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
body.theme-dark .hero-title { color: #FFFFFF; }
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto 2.5rem;
}

.hero-search-box {
  max-width: 700px;
  margin: 0 auto;
}
.hero-search-form {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s ease;
}
.hero-search-form:focus-within {
  border-color: var(--primary);
}
.hero-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
}
.search-icon { font-size: 1.2rem; color: var(--text-muted); }
.quick-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: var(--text-muted);
}
.quick-tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Section Headings */
.section-eyebrow {
  display: block;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: 2.25rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
body.theme-dark .section-title { color: #FFFFFF; }
.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Verse of the Day Card */
.votd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--gold);
}
.votd-text {
  font-size: 1.65rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  color: var(--text-main);
}
.votd-ref {
  font-size: 1.15rem;
  color: var(--primary);
}
body.theme-dark .votd-ref { color: var(--gold); }
.mood-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
}

/* Mood Grid */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.mood-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.mood-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}
.mood-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.mood-card-title {
  font-size: 1.2rem;
  font-family: var(--font-serif);
  color: var(--primary);
  margin-bottom: 0.5rem;
}
body.theme-dark .mood-card-title { color: #FFFFFF; }
.mood-card-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}
.mini-tag {
  background: var(--bg-secondary);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text-light);
}

/* Bible Books Grid & Tabs */
.testament-tabs .tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.testament-tabs .tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.books-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.book-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}
.book-chip:hover {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.book-chip-name { font-weight: 600; font-size: 0.9rem; }
.book-chip-count { font-size: 0.75rem; color: var(--text-muted); }
.book-chip:hover .book-chip-count { color: rgba(255,255,255,0.8); }

.books-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.book-card {
  background: 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;
}
.book-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.book-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary);
  margin: 0.5rem 0 0.25rem;
}
body.theme-dark .book-card-title { color: #FFFFFF; }
.book-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
}

/* Chapter Selection Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}
.chapter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.15s ease;
}
.chapter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Reader View */
.reader-toolbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 0;
}
.ctrl-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}
.ctrl-btn:hover { background: var(--border-color); }
.chapter-content-card {
  max-width: 800px;
  margin: 0 auto;
}
.verse-row {
  display: flex;
  align-items: baseline;
  padding: 0.5rem 0;
  transition: background 0.15s ease;
  position: relative;
}
.verse-row:hover {
  background: rgba(0,0,0,0.02);
}
body.theme-dark .verse-row:hover {
  background: rgba(255,255,255,0.02);
}
.verse-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  width: 2.2rem;
  flex-shrink: 0;
  text-align: right;
  margin-right: 0.75rem;
  user-select: none;
}
.verse-text {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.8;
}
.verse-copy-mini {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: opacity 0.15s ease;
}
.verse-row:hover .verse-copy-mini { opacity: 0.7; }
.verse-copy-mini:hover { opacity: 1; }

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
}
.plan-title {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
body.theme-dark .plan-title { color: #FFFFFF; }
.plan-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex: 1;
}

/* Forms */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}
.filter-input {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}
.filter-input:focus { border-color: var(--primary); }

.alert-success {
  background: #C6F6D5;
  color: #22543D;
  border: 1px solid #9AE6B4;
  padding: 1rem;
  border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
  background-color: #0F172A;
  color: #94A3B8;
  padding: 4.5rem 0 0;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3.5rem;
}
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
.footer-heading {
  color: #F8FAFC;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: #94A3B8; font-size: 0.9rem; }
.footer-links a:hover { color: #FFFFFF; }
.footer-bottom {
  border-top: 1px solid #1E293B;
  padding: 1.5rem 0;
}

/* Toast notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1A202C;
  color: #FFFFFF;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
