/* The Bible reader (/bible/). Loaded only on those pages. */

/* ---------- Go to a passage ---------- */
.bible-go { position: relative; display: flex; max-width: 420px; margin-top: 22px; }
.bible-go input {
	width: 100%; min-height: 48px; padding: 0 52px 0 18px; border: 1px solid #d6d0c3; border-radius: 999px;
	background: #fff; color: var(--ink); font: 400 16px var(--text); -webkit-appearance: none; appearance: none;
}
.bible-go input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px rgba(31, 79, 138, .15); }
.bible-go button { position: absolute; right: 5px; top: 5px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; }
.bible-go button svg { width: 18px; height: 18px; }
.page-kicker a { color: inherit; }

/* ---------- Home: books ---------- */
.bible-index { padding-block: clamp(28px, 4vw, 48px) clamp(64px, 9vw, 104px); display: grid; gap: clamp(28px, 4vw, 44px); }
.bible-chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bible-chips a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 500 15px var(--text); }
.bible-chips a:hover { background: var(--panel); color: var(--ink); }
.bible-books ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.bible-books a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: 8px; color: var(--ink); font: 500 17px var(--serif); }
.bible-books a:hover { background: var(--panel); color: var(--ink); }
.bible-books small { font: 500 12px var(--text); color: var(--muted); }
.bible-chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.bible-chapters a { display: grid; place-items: center; height: 52px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 600 17px var(--text); }
.bible-chapters a:hover { background: var(--brand); color: #fff; box-shadow: none; }

/* ---------- Chapter: the reader app ---------- */
.bible-toolbar {
	position: sticky; top: var(--header); z-index: 20; display: flex; align-items: center; gap: 10px;
	padding: 10px max(var(--gutter), calc((100vw - 1400px) / 2)); background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.bt-nav, .bt-view { display: flex; align-items: center; gap: 6px; }
.bt-view { margin-left: auto; }
.bt-select {
	height: 42px; padding: 0 34px 0 14px; border: 1px solid #d9d3c6; border-radius: 10px; background: #fff
	url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236b6b71' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
	color: var(--ink); font: 650 16px var(--text); cursor: pointer; -webkit-appearance: none; appearance: none;
}
.bt-book { min-width: 150px; }
.bt-select:focus-visible, .bt-btn:focus-visible { outline: 3px solid var(--action); outline-offset: 1px; }
.bt-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; height: 42px; padding: 0 10px;
	border: 1px solid #d9d3c6; border-radius: 10px; background: #fff; color: var(--ink); font: 700 15px var(--text); cursor: pointer;
}
.bt-btn:hover { background: var(--panel); color: var(--ink); }
.bt-btn svg { width: 19px; height: 19px; flex: none; }
.bt-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.bt-size span { font-size: 13px; }
.bt-size-up span { font-size: 18px; }
.bt-layout[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.bible-toolbar .bible-go { margin: 0; flex: 0 1 260px; }
.bible-toolbar .bible-go input { min-height: 42px; font-size: 15px; }
.bible-toolbar .bible-go button { width: 32px; height: 32px; }
html:has(.bible-toolbar) { scroll-padding-top: calc(var(--header) + 64px + 20px); }

.bible-main { max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }
.bible-read { width: 100%; max-width: 780px; margin-inline: auto; padding-block: clamp(28px, 4vw, 48px) clamp(64px, 9vw, 104px); }
.bible-chapter-head h1 { font-size: clamp(40px, 5vw, 56px); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; }
.bible-chapter-head .page-kicker { margin-bottom: 8px; }

.bible-teach { margin-top: 24px; display: grid; gap: 10px; }
.bible-teach .label { margin: 0; }
.teach-card { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.teach-card:hover { background: var(--panel); color: var(--ink); }
.teach-card img { width: 112px; height: 63px; flex: none; border-radius: 8px; object-fit: cover; background: var(--chip); }
.teach-card small { display: flex; align-items: center; gap: 6px; font: 600 12px var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.teach-card small svg { width: 16px; height: 16px; color: var(--yt); }
.teach-card b { display: block; margin-top: 3px; font: 600 16px/1.35 var(--text); }

.bible-sum { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bible-sum summary { padding: 14px 0; cursor: pointer; font: 600 15px var(--text); color: var(--body); list-style: none; display: flex; justify-content: space-between; }
.bible-sum summary::-webkit-details-marker { display: none; }
.bible-sum summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
.bible-sum[open] summary::after { content: "–"; }
.bible-sum ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font: 400 16px/1.5 var(--serif); color: var(--body); }
.bible-sum li a { display: inline-block; min-width: 26px; font: 700 13px var(--text); color: var(--action); }

.bible-text { margin-top: 26px; font: 400 var(--bsize, clamp(22px, 2.2vw, 25px))/1.85 var(--serif); color: #15161a; }
.bible-lines .bible-text p { margin: 0; }
.bible-lines .bible-text .v { display: block; padding: .15em .25em; margin: 0 -.25em .2em; }
.bible-lines .bible-text .vn { top: 0; display: inline-block; min-width: 1.9em; margin-right: .2em; font-size: .6em; vertical-align: .15em; }
.bible-text p { margin: 0 0 1em; }
.v { border-radius: 4px; transition: background-color .3s; }
.v.on, .v.hl { background: #fdf0c4; box-shadow: 0 0 0 3px #fdf0c4; }
.vn { position: relative; top: -.5em; margin-right: 4px; padding: 2px 3px; font: 700 .56em var(--text); color: var(--action); text-decoration: none; }
.vn:hover { color: var(--brand); text-decoration: underline; }
.w { cursor: pointer; border-radius: 3px; }
@media (hover: hover) { .w:hover { background: rgba(31, 79, 138, .1); } }
.w.on { background: rgba(31, 79, 138, .18); }
.vt { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 2px; vertical-align: 2px; padding: 0; border: 0; border-radius: 50%; background: var(--yt); color: #fff; cursor: pointer; }
.vt svg { width: 11px; height: 11px; margin-left: 1px; }

.bible-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.bible-pager a { display: block; padding: 14px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 600 17px var(--text); }
.bible-pager a:hover { background: var(--panel); color: var(--ink); }
.bible-pager small { display: block; font: 500 12px var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bible-pager .next { grid-column: 2; text-align: right; }

/* ---------- The panel: a word or a verse ---------- */
.bible-panel { position: fixed; z-index: 60; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 48px)); max-height: min(72vh, 720px); display: flex; }
.bible-panel[hidden] { display: none; }
.bible-panel-in { position: relative; width: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 24px; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px -12px rgba(15, 20, 35, .35), 0 0 0 1px rgba(15, 20, 35, .06); }
.bible-panel-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--panel); color: var(--ink); cursor: pointer; }
.bible-panel-x svg { width: 18px; height: 18px; }
.bp-kicker { margin: 0 44px 6px 0; font: 700 11px var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--action); }
.bp-word, .bp-ref { margin: 0 44px 0 0; font: 500 26px/1.2 var(--serif); color: var(--ink); }
.bp-lemma { margin: 14px 0 0; font: 400 34px/1.2 "Times New Roman", serif; color: var(--brand); }
.bp-say { margin: 4px 0 0; font: 400 15px var(--text); color: var(--muted); }
.bible-panel h3 { margin: 18px 0 8px; font: 700 12px var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bp-defs { margin: 0; padding-left: 18px; display: grid; gap: 6px; font: 400 16px/1.5 var(--serif); color: var(--body); }
.bp-usage { margin: 0; font: 400 15px/1.55 var(--text); color: var(--body); }
.bp-load, .bp-none { margin-top: 14px; color: var(--muted); font: 400 15px var(--text); }
.bp-verse { margin: 12px 0 0; font: 400 18px/1.6 var(--serif); color: var(--body); }
.bp-actions { display: flex; gap: 8px; margin: 14px 0 0; }
.bp-btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--panel); color: var(--ink); font: 600 14px var(--text); cursor: pointer; }
.bp-btn:hover { background: var(--chip); }
.bible-panel .teach-card { margin-top: 8px; }
.bible-panel .teach-card img { width: 96px; height: 54px; }
.bp-refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bp-refs a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; color: var(--body); font: 400 15px/1.45 var(--serif); }
.bp-refs a:hover { background: var(--panel); color: var(--ink); }
.bp-refs b { display: block; font: 700 14px var(--text); color: var(--action); }

.bp-hint { margin: 10px 0 0; font: 400 15px/1.5 var(--text); color: var(--muted); }
.bible-panel .bible-teach { margin-top: 18px; }
.bible-panel .bible-sum { margin-top: 18px; }
.bible-panel .bible-sum ul { font-size: 15px; }

/* Computers: the Study panel is docked beside the text. */
@media (min-width: 1100px) {
	.bible-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(32px, 4vw, 64px); align-items: start; }
	.bible-inline { display: none; }
	.bible-panel { position: sticky; top: calc(var(--header) + 64px + 20px); right: auto; bottom: auto; z-index: 1; width: auto; max-height: calc(100vh - var(--header) - 64px - 40px); margin-top: clamp(28px, 4vw, 48px); }
	.bible-panel-in { border-radius: 16px; box-shadow: none; border: 1px solid var(--line); }
	.bible-panel-x[hidden] { display: none; }
}
@media (max-width: 1299px) { .bt-layout-label { display: none; } }

/* Phones: the toolbar wraps onto two rows and scrolls away; the panel slides up from the bottom. */
@media (max-width: 760px) {
	.bible-toolbar { position: static; flex-wrap: wrap; padding: 10px var(--gutter); }
	.bt-nav { width: 100%; }
	.bt-book { flex: 1 1 auto; min-width: 0; }
	.bible-toolbar .bible-go { flex: 1 1 0; min-width: 0; max-width: none; }
	.bt-view { margin-left: 0; flex: none; }
	.bt-view .bt-btn { min-width: 40px; padding: 0 8px; }
	html:has(.bible-toolbar) { scroll-padding-top: calc(var(--header) + 16px); }
}
@media (max-width: 700px) {
	.bible-panel { left: 0; right: 0; bottom: 0; width: 100%; max-height: 70vh; }
	.bible-panel-in { border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
	.teach-card img { width: 96px; height: 54px; }
}
