/* Gospel Mix – Bíblia Online: leitor
   Todas as regras ficam sob .gmb-app para não conflitar com o tema (ex.: Newspaper). */

.gmb-app {
	--gmb-navy: #16294d;
	--gmb-navy-hover: #213a6b;
	--gmb-paper: #faf7f0;
	--gmb-surface: #ffffff;
	--gmb-ink: #1e2432;
	--gmb-muted: #687086;
	--gmb-line: #e6e0d2;
	--gmb-mark: #f3e3a3;
	--gmb-on-navy: #ffffff;
	--gmb-scale: 1;
	--gmb-sticky-top: 0px;
	--gmb-serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--gmb-sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--gmb-radius: 12px;

	color-scheme: light;
	position: relative;
	box-sizing: border-box;
	background: var(--gmb-paper);
	color: var(--gmb-ink);
	font-family: var(--gmb-sans);
	font-size: 16px;
	line-height: 1.5;
	border-radius: var(--gmb-radius);
	max-width: 100%;
	margin: 0 auto 2rem;
	-webkit-text-size-adjust: 100%;
}

.gmb-app[data-theme="dark"] {
	--gmb-navy: #a9c1ee;
	--gmb-navy-hover: #c4d5f5;
	--gmb-paper: #0f1626;
	--gmb-surface: #172137;
	--gmb-ink: #e3e7ef;
	--gmb-muted: #98a2b7;
	--gmb-line: #273350;
	--gmb-mark: rgba(214, 178, 80, 0.3);
	--gmb-on-navy: #0f1626;
	color-scheme: dark;
}

.gmb-app *,
.gmb-app *::before,
.gmb-app *::after {
	box-sizing: border-box;
}

/* Neutraliza estilos herdados do tema em botões e selects. */
.gmb-app button,
.gmb-app select {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
	min-height: 0;
	width: auto;
	height: auto;
}

.gmb-app :focus-visible {
	outline: 2px solid var(--gmb-navy);
	outline-offset: 2px;
}

.gmb-app .gmb-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gmb-app .gmb-ico {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}

/* ---------- barra superior ---------- */

.gmb-app .gmb-bar {
	position: sticky;
	top: var(--gmb-sticky-top);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: color-mix(in srgb, var(--gmb-paper) 92%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--gmb-line);
	border-radius: var(--gmb-radius) var(--gmb-radius) 0 0;
}

.gmb-app .gmb-locator {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 10px;
	font-family: var(--gmb-serif);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--gmb-navy);
	min-width: 0;
}

.gmb-app .gmb-locator-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gmb-app .gmb-locator:hover {
	background: var(--gmb-surface);
}

.gmb-app .gmb-trans-form {
	margin: 0;
}

.gmb-app .gmb-trans {
	padding: 7px 26px 7px 10px;
	border: 1px solid var(--gmb-line);
	background: var(--gmb-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23687086' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--gmb-ink);
}

.gmb-app .gmb-tools {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: auto;
}

.gmb-app .gmb-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	color: var(--gmb-muted);
	font-size: 1.5rem;
}

.gmb-app .gmb-icon-btn:hover {
	background: var(--gmb-surface);
	color: var(--gmb-navy);
}

.gmb-app .gmb-a-small { font-family: var(--gmb-serif); font-size: 0.85rem; font-weight: 600; }
.gmb-app .gmb-a-big { font-family: var(--gmb-serif); font-size: 1.2rem; font-weight: 600; }

.gmb-app .gmb-ico-sun,
.gmb-app[data-theme="dark"] .gmb-ico-moon { display: none; }
.gmb-app[data-theme="dark"] .gmb-ico-sun { display: block; }

/* ---------- página de leitura ---------- */

.gmb-app .gmb-page {
	max-width: 40rem;
	margin: 0 auto;
	padding: 28px 22px 12px;
	transition: opacity 0.15s ease;
}

.gmb-app .gmb-page.is-loading {
	opacity: 0.45;
}

.gmb-app .gmb-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	font-family: var(--gmb-sans);
	font-size: 1rem;
	line-height: 1.3;
}

.gmb-app .gmb-heading-book {
	font-family: var(--gmb-serif);
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--gmb-ink);
}

.gmb-app .gmb-heading-trans {
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--gmb-muted);
}

.gmb-app .gmb-text {
	font-family: var(--gmb-serif);
	font-size: calc(1.1875rem * var(--gmb-scale));
	line-height: 1.75;
	color: var(--gmb-ink);
	-webkit-hyphens: auto;
	hyphens: auto;
}

.gmb-app .gmb-flow {
	margin: 0;
	padding: 0;
}

/* O numeral do capítulo, como nas Bíblias impressas. */
.gmb-app .gmb-chapnum {
	float: left;
	margin: 0.06em 0.16em 0 -0.04em;
	font-family: var(--gmb-serif);
	font-size: 4.1em;
	font-weight: 600;
	line-height: 0.82;
	color: var(--gmb-navy);
	font-variant-numeric: lining-nums;
}

.gmb-app .gmb-v {
	border-radius: 3px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.12s ease;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.gmb-app .gmb-v:focus-visible {
	outline-offset: 1px;
}

.gmb-app .gmb-v.is-marked {
	background: var(--gmb-mark);
}

.gmb-app .gmb-v.is-selected {
	text-decoration: underline;
	text-decoration-color: var(--gmb-navy);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.22em;
}

.gmb-app .gmb-vn {
	position: relative;
	top: -0.55em;
	margin: 0 0.18em 0 0.08em;
	font-family: var(--gmb-sans);
	font-size: 0.58em;
	font-weight: 600;
	line-height: 0;
	color: var(--gmb-navy);
	vertical-align: baseline;
	user-select: none;
}

.gmb-app .gmb-chapnum + .gmb-v .gmb-vn {
	display: none;
}

.gmb-app .gmb-empty,
.gmb-app .gmb-error p {
	margin: 0 0 12px;
	font-family: var(--gmb-sans);
	font-size: 1rem;
	color: var(--gmb-muted);
}

.gmb-app .gmb-btn {
	padding: 10px 16px;
	background: var(--gmb-navy);
	color: var(--gmb-on-navy);
	font-weight: 600;
}

.gmb-app .gmb-credit {
	margin: 28px 0 0;
	font-size: 0.75rem;
	color: var(--gmb-muted);
}

/* ---------- navegação entre capítulos ---------- */

.gmb-app .gmb-pager {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	max-width: 40rem;
	margin: 0 auto;
	padding: 16px 22px 28px;
}

.gmb-app .gmb-pager-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	border: 1px solid var(--gmb-line);
	border-radius: 999px;
	background: var(--gmb-surface);
	color: var(--gmb-navy);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	box-shadow: none;
}

.gmb-app .gmb-pager-link:hover {
	border-color: var(--gmb-navy);
	color: var(--gmb-navy);
	text-decoration: none;
}

/* ---------- barra de ações dos versículos ---------- */

.gmb-app .gmb-actionbar {
	position: fixed;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 2px;
	max-width: calc(100vw - 24px);
	padding: 6px;
	transform: translateX(-50%);
	background: var(--gmb-navy);
	color: var(--gmb-on-navy);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(10, 20, 40, 0.28);
	overflow-x: auto;
}

.gmb-app .gmb-actionbar[hidden] {
	display: none;
}

.gmb-app .gmb-actionbar-count {
	padding: 0 10px;
	font-size: 0.8125rem;
	opacity: 0.8;
	white-space: nowrap;
}

.gmb-app .gmb-actionbar button {
	padding: 10px 12px;
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	color: var(--gmb-on-navy);
}

.gmb-app .gmb-actionbar button:hover {
	background: rgba(255, 255, 255, 0.12);
}

.gmb-app .gmb-actionbar .gmb-actionbar-close {
	font-size: 1.25rem;
	padding: 6px 12px;
}

/* ---------- seletor de livro/capítulo ---------- */

.gmb-app .gmb-sheet {
	width: min(640px, calc(100vw - 24px));
	max-width: none;
	max-height: min(80vh, 760px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: var(--gmb-paper);
	color: var(--gmb-ink);
	box-shadow: 0 24px 60px rgba(10, 20, 40, 0.35);
	overflow: hidden;
}

.gmb-app .gmb-sheet[open] {
	display: flex;
	flex-direction: column;
}

.gmb-app .gmb-sheet::backdrop {
	background: rgba(10, 18, 35, 0.5);
}

.gmb-app .gmb-sheet-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 10px 10px 18px;
	border-bottom: 1px solid var(--gmb-line);
}

.gmb-app .gmb-sheet-title {
	flex: 1;
	font-family: var(--gmb-serif);
	font-size: 1.2rem;
	font-weight: 600;
}

.gmb-app .gmb-sheet-back {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin-left: -8px;
	color: var(--gmb-navy);
}

.gmb-app .gmb-sheet-back[hidden] {
	display: none;
}

.gmb-app .gmb-sheet-body {
	overflow-y: auto;
	padding: 8px 14px 20px;
	overscroll-behavior: contain;
}

.gmb-app .gmb-testament-title {
	margin: 14px 4px 8px;
	padding: 0;
	font-family: var(--gmb-sans);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--gmb-muted);
}

.gmb-app .gmb-book-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 4px;
}

.gmb-app .gmb-book {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	text-align: left;
}

.gmb-app .gmb-book:hover,
.gmb-app .gmb-chapter:hover {
	background: var(--gmb-surface);
}

.gmb-app .gmb-book-abbr {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 30px;
	border-radius: 6px;
	background: var(--gmb-surface);
	border: 1px solid var(--gmb-line);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--gmb-navy);
}

.gmb-app .gmb-book-name {
	font-size: 0.9375rem;
}

.gmb-app .gmb-book.is-current .gmb-book-abbr,
.gmb-app .gmb-chapter.is-current {
	background: var(--gmb-navy);
	border-color: var(--gmb-navy);
	color: var(--gmb-on-navy);
}

.gmb-app .gmb-book.is-current .gmb-book-name {
	font-weight: 600;
	color: var(--gmb-navy);
}

.gmb-app .gmb-chapter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
	gap: 6px;
	padding-top: 10px;
}

.gmb-app .gmb-chapter {
	height: 48px;
	border: 1px solid var(--gmb-line);
	font-size: 1rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/* ---------- aviso flutuante ---------- */

.gmb-app .gmb-toast {
	position: fixed;
	left: 50%;
	bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	z-index: 99991;
	padding: 10px 16px;
	transform: translate(-50%, 8px);
	background: var(--gmb-ink);
	color: var(--gmb-paper);
	border-radius: 10px;
	font-size: 0.875rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.gmb-app .gmb-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.gmb-pending {
	padding: 12px 16px;
	border-left: 4px solid #16294d;
	background: #f3f5fa;
	font-size: 14px;
}

/* ---------- celular ---------- */

@media (max-width: 600px) {
	.gmb-app {
		border-radius: 0;
		margin-left: calc(-1 * var(--gmb-bleed, 0px));
		margin-right: calc(-1 * var(--gmb-bleed, 0px));
	}

	.gmb-app .gmb-bar {
		border-radius: 0;
		padding: 8px;
		gap: 4px;
	}

	.gmb-app .gmb-icon-btn {
		width: 36px;
	}

	.gmb-app .gmb-page {
		padding: 22px 18px 8px;
	}

	.gmb-app .gmb-pager {
		padding: 12px 18px 24px;
	}

	.gmb-app .gmb-pager-link span {
		max-width: 34vw;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.gmb-app .gmb-sheet {
		width: 100vw;
		max-height: 88vh;
		margin: auto 0 0;
		border-radius: 16px 16px 0 0;
	}

	.gmb-app .gmb-book-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gmb-app *,
	.gmb-app *::before,
	.gmb-app *::after {
		transition: none !important;
	}
}

@media print {
	.gmb-app .gmb-bar,
	.gmb-app .gmb-pager,
	.gmb-app .gmb-actionbar,
	.gmb-app .gmb-toast {
		display: none !important;
	}
}
