/* UrduPaper E-Paper frontend. All selectors are scoped to avoid theme collisions. */
.upep-site-main {
	width: 100%;
	max-width: 1320px;
	margin-inline: auto;
	padding: 24px 20px 48px;
}

.upep-root,
.upep-root *,
.upep-widget,
.upep-widget * {
	box-sizing: border-box;
}

.upep-root {
	--upep-accent: #f4ac04;
	--upep-toolbar: #333333;
	--upep-radius: 4px;
	position: relative;
	width: 100%;
	color: #222;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.5;
}

.upep-root [hidden],
.upep-widget [hidden] {
	display: none !important;
}

.upep-root a,
.upep-widget a {
	text-decoration: none;
}

.upep-root button,
.upep-root input,
.upep-widget button {
	font: inherit;
}

.upep-root button:focus-visible,
.upep-root a:focus-visible,
.upep-root input:focus-visible,
.upep-widget button:focus-visible,
.upep-widget a:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

.upep-page-header,
.upep-edition-header {
	margin: 0 0 20px;
	text-align: right;
}

.upep-page-header h1,
.upep-page-header h2,
.upep-edition-header h1 {
	margin: 0;
	color: #181818;
	font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 700;
	line-height: 1.35;
}

.upep-edition-cities {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.upep-edition-cities a {
	display: inline-flex;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f0f0f0;
	color: #333;
	font-size: 14px;
}

.epaper-container {
	padding-top: 4px;
}

.upep-root .epaper-control-row {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	padding: 5px;
	border-radius: var(--upep-radius);
	background: var(--upep-toolbar);
	box-shadow: 0 5px 5px rgb(0 0 0 / 30%);
	color: #fff;
	font-weight: 700;
}

.upep-root .epaper-buttons {
	position: relative;
	margin-inline: 10px;
	text-align: right;
}

.upep-root .upep-control-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 46px;
	padding: 10px 24px;
	border: 0;
	border-radius: var(--upep-radius);
	background: #050505;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
}

.upep-root .upep-control-button:hover {
	background: #171717;
	color: #fff;
}

.upep-root .dl-btn .upep-control-button {
	background: var(--upep-accent);
	color: #111;
}

.upep-root .posted-on {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 230px;
	min-height: 46px;
	margin-inline: 5px 10px;
	padding: 8px 14px;
	border-radius: var(--upep-radius);
	background: #fff;
	color: #333;
	font-family: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
}

.upep-root .epaper-nav-links {
	display: flex;
	gap: 8px;
	margin-inline-start: auto;
	text-align: left;
}

.upep-root .epaper-nav-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 46px;
	border-radius: var(--upep-radius);
	background: #050505;
	color: #fff;
	font-size: 28px;
	line-height: 1;
}

.upep-root .epaper-nav-links a:hover {
	background: var(--upep-accent);
	color: #111;
}

.upep-root .upep-dropdown {
	position: relative;
}

.upep-root .upep-dropdown-panel {
	position: absolute;
	top: calc(100% + 5px);
	right: 0;
	z-index: 1000;
	width: max-content;
	min-width: 190px;
	max-width: min(320px, 90vw);
	max-height: 360px;
	margin: 0;
	padding: 10px;
	overflow-y: auto;
	border: 1px solid #ddd;
	border-radius: var(--upep-radius);
	background: #f7f7f7;
	box-shadow: 0 8px 20px rgb(0 0 0 / 25%);
	list-style: none;
	text-align: right;
}

.upep-root .upep-dropdown-panel li {
	width: 100%;
	margin: 0;
	padding: 0;
}

.upep-root .upep-dropdown-panel li + li {
	border-top: 1px solid #e5e5e5;
}

.upep-root .upep-dropdown-panel a {
	display: block;
	width: 100%;
	padding: 8px 10px;
	background: transparent;
	color: #333;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	text-align: right;
}

.upep-root .upep-dropdown-panel a:hover,
.upep-root .upep-dropdown-panel a[aria-current="page"] {
	background: #e9e9e9;
	color: #000;
}

.upep-root .archive-controls .epaper-buttons {
	width: 180px;
	max-width: 180px;
}

.upep-root .archive-controls .upep-control-button {
	padding-inline: 15px;
}

.upep-root .epaper-search-box {
	position: relative;
	width: 50%;
	margin-inline-start: auto;
	padding-inline: 10px;
}

.upep-root .epaper-ajax-search {
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: var(--upep-radius);
	background: #fff;
	color: #222;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	direction: auto;
}

.upep-root .upep-search-results {
	position: absolute;
	top: calc(100% + 5px);
	left: 10px;
	z-index: 1001;
	width: calc(100% - 20px);
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: var(--upep-radius);
	background: #f7f7f7;
	box-shadow: 0 8px 20px rgb(0 0 0 / 25%);
	color: #333;
	direction: rtl;
}

.upep-root .upep-search-results > a {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px;
	border-radius: 3px;
	color: #222;
	text-align: right;
}

.upep-root .upep-search-results > a + a {
	border-top: 1px solid #e3e3e3;
}

.upep-root .upep-search-results > a:hover {
	background: #e7e7e7;
}

.upep-root .upep-search-results img {
	width: 46px;
	height: 58px;
	flex: 0 0 auto;
	object-fit: cover;
}

.upep-root .upep-search-results span {
	display: grid;
	min-width: 0;
}

.upep-root .upep-search-results strong,
.upep-root .upep-search-results small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.upep-root .upep-search-results small {
	color: #666;
	font-size: 12px;
}

.upep-root .upep-search-results p {
	margin: 0;
	padding: 10px;
	color: #333;
}

.upep-root .epaper-thumbs-nav {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	width: 100%;
	margin: 20px 0;
	padding: 10px 10px 16px;
	overflow-x: auto;
	overflow-y: hidden;
	border-radius: var(--upep-radius);
	background: #f0f0f0;
	scrollbar-width: thin;
}

.upep-root .epaper_nav_thumb {
	position: relative;
	display: block;
	width: 100px;
	min-width: 100px;
	margin: 0;
	padding: 0;
	overflow: visible;
	border: 5px solid #fff;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
}

.upep-root .epaper_nav_thumb.active {
	border-color: var(--upep-accent);
}

.upep-root .epaper_nav_thumb img {
	display: block;
	width: 100%;
	height: 116px;
	margin: 0;
	object-fit: cover;
}

.upep-root .epaper_nav_thumb .page-count {
	position: absolute;
	left: 0;
	bottom: 0;
	display: block;
	width: 100%;
	padding: 5px;
	background: rgb(0 0 0 / 78%);
	color: #fff;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 13px;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
}

.upep-root .epaper_nav_thumb .arrow-bottom {
	position: absolute;
	bottom: -19px;
	left: 50%;
	display: none;
	width: 0;
	height: 0;
	margin-left: -10px;
	border-width: 14px 10px 0;
	border-style: solid;
	border-color: var(--upep-accent) transparent transparent;
}

.upep-root .epaper_nav_thumb.active .arrow-bottom {
	display: block;
}

.upep-root .epaper-preview {
	position: relative;
	width: 100%;
	min-height: 420px;
	margin: 0;
	overflow: hidden;
	background: #eee;
	text-align: center;
}

.upep-root .epaper-preview > img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
}

.upep-root .upep-loading {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	background: rgb(0 0 0 / 72%);
	color: #fff;
	font-size: 18px;
}

.upep-root .upep-image-error {
	position: absolute;
	inset: 30px;
	z-index: 11;
	margin: 0;
	padding: 16px;
	border-radius: var(--upep-radius);
	background: #fff0f0;
	color: #8a1f11;
}

.upep-root .img-magnifier-glass {
	position: absolute;
	z-index: 5;
	width: min(500px, 48%);
	height: 200px;
	border: 3px solid #000;
	border-radius: 5px;
	background-color: #fff;
	background-repeat: no-repeat;
	box-shadow: 0 5px 18px rgb(0 0 0 / 40%);
	pointer-events: none;
}

.upep-root .upep-empty {
	margin: 20px 0;
	padding: 28px;
	border: 1px solid #ddd;
	border-radius: var(--upep-radius);
	background: #f7f7f7;
	font-size: 18px;
	text-align: center;
}

.upep-root .upep-archive-description {
	margin-top: 8px;
	color: #555;
}

.upep-root .upep-archive-grid {
	display: grid;
	grid-template-columns: repeat(var(--upep-columns, 4), minmax(0, 1fr));
	gap: 24px 18px;
	margin-top: 22px;
}

.upep-root.upep-columns-1 .upep-archive-grid {
	grid-template-columns: minmax(0, 1fr);
}

.upep-root.upep-columns-2 .upep-archive-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upep-root.upep-columns-3 .upep-archive-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.upep-root .upep-archive-card {
	min-width: 0;
	margin: 0;
	padding: 10px;
	border: 1px solid #e3e3e3;
	border-radius: var(--upep-radius);
	background: #fff;
	box-shadow: 0 2px 8px rgb(0 0 0 / 7%);
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.upep-root .upep-archive-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 7px 18px rgb(0 0 0 / 14%);
}

.upep-root .upep-card-cover {
	display: block;
	width: 100%;
	aspect-ratio: 320 / 420;
	overflow: hidden;
	background: #e9e9e9;
}

.upep-root .upep-card-cover img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.upep-cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 180px;
	background: linear-gradient(145deg, #efefef, #d4d4d4);
	color: #777;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: .08em;
}

.upep-root .upep-card-content {
	text-align: center;
}

.upep-root .upep-card-content h2 {
	margin: 10px 0 4px;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.upep-root .upep-card-content h2 a {
	color: #161616;
}

.upep-root .upep-card-content time {
	display: block;
	color: #707070;
	font-size: 13px;
}

.upep-root .upep-pagination {
	margin-top: 30px;
}

.upep-root .upep-pagination .nav-links,
.upep-root .upep-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.upep-root .upep-pagination a.page-numbers,
.upep-root .upep-pagination span.page-numbers,
.upep-root .upep-pagination .page-numbers a,
.upep-root .upep-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 6px 10px;
	border-radius: var(--upep-radius);
	background: #111;
	color: #fff;
}

.upep-root .upep-pagination .current {
	background: var(--upep-accent) !important;
	color: #111 !important;
}

.upep-comments {
	width: 100%;
	max-width: 1280px;
	margin: 30px auto 0;
}

/* Sidebar slider: visually compatible with the source theme without Owl Carousel. */
.upep-widget {
	--upep-accent: #f4ac04;
	--upep-radius: 4px;
	position: relative;
	width: 100%;
}

.upep-widget .upep-widget-slider {
	position: relative;
	width: 100%;
	height: auto;
	overflow: hidden;
	text-align: center;
}

.upep-widget .upep-widget-slide {
	width: 100%;
	margin: 0;
}

.upep-widget .upep-widget-cover {
	display: block;
	width: 100%;
	margin: 0 0 5px;
	aspect-ratio: 320 / 420;
	overflow: hidden;
	background: #eee;
}

.upep-widget .upep-widget-cover img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.upep-widget .upep-widget-slide h4 {
	margin: 5px 0;
	font-size: 22px;
	line-height: 1.35;
	text-align: center;
}

.upep-widget .upep-widget-slide h4 a {
	display: block;
	width: 100%;
	padding: 10px;
	border-radius: var(--upep-radius);
	background: #101010;
	color: #fff;
}

.upep-widget .upep-widget-nav {
	position: absolute;
	top: 45%;
	left: 0;
	display: flex;
	justify-content: space-between;
	width: 100%;
	pointer-events: none;
}

.upep-widget .upep-widget-nav button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 44px;
	padding: 0;
	border: 0;
	background: rgb(0 0 0 / 74%);
	color: #fff;
	cursor: pointer;
	font-size: 24px;
	pointer-events: auto;
}

.upep-widget .upep-widget-nav button:hover {
	background: var(--upep-accent);
	color: #111;
}

.upep-root .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 1024px) {
	.upep-root .upep-archive-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.upep-root.upep-columns-1 .upep-archive-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.upep-root.upep-columns-2 .upep-archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.upep-root .upep-control-button {
		padding-inline: 14px;
		font-size: 18px;
	}
}

@media (max-width: 768px) {
	.upep-site-main {
		padding: 16px 12px 36px;
	}

	.upep-root .epaper-control-row {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 10px;
	}

	.upep-root .epaper-control-row > *,
	.upep-root .archive-controls .epaper-buttons,
	.upep-root .epaper-search-box,
	.upep-root .posted-on,
	.upep-root .epaper-nav-links {
		width: 100%;
		max-width: none;
		margin: 0;
	}

	.upep-root .epaper-nav-links {
		justify-content: center;
	}

	.upep-root .epaper-nav-links a {
		width: 50%;
	}

	.upep-root .epaper-search-box {
		padding: 0;
	}

	.upep-root .upep-search-results {
		left: 0;
		width: 100%;
	}

	.upep-root .upep-dropdown-panel {
		position: static;
		width: 100%;
		max-width: none;
		margin-top: 5px;
	}

	.upep-root .upep-archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 12px;
	}

	.upep-root.upep-columns-1 .upep-archive-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.upep-root.upep-columns-3 .upep-archive-grid,
	.upep-root.upep-columns-4 .upep-archive-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.upep-root .epaper_nav_thumb {
		width: 95px;
		min-width: 95px;
	}

	.upep-root .epaper-preview {
		min-height: 180px;
	}

	.upep-root .img-magnifier-glass {
		display: none !important;
	}
}

@media (max-width: 480px) {
	.upep-root .upep-archive-grid,
	.upep-root.upep-columns-1 .upep-archive-grid,
	.upep-root.upep-columns-2 .upep-archive-grid,
	.upep-root.upep-columns-3 .upep-archive-grid,
	.upep-root.upep-columns-4 .upep-archive-grid {
		grid-template-columns: 1fr;
	}

	.upep-root .upep-archive-card {
		max-width: 360px;
		margin-inline: auto;
	}

	.upep-root .epaper_nav_thumb {
		width: 82px;
		min-width: 82px;
	}

	.upep-root .epaper_nav_thumb img {
		height: 104px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.upep-root *,
	.upep-widget * {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}
