/**
 * Urdu Poetry Manager — front-end styles (pothwarnama / rekhta inspired)
 */

.upm-poetry,
.urdu-poetry.upm-poetry {
	direction: rtl;
	text-align: right;
	max-width: var(--upm-max-width, 420px);
	margin: 1.5rem auto;
	padding: 1.25rem 1.5rem;
	box-sizing: border-box;
	unicode-bidi: embed;
}

/* Justified misra lines (each مصرع full width, both edges aligned) */
.upm-layout-justified .upm-misra {
	margin: 0;
	padding: 0;
	line-height: 1.65;
	text-align: justify;
	text-justify: inter-word;
}

.upm-layout-justified .upm-misra::after {
	content: "";
	display: inline-block;
	width: 100%;
}

/* Couplet (شعر) spacing */
.upm-sher {
	margin-bottom: 1.25rem;
}

.upm-sher:last-child {
	margin-bottom: 0.5rem;
}

/* Centered layout */
.upm-layout-centered {
	text-align: center;
}

.upm-layout-centered .upm-misra {
	text-align: center;
}

.upm-layout-centered .upm-misra::after {
	display: none;
}

/* Rekhta-style card */
.upm-layout-rekhta {
	background: #f9f9f9;
	border-right: 3px solid #c4c4c4;
	border-radius: 8px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.upm-layout-rekhta .upm-misra {
	text-align: justify;
	text-justify: inter-word;
	line-height: 1.5;
}

.upm-layout-rekhta .upm-misra::after {
	content: "";
	display: inline-block;
	width: 100%;
}

/* Radif / matla */
.upm-poetry-meta {
	font-size: 0.85em;
	color: #666;
	margin-bottom: 1rem;
	text-align: center;
}

.upm-poetry-meta .upm-radif,
.upm-poetry-meta .upm-matla {
	display: block;
}

/* Poet attribution — left aligned like classic sites */
.upm-shayar-name,
.shayar-name.upm-shayar-name {
	text-align: left;
	direction: ltr;
	font-style: italic;
	margin-top: 1rem;
	font-size: 1rem;
	color: #444;
}

.upm-shayar-name a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
}

.upm-shayar-name a:hover {
	color: #1a1a1a;
}

.upm-pen {
	font-style: normal;
}

/* Poet archive */
.upm-poet-header {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.upm-poet-photo img {
	border-radius: 50%;
	max-width: 120px;
	height: auto;
}

.upm-poet-title {
	margin: 0 0 0.5rem;
	font-size: 1.75rem;
}

.upm-poet-dates {
	margin: 0;
	color: #555;
}

.upm-poet-poems-list .upm-poem-card {
	margin-bottom: 3rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #eee;
}

.upm-poet-poems-list .upm-poem-card:last-child {
	border-bottom: none;
}

.upm-poem-card-title {
	font-size: 1.1rem;
	margin: 0 0 1rem;
}

.upm-poem-card-title a {
	text-decoration: none;
}

/* Poets grid shortcode */
.upm-poets-grid {
	display: grid;
	gap: 1.5rem;
	margin: 2rem 0;
}

.upm-poets-grid.upm-cols-1 { grid-template-columns: 1fr; }
.upm-poets-grid.upm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.upm-poets-grid.upm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.upm-poets-grid.upm-cols-4 { grid-template-columns: repeat(4, 1fr); }

.upm-poet-card {
	text-align: center;
	padding: 1rem;
	border: 1px solid #eee;
	border-radius: 8px;
}

.upm-poet-card h3 {
	margin: 0.75rem 0 0;
	font-size: 1rem;
}

.upm-poet-card img {
	border-radius: 50%;
	max-width: 80px;
	height: auto;
}

@media (max-width: 640px) {
	.upm-poetry,
	.urdu-poetry.upm-poetry {
		max-width: 100%;
		padding: 1rem;
	}

	.upm-poets-grid.upm-cols-2,
	.upm-poets-grid.upm-cols-3,
	.upm-poets-grid.upm-cols-4 {
		grid-template-columns: 1fr;
	}
}
