/* The one-verse page (index.php?p=verse). It stands alone, without the
   reader's stylesheet, so it stays light to load. The look follows the
   reader's reading column: the Arabic large, the first translation as the
   main one, the others set apart under it. */

@font-face {
	font-family: Montserrat;
	src: url('theme/fonts/Montserrat-Regular.otf');
	font-display: swap;
}

@font-face {
	font-family: AdobeArabic;
	/* AdobeArabic-Arabic.woff2 is the same font cut down to its Arabic
	   characters (with every Arabic shaping and mark-placement feature) and
	   compressed: 60 KB instead of 376. It draws the Quran text pixel for
	   pixel as the full font does. Browsers too old for woff2 take the full
	   file. */
	src: url('theme/fonts/AdobeArabic-Arabic.woff2') format('woff2'),
	     url('theme/fonts/AdobeArabic-Regular.otf') format('opentype');
	font-display: swap;
}

@font-face {
	font-family: TrajanPro;
	src: url('theme/fonts/TrajanProBold.ttf');
	font-display: swap;
}

.verse-page {
	--vp-bg: #f5f5f5;
	--vp-bg-image: url('theme/bg.png');
	--vp-text: #333;
	--vp-muted: #666;
	--vp-accent: #198f9d;
	--vp-rule: #dcdcdc;
	--vp-line: #e3e8ea;
	--vp-card: rgba(255, 255, 255, 0.65);
}

.verse-page.night {
	--vp-bg: #1f282d;
	--vp-bg-image: url('theme/dark-bg.png');
	--vp-text: #fff;
	--vp-muted: #a9b4bb;
	--vp-accent: #4db8c7;
	--vp-rule: rgba(255, 255, 255, 0.12);
	--vp-line: rgba(255, 255, 255, 0.1);
	--vp-card: rgba(255, 255, 255, 0.04);
}

html {
	-webkit-text-size-adjust: 100%;
}

body.verse-page {
	margin: 0;
	min-height: 100vh;
	background-color: var(--vp-bg);
	background-image: var(--vp-bg-image);
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-size: cover;
	color: var(--vp-text);
	font-family: Montserrat, Arial, sans-serif;
	font-size: 16.6px;
	line-height: 1.75;
}

.vp-top {
	max-width: 760px;
	margin: 0 auto;
	padding: 14px 16px 0;
}

.vp-home {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--vp-accent);
	text-decoration: none;
	font-family: TrajanPro, Montserrat, serif;
	font-weight: bold;
	font-size: 18px;
}

.vp-home img {
	display: block;
	width: 40px;
	height: auto;
}

.vp-main {
	max-width: 760px;
	margin: 0 auto;
	padding: 8px 16px 48px;
}

.vp-head {
	text-align: center;
	padding: 18px 0 6px;
}

.vp-surah-ar {
	margin: 0;
	font-family: AdobeArabic, serif;
	font-size: 2em;
	line-height: 1.3;
	color: var(--vp-accent);
}

.vp-head h1 {
	margin: 4px 0 0;
	font-size: 1.5em;
	font-weight: normal;
	line-height: 1.3;
}

/* the surah's name links to its page: plain until hovered */
a.vp-surah {
	color: inherit;
	text-decoration: none;
}

a.vp-surah:hover,
a.vp-surah:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--vp-accent);
	text-underline-offset: 4px;
}

.vp-ref {
	color: var(--vp-accent);
	white-space: nowrap;
}

.vp-sub {
	margin: 6px 0 0;
	font-size: 0.85em;
	color: var(--vp-muted);
}

.vp-ar {
	margin: 24px 0 18px;
	font-family: AdobeArabic, serif;
	font-size: 2.2em;
	line-height: 1.8;
	text-align: right;
}

.vp-trs {
	padding-bottom: 8px;
}

.vp-tr {
	line-height: 1.75;
}

/* The first translation (the site's default) is the main one; the others
   are set apart under it, as in the reader */
.vp-tr + .vp-tr,
.vp-fold-row + .vp-tr {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed var(--vp-rule);
}

.vp-tr-name {
	margin: 0;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	line-height: 1.6;
	color: var(--vp-accent);
	opacity: 0.85;
}

.vp-tr-text {
	margin: 0;
	color: var(--vp-muted);
	font-style: italic;
}

.vp-trs > .vp-tr:first-child .vp-tr-text {
	color: var(--vp-text);
	font-style: normal;
}

/* Folded sections: the rest of the translations, and the commentary. A
   row that opens with a click; what it folds stays in the page, so search
   engines still read it. */
.vp-fold-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 16px;
	border: 1px solid var(--vp-line);
	border-radius: 10px;
	background-color: var(--vp-card);
	list-style: none;
	cursor: pointer;
	transition: border-color 0.15s;
}

.vp-fold-row::-webkit-details-marker {
	display: none;
}

.vp-fold-row:hover {
	border-color: var(--vp-accent);
}

.vp-fold-row:focus-visible {
	outline: 2px solid var(--vp-accent);
	outline-offset: 2px;
}

.vp-fold-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.vp-fold-title {
	color: var(--vp-accent);
	font-size: 0.9em;
	font-weight: bold;
	line-height: 1.5;
}

/* a chevron: down when folded, up when open */
.vp-fold-chev {
	flex: none;
	width: 7px;
	height: 7px;
	margin: -3px 2px 0 0;
	border-right: 1.5px solid var(--vp-accent);
	border-bottom: 1.5px solid var(--vp-accent);
	transform: rotate(45deg);
	transition: transform 0.2s;
}

.vp-fold[open] > .vp-fold-row .vp-fold-chev {
	margin-top: 3px;
	transform: rotate(-135deg);
}

.vp-more {
	margin-top: 16px;
}

.vp-more[open] > .vp-fold-row {
	margin-bottom: 4px;
}

/* Previous / Read in context / Next -- under the heading and again at the
   end of the page */
.vp-nav {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--vp-line);
	font-size: 0.85em;
	line-height: 1.4;
}

.vp-cm + .vp-nav,
.vp-trs + .vp-nav {
	margin-top: 28px;
	border-top: 1px solid var(--vp-line);
	border-bottom: 0;
}

.vp-nav-step {
	color: var(--vp-text);
	text-decoration: none;
}

.vp-nav-next {
	text-align: right;
}

.vp-nav-dir {
	color: var(--vp-muted);
}

.vp-nav-ref {
	color: var(--vp-accent);
	font-weight: bold;
}

.vp-nav-step:hover .vp-nav-dir,
.vp-nav-step:focus-visible .vp-nav-dir {
	color: var(--vp-text);
}

.vp-nav-read {
	padding: 7px 16px;
	border: 1px solid var(--vp-accent);
	border-radius: 999px;
	color: var(--vp-accent);
	text-decoration: none;
	white-space: nowrap;
}

.vp-nav-read:hover,
.vp-nav-read:focus-visible {
	background-color: var(--vp-accent);
	color: var(--vp-bg);
}

@media (max-width: 480px) {
	/* the words go, the arrows and verse numbers stay */
	.vp-nav-dir {
		font-size: 0;
	}

	/* the surah page's neighbours keep only their number */
	.sp-nav-name {
		display: none;
	}

	.vp-nav-prev .vp-nav-dir::before {
		content: '‹';
		font-size: 1.2rem;
	}

	.vp-nav-next .vp-nav-dir::after {
		content: '›';
		font-size: 1.2rem;
	}
}

/* The commentary, folded under the translations. Its row shows the start
   of the notes, until it is opened. */
.vp-cm {
	margin-top: 24px;
}

.vp-cm-preview {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.85em;
	line-height: 1.5;
	color: var(--vp-muted);
}

.vp-cm[open] .vp-cm-preview {
	display: none;
}

.vp-cm-part {
	padding: 16px 2px 0;
}

.vp-cm-range {
	margin: 0 0 8px;
	font-size: 0.85em;
	font-weight: bold;
	color: var(--vp-muted);
}

.vp-cm-body p {
	margin: 0 0 12px;
}

.vp-cm-body .vp-cm-ar {
	font-family: AdobeArabic, serif;
	font-size: 1.7em;
	line-height: 1.7;
	text-align: right;
}

/* The surah page (index.php?p=chapter): every verse, each a link to its
   own page */
.vp-nav-end {
	margin-top: 8px;
	border-top: 1px solid var(--vp-line);
	border-bottom: 0;
}

.sp-lang {
	margin: 14px 0 0;
	font-size: 0.8em;
	color: var(--vp-muted);
	text-align: center;
}

.sp-bismillah {
	padding: 18px 0 6px;
	text-align: center;
}

.sp-bismillah .sp-ar {
	text-align: center;
}

.sp-verses {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.sp-verses li + li {
	border-top: 1px solid var(--vp-line);
}

.sp-verse {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 -12px;
	padding: 16px 12px;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s;
}

.sp-verse:hover,
.sp-verse:focus-visible {
	background-color: var(--vp-card);
}

.sp-verse:focus-visible {
	outline: 2px solid var(--vp-accent);
	outline-offset: -2px;
}

.sp-num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 30px;
	padding: 0 4px;
	box-sizing: border-box;
	border: 1.5px solid var(--vp-accent);
	border-radius: 15px;
	color: var(--vp-accent);
	font-size: 0.75em;
	font-weight: bold;
}

.sp-body {
	flex: 1;
	min-width: 0;
}

.sp-ar {
	display: block;
	margin: 0 0 6px;
	font-family: AdobeArabic, serif;
	font-size: 1.8em;
	line-height: 1.8;
	text-align: right;
}

.sp-tr {
	display: block;
	margin: 0;
	line-height: 1.75;
}

.sp-tr-name {
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--vp-accent);
	opacity: 0.85;
}

.vp-missing {
	text-align: center;
	padding: 48px 0;
}

.vp-missing a {
	color: var(--vp-accent);
}

@media (max-width: 480px) {
	body.verse-page {
		font-size: 15.5px;
	}

	.vp-ar {
		font-size: 2em;
	}
}
