/* /JackalL/frontend/styles/reading.css */
/* Reading page — intact passage on top, sticky sentence detail at the bottom. */

/* ── Input ────────────────────────────────────────────────────────────── */
.rd-input-wrap { padding: 0 28px 8px; }

.rd-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
}
.rd-textarea:focus { outline: none; border-color: var(--accent); }
.rd-textarea::placeholder { color: var(--text-muted); }

.rd-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; flex-wrap: wrap;
}
.rd-status { font-size: 12px; color: var(--text-secondary); }
.rd-status.error { color: var(--danger); }

/* ── Player bar ───────────────────────────────────────────────────────── */
.rd-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 28px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 6;
}
.rd-controls.hidden { display: none; }

.rd-select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}
.rd-select:focus { outline: none; border-color: var(--accent); }

.rd-pill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.rd-pill:hover { color: var(--text-primary); border-color: var(--accent-dark); }
.rd-pill.on {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
}
.rd-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.rd-hint { font-size: 11px; color: var(--text-muted); margin: 0 28px 10px; }

/* ── The passage, kept whole ──────────────────────────────────────────── */
.rd-passage { padding: 0 28px; max-width: 760px; }

.rp-para {
  font-size: 18px;
  line-height: 2.1;
  color: var(--text-primary);
  margin: 0 0 20px;
}

/* /JackalL/frontend/styles/reading.css — PATCH */

  .rp-sent {
  cursor: pointer;
  border-radius: 5px;
  padding: 3px 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background 0.18s ease, color 0.18s ease, font-size 0.18s ease;
}
.rp-sent:hover { background: rgba(255, 224, 138, 0.16); }

/* Warm highlighter — soft on the eyes, and a touch larger while spoken */
.rp-sent.active {
  background: #FBE49B;
  color: #2A2317;
  font-size: 1.06em;
  font-weight: 500;
  box-shadow: 0 0 0 3px #FBE49B;   /* softens the edge without extra padding */
}

[data-theme="light"] .rp-sent:hover { background: rgba(240, 190, 60, 0.18); }
[data-theme="light"] .rp-sent.active {
  background: #FCEBA6;
  color: #2A2317;
  box-shadow: 0 0 0 3px #FCEBA6;
}

/* Reflow from the size bump can nudge the line — keep the paragraph steady */
.rp-para { text-rendering: optimizeLegibility; }

  /* ── Sticky detail card — only the current sentence ───────────────────── */
.rd-detail {
  position: sticky;
  bottom: 12px;
  z-index: 7;
  margin: 24px 28px 28px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-dark);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.rd-detail.hidden { display: none; }

.rd-detail-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.rd-detail-label {
  flex: 1;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rd-detail-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
}
.rd-detail-btn:hover { color: var(--accent); border-color: var(--accent); }

.rd-detail-fr {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}
.rd-detail-pron {
  font-size: 12px;
  color: var(--accent-dark);
  margin-top: 5px;
  font-style: italic;
}
.rd-detail.hide-pron .rd-detail-pron { display: none; }

.rd-detail-en {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.6;
}
.rd-detail.hide-en .rd-detail-en { display: none; }

.rd-detail-tip {
  font-size: 11px;
  color: var(--warning);
  margin-top: 6px;
}

/* ── Full translation ─────────────────────────────────────────────────── */
.rd-translation { margin: 0 28px 40px; max-width: 760px; }
.rd-translation:empty { display: none; }

.rt-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.rt-body {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
}
.rt-copy { margin-top: 10px; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .rd-input-wrap, .rd-passage { padding-left: 14px; padding-right: 14px; }
  .rd-controls, .rd-translation, .rd-hint { margin-left: 14px; margin-right: 14px; }
  .rd-detail {
    margin-left: 10px; margin-right: 10px;
    bottom: 10px;   /* .main already reserves room for the tab bar */
  }
  .rp-para { font-size: 17px; line-height: 2.0; }
  .rd-count { margin-left: 0; }
}