/* CB Reference Tagger — public styles. Legacy cbgrt selectors are stable. */
:root {
	--cbgrt-accent: #9a733d;
	--cbgrt-card-bg: #fffaf0;
	--cbgrt-card-text: #1c2733;
	--cbgrt-border: rgba(28, 39, 51, 0.18);
	--cbgrt-shadow: 0 18px 48px rgba(16, 24, 32, 0.2);
}

.cbgrt-reference-wrap {
	display: inline;
	position: relative;
}

.cbgrt-term {
	color: inherit;
	cursor: help;
	text-decoration-color: var(--cbgrt-accent);
	text-decoration-line: underline;
	text-decoration-style: dotted;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.18em;
}

.cbgrt-term:hover,
.cbgrt-term:focus-visible {
	color: var(--cbgrt-accent);
	text-decoration-style: solid;
}

.cbgrt-scripture-trigger {
	cursor: pointer;
}

.cbgrt-term:focus-visible,
.cbgrt-card__cta:focus-visible,
.cbgrt-index a:focus-visible,
.cbgrt-index input:focus-visible {
	outline: 3px solid var(--cbgrt-accent);
	outline: 3px solid color-mix(in srgb, var(--cbgrt-accent) 60%, white);
	outline-offset: 3px;
}

.cbgrt-card[hidden] {
	display: none !important;
}

.cbgrt-card {
	background: var(--cbgrt-card-bg);
	border: 1px solid var(--cbgrt-border);
	border-radius: 8px;
	box-shadow: var(--cbgrt-shadow);
	box-sizing: border-box;
	color: var(--cbgrt-card-text);
	display: block;
	font-family: inherit;
	font-size: 0.96rem;
	font-style: normal;
	font-weight: 400;
	left: 0;
	letter-spacing: normal;
	line-height: 1.5;
	max-width: calc(100vw - 24px);
	padding: 18px 20px 17px;
	position: absolute;
	text-align: left;
	text-transform: none;
	top: calc(100% + 10px);
	transform: translateX(var(--cbgrt-shift-x, 0));
	white-space: normal;
	width: 360px;
	z-index: 99999;
}

.cbgrt-card.cbgrt-card--above {
	bottom: calc(100% + 10px);
	top: auto;
}

.cbgrt-card::before {
	background: var(--cbgrt-card-bg);
	border-left: 1px solid var(--cbgrt-border);
	border-top: 1px solid var(--cbgrt-border);
	content: "";
	height: 12px;
	left: calc(18px - var(--cbgrt-shift-x, 0));
	position: absolute;
	top: -7px;
	transform: rotate(45deg);
	width: 12px;
}

.cbgrt-card.cbgrt-card--above::before {
	border: 0;
	border-bottom: 1px solid var(--cbgrt-border);
	border-right: 1px solid var(--cbgrt-border);
	bottom: -7px;
	top: auto;
}

.cbgrt-card__eyebrow,
.cbgrt-card__title,
.cbgrt-card__definition,
.cbgrt-card__use {
	display: block;
}

.cbgrt-card__eyebrow {
	color: var(--cbgrt-accent);
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin-bottom: 3px;
	text-transform: uppercase;
}

.cbgrt-card__title {
	font-size: 1.2em;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 8px;
}

.cbgrt-card__definition {
	margin-bottom: 10px;
}

.cbgrt-card__use {
	border-top: 1px solid var(--cbgrt-border);
	font-size: 0.92em;
	margin-top: 10px;
	padding-top: 10px;
}

.cbgrt-card__label {
	font-weight: 700;
}

.cbgrt-card__cta,
.cbgrt-entry__article-link a {
	color: var(--cbgrt-accent);
	display: inline-block;
	font-weight: 700;
	margin-top: 13px;
	text-decoration: none;
}

.cbgrt-card__cta:hover,
.cbgrt-entry__article-link a:hover {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.cbgrt-entry__lead {
	border-left: 4px solid var(--cbgrt-accent);
	font-size: 1.18em;
	line-height: 1.55;
	margin: 0 0 1.2em;
	padding: 0.45em 0 0.45em 1em;
}

.cbgrt-entry__aliases {
	font-size: 0.94em;
	margin-bottom: 1.5em;
}

.cbgrt-entry__section {
	margin: 1.8em 0;
}

.cbgrt-entry__section h2,
.cbgrt-entry__sources h2 {
	margin-bottom: 0.55em;
}

.cbgrt-entry__sources {
	border-top: 1px solid var(--cbgrt-border);
	margin-top: 2.2em;
	padding-top: 1.2em;
}

.cbgrt-index__search {
	margin: 0 0 1.4rem;
}

.cbgrt-index__search label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.45rem;
}

.cbgrt-index__search input {
	background: #fff;
	border: 1px solid var(--cbgrt-border);
	border-radius: 5px;
	box-sizing: border-box;
	color: inherit;
	font: inherit;
	max-width: 620px;
	padding: 0.75rem 0.9rem;
	width: 100%;
}

.cbgrt-index__letters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 2rem;
}

.cbgrt-index__letters a {
	align-items: center;
	border: 1px solid var(--cbgrt-border);
	border-radius: 4px;
	color: inherit;
	display: inline-flex;
	font-size: 0.88rem;
	font-weight: 700;
	height: 2rem;
	justify-content: center;
	text-decoration: none;
	width: 2rem;
}

.cbgrt-index__letters a:hover {
	background: var(--cbgrt-accent);
	border-color: var(--cbgrt-accent);
	color: #fff;
}

.cbgrt-index__group {
	border-top: 1px solid var(--cbgrt-border);
	margin: 2rem 0;
	padding-top: 1rem;
}

.cbgrt-index__group > h2 {
	color: var(--cbgrt-accent);
	font-size: 1.7rem;
	margin: 0 0 0.8rem;
}

.cbgrt-index__group ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cbgrt-index__item {
	border-bottom: 1px solid var(--cbgrt-border);
	padding: 1rem 0;
}

.cbgrt-index__item h3 {
	font-size: 1.08rem;
	margin: 0 0 0.28rem;
}

.cbgrt-index__item p {
	margin: 0;
}

.cbgrt-index__badge {
	background: color-mix(in srgb, var(--cbgrt-accent) 14%, transparent);
	border-radius: 999px;
	color: var(--cbgrt-accent);
	display: inline-block;
	font-size: 0.67em;
	letter-spacing: 0.07em;
	margin-left: 0.4em;
	padding: 0.22em 0.55em;
	text-transform: uppercase;
	vertical-align: 0.15em;
}

/* Shared Scripture reader. */
.cbrt-reader[hidden] {
	display: none !important;
}

.cbrt-reader {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 1000000;
}

.cbrt-reader__backdrop {
	background: rgba(5, 12, 22, 0.78);
	inset: 0;
	position: absolute;
}

.cbrt-reader__dialog {
	background: #fffdf8;
	border: 1px solid rgba(185, 151, 77, 0.55);
	border-radius: 12px;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
	box-sizing: border-box;
	color: #172334;
	display: flex;
	flex-direction: column;
	font-family: inherit;
	max-height: min(86vh, 900px);
	max-width: 920px;
	overflow: hidden;
	position: relative;
	width: 100%;
	z-index: 1;
}

.cbrt-reader__dialog:focus {
	outline: none;
}

.cbrt-reader__header {
	align-items: flex-start;
	background: #0b1628;
	color: #fff;
	display: flex;
	gap: 24px;
	justify-content: space-between;
	padding: 20px 24px 18px;
}

.cbrt-reader__eyebrow {
	color: #d9bb78;
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	margin-bottom: 2px;
	text-transform: uppercase;
}

.cbrt-reader__header h2 {
	color: #fff;
	font-size: clamp(1.35rem, 3vw, 1.9rem);
	line-height: 1.2;
	margin: 0;
}

.cbrt-reader__close {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.38);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 1.65rem;
	height: 38px;
	justify-content: center;
	line-height: 1;
	padding: 0 0 3px;
	width: 38px;
}

.cbrt-reader__close:hover,
.cbrt-reader__close:focus-visible {
	background: #b9974d;
	border-color: #b9974d;
	color: #0b1628;
}

.cbrt-reader__status {
	font-size: 1rem;
	padding: 32px 24px;
}

.cbrt-reader__status--error {
	color: #8b1e1e;
}

.cbrt-reader__content {
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
}

.cbrt-reader__tabs {
	background: #f4efe3;
	border-bottom: 1px solid rgba(23, 35, 52, 0.16);
	display: flex;
	gap: 4px;
	padding: 10px 16px 0;
	position: sticky;
	top: 0;
	z-index: 2;
}

.cbrt-reader__tabs button {
	background: transparent;
	border: 0;
	border-bottom: 3px solid transparent;
	color: #26364b;
	cursor: pointer;
	font: inherit;
	font-size: 0.94rem;
	font-weight: 700;
	margin: 0;
	padding: 10px 14px 9px;
}

.cbrt-reader__tabs button[aria-selected="true"] {
	background: #fffdf8;
	border-bottom-color: #b9974d;
	color: #0b1628;
}

.cbrt-reader__tabs button:focus-visible,
.cbrt-reader__actions button:focus-visible,
.cbrt-reader__footer a:focus-visible {
	outline: 3px solid #b9974d;
	outline-offset: 2px;
}

.cbrt-reader__panels {
	font-size: 1.03rem;
	line-height: 1.7;
	padding: 22px 24px 14px;
}

.cbrt-reader__panels [role="tabpanel"]:focus {
	outline: none;
}

.cbrt-reader__verse {
	display: grid;
	gap: 12px;
	grid-template-columns: 48px minmax(0, 1fr);
	margin: 0 0 0.9em;
}

.cbrt-reader__verse-number {
	color: #8a692f;
	font-size: 0.78em;
	font-weight: 700;
	padding-top: 0.25em;
	text-align: right;
}

.cbrt-reader__verse-text[lang="grc"],
.cbrt-reader__verse-text[lang="he"] {
	font-family: "SBL Greek", "SBL Hebrew", "Noto Serif Hebrew", "Times New Roman", serif;
	font-size: 1.18em;
	line-height: 1.8;
}

.cbrt-reader__verse-text[dir="rtl"] {
	text-align: right;
}

.cbrt-reader__unavailable {
	color: #6c7078;
	font-family: inherit !important;
	font-size: 0.94em !important;
	font-style: italic;
}

.cbrt-reader__parallel-row {
	border-bottom: 1px solid rgba(23, 35, 52, 0.16);
	margin-bottom: 22px;
	padding-bottom: 20px;
}

.cbrt-reader__parallel-row:last-child {
	border-bottom: 0;
	margin-bottom: 0;
}

.cbrt-reader__parallel-row h3 {
	color: #8a692f;
	font-size: 0.88rem;
	letter-spacing: 0.04em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.cbrt-reader__parallel-columns {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cbrt-reader__parallel-columns > div {
	min-width: 0;
}

.cbrt-reader__parallel-columns h4 {
	color: #0b1628;
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.cbrt-reader__parallel-columns p {
	margin: 0;
}

.cbrt-reader__parallel-columns p[lang="grc"],
.cbrt-reader__parallel-columns p[lang="he"] {
	font-family: "SBL Greek", "SBL Hebrew", "Noto Serif Hebrew", "Times New Roman", serif;
	font-size: 1.15em;
	line-height: 1.8;
}

.cbrt-reader__parallel-columns p[dir="rtl"] {
	text-align: right;
}

.cbrt-reader__actions {
	align-items: center;
	border-top: 1px solid rgba(23, 35, 52, 0.16);
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 24px;
	padding: 16px 0;
}

.cbrt-reader__actions button {
	background: #0b1628;
	border: 1px solid #0b1628;
	border-radius: 5px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 0.83rem;
	font-weight: 700;
	padding: 8px 11px;
}

.cbrt-reader__actions button:hover {
	background: #b9974d;
	border-color: #b9974d;
	color: #0b1628;
}

.cbrt-reader__copy-status {
	color: #35623b;
	font-size: 0.86rem;
	font-weight: 700;
	min-height: 1em;
}

.cbrt-reader__footer {
	background: #f4efe3;
	border-top: 1px solid rgba(23, 35, 52, 0.12);
	font-size: 0.78rem;
	line-height: 1.45;
	padding: 13px 24px 15px;
}

.cbrt-reader__footer p {
	margin: 0 0 6px;
}

.cbrt-reader__footer a {
	color: #76571f;
	font-weight: 700;
	text-decoration: none;
}

.cbrt-reader__footer a:hover {
	text-decoration: underline;
}

.cbrt-reader-open {
	overflow: hidden;
}

@media (max-width: 560px) {
	.cbgrt-card {
		font-size: 0.92rem;
		padding: 16px;
		width: min(330px, calc(100vw - 24px));
	}

	.cbrt-reader {
		align-items: flex-end;
		padding: 0;
	}

	.cbrt-reader__dialog {
		border-bottom: 0;
		border-left: 0;
		border-radius: 12px 12px 0 0;
		border-right: 0;
		max-height: 94vh;
	}

	.cbrt-reader__header {
		padding: 16px 17px 14px;
	}

	.cbrt-reader__tabs {
		overflow-x: auto;
		padding-left: 8px;
		padding-right: 8px;
	}

	.cbrt-reader__tabs button {
		flex: 0 0 auto;
		font-size: 0.86rem;
		padding-left: 10px;
		padding-right: 10px;
	}

	.cbrt-reader__panels {
		padding: 18px 16px 10px;
	}

	.cbrt-reader__verse {
		gap: 8px;
		grid-template-columns: 38px minmax(0, 1fr);
	}

	.cbrt-reader__parallel-columns {
		gap: 15px;
		grid-template-columns: 1fr;
	}

	.cbrt-reader__actions {
		margin: 0 16px;
	}

	.cbrt-reader__footer {
		padding-left: 16px;
		padding-right: 16px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.cbgrt-card:not([hidden]) {
		animation: cbgrt-card-in 130ms ease-out;
	}

	@keyframes cbgrt-card-in {
		from {
			opacity: 0;
			transform: translateX(var(--cbgrt-shift-x, 0)) translateY(3px);
		}
		to {
			opacity: 1;
			transform: translateX(var(--cbgrt-shift-x, 0)) translateY(0);
		}
	}
}
