/**
 * 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, the
 *      latest-prayer block and the archive card.
 *   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);
}

.od-bible-passage__link {
	color: var(--od-color-purple);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.od-bible-passage__link:hover,
.od-bible-passage__link:focus {
	color: var(--od-color-wwl-orange);
	text-decoration-thickness: 2px;
}

/* Single prayer — sits below the content, separated from it. */
.od-bible-passage--single {
	margin-top: 2em;
	padding-top: 1em;
	border-top: 1px solid var(--od-color-light-gray);
	font-size: 1em;
}

/* Latest-prayer block — inside a compact card, so tighter. */
.od-bible-passage--block {
	margin-top: 0.75em;
}

/* Archive card — plain text under the title. Deliberately quiet: it is
   supporting metadata, not a call to action. */
.od-bible-passage--archive {
	margin: 0.25em 0 0;
	font-size: 0.85em;
	color: var(--od-color-dark-gray);
}

/* ═══════════════════════════════════════════════════════════════════════
 * 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-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;
}
