/* =========================================================
   Bible pages
   ========================================================= */

/* ---------- Library ---------- */
.bible-intro { max-width: 720px; margin: 0 auto 36px; }
.bible-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 16px; margin-bottom: 28px;
}
.bible-tabs { display: flex; flex-wrap: wrap; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px; }
.bible-tab {
	border: 0; background: none; padding: .65rem 1.3rem; border-radius: 999px; cursor: pointer;
	font: 600 .95rem var(--sans); color: var(--maroon); transition: background .2s, color .2s;
}
.bible-tab .count { font-weight: 500; font-size: .78rem; opacity: .65; margin-left: 4px; }
.bible-tab:hover { background: var(--cream); }
.bible-tab[aria-selected="true"] { background: var(--maroon); color: #fff; }
.bible-tab[aria-selected="true"] .count { color: var(--gold-light); opacity: 1; }
.bible-search input {
	width: 280px; max-width: 100%; padding: .75rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
	font: inherit; font-size: .95rem; background: #fff;
}
.bible-search input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,62,.2); }
@media (max-width: 700px) {
	.bible-toolbar { flex-direction: column; align-items: stretch; }
	.bible-tabs { border-radius: 16px; justify-content: center; }
	.bible-search input { width: 100%; }
}

.bible-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.bible-tile {
	display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: #fff;
	border: 1px solid var(--line); border-top: 3px solid var(--crimson); border-radius: 10px;
	text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s;
	min-height: 96px;
}
.bible-tile:hover, .bible-tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-top-color: var(--gold); }
.tile-lang { font-weight: 600; font-size: 1.05rem; color: var(--maroon); line-height: 1.3; }
.tile-abbr { font-size: .74rem; font-weight: 700; letter-spacing: .1em; color: var(--gold-dark); }
.tile-meta { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.bible-empty { text-align: center; color: var(--muted); padding: 30px 0; }
.bible-tile.is-hidden { display: none; }

/* ---------- Shared ---------- */
.bible-wrap { padding-top: clamp(36px, 5vw, 60px); }
.bible-crumbs { font-size: .92rem; color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.bible-crumbs a { color: var(--crimson); text-decoration: none; }
.bible-crumbs a:hover { text-decoration: underline; }

/* ---------- Book list ---------- */
.bible-head { margin-bottom: 36px; }
.bible-head h1 { margin-bottom: .1em; }
.bible-sub { color: var(--muted); margin-bottom: .4em; }
.bible-change { font-size: .9rem; font-weight: 600; color: var(--gold-dark); text-decoration: none; }
.bible-notice { margin-bottom: 24px; }
.bible-sections { display: grid; gap: 30px; }
.bible-sections.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .bible-sections.cols-2 { grid-template-columns: 1fr; } }
.bible-section-title {
	font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: var(--gold-dark); text-align: center; padding-bottom: 12px; border-bottom: 2px solid var(--gold); margin-bottom: 14px;
}
.bible-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cols-1 .bible-books { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bible-books a {
	display: block; padding: .8rem 1.1rem; background: var(--cream); border: 1px solid var(--line);
	border-radius: 10px; color: var(--maroon); text-decoration: none; font-size: 1.05rem; font-weight: 500;
	transition: background .2s, color .2s, border-color .2s;
}
.bible-books a:hover, .bible-books a:focus-visible { background: var(--maroon); border-color: var(--maroon); color: #fff; }

/* ---------- Reader ---------- */
.bible-reader { --bible-size: 1.15rem; transition: background .3s, color .3s; }
.bible-book-title { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .4em; }

.bible-chapters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.bible-chapters a {
	min-width: 42px; height: 42px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
	border-radius: 8px; background: var(--cream); border: 1px solid var(--line); color: var(--maroon);
	text-decoration: none; font-weight: 600; font-size: .95rem; transition: background .2s, color .2s;
}
.bible-chapters a:hover { background: var(--line); }
.bible-chapters a.is-current { background: var(--crimson); border-color: var(--crimson); color: #fff; }

.bible-controls {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px;
	background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%); border-radius: 12px; margin-bottom: 34px;
}
.bible-select { flex: 1 1 200px; }
.bible-select select {
	width: 100%; padding: .65rem 2.2rem .65rem .9rem; border-radius: 8px; border: 1px solid rgba(236,208,130,.35);
	background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23ecd082' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E") no-repeat right .9rem center;
	color: #fff; font: 500 .95rem var(--sans); -webkit-appearance: none; appearance: none; cursor: pointer;
}
.bible-select select option, .bible-select select optgroup { color: var(--text); background: #fff; }
.bible-tools { display: flex; gap: 8px; margin-left: auto; }
.bible-tools .tool {
	width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex;
	align-items: center; justify-content: center; background: var(--gold-grad); color: var(--maroon-deep);
	font: 700 .85rem var(--sans);
}
.bible-tools .tool:hover { filter: brightness(1.08); }

.bible-text { max-width: 860px; font-size: var(--bible-size); line-height: 1.95; }
.bible-chapter-title { font-size: 1.7rem; margin-bottom: .9em; }
/* Bible pages: jump instantly (no smooth scroll) */
html { scroll-behavior: auto; }

/* Previous/Next land here, clear of the sticky header */
#read { scroll-margin-top: 110px; }
.admin-bar #read { scroll-margin-top: 142px; }
@media (max-width: 860px) { #read { scroll-margin-top: 90px; } }
.verse { margin: 0 0 .45em; }
.verse .vn {
	font-family: var(--sans); font-size: .62em; font-weight: 700; color: var(--crimson); text-decoration: none;
	vertical-align: super; line-height: 0; margin-right: 2px; font-style: italic;
}
.verse .vn:hover { text-decoration: underline; }
.verse:target { background: rgba(201,154,62,.18); border-radius: 6px; box-shadow: 0 0 0 6px rgba(201,154,62,.18); }
.verse .added { font-style: italic; opacity: .8; }

/* Drop cap on verse 1 */
.bible-text .verse:first-of-type .vn { display: none; }
.bible-text .verse:first-of-type::first-letter {
	float: left; font-family: var(--serif); font-size: 3.6em; line-height: .9; font-weight: 700;
	color: var(--crimson); margin: .06em .12em 0 0;
}
.bible-text[dir="rtl"] .verse:first-of-type::first-letter { float: right; margin: .06em 0 0 .12em; }
.bible-text .verse:first-of-type { min-height: 2.6em; }

.bible-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.bible-pager a {
	padding: .75rem 1.5rem; border-radius: 999px; background: var(--cream); border: 1px solid var(--line);
	color: var(--maroon); font-weight: 600; text-decoration: none; transition: background .2s, color .2s;
}
.bible-pager a:hover { background: var(--maroon); color: #fff; }

/* Dark reading mode */
.bible-reader.is-dark { background: #1a0d0e; color: #e9ddcb; }
.bible-reader.is-dark h1, .bible-reader.is-dark h2 { color: #f3e6cc; }
.bible-reader.is-dark .bible-crumbs, .bible-reader.is-dark .bible-crumbs span { color: #b9a68f; }
.bible-reader.is-dark .bible-crumbs a, .bible-reader.is-dark .verse .vn { color: var(--gold-light); }
.bible-reader.is-dark .bible-text .verse:first-of-type::first-letter { color: var(--gold); }
.bible-reader.is-dark .bible-chapters a, .bible-reader.is-dark .bible-pager a { background: #2a1517; border-color: #3d2124; color: #f0dfc2; }
.bible-reader.is-dark .bible-chapters a.is-current { background: var(--gold); border-color: var(--gold); color: var(--maroon-deep); }
.bible-reader.is-dark .bible-pager { border-color: #3d2124; }

/* =========================================================
   Reading bookmarks
   ========================================================= */
.tool-mark { width: auto !important; padding: 0 14px; gap: 6px; border-radius: 999px !important; }
.tool-mark .bm-solid { display: none; }
.tool-mark[aria-pressed="true"] { background: var(--crimson) !important; color: #fff !important; }
.tool-mark[aria-pressed="true"] .bm-solid { display: inline; }
.tool-mark[aria-pressed="true"] .bm-outline { display: none; }
.tool-mark span { font: 700 .82rem var(--sans); }

.bm-resume {
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 26px;
	background: var(--cream); border: 1px solid var(--line); border-left: 3px solid var(--crimson); border-radius: 12px; color: var(--crimson);
}
.bm-resume[hidden] { display: none; }
.bm-resume-text { flex: 1; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.bm-resume .bm-k { color: var(--muted); font-size: .88rem; }
.bm-resume b { color: var(--maroon); }
.bm-when { color: var(--muted); font-size: .85rem; }
.bm-go { flex: none; padding: .55rem 1.2rem; border-radius: 999px; background: var(--gold-grad); color: var(--maroon-deep); font-weight: 700; font-size: .9rem; text-decoration: none; }

.bm-continue { margin-bottom: 34px; }
.bm-continue[hidden] { display: none; }
.bm-title { font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dark); margin: 0 0 12px; }
.bm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bm-card { position: relative; }
.bm-card-link {
	display: flex; flex-direction: column; gap: 2px; padding: 16px 44px 16px 18px; border-radius: 12px; text-decoration: none; color: #fff;
	background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%); box-shadow: var(--shadow); transition: transform .2s;
}
.bm-card-link:hover { transform: translateY(-2px); }
.bm-card-ver { font-size: .78rem; color: var(--gold-light); font-weight: 600; letter-spacing: .04em; }
.bm-card-ref { font-size: 1.2rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.bm-card-when { font-size: .8rem; color: var(--on-dark-soft); }
.bm-card-go { margin-top: 8px; font-size: .88rem; font-weight: 700; color: var(--gold-light); }
.bm-del { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.bm-del:hover { background: rgba(255,255,255,.25); }
.bm-note { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

.bible-tile { position: relative; }
.bible-tile.has-mark { border-top-color: var(--gold); }
.tile-mark {
	margin-top: 6px; align-self: flex-start; font-size: .74rem; font-weight: 700; color: #fff; background: var(--crimson);
	border-radius: 6px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bm-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translate(-50%, 200%); opacity: 0;
	display: flex; align-items: center; gap: 14px; background: #1a0d0e; color: #fff; padding: 12px 18px; border-radius: 12px;
	box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: .92rem; transition: transform .25s, opacity .25s; max-width: calc(100% - 24px);
}
.bm-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.bm-toast button { background: none; border: 0; color: var(--gold-light); font: 700 .9rem var(--sans); cursor: pointer; }

.bible-reader.is-dark .bm-resume { background: #2a1517; border-color: #3d2124; border-left-color: var(--gold); }
.bible-reader.is-dark .bm-resume-text, .bible-reader.is-dark .bm-resume b { color: #f0dfc2; }

@media (max-width: 600px) {
	.bible-tools { margin-left: 0; width: 100%; }
	.tool-mark { margin-right: auto; }
	.bm-resume { padding: 10px 12px; gap: 10px; flex-wrap: nowrap; margin-bottom: 20px; }
	.bm-resume > svg { flex: none; width: 18px; }
	.bm-resume .bm-k { display: block; font-size: .78rem; }
	.bm-resume .bm-when { display: none; }
	.bm-go { padding: .5rem .9rem; font-size: .85rem; white-space: nowrap; }
	.bm-continue { margin-bottom: 26px; }
	.bm-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
	.bm-card-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ver go" "ref go" "when go"; align-items: center; padding: 12px 44px 12px 14px; column-gap: 10px; }
	.bm-card-ver { grid-area: ver; }
	.bm-card-ref { grid-area: ref; font-size: 1.05rem; }
	.bm-card-when { grid-area: when; font-size: .75rem; }
	.bm-card-go { grid-area: go; margin: 0; }
	.bm-del { top: 50%; transform: translateY(-50%); right: 8px; width: 28px; height: 28px; }
	.bm-toast { left: 12px; right: 12px; max-width: none; transform: translateY(200%); }
	.bm-toast.is-on { transform: none; }
	.bm-toast span { flex: 1; }
}
