/* ===== Farooqi Writes - Poetry Engine =====
   Colors/sizes below read from CSS custom properties (--fpe-*), which the
   plugin writes dynamically from Settings > Poetry Engine. Change the look
   from the admin dashboard — you should never need to hand-edit this file
   on a new site. The value after the comma is the fallback if settings
   haven't been saved yet. */

:root {
	--fpe-primary: #5b3fa6;
	--fpe-primary-dark: #4a3a8a;
	--fpe-badge-bg: #f1ecff;
	--fpe-urdu-size: 26px;
	--fpe-urdu-line-height: 1.7;
	--fpe-card-radius: 16px;
	--fpe-roman-line-height: 1.6;
}

/* @font-face for the Urdu font is output from PHP (see fpe_font_face_css in
   farooqi-poetry-engine.php) together with a <link rel="preload">, so the font
   is fetched immediately instead of after this file is parsed. */

/* ---- Card base ---- */
.fpe-card {
	background: #fff;
	border: 1px solid #eee;
	border-radius: var(--fpe-card-radius, 16px);
	padding: 22px 24px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	position: relative;
	transition: box-shadow .25s ease, transform .25s ease;
}
.fpe-card:hover {
	box-shadow: 0 10px 28px rgba(0,0,0,0.10);
	transform: translateY(-2px);
}

.fpe-card-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
}
.fpe-badge, .fpe-count-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--fpe-badge-bg, #f1ecff);
	color: var(--fpe-primary, #5b3fa6);
}
.fpe-count-badge { background:#fff4e5; color:#b5600a; }

.fpe-urdu-text {
	font-family: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", serif;
	font-size: var(--fpe-urdu-size, 26px);
	line-height: var(--fpe-urdu-line-height, 1.7) !important;
	color: #1a1a2e;
	text-align: center;
	white-space: normal; /* line breaks come from nl2br(); pre-line was rendering stray template whitespace */
}
.fpe-ghazal-card .fpe-urdu-text { font-size: calc(var(--fpe-urdu-size, 26px) - 2px); }

/* Never justify: some themes set text-align:justify, which stretches Urdu letters with kashida */
.fpe-urdu-text, .fpe-urdu-text *, .fpe-roman-text, .fpe-roman-text * {
	text-align: center !important;
	text-align-last: center !important;
	text-justify: none !important;
}

/* One sher (2 lines) per block, spaced apart */
.fpe-sher-block { margin: 0 0 14px 0; }
.fpe-sher-block:last-child { margin-bottom: 0; }

/* Ghazal: remaining ashaar hidden until the card is expanded (Urdu and Roman together) */
.fpe-hidden-ashaar { display: none; margin-top: 14px; }
.fpe-expanded .fpe-hidden-ashaar { display: block; }

.fpe-roman-text {
	margin-top: 12px;
	font-size: 14px;
	line-height: var(--fpe-roman-line-height, 1.6);
	color: #555;
	text-align: center;
	white-space: normal;
}
.fpe-roman-text .fpe-sher-block { margin-bottom: 8px; }
.fpe-roman-text .fpe-sher-block:last-child { margin-bottom: 0; }

.fpe-card { display: flex; flex-direction: column; }

.fpe-expand-btn {
	display: block;
	margin: 12px auto 0;
	background: none;
	border: none;
	color: var(--fpe-primary, #5b3fa6);
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
}

/* ---- Actions row ---- */
.fpe-card-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;      /* pushes buttons to the card bottom so every card in a row lines up */
	padding-top: 18px;
	flex-wrap: wrap;
}
.fpe-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1px solid #e3ddf5;
	background: #f8f6ff;
	color: var(--fpe-primary-dark, #4a3a8a);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s ease, color .2s ease;
}
.fpe-action-btn:hover { background: var(--fpe-primary, #5b3fa6); color:#fff; border-color: var(--fpe-primary, #5b3fa6); }
.fpe-copy-btn.fpe-copied { background:#1fa855; color:#fff; border-color:#1fa855; }

/* ---- Toast ---- */
#fpeToast {
	position: fixed;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: #1a1a2e;
	color: #fff;
	padding: 10px 22px;
	border-radius: 999px;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
	z-index: 9999;
}
#fpeToast.show { opacity: 1; }

/* ---- Grid ---- */
/* data-cols is set by PHP: 3 for short sher cards, 2 for ghazal categories.
   Cards in a row stretch to the same height (align-items: stretch). */
.fpe-card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	align-items: stretch;
	gap: 24px;
	margin: 20px 0;
}
.fpe-card-grid[data-cols="1"] { grid-template-columns: 1fr; }
.fpe-card-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.fpe-card-grid > * { min-width: 0; }
@media (max-width: 992px) { .fpe-card-grid[data-cols="3"] { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .fpe-card-grid, .fpe-card-grid[data-cols] { grid-template-columns: 1fr; } }

/* ---- Archive hero ---- */
.fpe-archive-hero { text-align:center; padding: 50px 20px 20px; }
.fpe-archive-hero h1 { font-size: 32px; color:#1a1a2e; }
.fpe-archive-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; }
.fpe-pagination { text-align:center; margin-top: 30px; }
.fpe-pagination a, .fpe-pagination span { display:inline-block; margin:0 4px; padding:8px 14px; border-radius:8px; background: var(--fpe-badge-bg, #f1ecff); color: var(--fpe-primary, #5b3fa6); text-decoration:none; }
.fpe-pagination .current { background: var(--fpe-primary, #5b3fa6); color:#fff; }

/* ---- Single post ---- */
.fpe-single-hero { width: 100%; height: 450px; overflow: hidden; }
.fpe-single-hero img { width:100%; height:100%; object-fit: cover; }
@media (max-width: 767px) { .fpe-single-hero { height: 220px; } }
@media (max-width: 480px) { .fpe-single-hero { height: 190px; } }

.fpe-single-wrap { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.fpe-single-layout { display:grid; grid-template-columns: 2.2fr 1fr; gap: 40px; }
@media (max-width: 900px) { .fpe-single-layout { grid-template-columns: 1fr; } }

.fpe-single-content { max-width: 720px; }
.fpe-single-title { font-size: 28px; color:#1a1a2e; margin-bottom: 20px; }

.fpe-post-content { margin-top: 28px; font-size: 15px; line-height: 1.85; color:#444; }
.fpe-post-content strong, .fpe-post-content b { color:#1a1a2e; }
.fpe-post-content a { color: var(--fpe-primary, #5b3fa6); text-decoration: underline; }

.fpe-sidebar-widget { background:#faf9ff; border:1px solid #eee; border-radius:14px; padding:20px; }
.fpe-sidebar-widget h3 { margin-top:0; font-size:16px; color:#1a1a2e; }
.fpe-sidebar-widget ul { list-style:none; margin:0; padding:0; }
.fpe-sidebar-widget li { padding:8px 0; border-bottom:1px solid #eee; }
.fpe-sidebar-widget li a { color: var(--fpe-primary-dark, #4a3a8a); text-decoration:none; font-size:14px; }
.fpe-sidebar-widget li a:hover { color: var(--fpe-primary, #5b3fa6); }

/* ---- Contact form ---- */
.fpe-contact-form { max-width: 520px; }
.fpe-form-row { margin-bottom: 16px; }
.fpe-form-row label { display:block; margin-bottom:6px; font-weight:600; color:#1a1a2e; }
.fpe-form-row input, .fpe-form-row textarea {
	width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #ddd; font-size: 14px;
}
.fpe-submit-btn {
	background: linear-gradient(135deg, var(--fpe-primary, #5b3fa6), var(--fpe-primary-dark, #4a3a8a));
	color:#fff; border:none; padding: 12px 28px; border-radius: 999px;
	font-weight:600; cursor:pointer; font-size:14px;
}
.fpe-submit-btn:hover { opacity:.9; }
.fpe-form-status { margin-top: 12px; font-size: 13px; }