/* Hebrew & Greek: a verse as an interlinear with its original-language and KJV audio looping. Reuses the Memorize
   chooser and buttons (.memorize-body, .memorize-pick, .memorize-audio) and the reader's interlinear classes;
   only what is new lives here. While it is open the reader stays covered. */
body.origwords-open #origwords-overlay.overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  transform: none !important;
  background: var(--overlay-bg) !important;
  z-index: 11000 !important;
}

body.origwords-open #origwords-overlay .overlay-header {
  padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

#origwords-overlay .overlay-header-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}

#origwords-overlay .memorize-audio {
  white-space: nowrap;
}

#origwords-overlay .overlay-title {
  text-align: left;
  white-space: normal;
}

body.origwords-open .app-topbar,
body.origwords-open .reader-wrapper,
body.origwords-open .reader,
body.origwords-open .bible-sidecar,
body.origwords-open #bible-sidecar,
body.origwords-open #desktop-right-panel {
  visibility: hidden !important;
}

#origwords-overlay .memorize-range {
  grid-template-columns: 1fr 1fr;
}

#origwords-start,
#origwords-change,
.ow-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 1rem;
  font-family: var(--font-family-sans);
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--ui-chrome-border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#origwords-start:disabled,
.ow-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}

#origwords-change {
  margin-top: 1.25rem;
}

.ow-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.ow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.5rem;
}

.ow-ref {
  font-family: var(--font-family-sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.ow-lang,
.ow-audio-status {
  font-family: var(--font-family-sans);
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 0;
}

/* The interlinear is the reader's own markup (.interlinear-verse, .aligned-segment,
   .greek-text ...), so styles.css draws it; here it is only made larger for a phone. */
.ow-il {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
}

.ow-il .interlinear-verse {
  gap: 0.6rem 0.45rem;
  margin: 0;
}

.ow-il .interlinear-verse.interlinear-rtl {
  padding-right: 0;
}

.ow-il .mode-interlinear .greek-text,
.ow-il .interlinear-verse .greek-text {
  font-family: 'SBL Greek', 'Gentium Plus', 'Times New Roman', serif;
  font-size: 1.55em;
  color: var(--fg);
}

.ow-il .interlinear-verse.is-hebrew .greek-text {
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  font-size: 1.9em;
}

.ow-il .greek-translit {
  font-size: 0.72em;
}

.ow-il .segment-eng {
  font-size: 0.85em;
  color: var(--fg-secondary);
}

.ow-il .aligned-segment {
  cursor: pointer;
  padding: 0.3rem 0.45rem;
  border-radius: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.ow-il .aligned-segment.is-on {
  background: rgba(0, 102, 204, 0.14);
  box-shadow: inset 0 -2px 0 var(--button-primary);
}

.ow-audio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin: 0.75rem 0 0;
}

.ow-speed {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-family: var(--font-family-sans);
  font-size: 0.78rem;
  color: var(--fg-secondary);
}

.ow-speed select {
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--ui-chrome-border);
  border-radius: 999px;
  padding: 0.22rem 1.35rem 0.22rem 0.55rem;
  cursor: pointer;
}

.ow-pace {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-left: auto;
}

/* Author display must not override the hidden attribute, or Pace and Speed show at once. */
#origwords-wpm-label[hidden],
#origwords-speed-label[hidden] {
  display: none !important;
}

.ow-wpm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-family-sans);
  font-size: 0.78rem;
  color: var(--fg-secondary);
}

.ow-wpm input[type="range"] {
  width: 7.5rem;
  margin: 0;
  accent-color: var(--button-primary, #0066cc);
}

.ow-wpm-readout {
  min-width: 4.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

/* The lit word is the one the narrator is speaking. Media time drives it, so a pace change cannot drift it. */
.ow-il .greek-word.is-paced,
.ow-il .ow-title-word.is-paced {
  background: #ffe08a;
  box-shadow: inset 0 -3px 0 #e0a100;
  border-radius: 0.35rem;
}

.ow-il .greek-word.is-paced:hover,
.ow-il .ow-title-word.is-paced:hover {
  background: #ffe08a;
}

.ow-il .greek-word.is-paced .greek-text,
.ow-il .ow-title-word.is-paced .ow-title-he,
.ow-il .interlinear-verse.is-hebrew .greek-word.is-paced .greek-text {
  color: #1a1a1a;
}

.ow-il .greek-word.is-paced .greek-translit,
.ow-il .ow-title-word.is-paced .ow-title-tr {
  color: #6a4b00;
  font-style: normal;
}

/* Psalm title spoken before verse 1 in the Hebrew recording, and the small explanatory notes */
.ow-title {
  margin: 0 0 0.9rem;
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--ui-chrome-border);
}

.ow-title-label {
  font-family: var(--font-family-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-secondary);
  margin: 0 0 0.3rem;
}

.ow-title-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
}

.ow-title-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.ow-title-he {
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  font-size: 1.6em;
  color: var(--fg);
}

.ow-title-tr {
  font-size: 0.72em;
  color: var(--fg-secondary);
  direction: ltr;
}

.ow-title-eng {
  font-size: 0.85em;
  color: var(--fg-secondary);
  font-style: italic;
  margin: 0.4rem 0 0;
}

.ow-footnote {
  font-family: var(--font-family-sans);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--fg-secondary);
  margin: 0.9rem 0 0;
}

.ow-missing {
  font-family: var(--font-family-sans);
  font-size: 0.95rem;
  color: var(--fg-secondary);
  margin: 0;
}

.ow-detail {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ui-chrome-border);
  border-radius: 0.8rem;
  min-height: 3rem;
  scroll-margin-top: 1rem;
}

.ow-detail-eng {
  font-family: var(--font-family-serif);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.ow-detail-word + .ow-detail-word {
  border-top: 1px solid var(--ui-chrome-border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.ow-detail-orig {
  font-family: 'SBL Hebrew', 'SBL Greek', 'Gentium Plus', 'Times New Roman', serif;
  font-size: 2.4rem;
  line-height: 1.3;
  margin: 0;
}

.ow-detail-tr {
  font-family: var(--font-family-sans);
  font-size: 1.1rem;
  font-style: italic;
  margin: 0.1rem 0 0.5rem;
}

.ow-detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0;
  font-family: var(--font-family-sans);
  font-size: 1rem;
}

.ow-detail dt {
  color: var(--fg-secondary);
}

.ow-detail dd {
  margin: 0;
}

.ow-detail dd[dir="rtl"] {
  text-align: left;
  unicode-bidi: plaintext;
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  font-size: 1.3rem;
}

.ow-code {
  color: var(--fg-secondary);
  font-size: 0.85rem;
}

@media (max-width: 420px) {
  #origwords-overlay .overlay-header {
    padding-left: 0.25rem;
    padding-right: 0.35rem;
    gap: 0.35rem;
  }

  #origwords-overlay .memorize-audio {
    font-size: 0.72rem;
    padding: 0.28rem 0.45rem;
  }
}
