/* ============================================================
   WordPress Bible Web — Feuille de style publique
   ============================================================ */

:root {
	--wbw-primary:    #2c5f8a;
	--wbw-primary-dk: #1e4266;
	--wbw-accent:     #c8a951;
	--wbw-bg:         #fdfaf5;
	--wbw-border:     #d9cdb8;
	--wbw-text:       #2e2a24;
	--wbw-muted:      #7a7265;
	--wbw-radius:     6px;
}

/* ---- Conteneur principal ---- */
.wbw-reader {
	font-family: "Inter", sans-serif;
	font-weight: bold;
	color: var(--wbw-text);
	background: var(--wbw-bg);
	border: 1px solid var(--wbw-border);
	border-radius: 0;
	box-sizing: border-box;
	width: auto;
	min-width: 0;
	max-width: 100%;
	overflow-x: hidden;
	overflow-y: visible;
	margin: 25px;
}

.wbw-reader *,
.wbw-reader *::before,
.wbw-reader *::after {
	box-sizing: border-box;
}

/* ---- Espace personnel ---- */
.wbw-library,
.wbw-account-prompt {
	padding: 16px;
	background: #fff;
	border-bottom: 1px solid var(--wbw-border);
}

.wbw-library-header,
.wbw-account-prompt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.wbw-library-eyebrow {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	color: var(--wbw-muted);
}

.wbw-account-prompt strong,
.wbw-account-prompt span {
	display: block;
}

.wbw-account-prompt span {
	margin-top: 3px;
	font-size: 13px;
	font-weight: 500;
	color: var(--wbw-muted);
}

.wbw-account-actions {
	display: flex;
	gap: 8px;
}

.wbw-account-link {
	color: var(--wbw-primary);
	font-size: 13px;
	text-decoration: none;
}

.wbw-account-link-primary {
	padding: 7px 11px;
	background: var(--wbw-primary);
	color: #fff;
	border-radius: var(--wbw-radius);
}

.wbw-library-tabs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
	margin-top: 14px;
	border-bottom: 1px solid var(--wbw-border);
}

.wbw-library-tab {
	display: block;
	padding: 8px 10px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: transparent;
	color: var(--wbw-muted);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
}

.wbw-reader .wbw-library-tab:hover,
.wbw-reader .wbw-library-tab:focus,
.wbw-reader .wbw-library-tab:active,
.wbw-reader .wbw-library-tab.is-active {
	background: transparent;
	box-shadow: none;
}

.wbw-reader .wbw-library-tab:hover {
	color: var(--wbw-primary);
}

.wbw-library-tab.is-active {
	border-bottom-color: var(--wbw-primary);
	color: var(--wbw-primary);
}

.wbw-library-tab span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	margin-left: 4px;
	padding: 0 5px;
	background: #edf3f8;
	border-radius: 11px;
}

.wbw-library-panel {
	padding-top: 10px;
}

.wbw-library-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	max-height: 250px;
	overflow-y: auto;
}

.wbw-library-empty {
	grid-column: 1 / -1;
	margin: 2px 0;
	color: var(--wbw-muted);
	font-size: 13px;
	font-weight: 500;
}

.wbw-library-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 32px;
	border: 1px solid var(--wbw-border);
	border-left: 5px solid var(--highlight-color, var(--wbw-primary));
	border-radius: var(--wbw-radius);
	background: #fff;
	overflow: hidden;
}

.wbw-library-jump {
	min-width: 0;
	padding: 10px;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.wbw-library-jump strong,
.wbw-library-jump span,
.wbw-library-jump small {
	display: block;
}

.wbw-library-jump strong {
	color: var(--wbw-primary);
	font-size: 12px;
}

.wbw-library-jump span {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wbw-library-jump small {
	margin-top: 5px;
	color: var(--wbw-muted);
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wbw-library-remove {
	border: 0;
	border-left: 1px solid var(--wbw-border);
	background: #fff;
	color: var(--wbw-muted);
	font-size: 20px;
	cursor: pointer;
}

.wbw-library-remove:hover {
	background: #f8eaea;
	color: #9d2424;
}

/* ---- Page Mon Espace Bible ---- */
.wbw-dashboard {
	box-sizing: border-box;
	width: min(1120px, calc(100% - 32px));
	margin: 32px auto;
	padding: 24px;
	border: 1px solid var(--wbw-border);
	background: #fff;
	color: var(--wbw-text);
	font-family: "Inter", sans-serif;
	font-weight: bold;
}

.wbw-dashboard *,
.wbw-dashboard *::before,
.wbw-dashboard *::after {
	box-sizing: border-box;
}

.wbw-dashboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	color: var(--wbw-text);
}

.wbw-back-reader,
.wbw-dashboard-login a {
	display: inline-flex;
	align-items: center;
	padding: 9px 13px;
	background: var(--wbw-primary);
	color: #fff;
	font-size: 13px;
	text-decoration: none;
}

.wbw-dashboard .wbw-library-tabs {
	margin-top: 24px;
}

.wbw-library-search {
	margin-top: 24px;
}

.wbw-library-search label {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
}

.wbw-library-search input[type="search"] {
	display: block;
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid var(--wbw-border);
	border-radius: 0;
	background: #fff;
	color: var(--wbw-text);
	font: inherit;
	font-size: 14px;
}

.wbw-library-search input[type="search"]:focus {
	border-color: var(--wbw-primary);
	box-shadow: 0 0 0 2px rgba(43, 101, 143, 0.16);
	outline: 0;
}

.wbw-library-search-status {
	min-height: 18px;
	margin: 6px 0 0;
	color: var(--wbw-muted);
	font-size: 12px;
	font-weight: 500;
}

.wbw-dashboard .wbw-library-tab:hover,
.wbw-dashboard .wbw-library-tab:focus,
.wbw-dashboard .wbw-library-tab:active,
.wbw-dashboard .wbw-library-tab.is-active {
	background: transparent;
	box-shadow: none;
}

.wbw-dashboard .wbw-library-tab.is-active {
	border-bottom-color: var(--wbw-primary);
	color: var(--wbw-primary);
}

.wbw-dashboard .wbw-library-panel {
	padding-top: 18px;
}

.wbw-dashboard .wbw-library-list,
.wbw-dashboard .wbw-notes-list {
	max-height: none;
}

.wbw-dashboard-login {
	width: min(720px, calc(100% - 32px));
	margin: 32px auto;
	padding: 24px;
	border: 1px solid var(--wbw-border);
	font-family: "Inter", sans-serif;
}

.wbw-new-note,
.wbw-note-save {
	padding: 8px 12px;
	border: 0;
	border-radius: var(--wbw-radius);
	background: var(--wbw-primary);
	color: #fff;
	font: bold 13px "Inter", sans-serif;
	cursor: pointer;
}

.wbw-note-editor {
	display: grid;
	gap: 7px;
	margin-bottom: 12px;
	padding: 12px;
	border: 1px solid var(--wbw-border);
	background: #f8fafc;
}

.wbw-note-editor[hidden] {
	display: none;
}

.wbw-note-editor label {
	font-size: 12px;
}

.wbw-note-editor input,
.wbw-note-editor textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--wbw-border);
	border-radius: var(--wbw-radius);
	background: #fff;
	font: 500 14px/1.5 "Inter", sans-serif;
}

.wbw-note-editor textarea {
	resize: vertical;
}

.wbw-note-editor-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 3px;
}

.wbw-note-cancel {
	padding: 8px 12px;
	border: 1px solid var(--wbw-border);
	border-radius: var(--wbw-radius);
	background: #fff;
	color: var(--wbw-text);
	font: bold 13px "Inter", sans-serif;
	cursor: pointer;
}

.wbw-notes-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin-top: 10px;
	max-height: 300px;
	overflow-y: auto;
}

.wbw-note-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 32px;
	border: 1px solid var(--wbw-border);
	border-left: 5px solid var(--wbw-primary);
	border-radius: var(--wbw-radius);
	background: #fff;
	overflow: hidden;
}

.wbw-note-edit {
	min-width: 0;
	padding: 10px;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.wbw-note-edit strong,
.wbw-note-edit span {
	display: block;
}

.wbw-note-edit strong {
	color: var(--wbw-primary);
	font-size: 13px;
}

.wbw-note-edit span {
	margin-top: 5px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wbw-note-delete {
	border: 0;
	border-left: 1px solid var(--wbw-border);
	background: #fff;
	color: var(--wbw-muted);
	font-size: 20px;
	cursor: pointer;
}

.wbw-note-delete:hover {
	background: #f8eaea;
	color: #9d2424;
}

/* ---- Barre de navigation ---- */
.wbw-nav {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	padding: 14px 16px;
	background: #000;
	border-radius: 0;
	box-shadow: 0 1px 8px rgba(0, 40, 90, 0.12);
	color: #fff;
}

.wbw-nav-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: flex-end;
	gap: 8px 12px;
	width: 100%;
}

.wbw-nav-row-top {
	display: grid;
	grid-template-columns: minmax(220px, 2fr) minmax(220px, 1.3fr) minmax(140px, 0.9fr) auto;
	align-items: end;
	gap: 8px 12px;
}

.wbw-nav-row-top .wbw-nav-group {
	min-width: 0;
}

.wbw-nav-row-top .wbw-select {
	width: 100%;
}

.wbw-nav-row-bottom {
	width: 100%;
}

.wbw-nav-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wbw-nav label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: rgba(255,255,255,.75);
	font-family: sans-serif;
}

.wbw-select {
	font-size: 14px;
	padding: 5px 8px;
	border: 1px solid var(--wbw-primary-dk);
	border-radius: var(--wbw-radius);
	background: #fff;
	color: var(--wbw-text);
	min-width: 160px;
}

/* ---- Boutons ---- */
.wbw-btn {
	padding: 6px 14px;
	border: none;
	border-radius: var(--wbw-radius);
	cursor: pointer;
	font-size: 14px;
	font-family: sans-serif;
	line-height: 1.2;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}

.wbw-btn-arrow {
	background: var(--wbw-primary);
	color: #FFFFFF;
	font-size: 18px;
	padding: 8px 14px;
}
.wbw-btn-arrow:hover { background: var(--wbw-primary-dk); }

.wbw-nav-arrows {
	flex-direction: row;
	gap: 6px;
	align-items: flex-end;
}

/* ---- Recherche ---- */
.wbw-search-group {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
}

.wbw-search-input {
	padding: 8px 12px;
	border: 1px solid var(--wbw-primary-dk);
	border-radius: var(--wbw-radius) 0 0 var(--wbw-radius);
	font-size: 16px;
	min-width: 0;
	width: auto;
	flex: 1 1 auto;
	max-width: 100%;
}

.wbw-btn-search {
	background: var(--wbw-primary);
	color: #FFFFFF;
	border-radius: 0 var(--wbw-radius) var(--wbw-radius) 0;
	padding: 8px 16px;
	font-size: 16px;
	line-height: 1.2;
}
.wbw-btn-search:hover { background: var(--wbw-primary-dk); }

/* ---- Zone de contenu ---- */
.wbw-content-area {
	padding: 20px 24px;
	min-height: 300px;
	position: relative;
}

/* ---- Entête du passage ---- */
.wbw-passage-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--wbw-accent);
}

#wbw-passage-label {
	font-size: 1.25em;
	font-weight: bold;
	color: var(--wbw-primary);
}

.wbw-version-badge {
	background: var(--wbw-primary);
	color: #fff;
	font-size: 11px;
	font-family: sans-serif;
	padding: 2px 8px;
	border-radius: 20px;
}

.wbw-speech {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) auto;
	align-items: end;
	gap: 8px 12px;
	margin: 0 0 16px;
	padding: 12px;
	border: 1px solid var(--wbw-border);
	background: #f7f9fa;
}

.wbw-speech-voice label {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
}

.wbw-speech-voice .wbw-select {
	width: 100%;
	min-width: 0;
}

.wbw-speech-actions {
	display: flex;
	gap: 6px;
}

.wbw-speech-toggle,
.wbw-speech-stop {
	min-height: 35px;
	background: var(--wbw-primary);
	color: #fff;
}

.wbw-speech-stop {
	background: #555;
}

.wbw-speech button:disabled,
.wbw-speech select:disabled {
	cursor: not-allowed;
	opacity: .55;
}

.wbw-speech-status {
	grid-column: 1 / -1;
	min-height: 17px;
	margin: 0;
	color: var(--wbw-muted);
	font-size: 12px;
	font-weight: 500;
}

/* ---- Spinner ---- */
.wbw-spinner {
	display: none;
	align-items: center;
	gap: 10px;
	color: var(--wbw-muted);
	font-family: sans-serif;
	font-size: 14px;
}
.wbw-spinner.is-loading { display: flex; }

.wbw-spinner-icon {
	display: inline-block;
	width: 20px; height: 20px;
	border: 3px solid var(--wbw-border);
	border-top-color: var(--wbw-primary);
	border-radius: 50%;
	animation: wbw-spin .7s linear infinite;
}
@keyframes wbw-spin { to { transform: rotate(360deg); } }

/* ---- Versets ---- */
.wbw-verses {
	display: block;
	visibility: visible;
	font-size: 1.05em;
	min-height: 120px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.wbw-verses-table {
	width: 100%;
	border: 0;
	border-collapse: separate;
	border-spacing: 0 4px;
	table-layout: fixed;
}

.wbw-verse {
	border: 0;
}

.wbw-verse-num {
	width: 30px;
	padding: 3px 8px 0 0;
	border: 0;
	font-size: .75em;
	color: var(--wbw-muted);
	font-family: sans-serif;
	line-height: 1.9;
	text-align: right;
	vertical-align: top;
	-webkit-user-select: none;
	user-select: none;
}

.wbw-verse-text {
	padding: 0;
	border: 0;
	line-height: 1.9;
	vertical-align: top;
}

.wbw-verse-text.is-highlighted {
	background: var(--highlight-color);
	box-shadow: 4px 0 0 var(--highlight-color), -2px 0 0 var(--highlight-color);
}

.wbw-verse-actions {
	width: 66px;
	padding: 0 0 0 8px;
	border: 0;
	vertical-align: top;
	white-space: nowrap;
}

.wbw-verse-action {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid transparent;
	background: transparent;
	color: var(--wbw-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.wbw-verse-action:hover,
.wbw-verse-action:focus,
.wbw-verse-action:active,
.wbw-verse-action.is-active {
	background: transparent;
	box-shadow: none;
	color: var(--wbw-primary);
}

.wbw-verse-action:focus-visible {
	border-color: var(--wbw-primary);
	outline: 0;
}

/* ---- Éditeur d'annotation ---- */
.wbw-annotation-dialog {
	width: min(500px, calc(100% - 32px));
	padding: 0;
	border: 1px solid var(--wbw-border);
	border-radius: 8px;
	color: var(--wbw-text);
	font-family: "Inter", sans-serif;
}

.wbw-annotation-dialog::backdrop {
	background: rgba(0, 0, 0, .55);
}

.wbw-annotation-dialog form {
	padding: 18px;
}

.wbw-dialog-header,
.wbw-dialog-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wbw-dialog-header span,
.wbw-dialog-header strong {
	display: block;
}

.wbw-dialog-header span {
	font-size: 11px;
	text-transform: uppercase;
	color: var(--wbw-muted);
}

.wbw-dialog-close {
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	font-size: 24px;
	cursor: pointer;
}

.wbw-color-picker {
	margin: 18px 0;
	padding: 0;
	border: 0;
}

.wbw-color-picker legend,
.wbw-note-label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
}

.wbw-color-swatch {
	width: 34px;
	height: 34px;
	margin-right: 6px;
	border: 2px solid transparent;
	border-radius: 50%;
	background: var(--swatch-color);
	cursor: pointer;
}

.wbw-color-swatch.is-selected {
	border-color: #000;
	box-shadow: 0 0 0 2px #fff inset;
}

#wbw-annotation-note {
	box-sizing: border-box;
	width: 100%;
	padding: 10px;
	border: 1px solid var(--wbw-border);
	border-radius: var(--wbw-radius);
	font: 500 14px/1.5 "Inter", sans-serif;
	resize: vertical;
}

.wbw-dialog-actions {
	margin-top: 16px;
}

.wbw-dialog-delete,
.wbw-dialog-save {
	padding: 9px 14px;
	border: 0;
	border-radius: var(--wbw-radius);
	cursor: pointer;
	font: bold 13px "Inter", sans-serif;
}

.wbw-dialog-delete {
	background: transparent;
	color: #9d2424;
}

.wbw-dialog-save {
	margin-left: auto;
	background: var(--wbw-primary);
	color: #fff;
}

/* ---- Résultats de recherche ---- */
.wbw-search-results {
	display: none;
}
.wbw-search-results.is-open {
	display: block;
}

.wbw-search-results h3 {
	font-size: 1em;
	font-family: sans-serif;
	color: var(--wbw-muted);
	margin-bottom: 12px;
}

.wbw-result-item {
	border: 1px solid var(--wbw-border);
	border-radius: var(--wbw-radius);
	padding: 10px 14px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: background .1s;
}
.wbw-result-item:hover { background: #f0e9d8; }

.wbw-result-ref {
	font-family: sans-serif;
	font-size: 12px;
	color: var(--wbw-primary);
	font-weight: bold;
	margin-bottom: 4px;
}

.wbw-result-text {
	font-size: .95em;
	line-height: 1.5;
}

.wbw-result-text mark {
	background: #ffe88a;
	color: inherit;
	border-radius: 2px;
}

/* ---- Navigation bas ---- */
.wbw-nav-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	border-top: 1px solid var(--wbw-border);
	background: #f5f0e8;
}

.wbw-chapter-indicator {
	font-family: sans-serif;
	font-size: 13px;
	color: var(--wbw-muted);
}

.wbw-nav-bottom .wbw-btn-arrow {
	background: var(--wbw-primary);
	color: #FFFFFF;
	font-size: 14px;
	padding: 6px 14px;
}
.wbw-nav-bottom .wbw-btn-arrow:hover { background: var(--wbw-primary-dk); }

/* ---- Notice ---- */
.wbw-notice {
	padding: 12px 16px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: var(--wbw-radius);
	font-family: sans-serif;
}

/* ---- Responsive tablette ---- */
@media (max-width: 900px) {
	.wbw-reader {
		width: calc(100% - 24px);
		max-width: calc(100% - 24px);
		margin: 12px;
	}
	.wbw-nav-row-top {
		display: flex;
		grid-template-columns: none;
	}
	.wbw-nav-row {
		flex-direction: column;
		align-items: stretch;
	}
	.wbw-nav-row-top .wbw-select {
		min-width: 0;
		width: 100%;
		max-width: 100%;
	}
	.wbw-nav-arrows { align-self: stretch; }
	.wbw-nav-arrows .wbw-btn { flex: 1 1 50%; }
}

/* ---- Responsive mobile ---- */
@media (max-width: 640px) {
	.wbw-dashboard {
		width: 100%;
		margin: 12px 0;
		padding: 14px;
		border-right: 0;
		border-left: 0;
	}
	.wbw-dashboard-header {
		align-items: flex-start;
		flex-direction: column;
	}
	.wbw-library-header,
	.wbw-account-prompt { align-items: flex-start; flex-direction: column; }
	.wbw-library-list,
	.wbw-notes-list { grid-template-columns: 1fr; }
	.wbw-account-actions { width: 100%; }
	.wbw-library {
		padding: 12px;
	}
	.wbw-library-tabs {
		gap: 0;
	}
	.wbw-library-tab {
		padding: 8px 3px;
		font-size: 11px;
	}
	.wbw-library-tab span {
		min-width: 19px;
		height: 19px;
		margin-left: 2px;
		padding: 0 4px;
	}
	.wbw-reader {
		width: 100%;
		max-width: 100%;
		margin: 8px 0;
		border-right: 0;
		border-left: 0;
		border-radius: 0;
	}
	.wbw-nav { padding: 12px; border-radius: 0; }
	.wbw-search-input { min-width: 0; flex: 1; }
	.wbw-btn-search { padding-right: 10px; padding-left: 10px; font-size: 14px; }
	.wbw-content-area { padding: 14px; }
	.wbw-speech { grid-template-columns: 1fr; }
	.wbw-speech-actions .wbw-btn { flex: 1 1 50%; }
}
