$epub-verse: true !default;
@if $epub-verse {

	// Verse, poetry, lyrics

	.verse {
		text-indent: 0;
		margin: $line-height-default 0;
	}
	.verse + p {
		text-indent: 0; // Paragraphs after verse should be flush left
	}
	ul.verse {
		list-style-type: none;
		padding: 0;
		margin: $line-height-default 0;
	}
	// Hanging indent for runover lines
	ul.verse li {
		text-indent: -2em;
		margin-left: 2em;
	}

	// Indents for lines of verse.
	// In markdown, add {:.indent-x} to the start of the list item text,
	// e.g. -	{:.indent-3}My line of poetry indented by three ems.

	@for $i from 1 through 60 {
		$add-margin: $i + 2em;
		ul.verse li.indent-#{$i} { margin-left: $add-margin; }
	}

	/* Verse in a blockquote centres on its longest line, which is best-practice poetry layout */
	blockquote.verse {
		color: inherit;
		margin-top: 0;
		width: 100%;
	    padding: 0;
	}
	blockquote.verse h1, 
	blockquote.verse h2,
	blockquote.verse h3, 
	blockquote.verse h4,
	blockquote.verse h5, 
	blockquote.verse h6 {
		margin-bottom: 1em;
	}
	blockquote.verse ul {
		margin-bottom: 0; /* Already gets its space after from ul.verse */
	}

	// We originally included this to center poems on their longest line. But on small screens it's unnecessary.
	// blockquote.verse {
	//     text-align: center;
	// }
	// blockquote.verse ul.verse {
	//     text-align: left;
	//     display: inline-block;
	//     min-width: 51%; // Ensures verses with short lines don't end up floating side by side
	// }

	/* If verse is in a list, we can preserve line breaks and white space */
	ul.verse li {
		white-space: pre-wrap;
	}
	ul.verse li h1,
	ul.verse li h2,
	ul.verse li h3,
	ul.verse li h4,
	ul.verse li h5,
	ul.verse li h6 {
		display: inline; // To avoid pre-wrap line breaks inside the li
	}
	// Override indents applied to .verse li
	ul.verse li h1 { margin-left: -1.75em; }
	ul.verse li h2 { margin-left: -2.25em; }
	ul.verse li h3 { margin-left: -3em; }
	ul.verse li h4 { margin-left: -3.5em; }
	ul.verse li h5 { margin-left: -4.25em; }
	ul.verse li h6 { margin-left: -5em; }

	// If a line is blank it's an empty list item. That will collapse away by default, so we add a blank line back in.
	ul.verse li:empty {
	    line-height: 100%; // On screens, this keeps line heights consistent. Don't use this in print where baseline grid is important.
	}
	ul.verse li:empty:after {
		content: " ";
	}

}