/* ============================================================
   ClashingWithGod's Bible Study
   Modern Design System – v1
   ============================================================ */

:root {
  /* Brand */
  --color-primary: #1e3a5f;          /* Deep navy – trust, scripture */
  --color-primary-hover: #152a45;
  --color-primary-light: #e8eef5;
  --color-accent: #c9a227;           /* Soft gold – dignity without flash */
  --color-accent-hover: #b08d1f;
  --color-accent-light: #faf6e9;

  /* Surfaces */
  --color-bg: #f7f5f0;               /* Warm off-white, easy on eyes for long reading */
  --color-surface: #ffffff;
  --color-surface-2: #f0ece4;
  --color-border: #e2dcd0;
  --color-border-strong: #cfc6b6;

  /* Text */
  --color-text: #1a1a1a;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #7a7468;
  --color-text-inverse: #ffffff;

  /* Semantic */
  --color-success: #2e7d4f;
  --color-success-bg: #e6f4ec;
  --color-error: #b91c1c;
  --color-error-bg: #fef2f2;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-info: #1d4ed8;
  --color-info-bg: #eff6ff;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;  /* Scripture */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing & radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow: 0 4px 12px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 12px 28px rgb(0 0 0 / 0.08);

  --header-height: calc(min(100vw, 1200px) / 4.89 + 52px);
  --container-max: 1200px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg: #0f1419;
  --color-surface: #1a222c;
  --color-surface-2: #243040;
  --color-border: #2d3a4a;
  --color-border-strong: #3d4d60;
  --color-text: #f0ebe3;
  --color-text-secondary: #c8c0b4;
  --color-text-muted: #8a8276;
  --color-primary: #5b8fd4;
  --color-primary-hover: #7aa6e0;
  --color-primary-light: #1e2f45;
  --color-accent: #d4af37;
  --color-accent-hover: #e0c04a;
  --color-accent-light: #2a2415;
}

/* Reset */
*, *::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: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-hover); }

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--color-text-secondary); }

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

.page {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* ========== SITE CHROME (banner + menu) ========== */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-chrome .main-header {
  position: relative;
}

/* Logo banner above the menu – no white box, dark strip blends with logo */
.site-banner {
  background: #0a1628;
  border-bottom: none;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}
.site-banner-inner {
  /* Full-bleed within chrome; image sets height via aspect ratio */
  display: block;
  width: 100%;
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 0;
  line-height: 0;
}
.banner-brand {
  display: block;
  line-height: 0;
  text-decoration: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.site-banner-logo {
  display: block;
  width: 100%;
  height: auto;
  /* Match reference: 2772 × 567 (aspect ≈ 4.89:1)
     At 1200px wide → ~245px tall */
  aspect-ratio: 9772 / 567;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  max-height: none;
}
.banner-text-title {
  display: block;
  color: #f0d78c;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding: 0.35rem 0;
}

/* Menu bar under the banner */
.main-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  min-height: 52px;
  box-shadow: var(--shadow-sm);
}

.main-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 1rem;
}

/* Legacy logo classes kept harmless (no white box) */
.logo-section { display: none; }
.logo-mark { display: none !important; }
.site-title { font-size: 1.15rem; font-weight: 650; }

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.75rem;
}
.nav-logout-form { display: inline; }

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 550;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.3;
}

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

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.btn-secondary:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-accent {
  background: var(--color-accent);
  color: #1a1a1a;
}
.btn-accent:hover {
  background: var(--color-accent-hover);
  color: #1a1a1a;
}

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

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
}

/* ========== CARDS ========== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

/* ========== HOMEPAGE ========== */
.hero {
  text-align: center;
  padding: 4rem 1rem 3.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero h1 .accent {
  color: var(--color-accent);
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  line-height: 1.55;
}

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

/* Feature grid */
.features {
  padding: 1rem 0 3rem;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.6rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.feature-icon {
  width: 42px;
  height: 42px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

/* ========== FOOTER ========== */
.main-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0 1.5rem;
  margin-top: auto;
}

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

.footer-brand {
  font-weight: 600;
  color: var(--color-text);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

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

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: 1.5rem; }

/* Alerts */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}
.alert-error { background: var(--color-error-bg); color: var(--color-error); border: 1px solid #fecaca; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #a7f3d0; }
.alert-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid #bfdbfe; }

.upload-status { margin-top: 1rem; }
.upload-status[hidden] { display: none; }
.upload-status-message { margin: 0 0 0.55rem; font-size: 0.9rem; }
.upload-progress-track {
  height: 0.7rem;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-2);
}
.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
  transition: width 120ms linear;
}
.upload-status[data-state="processing"] .upload-progress-bar {
  background: var(--color-accent);
}
.upload-status[data-state="success"] .upload-progress-bar { background: var(--color-success); }
.upload-status[data-state="error"] .upload-progress-bar { background: var(--color-error); }
.upload-status[data-state="error"] .upload-status-message { color: var(--color-error); }
@media (prefers-reduced-motion: reduce) {
  .upload-progress-bar { transition: none; }
}

/* Forms (base) */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 550;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 0.75rem;
    box-shadow: var(--shadow);
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    width: 100%;
    padding: 0.75rem 1rem;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-actions {
    margin-left: auto;
  }
  .site-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2.5rem 0.5rem 2rem;
  }
  .cta-buttons {
    flex-direction: column;
  }
  .cta-buttons .btn {
    width: 100%;
  }
}

/* ============================================================
   Bible Reader – Section 2
   ============================================================ */

.reader-page {
  max-width: 1100px;
  margin: 0 auto;
}

.reader-toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-height) + 0.75rem);
  z-index: 50;
}

.reader-toolbar .form-group {
  margin-bottom: 0;
  min-width: 120px;
}

.reader-toolbar .form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.reader-toolbar .form-control {
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  min-width: 110px;
}
.version-compare-options {
  min-width: 220px;
  max-width: 320px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
}
.version-compare-options legend {
  padding: 0 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.version-compare-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.65rem;
  max-height: 4.3rem;
  overflow-y: auto;
}
.version-compare-list label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.version-compare-list label span { color: var(--color-text-muted); }
.compare-selection-count {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.reader-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}

/* Font size controls */
.font-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.font-controls button {
  background: var(--color-surface);
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition);
}

.font-controls button:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.font-controls span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 0 0.35rem;
  min-width: 28px;
  text-align: center;
}

/* Main reader layout */
.reader-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.reader-layout.with-panel {
  grid-template-columns: 1fr 340px;
}
.reader-layout.comparison-mode { grid-template-columns: minmax(0, 1fr); }
.reader-layout.comparison-mode.with-panel { grid-template-columns: minmax(0, 1fr) 340px; }

@media (max-width: 900px) {
  .reader-layout.with-panel,
  .reader-layout.comparison-mode.with-panel {
    grid-template-columns: 1fr;
  }
}

/* Scripture panel */
.scripture-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.scripture-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--color-surface-2);
}

.scripture-header h2 {
  font-size: 1.25rem;
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
}

.scripture-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.verses-container {
  padding: 1.5rem 1.75rem 2rem;
  font-family: var(--font-serif);
  font-size: var(--reader-font-size, 1.15rem);
  line-height: 1.75;
  color: var(--color-text);
}
.version-comparison {
  display: grid;
  grid-template-columns: repeat(var(--comparison-count), minmax(260px, 1fr));
  gap: 0.75rem;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  overscroll-behavior-x: contain;
}
.comparison-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.comparison-pane-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-family: var(--font-sans);
}
.comparison-pane-header strong {
  color: var(--color-primary);
  white-space: nowrap;
}
.comparison-pane-header span {
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comparison-pane-scroll {
  height: min(72vh, 900px);
  min-height: 22rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem;
  font-family: var(--font-serif);
  font-size: var(--reader-font-size, 1.15rem);
  line-height: 1.65;
}
.comparison-verse {
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 0.25rem;
}
.comparison-verse-number {
  display: inline-block;
  min-width: 1.5rem;
  margin-right: 0.25rem;
  color: var(--color-accent);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  vertical-align: super;
}
.comparison-verse-text { line-height: inherit; }
.comparison-verse-text.verse-missing {
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-style: italic;
}

.verse {
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  position: relative;
  cursor: default;
}

.verse:hover {
  background: var(--color-primary-light);
}

.verse.active {
  background: var(--color-accent-light);
}

.verse-num {
  font-family: var(--font-sans);
  font-size: 0.7em;
  font-weight: 600;
  color: var(--color-accent);
  vertical-align: super;
  margin-right: 0.35rem;
  user-select: none;
}

.verse-text {
  font-family: var(--font-serif);
}

/* Verse action popup (simple) */
.verse-actions {
  display: none;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.25rem;
  gap: 0.15rem;
  z-index: 10;
}

.verse:hover .verse-actions {
  display: flex;
}

.verse-actions button,
.verse-actions a {
  display: inline-block;
  background: transparent;
  border: none;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.verse-actions button:hover,
.verse-actions a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Side panel (commentary / notes placeholder) */
.side-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - 8rem);
  position: sticky;
  top: calc(var(--header-height) + 5.5rem);
}

.side-panel-header {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-panel-header strong {
  font-size: 0.95rem;
}

.side-panel-body {
  padding: 1.15rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.side-panel-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}
.commentary-entry + .commentary-entry {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.commentary-entry h5 {
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-accent);
}
.commentary-entry-content {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

/* Community */
.community-page,
.public-profile-page { max-width: 1080px; margin: 0 auto; }
.community-title { margin-bottom: 1.25rem; flex-wrap: wrap; }
.community-title h1,
.community-section h2,
.community-chat h2 { margin: 0; font-size: 1.2rem; }
.community-title p { margin: 0.2rem 0 0; }
.community-handle { color: var(--color-text-muted); font-size: 0.9rem; }
.community-section {
  min-width: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}
.community-search { display: flex; gap: 0.5rem; max-width: 34rem; margin: 0.75rem 0; }
.community-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.community-section h3 { margin: 1rem 0 0.5rem; font-size: 1rem; }
.community-list { display: flex; flex-direction: column; gap: 0.35rem; }
.community-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
}
.community-list-row small { display: block; color: var(--color-text-muted); }
.community-friend-link { color: var(--color-text); }
.community-friend-link:hover,
.community-friend-link.is-selected { background: var(--color-primary-light); color: var(--color-primary); }
.community-inline-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.community-create-group { display: grid; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.community-chat { margin-top: 1.25rem; border: 1px solid var(--color-border); background: var(--color-surface); }
.community-chat > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem 1rem; background: var(--color-surface-2); border-bottom: 1px solid var(--color-border); }
.community-chat > header .text-muted { font-size: 0.82rem; }
.community-chat-messages { display: flex; flex-direction: column; gap: 0.65rem; max-height: min(52vh, 540px); overflow-y: auto; padding: 1rem; }
.community-message { align-self: flex-start; width: min(85%, 42rem); padding: 0.65rem 0.8rem; background: var(--color-surface-2); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.community-message.is-mine { align-self: flex-end; background: var(--color-primary-light); }
.community-message strong { font-size: 0.8rem; color: var(--color-primary); }
.community-message p { margin: 0.2rem 0; color: var(--color-text); white-space: pre-wrap; }
.community-message time { display: block; color: var(--color-text-muted); font-size: 0.7rem; }
.community-compose { display: flex; align-items: end; gap: 0.65rem; padding: 0.75rem; border-top: 1px solid var(--color-border); }
.community-compose textarea { flex: 1; min-width: 0; resize: vertical; padding: 0.65rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font: inherit; }
.community-invite-form { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); }
.community-invite-form .form-label { margin: 0; white-space: nowrap; }
.community-member-roles { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); }
.community-member-roles > strong { display: block; margin-bottom: 0.35rem; }
.community-remove-message { display: flex; justify-content: flex-end; margin-top: 0.35rem; }
.community-friend-link { display: inline-flex; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.user-ban-form { display: grid; gap: 0.35rem; min-width: 12rem; }
.user-ban-form label { font-size: 0.78rem; color: var(--color-text-muted); }
.user-ban-form input[type="checkbox"] { width: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 760px) {
  .community-columns { grid-template-columns: 1fr; gap: 0; }
  .community-list-row { align-items: flex-start; }
  .community-chat-messages { max-height: 55vh; }
  .community-invite-form { align-items: stretch; flex-wrap: wrap; }
}

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.chapter-nav .btn {
  min-width: 140px;
}

/* Empty / no data state */
.reader-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.reader-empty h3 {
  margin-bottom: 0.75rem;
}

.reader-empty p {
  margin-bottom: 1.5rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Focus / reading mode helpers */
body.reader-focus .site-chrome {
  opacity: 0.92;
}

/* Responsive reader */
@media (max-width: 700px) {
  .reader-toolbar {
    position: static;
    padding: 0.75rem;
  }
  .verses-container {
    padding: 1.15rem 1rem 1.5rem;
    font-size: var(--reader-font-size, 1.05rem);
  }
  .verse-actions {
    position: static;
    transform: none;
    display: none;
    margin-top: 0.35rem;
    width: 100%;
    justify-content: flex-start;
  }
  .verse:hover .verse-actions,
  .verse.active .verse-actions {
    display: flex;
  }
  .scripture-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Section 8 polish */
.page-title { margin-bottom: 1.25rem; }
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface-2);
  padding: 0.12em 0.35em;
  border-radius: var(--radius-sm);
}
mark {
  background: var(--color-accent-light);
  color: var(--color-text);
  padding: 0.05em 0.15em;
  border-radius: 3px;
}
[data-theme="dark"] mark {
  background: #5c4a1a;
}
.nav-actions .btn-primary {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .site-banner { padding: 0; }
  .site-banner-inner { max-width: 100%; }
  .banner-brand { max-width: 100%; }
  .site-banner-logo {
    width: 100%;
    height: auto;
    aspect-ratio: 2772 / 567;
    max-height: none;
  }
  .banner-text-title { font-size: 1.05rem; }
}
