/* =====================================================================
   Biblia – app.css (handgeschrieben, kein Build, keine CDN)
   Ruhige, leseorientierte Gestaltung. Hell/Dunkel automatisch.
   ===================================================================== */

:root {
  --bg:        #fbf9f4;   /* warmes Papier */
  --fg:        #23211c;
  --muted:     #6f6a5f;
  --line:      #e3ddd0;
  --card:      #ffffff;
  --accent:    #8a5a2b;   /* gedämpftes Kupfer */
  --vn:        #b8a98c;   /* Versnummer */
  --maxread:   38rem;     /* Lesebreite (Maß) */
  --serif:     "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:      system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#15140f; --fg:#e8e3d6; --muted:#9b9482; --line:#322f27;
    --card:#1d1b15; --accent:#ca8b4f; --vn:#6c6450;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); line-height: 1.6;
}

/* --- Kopfzeile ------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  color: var(--fg); text-decoration: none; letter-spacing: .01em; }
.langs { display: flex; gap: .25rem; }
.langs a { color: var(--muted); text-decoration: none; font-size: .8rem;
  padding: .2rem .5rem; border-radius: 6px; }
.langs a.is-active { color: var(--fg); background: var(--line); }
.langs a:hover { color: var(--fg); }

/* --- Seite ---------------------------------------------------------- */
.page { max-width: 64rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

/* --- Steuerleiste --------------------------------------------------- */
.controls {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: end;
  margin-bottom: 1.5rem;
}
.ctl { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 auto; }
.ctl span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); }
.ctl-book     { flex-basis: 14rem; }
.ctl-chapter  { flex-basis: 6rem; flex-grow: 0; }
.ctl select {
  font-family: var(--sans); font-size: .95rem; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .6rem; width: 100%; cursor: pointer;
}
.ctl select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- Kapitelüberschrift -------------------------------------------- */
.chapter-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.8rem;
  margin: 0 0 1.25rem; color: var(--fg);
}

/* --- Einzeltext ----------------------------------------------------- */
.single { max-width: var(--maxread); }
.verse {
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.75;
  margin: 0 0 .35rem; text-align: justify; hyphens: auto;
}
.vn {
  font-family: var(--sans); font-size: .62em; color: var(--vn);
  margin-right: .35em; vertical-align: .35em; font-weight: 600;
}
.empty { color: var(--muted); }

/* --- Parallelansicht ----------------------------------------------- */
.parallel { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
.col { min-width: 0; }
.col-head {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  color: var(--fg); padding-bottom: .5rem; margin-bottom: .75rem;
  border-bottom: 1px solid var(--line); position: sticky; top: 3.2rem;
  background: var(--bg);
}
.col-head .abbr { color: var(--muted); font-weight: 400; }
.parallel .verse { font-size: 1.05rem; line-height: 1.7; text-align: left; }

/* --- Navigation ----------------------------------------------------- */
.chapter-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.btn {
  font-family: var(--sans); font-size: .9rem; text-decoration: none;
  color: var(--accent); padding: .55rem .9rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.disabled { color: var(--muted); opacity: .5; pointer-events: none; }

/* --- Fehler --------------------------------------------------------- */
.errorbox { text-align: center; padding: 4rem 1rem; }
.errorbox h1 { font-family: var(--serif); font-size: 3rem; margin: 0; }
.errorbox a { color: var(--accent); }

/* --- Mobil: Parallelansicht untereinander --------------------------- */
@media (max-width: 640px) {
  .parallel { grid-template-columns: 1fr; gap: 1.75rem; }
  .col-head { position: static; }
  .chapter-title { font-size: 1.5rem; }
  .ctl-book, .ctl-version, .ctl-compare { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* --- Suche im Kopf -------------------------------------------------- */
.topsearch { flex: 1 1 12rem; max-width: 22rem; margin: 0 .5rem; }
.topsearch input {
  width: 100%; font-family: var(--sans); font-size: .9rem; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem .9rem;
}
.topsearch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- Suchseite ------------------------------------------------------ */
.search { max-width: var(--maxread); }
.search-form { display: flex; gap: .5rem; margin-bottom: .75rem; }
.search-form input[type="search"] {
  flex: 1 1 auto; font-family: var(--sans); font-size: 1rem; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem .8rem;
}
.search-form button {
  font-family: var(--sans); font-size: .95rem; color: #fff; background: var(--accent);
  border: 0; border-radius: 8px; padding: .6rem 1.1rem; cursor: pointer;
}
.search-scope { color: var(--muted); font-size: .85rem; margin: 0 0 1.5rem; }
.search-scope select {
  font-family: var(--sans); color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: .25rem .4rem;
}
.search-hint { color: var(--muted); }
.search-count { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.search-count .muted { color: var(--vn); }

.hits { list-style: none; padding: 0; margin: 0; }
.hit { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.hit-ref {
  display: inline-block; font-family: var(--sans); font-size: .8rem; font-weight: 600;
  color: var(--accent); text-decoration: none; margin-bottom: .2rem;
}
.hit-ref:hover { text-decoration: underline; }
.hit-text { display: block; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; }

mark { background: rgba(202,139,79,.28); color: inherit; border-radius: 3px; padding: 0 .1em; }

/* Treffer-Vers nach Sprung kurz hervorheben */
.verse.target { background: rgba(202,139,79,.18); border-radius: 6px;
  box-shadow: 0 0 0 .4rem rgba(202,139,79,.18); transition: background .3s; }

@media (max-width: 640px) {
  .topsearch { order: 3; flex-basis: 100%; max-width: none; margin: .4rem 0 0; }
  .topbar { flex-wrap: wrap; }
}

/* --- Fußzeilen-Menü ------------------------------------------------- */
.sitefooter { border-top: 1px solid var(--line); margin-top: 3rem; }
.footmenu { max-width: 64rem; margin: 0 auto; padding: 1.25rem 1rem;
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.footmenu a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.footmenu a:hover { color: var(--accent); }

/* --- Statische Seite ------------------------------------------------ */
.staticpage { max-width: var(--maxread); }
.staticpage h1 { font-family: var(--serif); font-size: 1.8rem; margin: 0 0 1rem; }
.staticbody { font-size: 1.05rem; line-height: 1.7; }
.staticbody h2, .staticbody h3 { font-family: var(--serif); }
.staticbody a { color: var(--accent); }
.staticbody ul, .staticbody ol { padding-left: 1.3rem; }
.staticbody blockquote { border-left: 3px solid var(--line); margin: 1rem 0;
  padding: .3rem 0 .3rem 1rem; color: var(--muted); }

/* --- Lesezeichen ---------------------------------------------------- */
.bm-link { color: var(--vn); text-decoration: none; font-size: 1rem; padding: .2rem .4rem; }
.bm-link:hover { color: var(--accent); }
.chapter-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.chapter-head .chapter-title { margin: 0; }
.bm-toggle {
  font-size: 1.2rem; line-height: 1; background: none; border: 1px solid var(--line);
  color: var(--vn); border-radius: 8px; padding: .3rem .55rem; cursor: pointer;
}
.bm-toggle:hover { border-color: var(--accent); color: var(--accent); }
.bm-toggle.on { color: var(--accent); border-color: var(--accent); }
.bm-list { list-style: none; padding: 0; margin: 0; max-width: var(--maxread); }
.bm-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 0;
  border-bottom: 1px solid var(--line); }
.bm-go { flex: 1 1 auto; font-family: var(--serif); font-size: 1.1rem; color: var(--fg); text-decoration: none; }
.bm-go:hover { color: var(--accent); }
.bm-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.bm-del:hover { color: var(--err); }
.bm-empty { color: var(--muted); padding: 1rem 0; }
