/* Webový přehrávač synchronního biblionu — vzhled.
   Světlý i tmavý motiv, zvýraznění nejen barvou (kontrast ≥ 3:1 + podtržení). */

:root {
  --bg: #ffffff;
  --bg-soft: #f2f2f4;
  --fg: #17181c;
  --fg-soft: #4a4d57;
  --line: #d3d5dd;
  --accent: #14507d;
  --accent-fg: #ffffff;
  --word-bg: #ffe08a;
  --word-fg: #17181c;
  --seg-bg: #eef3f8;
  --seg-mark: #14507d;
  --focus: #0a63b0;
  --reader-size: 1rem;
}

:root[data-theme="dark"] {
  --bg: #14151a;
  --bg-soft: #1e2027;
  --fg: #eceef4;
  --fg-soft: #b3b8c6;
  --line: #363a45;
  --accent: #7fb6e8;
  --accent-fg: #0f1014;
  --word-bg: #6a4d00;
  --word-fg: #fff4d6;
  --seg-bg: #1f242c;
  --seg-mark: #7fb6e8;
  --focus: #9cc9f5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14151a;
    --bg-soft: #1e2027;
    --fg: #eceef4;
    --fg-soft: #b3b8c6;
    --line: #363a45;
    --accent: #7fb6e8;
    --accent-fg: #0f1014;
    --word-bg: #6a4d00;
    --word-fg: #fff4d6;
    --seg-bg: #1f242c;
    --seg-mark: #7fb6e8;
    --focus: #9cc9f5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  /* místo pro ukotvený panel, aby nepřekrýval text */
  padding-bottom: 12rem;
}

a { color: var(--accent); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 1rem;
  z-index: 20;
}
.skip:focus { left: 0; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.site p { margin: 0; }
.brand a { font-weight: 700; text-decoration: none; }

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

h1 { font-size: 1.6rem; line-height: 1.25; margin: 1rem 0 0.25rem; }
.meta { color: var(--fg-soft); margin: 0 0 1rem; }

.resume {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}
.resume p { margin: 0 0 0.5rem; }

.chapters h2, .reader h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }

.chapter-list { margin: 0; padding-left: 1.5rem; }
.chapter-list li { margin: 0.15rem 0; }
.chapter-list button {
  background: none;
  border: 0;
  padding: 0.3rem 0.2rem;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}
.chapter-list button[aria-current="true"] {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}
.chapter-list button[aria-current="true"]::after { content: " ←"; }

.reader { font-size: var(--reader-size); }
#chapter-heading { font-size: 1.35rem; margin: 1.5rem 0 0.25rem; }
#chapter-num { color: var(--fg-soft); margin: 0 0 1rem; font-size: 0.9rem; }

#text .seg {
  margin: 0 0 0.9rem;
  padding: 0.15rem 0.5rem 0.15rem 0.75rem;
  border-left: 4px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
}
#text h3.seg { font-size: 1.15rem; margin-top: 1.6rem; }
#text h4.seg { font-size: 1.05rem; margin-top: 1.3rem; }
#text ul { margin: 0 0 0.9rem; padding-left: 1.4rem; }
#text li.seg { margin-bottom: 0.35rem; }

#chapter-heading.seg { cursor: pointer; }

.seg.is-current {
  background: var(--seg-bg);
  border-left-color: var(--seg-mark);
}

.w.is-active {
  background: var(--word-bg);
  color: var(--word-fg);
  border-radius: 0.2rem;
  box-shadow: 0 2px 0 0 var(--seg-mark);
}

.controls {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 0.6rem 1rem 0.8rem;
  z-index: 10;
}
.controls-inner { max-width: 44rem; margin: 0 auto; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.row + .row { margin-top: 0.5rem; }

.controls button, .controls select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.45rem 0.7rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.controls button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 700;
  min-width: 7rem;
}
.controls label { display: inline-flex; align-items: center; gap: 0.35rem; }

#seek { flex: 1 1 12rem; min-width: 8rem; height: 2rem; }
#time { font-variant-numeric: tabular-nums; color: var(--fg-soft); }

.hint { margin: 2rem 0 0; color: var(--fg-soft); font-size: 0.95rem; }
.hint h2 { font-size: 1rem; margin-bottom: 0.25rem; }

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

@media (prefers-contrast: more) {
  .w.is-active { outline: 2px solid var(--fg); }
  .seg.is-current { outline: 1px solid var(--seg-mark); }
}

@media print {
  .controls, .site, .chapters, .hint { display: none; }
  body { padding-bottom: 0; }
}
