/* Faith Harvest /bible reader ([fh_bible]). A dark teal panel on the site's mint paper
   (colours from website/site-background.css and the app's deep cards). Every selector is scoped to .fh-bible.

   Theme-proofing: the reader sits inside themes and page builders (Astra + an Elementor Shortcode widget on
   faithharvest.cc) that set bold, letter-spaced, capitalised type on body, p, headings, links, buttons and
   sup. The reset below (plain selector lists) sets every text property the reader relies on, at specificity (0,2,1), which beats
   the usual theme rules (h2, .entry-content h2, .elementor-kit-N h2). The reader's own rules that change
   a reset property come after it and use at least the same specificity (".fh-bible h2.fh-bible-title",
   ".fh-bible .fh-bible-text h3"), so they win by order. No !important (except [hidden]). */
.fh-bible {
  --fh-panel: #14484B;
  --fh-card: #1B5457;
  --fh-line: rgba(255, 255, 255, 0.16);
  --fh-title: #FFFFFF;
  --fh-body: #DCEFEE;
  --fh-muted: #B9DAD8;
  --fh-accent: #8FD3D0;
  --fh-gold: #E8C77A;
  /* Highlights are opaque (the translucent colours mixed over --fh-panel), so where wrapped lines touch
     they don't double up into darker stripes. */
  --fh-band: #225B60;      /* rgba(95, 179, 193, 0.18) over the panel */
  --fh-band-edge: #5FB3C1;
  --fh-gold-bg: #435655;   /* rgba(232, 199, 122, 0.22) over the panel */
  --fh-size: 19px;
  --fh-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fh-serif: Georgia, "Times New Roman", serif;
  box-sizing: border-box;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 14px;
  background: var(--fh-panel);
  color: var(--fh-body);
  font-family: var(--fh-sans);
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-decoration: none;
  text-align: left;
  overflow-wrap: anywhere;
}
.fh-bible *, .fh-bible *::before, .fh-bible *::after { box-sizing: border-box; }
.fh-bible [hidden] { display: none !important; }

/* Reset: everything inherits the panel's type unless a rule below says otherwise. Plain selector lists
   (not :is()), so older Safari (iOS 13) keeps the rule. option/optgroup are left out: native dropdowns
   draw them, and they get their own readable colours under Controls. */
.fh-bible.fh-bible div,
.fh-bible.fh-bible section,
.fh-bible.fh-bible article,
.fh-bible.fh-bible aside,
.fh-bible.fh-bible footer,
.fh-bible.fh-bible form,
.fh-bible.fh-bible h1,
.fh-bible.fh-bible h2,
.fh-bible.fh-bible h3,
.fh-bible.fh-bible h4,
.fh-bible.fh-bible h5,
.fh-bible.fh-bible h6,
.fh-bible.fh-bible p,
.fh-bible.fh-bible a,
.fh-bible.fh-bible span,
.fh-bible.fh-bible sup,
.fh-bible.fh-bible sub,
.fh-bible.fh-bible small,
.fh-bible.fh-bible strong,
.fh-bible.fh-bible b,
.fh-bible.fh-bible em,
.fh-bible.fh-bible i,
.fh-bible.fh-bible ol,
.fh-bible.fh-bible ul,
.fh-bible.fh-bible li,
.fh-bible.fh-bible dl,
.fh-bible.fh-bible dt,
.fh-bible.fh-bible dd,
.fh-bible.fh-bible label,
.fh-bible.fh-bible button,
.fh-bible.fh-bible select,
.fh-bible.fh-bible input,
.fh-bible.fh-bible noscript {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: normal;
  line-height: inherit;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-decoration: none;
  text-shadow: none;
  text-align: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  margin: 0;
  padding: 0;
  vertical-align: baseline;
}
.fh-bible.fh-bible a { color: var(--fh-accent); text-decoration: underline; text-underline-offset: 2px; }
.fh-bible.fh-bible a:hover, .fh-bible.fh-bible a:focus { color: var(--fh-title); }

/* Controls */
.fh-bible.fh-bible form.fh-bible-search { display: flex; gap: 8px; margin: 0 0 12px; }
.fh-bible.fh-bible input,
.fh-bible.fh-bible select,
.fh-bible.fh-bible button {
  font-family: var(--fh-sans);
  font-size: 16px;
  line-height: 1.25;
  color: var(--fh-title);
  background: var(--fh-card);
  border: 1px solid var(--fh-line);
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 40px;
  box-shadow: none;
  width: auto;
  max-width: 100%;
}
.fh-bible.fh-bible button { text-align: center; cursor: pointer; white-space: nowrap; flex-shrink: 0; } /* wrap whole buttons, never letters */
.fh-bible.fh-bible button:hover:not(:disabled),
.fh-bible.fh-bible button:focus:not(:disabled) { background: var(--fh-card); color: var(--fh-title); border-color: var(--fh-accent); }
.fh-bible.fh-bible button:disabled { opacity: 0.45; cursor: default; }
.fh-bible.fh-bible button.fh-bible-primary,
.fh-bible.fh-bible button.fh-bible-primary:hover:not(:disabled),
.fh-bible.fh-bible button.fh-bible-primary:focus:not(:disabled) { background: var(--fh-accent); color: var(--fh-panel); border-color: var(--fh-accent); }
/* Native dropdown lists: dark text on a light background, whatever the theme or the select's own colours. */
.fh-bible.fh-bible option,
.fh-bible.fh-bible optgroup { color: #1A1A1A; background: #FFFFFF; font-family: var(--fh-sans); font-weight: 400; font-style: normal; letter-spacing: normal; text-transform: none; }
.fh-bible.fh-bible optgroup { font-weight: 700; }
/* The labels for the search box and selects are for screen readers only (own copy, so it doesn't depend on the theme). */
.fh-bible.fh-bible .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; word-wrap: normal;
}
.fh-bible.fh-bible input::placeholder { color: var(--fh-muted); opacity: 1; letter-spacing: normal; text-transform: none; font-weight: 400; }
.fh-bible.fh-bible .fh-bible-search input { flex: 1 1 auto; min-width: 0; }

.fh-bible.fh-bible div.fh-bible-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.fh-bible.fh-bible .fh-bible-book { flex: 1 1 180px; min-width: 0; }
.fh-bible.fh-bible .fh-bible-chapter { flex: 0 0 auto; }
.fh-bible.fh-bible .fh-bible-translation { flex: 0 1 auto; min-width: 0; }
.fh-bible.fh-bible .fh-bible-size { display: flex; gap: 4px; margin-left: auto; }

.fh-bible .fh-bible-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.fh-bible .fh-bible-layout.fh-bible-layout-single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  .fh-bible { padding: 14px; border-radius: 0; }
  .fh-bible .fh-bible-layout { grid-template-columns: minmax(0, 1fr); }
  .fh-bible.fh-bible .fh-bible-size { margin-left: 0; }
}

.fh-bible.fh-bible p.fh-bible-notice { margin: 0 0 12px; color: var(--fh-muted); }
.fh-bible.fh-bible .fh-bible-state { padding: 24px 0; text-align: center; }
.fh-bible.fh-bible .fh-bible-state p { margin: 0 0 12px; color: var(--fh-title); }
.fh-bible.fh-bible .fh-bible-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Search results */
.fh-bible.fh-bible section.fh-bible-results { margin: 0 0 20px; }
.fh-bible.fh-bible .fh-bible-results ol { list-style: none; }
.fh-bible.fh-bible .fh-bible-results li { border-bottom: 1px solid var(--fh-line); }
.fh-bible.fh-bible a.fh-bible-result {
  display: block; width: 100%; padding: 10px 0; color: var(--fh-body); text-decoration: none; line-height: 1.5;
}
.fh-bible.fh-bible a.fh-bible-result:hover, .fh-bible.fh-bible a.fh-bible-result:focus { color: var(--fh-title); }
.fh-bible.fh-bible span.fh-bible-result-ref { display: block; color: var(--fh-title); font-weight: 600; }
.fh-bible.fh-bible span.fh-bible-match { color: var(--fh-gold); font-weight: 600; }
.fh-bible.fh-bible p.fh-bible-results-head { color: var(--fh-muted); margin: 0 0 8px; }
.fh-bible.fh-bible .fh-bible-more { margin-top: 12px; }

/* Chapter text */
.fh-bible.fh-bible h2.fh-bible-title {
  margin: 0 0 12px; color: var(--fh-title); font-family: var(--fh-serif); font-size: 1.6em; font-weight: 400; line-height: 1.25;
}
.fh-bible.fh-bible div.fh-bible-text { font-family: var(--fh-serif); font-size: var(--fh-size); line-height: 1.65; color: var(--fh-body); }
.fh-bible.fh-bible .fh-bible-text h3 { margin: 1.2em 0 0.4em; color: var(--fh-title); font-size: 0.9em; font-weight: 700; line-height: 1.4; }
.fh-bible.fh-bible .fh-bible-text p { margin: 0 0 0.8em; }
/* A verse is an inline span that wraps over several lines. box-decoration-break: clone gives each line
   its own padded box; the vertical padding (half the line box minus the font's content area, about
   (1.65em - 1.14em) / 2) makes each line's band meet the next, so a highlighted passage reads as one
   block, not stripes. */
.fh-bible.fh-bible span.fh-bible-verse { scroll-margin-top: 30vh; padding: 0.26em 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.fh-bible.fh-bible span.fh-bible-verse.is-sermon { background: var(--fh-band); box-shadow: -6px 0 0 var(--fh-band); }
.fh-bible.fh-bible span.fh-bible-verse.is-target { background: var(--fh-gold-bg); box-shadow: -6px 0 0 var(--fh-gold-bg); }
.fh-bible.fh-bible sup.fh-bible-vn {
  color: var(--fh-accent); font-family: var(--fh-sans); font-size: 0.62em; font-weight: 400;
  vertical-align: super; line-height: 0; margin-right: 0.2em;
}
.fh-bible .fh-bible-placeholder span { display: block; height: 1em; margin: 0 0 0.7em; border-radius: 4px; background: var(--fh-line); }
.fh-bible .fh-bible-placeholder span:nth-child(3n) { width: 70%; }

/* Sermon sidebar */
.fh-bible.fh-bible .fh-bible-sermons h2 {
  margin: 0 0 10px; color: var(--fh-title); font-size: 1em; font-weight: 700; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.06em;
}
.fh-bible.fh-bible .fh-bible-sermons ul { list-style: none; }
.fh-bible.fh-bible .fh-bible-sermons li { padding: 8px 0; border-bottom: 1px solid var(--fh-line); line-height: 1.4; }
.fh-bible.fh-bible .fh-bible-sermons small { display: block; color: var(--fh-muted); font-size: 0.85em; }
.fh-bible.fh-bible .fh-bible-sermons .fh-bible-empty { color: var(--fh-muted); }

/* Attribution */
.fh-bible.fh-bible footer.fh-bible-attribution {
  margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--fh-line); font-size: 0.85em; color: var(--fh-muted); display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.fh-bible.fh-bible section.fh-bible-copyright { margin-top: 12px; font-size: 0.85em; color: var(--fh-muted); }
.fh-bible.fh-bible .fh-bible-copyright h2 { font-size: 1em; font-weight: 700; line-height: 1.4; color: var(--fh-title); margin: 0 0 6px; }
.fh-bible.fh-bible .fh-bible-copyright dt { color: var(--fh-title); font-weight: 600; margin-top: 6px; }
