/**
 * Open Doors - Bible passage reference.
 *
 * Two unrelated concerns share this file because they share a lifecycle:
 * the frontend citation and the editor meta box are added, changed and
 * removed together, and the whole thing is under 200 lines.
 *
 *   1. FRONTEND - .od-bible-passage, rendered by
 *      od_bible_render_reference() on the single prayer (paragraph),
 *      the latest-prayer block meta line (chip), and archive cards
 *      (chip, unlinked - see archive-part-prayer.php).
 *   2. EDITOR - the meta boxes on the prayer edit screen (admin only).
 */

/* ═══════════════════════════════════════════════════════════════════════
 * FRONTEND - the citation
 * ═══════════════════════════════════════════════════════════════════════ */

.od-bible-passage {
	margin: 1.5em 0 0;
	font-size: 0.95em;
	line-height: 1.4;
	color: var(--od-color-purple);
}

/* Inline editor - read-only passage surface (translations workbench). */
.od-bible-passage-quote {
	background-color: var(--od-color-light-gray);
	padding: calc(15px + 1vw) calc(10px + 2vw);
	font-size: 16px;
	border-radius: 10px;
	text-align: center;
	font-family: "futura-pt", sans-serif;
}

.od-bible-passage-quote .od-meta-chip {
	margin-bottom: 1em;
}

.od-bible-passage-quote__text {
	font-size: 18px;
	font-family: "futura-pt", sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════
 * EDITOR - meta boxes
 * ═══════════════════════════════════════════════════════════════════════ */

.od-bible-box {
	padding: 4px 0;
}

.od-bible-box__intro {
	margin: 0 0 12px;
	color: var(--od-color-dark-gray);
}

.od-bible-passage-text__field {
	width: 100%;
	min-height: 6em;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	color: var(--od-color-dark-gray);
	font: inherit;
	line-height: 1.45;
	resize: vertical;
}

.od-bible-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 12px;
}

.od-bible-field__label {
	font-weight: 600;
}

.od-bible-field__select {
	max-width: 420px;
}

.od-bible-field__input {
	max-width: 160px;
}

.od-bible-field__input.has-error {
	border-color: var(--od-color-wwl-red);
	box-shadow: 0 0 0 1px var(--od-color-wwl-red);
}

.od-bible-field__help {
	margin: 0 0 8px;
	color: var(--od-color-dark-gray);
	font-style: italic;
}

.od-bible-field__error {
	margin: 0;
	color: var(--od-color-wwl-red);
	font-weight: 600;
}

/* Chapter grid. Psalms is the stress case at 150 buttons - the wrap plus
   a scroll ceiling keeps the meta box from swallowing the screen. */
.od-bible-chapters {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-height: 240px;
	overflow-y: auto;
	padding: 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
}

.od-bible-chapters__empty {
	margin: 0;
	padding: 4px;
	color: var(--od-color-dark-gray);
	font-style: italic;
}

.od-bible-chapter {
	min-width: 38px;
	padding: 6px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	background: var(--od-color-light-gray);
	color: var(--od-color-dark-gray);
	font-size: 13px;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
}

/* Colour and border only - never font-weight. A heavier weight would
   change the button's width and shuffle the whole grid on hover. */
.od-bible-chapter:hover {
	border-color: var(--od-color-purple);
	background: var(--od-color-cyan);
	color: var(--od-color-purple);
}

.od-bible-chapter:focus-visible {
	outline: 2px solid var(--od-color-purple);
	outline-offset: 1px;
}

.od-bible-chapter.is-selected {
	border-color: var(--od-color-purple);
	background: var(--od-color-purple);
	color: #fff;
}

.od-bible-preview {
	margin: 12px 0 0;
	color: var(--od-color-purple);
	font-size: 14px;
}
