/* ==========================================================================
   Breakeven Theme — Poetry Formatting
   The core stylesheet for displaying poetry in all its forms.
   ========================================================================== */

/* --- Poem Container --- */
.poem-container {
	display: flex;
	justify-content: center;
}

.poem-body {
	display: inline-block;
	font-family: var(--font-poem);
	font-size: 1.3125rem;
	line-height: 1.7;
	text-align: left;
	max-width: 36em;
	width: 100%;
	padding: 0 1.5rem;
}

/* --- Stanzas --- */
.poem-body p,
.poem-body .stanza {
	margin-top: 0;
	margin-bottom: 0;
}

.poem-body p + p,
.poem-body .stanza + .stanza {
	margin-top: 1.5em;
}

/* --- Hanging Indents ---
   When a long line wraps on a narrow screen, the continuation
   is indented so the reader can tell where the poet's line
   begins vs. where the browser wrapped it. */
.poem-body p,
.poem-body .poem-line {
	text-indent: -2em;
	padding-left: 2em;
}

/* --- Verse Block Integration ---
   WordPress core/verse block outputs <pre>. We restyle it
   to match our poem formatting. */
.poem-body pre {
	font-family: var(--font-poem);
	font-size: inherit;
	line-height: inherit;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	color: inherit;
	text-indent: -2em;
	padding-left: 2em;
}

/* --- Relative Indentation Classes ---
   For poems that require specific indentation patterns. */
.indent-1 { margin-left: 1em; }
.indent-2 { margin-left: 2em; }
.indent-3 { margin-left: 3em; }
.indent-4 { margin-left: 4em; }
.indent-5 { margin-left: 5em; }
.indent-6 { margin-left: 6em; }
.indent-7 { margin-left: 7em; }
.indent-8 { margin-left: 8em; }

/* --- Dropcap --- */
.poem-body.dropcap > p:first-of-type::first-letter,
.poem-body.dropcap > pre:first-of-type::first-letter {
	font-size: 3.5em;
	float: left;
	line-height: 0.8;
	margin-right: 0.08em;
	margin-top: 0.05em;
	font-weight: 600;
	color: var(--accent);
}

/* --- Poem Title (single view) --- */
.poem-title {
	font-family: var(--font-poem);
	font-size: 2.25rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: 0.25em;
	color: var(--text-primary);
	text-align: center;
}

/* --- Poem Subtitle / Form Label --- */
.poem-form-label {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	text-align: center;
	margin-bottom: 2rem;
}

/* --- Epigraph / Dedication --- */
.poem-epigraph {
	font-family: var(--font-poem);
	font-style: italic;
	font-size: 1rem;
	color: var(--text-muted);
	margin: 0 auto 2.5em;
	max-width: 28em;
	text-align: center;
	border: none;
	padding: 0;
}

.poem-epigraph p {
	text-indent: 0;
	padding-left: 0;
	margin-bottom: 0.3em;
}

.poem-epigraph cite {
	display: block;
	font-style: normal;
	font-size: 0.85em;
	color: var(--text-muted);
}

.poem-epigraph cite::before {
	content: '\2014\00a0';
}

/* ==========================================================================
   Form-Specific Modifiers
   ========================================================================== */

/* --- Haiku: extra breathing room, centered --- */
.poem-body--haiku {
	font-size: 1.5rem;
	line-height: 2;
	text-align: center;
	max-width: 20em;
}

.poem-body--haiku p,
.poem-body--haiku pre {
	text-indent: 0;
	padding-left: 0;
}

/* --- Sonnet: slightly tighter width --- */
.poem-body--sonnet {
	max-width: 30em;
}

/* --- Concrete poetry: monospace, preserve all spacing --- */
.poem-body--concrete {
	font-family: 'Courier New', Courier, monospace;
	white-space: pre;
	line-height: 1.4;
	font-size: 1.125rem;
}

.poem-body--concrete p,
.poem-body--concrete pre {
	text-indent: 0;
	padding-left: 0;
	white-space: pre;
}

/* --- Prose poem: flush paragraphs, no hanging indent --- */
.poem-body--prose-poem {
	max-width: 32em;
}

.poem-body--prose-poem p,
.poem-body--prose-poem pre {
	text-indent: 0;
	padding-left: 0;
}

.poem-body--prose-poem p + p {
	text-indent: 1.5em;
	margin-top: 0;
}

/* --- Ghazal: couplet spacing --- */
.poem-body--ghazal p + p {
	margin-top: 2em;
}

/* ==========================================================================
   Poem Card (Archive/Feed Listing)
   ========================================================================== */
.poem-card {
	padding: 1.75rem 0;
	border-bottom: 1px solid var(--border);
}

.poem-card:first-child {
	padding-top: 0;
}

.poem-card__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.poem-card__title {
	font-family: var(--font-poem);
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}

.poem-card__title a {
	color: var(--text-primary);
	transition: color 0.2s ease;
}

.poem-card__title a:hover {
	color: var(--accent);
}

.poem-card__date {
	font-size: 0.8125rem;
	color: var(--text-muted);
	white-space: nowrap;
	flex-shrink: 0;
}

.poem-card__excerpt {
	margin-top: 0.5rem;
	font-family: var(--font-poem);
	font-style: italic;
	color: var(--text-secondary);
	font-size: 1rem;
	line-height: 1.5;
}

.poem-card__excerpt p {
	margin-bottom: 0;
	text-indent: 0;
	padding-left: 0;
}

.poem-card__meta {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 0.75rem;
}

/* ==========================================================================
   Poem Navigation (Previous / Next)
   ========================================================================== */
.poem-navigation {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
	max-width: 36em;
	margin: 4rem auto 0;
	padding: 2rem 1.5rem 0;
	border-top: 1px solid var(--border);
}

.poem-navigation__link {
	flex: 1;
}

.poem-navigation__link--next {
	text-align: right;
}

.poem-navigation__label {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	margin-bottom: 0.25rem;
}

.poem-navigation__title {
	font-family: var(--font-poem);
	font-size: 1.125rem;
	color: var(--accent);
}

.poem-navigation__title:hover {
	color: var(--accent-hover);
}

/* ==========================================================================
   Single Poem Layout
   ========================================================================== */
.poem-single {
	text-align: center;
	padding: 2rem 0 4rem;
}

.poem-single__header {
	margin-bottom: 3rem;
}

.poem-single__content {
	text-align: left;
}

.poem-single__footer {
	margin-top: 3rem;
	text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
	.poem-body {
		font-size: 1.125rem;
		line-height: 1.6;
		padding: 0 1rem;
	}

	.poem-body p,
	.poem-body .poem-line,
	.poem-body pre {
		text-indent: -1.5em;
		padding-left: 1.5em;
	}

	.poem-title {
		font-size: 1.75rem;
	}

	.poem-body--haiku {
		font-size: 1.25rem;
	}

	.poem-navigation {
		flex-direction: column;
		gap: 1.5rem;
	}

	.poem-navigation__link--next {
		text-align: left;
	}

	.indent-5,
	.indent-6,
	.indent-7,
	.indent-8 {
		margin-left: 3em;
	}
}
