/* main bible verse, text formatting */
.section,
.chapter {
	line-height: 1.8;
}

	.compact-ui .section,
	.compact-ui .chapter {
		line-height: 1.5;
	}

.section p,
.section div.p,
.chapter div.p {
	text-indent: 1em;
	margin: 0;
}

.section ins {
	text-decoration: none;
	font-style: italic;
}

.chapter-num {
	float: left;
	font-size: 2em;
	line-height: 1;
	margin: 0 .25em .5em 0;
}

.chapter-num + p {
	text-indent: 0;
}

.chapter[dir=rtl] .chapter-num {
	float: right;
	margin: 0 0 .5em .5em;
}

.verse-num,
.v-num {
	font-weight: bold;
	font-size: 70%;
	vertical-align: top;
	color: #333;
	font-family: Avenir, helvetica;
}


/* notes and cross references */
.note,
.cf {
	display: inline;
}

.note .key,
.cf .key {
	vertical-align: top;
	font-size: 60%;
	font-weight: normal;
	font-style: normal;
	color: #7491CE;
	cursor: pointer;
	display: inline;
	text-decoration: none;
}

.note  +.note,
.note + .cf,
.cf + .note,
.cf + .cf {
	padding-left: 0.20em;
}


	.compact-ui .note  +.note,
	.compact-ui .note + .cf,
	.compact-ui .cf + .note,
	.compact-ui .cf + .cf {
		padding-left: 0.50em;
	}


.chapter .note .key:hover,
.chapter .cf.key:hover {
	color: #fff;
	background: #33C;
}

.chapter .note .text,
.chapter .cf .text {
	display: none;
}

.document-footer .cf .key,
.document-footer .note .key {
	display: inline;
	vertical-align: top;
	font-size: 8px;
	font-weight: bold;
	color: #33C;
}

.text .notetype {
	font-weight: bold;
	font-style: italic;
}

.bibleref
/*, .xt */{
	color: #7491CE;
	cursor: pointer;
}

.bibleref:hover
/* ,.xt:hover */ {
	text-decoration: underline;
}

/* Gospels red letters */
.woc,
.wj {
	color: #A00;
}

.yhwh,
.nog {
	font-variant: small-caps;
}

.chapter .note .text,
.chapter .cf .text,
#search-results .note,
#search-results .cf {
	display: none;
}

/* most books */
.section .c,
.section .chapter-num,
.section .c-num {
	float: left;
	font-size: 2em;
	line-height: 1;
	font-weight: bold;
	margin-top: 0;
	margin-bottom: 0;
	margin-right: .2em;
	font-family: avenir, helvetica;
}

[dir=rtl] .c,
[dir=rtl] .section .chapter-num,
[dir=rtl] .section .c-num {
	float: right;
	margin-right: 0;
	margin-left: .2em;
}

div.c + div.p,
.chapter-num + div.p {
	text-indent: 0!important;
}

div.c + div.q {
	clear: both;
}

.v-1 {
	display: none;
}

/* Psalms */
.PS .c {
	font-size: 1.2em;
	margin-top: 2em;
	text-align: center;
	float: none;
}

.PS .v-1 {
	display: inline;
}

div.c + div.q .v-1 {
	display: inline;
}

/* Psalms: Simple fixed-width solution for decorative initials */
.PS .decorative-initial-container {
	float: left;
	margin: 0 15px 20px 0;
	width: 115px;
}

.PS .decorative-initial-container + span.v {
	display: inline;
	padding-left: 130px; /* Fixed left padding to clear the decorative initial */
	line-height: 1.8;
}

.v {
	padding: .3em 0;
}


.section[lang=he] .p,
.chapter[lang=he] .p,
.section[lang=heb] .p,
.chapter[lang=heb] .p {
	font-size: 125%;
}


.windows-container .section[lang=he],
.windows-container [lang=he],
.windows-container .section[lang=heb],
.windows-container [lang=heb] {
	font-family: 'SBL Hebrew', EzraSIL;
}


.windows-container .section[lang=grc],
.windows-container [lang=grc],
.windows-container .section[lang=el],
.windows-container [lang=el] {
	font-family: GentiumPlus, 'Gentium Plus';
}


/* put chapter on other side */
.section[dir=rtl] .c,
.section[dir=rtl] .c {
	float: right;
	margin-right: 0;
	margin-left: .2em;
}



h3.is1,
div.s,
div.is1 {
	color: #333;
	font-weight: bold;
	margin-top: 1em;
}

.PS .s,
.PS .ms {
	text-align: center;
}

.q, .q1 {
	padding-left: 3em!important;
	text-indent: -1.5em!important;
	position: relative;
}

.q2 {
	padding-left: 4em!important;
	text-indent: -1.5em!important;
	position: relative;
}

.q .verse-num,
.q .v-num {
	position: absolute;
	display: block;
	width: 2em;
	text-align: right;
	top: 0;
	left: 0;
}

.qs {
	text-align: right;
	font-style: italic;
}

.c + .p,
.c + p {
	margin-top: 0;
	text-indent: 0;
}

.d {
	font-size: .8em;
	text-align: center;
}

/* USFM */
.mt {
	display: block;
	text-align: center;
	font-size: 2em;
	margin-top: 3em;
	margin-bottom: 1em;
	line-height: 1.2;
}

.mt2,
.mt3 {
	display: block;
	text-align: center;
	font-size: 1.4em;
	margin-top: 3em;
	line-height: 1.2;
}

.mt2 + .mt,
.mt3 + .mt,
.mt2 + .mt3,
.mt2 + .mt2 {
	margin-top: 0;
}

/* introduction */
.is {
	margin-top: 1em;
	text-align: center;
}

.ip {
	line-height: 1.4;
	font-size: .9em;
	text-indent: 1.5em;
}

/* commentaries */
.comm-v-num {
	font-weight: bold;
	display: block;
	margin: 3em 0 0;
}

.commentary {
	line-height: 1.5;
	font-size: .9em;
}

/* Decorative images for biblical books */
.decorative-image {
	text-align: center;
	margin: 40px auto;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.decorative-image.book-end {
	margin: 40px auto;
	padding: 0;
	text-align: center;
}

.decorative-image img.book-ornament {
	max-width: 200px;
	max-height: 150px;
	width: auto;
	height: auto;
	display: block;
	margin: 40px auto;
	opacity: 0.85;
	transition: all 0.3s ease;
	
	/* Default theme - clean integration */
	filter: none;
}

/* Sepia theme adaptation */
.theme-sepia .decorative-image img.book-ornament {
	filter: sepia(50%) saturate(0.8) brightness(0.9) contrast(1.2);
	opacity: 0.75;
}

/* Dark theme adaptation */
.theme-dark .decorative-image img.book-ornament {
	filter: invert(1) sepia(20%) saturate(0.3) brightness(0.8);
	opacity: 0.7;
}

.decorative-image img.book-ornament:hover {
	opacity: 1;
	transform: scale(1.02);
}

/* Responsive adjustments for decorative images */
@media (max-width: 768px) {
	.decorative-image img.book-ornament {
		max-width: 160px;
		max-height: 120px;
		margin: 30px auto;
	}
}

@media (max-width: 480px) {
	.decorative-image img.book-ornament {
		max-width: 140px;
		max-height: 100px;
		margin: 25px auto;
	}
}

/* Print optimization */
@media print {
	.decorative-image img.book-ornament {
		max-width: 150px;
		margin: 20px auto;
		filter: none !important;
		opacity: 0.9 !important;
		break-inside: avoid;
		page-break-inside: avoid;
	}
}

/* Decorative initial letters for chapter beginnings */
.decorative-initial-container {
	float: left;
	margin: 0 25px 20px 0;
	line-height: 1;
	shape-outside: circle(50%);
	position: relative;
	z-index: 1;
}

/* Special styling when verse number precedes decorative initial */
.v-num + .decorative-initial-container {
	margin-left: 0;
	clear: none;
}

/* Complex decorative initial for first chapters */
.decorative-initial.complex {
	width: 115px;
	height: 180px;
	display: block;
	opacity: 0.9;
	transition: all 0.3s ease;
	
	/* Default theme - clean integration */
	filter: none;
}

/* Simple decorative initial for subsequent chapters */
.decorative-initial.simple {
	width: 108px;
	height: 180px;
	display: block;
	opacity: 0.9;
	transition: all 0.3s ease;
	
	/* Default theme - clean integration */
	filter: none;
}

/* Default decorative initial (backward compatibility) */
.decorative-initial {
	width: 115px;
	height: 180px;
	display: block;
	opacity: 0.9;
	transition: all 0.3s ease;
	
	/* Default theme - clean integration */
	filter: none;
}

/* Sepia theme adaptation for initials */
.theme-sepia .decorative-initial,
.theme-sepia .decorative-initial.complex,
.theme-sepia .decorative-initial.simple {
	filter: sepia(40%) saturate(0.9) brightness(0.95) contrast(1.1);
	opacity: 0.85;
}

/* Dark theme adaptation for initials */
.theme-dark .decorative-initial,
.theme-dark .decorative-initial.complex,
.theme-dark .decorative-initial.simple {
	filter: invert(1) sepia(15%) saturate(0.4) brightness(0.85);
	opacity: 0.8;
}

.decorative-initial:hover,
.decorative-initial.complex:hover,
.decorative-initial.simple:hover {
	opacity: 1;
	transform: scale(1.05);
}

/* Ensure proper text wrapping around the initial */
.decorative-initial-container + .c {
	margin-left: 0;
	clear: none;
}

.decorative-initial-container + .c + div.p {
	text-indent: 0 !important;
	margin-top: 0;
}

/* Responsive adjustments for decorative initials */
@media (max-width: 768px) {
	.decorative-initial {
		width: 92px;
		height: 144px;
	}
	
	.decorative-initial.complex {
		width: 92px;
		height: 144px;
	}
	
	.decorative-initial.simple {
		width: 86px;
		height: 144px;
	}
	
	.decorative-initial-container {
		margin: 0 18px 15px 0;
	}
}

@media (max-width: 480px) {
	.decorative-initial {
		width: 69px;
		height: 108px;
	}
	
	.decorative-initial.complex {
		width: 69px;
		height: 108px;
	}
	
	.decorative-initial.simple {
		width: 65px;
		height: 108px;
	}
	
	.decorative-initial-container {
		margin: 0 15px 12px 0;
	}
}

/* Print optimization for initials */
@media print {
	.decorative-initial {
		width: 58px;
		height: 90px;
		filter: none !important;
		opacity: 0.95 !important;
		break-inside: avoid;
		page-break-inside: avoid;
	}
	
	.decorative-initial.complex {
		width: 58px;
		height: 90px;
	}
	
	.decorative-initial.simple {
		width: 54px;
		height: 90px;
	}
	
	.decorative-initial-container {
		margin: 0 10px 8px 0;
	}
}

/* Book header ornaments and titles */
.book-header {
	display: grid !important;
	place-items: center !important;
	text-align: center !important;
	margin: 60px 0 40px 0 !important;
	padding: 0 !important;
	width: 100% !important;
	clear: both !important;
	grid-template-columns: 1fr !important;
}

.book-header-ornament {
	display: block !important;
	text-align: center !important;
	margin: 0 !important;
	width: 100% !important;
	justify-self: center !important;
}

.book-header-ornament img {
	max-width: 600px; /* Increased from 400px */
	width: 95%; /* Increased from 90% */
	height: auto;
	display: block;
	margin: 0 auto;
	opacity: 0.9;
	transition: all 0.3s ease;
	
	/* Default theme - clean integration */
	filter: none;
}

.book-header-title {
	font-family: Cambria, Georgia, serif !important; /* Explicitly set to match your config */
	font-size: 1.8em !important;
	font-weight: normal !important;
	text-align: center !important;
	color: #222 !important;
	letter-spacing: 1px !important;
	margin: 20px 0 0 0 !important;
	line-height: 1.4 !important;
	display: block !important;
	width: 100% !important;
	padding: 0 !important;
	justify-self: center !important;
	align-self: center !important;
}

/* Sepia theme adaptation for book headers */
.theme-sepia .book-header-ornament img {
	filter: sepia(60%) saturate(0.8) brightness(0.9) contrast(1.3);
	opacity: 0.8;
}

.theme-sepia .book-header-title {
	color: #4a3c28;
}

/* Dark theme adaptation for book headers */
.theme-dark .book-header-ornament img {
	filter: invert(1) sepia(25%) saturate(0.3) brightness(0.85);
	opacity: 0.75;
}

.theme-dark .book-header-title {
	color: #e8e8e8;
}

.book-header-ornament img:hover {
	opacity: 1;
	transform: scale(1.01);
}

/* Responsive adjustments for book headers */
@media (max-width: 768px) {
	.book-header {
		margin: 40px auto 30px;
	}
	
	.book-header-ornament img {
		max-width: 480px; /* Increased from 320px */
		width: 90%; /* Increased from 85% */
	}
	
	.book-header-title {
		font-size: 1.5em;
		letter-spacing: 0.8px;
		margin: 15px auto 30px;
		width: 100%;
		text-align: center !important;
	}
}

@media (max-width: 480px) {
	.book-header {
		margin: 30px auto 25px;
	}
	
	.book-header-ornament img {
		max-width: 380px; /* Increased from 280px */
		width: 85%; /* Increased from 80% */
	}
	
	.book-header-title {
		font-size: 1.3em;
		letter-spacing: 0.5px;
		margin: 12px auto 25px;
		line-height: 1.3;
		width: 100%;
		text-align: center !important;
	}
}

/* Print optimization for book headers */
@media print {
	.book-header {
		margin: 30px auto 20px;
		break-inside: avoid;
		page-break-inside: avoid;
	}
	
	.book-header-ornament img {
		max-width: 450px; /* Increased from 300px */
		filter: none !important;
		opacity: 0.95 !important;
	}
	
	.book-header-title {
		font-size: 1.4em;
		color: #000 !important;
		letter-spacing: 1px;
		margin: 10px auto 15px;
		width: 100%;
		text-align: center !important;
	}
}
