/* ============================================================
   BizNews E-Paper template
   ============================================================ */

/* E-Paper page logo (Logo Image 3) */
.epaper-page-logo {
	text-align: center;
}

.epaper-page-logo .biznews-epaper-logo {
	width: 100% !important;
	max-width: 100%;
	height: auto !important;
	display: block;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
	flex-shrink: unset;
}

@media (min-width: 768px) {
	.epaper-page-logo .biznews-epaper-logo {
		width: 500px !important;
		max-width: 500px;
	}
}

/* Grid card */
.epaper-card {
	transition: box-shadow .3s ease, transform .3s ease;
}

.epaper-card-link:hover .epaper-card,
.epaper-card-link:focus .epaper-card {
	box-shadow: 0 0 30px rgba(0, 0, 0, .1);
	transform: translateY(-4px);
}

.epaper-thumb {
	position: relative;
	height: 320px;
	overflow: hidden;
	background: #EDEFF4; /* Match theme light background */
}

.epaper-thumb img {
	width: 100%;
	height: 100%;
}

.epaper-icon {
	font-size: 70px;
	color: #e2362d;
}

.epaper-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(30, 32, 36, .55);
	color: #fff;
	font-size: 28px;
	opacity: 0;
	transition: opacity .3s ease;
}

.epaper-card-link:hover .epaper-overlay,
.epaper-card-link:focus .epaper-overlay {
	opacity: 1;
}

.epaper-card-actions {
	gap: 8px;
}

.epaper-whatsapp-share {
	background-color: #25d366;
	border-color: #25d366;
	color: #fff;
	min-width: 38px;
	padding-left: 10px;
	padding-right: 10px;
	flex-shrink: 0;
}

.epaper-whatsapp-share:hover,
.epaper-whatsapp-share:focus {
	background-color: #1da851;
	border-color: #1da851;
	color: #fff;
}

/* Archive list */
.epaper-archive li {
	border-bottom: 1px solid #ededed;
}

.epaper-archive li:last-child {
	border-bottom: 0;
}

.epaper-archive li a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 4px;
	color: #1e2024;
	text-decoration: none;
	font-weight: 500;
}

.epaper-archive li a:hover,
.epaper-archive li.active a {
	color: #e2362d;
}

/* E-Paper modal */
.epaper-modal {
	z-index: 1060;
}

.epaper-modal .modal-dialog.epaper-modal-dialog {
	max-width: 95vw;
	width: 95vw;
	height: 95vh;
	margin: 2.5vh auto;
}

.epaper-modal .modal-content {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.epaper-modal-body {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #1e2024;
	padding: 8px;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.epaper-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 5;
	transform: translate(-50%, -50%);
	color: #fff;
	text-align: center;
	font-size: 16px;
	pointer-events: none;
}

#epaper-flip {
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

#epaper-flip .df-container,
#epaper-flip .df-book-stage {
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
}

#epaper-flip .df-ui-wrapper {
	display: none !important;
}

.epaper-pdf-fallback {
	width: 100%;
	height: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
}

.epaper-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	flex-shrink: 0;
}

.epaper-controls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.epaper-controls .btn {
	min-width: 38px;
}

.epaper-controls .btn:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.epaper-pageinfo,
.epaper-zoominfo {
	min-width: 64px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
}

#epaperModal .modal-content:fullscreen .epaper-modal-body,
#epaperModal .modal-content:fullscreen #epaper-flip,
#epaperModal .modal-content:fullscreen .epaper-pdf-fallback {
	height: 100%;
	min-height: 0;
}

@media (max-width: 575.98px) {
	.epaper-thumb {
		height: 170px;
	}
	.epaper-icon {
		font-size: 52px;
	}
}

/* ---------- Mobile flipbook popup (phones only) ---------- */
@media (max-width: 767.98px) {
	.epaper-modal .modal-dialog.epaper-modal-dialog {
		max-width: 100vw;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		margin: 0;
	}

	.epaper-modal .modal-content {
		border: 0;
		border-radius: 0;
	}

	#epaperModal .epaper-modal-body {
		padding: 0;
		overflow: hidden;
	}

	#epaperModal #epaper-flip {
		width: 100% !important;
		height: 100% !important;
	}

	.epaper-mobile-viewer {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
		background: #1e2024;
	}

	.epaper-mobile-canvas {
		display: block;
		max-width: 100%;
		height: auto;
		margin: 0 auto;
		background: #fff;
		box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
	}

	.epaper-modal .epaper-toolbar {
		gap: 6px;
		padding: 6px 8px;
		flex-shrink: 0;
	}

	.epaper-modal .epaper-controls {
		gap: 4px;
		flex-wrap: wrap;
		justify-content: center;
	}

	.epaper-modal .epaper-controls .btn {
		min-width: 34px;
		padding: 4px 8px;
	}

	.epaper-modal .epaper-pageinfo,
	.epaper-modal .epaper-zoominfo {
		min-width: 48px;
		font-size: 13px;
	}

	.epaper-modal-header .modal-title,
	#epaperModalLabel {
		font-size: 14px;
		line-height: 1.25;
	}

	.epaper-modal-header {
		padding: 10px 12px;
		flex-shrink: 0;
	}

	.epaper-modal-header .btn {
		font-size: 12px;
		padding: 4px 8px;
	}
}

.epaper-share-landing .btn {
	min-width: 120px;
}

/* ---------- Edition reader (Rashtra Sanchar style) ---------- */
.epaper-edition-page--full {
	max-width: none;
	width: 100%;
	margin: 3rem 0 0;
	padding: 1rem 0 0;
}

.epaper-edition-page--full .epaper-edition-reader {
	border-radius: 0;
	box-shadow: none;
	min-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
}

.epaper-edition-reader {
	background: #2f3338;
	overflow: hidden;
}

.epaper-reader-toolbar-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 12px;
	background: #1a1c1f;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.epaper-reader-actions,
.epaper-edition-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.epaper-tool-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 34px;
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 3px;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s ease, border-color .2s ease;
}

.epaper-tool-btn:hover,
.epaper-tool-btn:focus {
	background: rgba(255, 255, 255, .18);
	color: #fff;
	text-decoration: none;
}

.epaper-tool-btn.active {
	background: #c41e24;
	border-color: #c41e24;
	color: #fff;
}

.epaper-tool-btn--download {
	background: #0d6efd;
	border-color: #0d6efd;
}

.epaper-tool-btn--whatsapp {
	background: #25d366;
	border-color: #25d366;
}

.epaper-reader-body {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	height: calc(100vh - 200px);
	position: relative;
	background: #3a3f45;
}

.epaper-thumb-sidebar {
	width: 108px;
	flex-shrink: 0;
	overflow: hidden;
	background: #25282c;
	border-right: 1px solid rgba(255, 255, 255, .08);
}

.epaper-thumb-sidebar-inner {
	width: 108px;
	height: 100%;
	overflow-y: auto;
	padding: 8px 6px;
	-webkit-overflow-scrolling: touch;
}

.epaper-thumb-item {
	display: block;
	width: 100%;
	border: 2px solid transparent;
	background: #fff;
	padding: 3px;
	margin-bottom: 8px;
	cursor: pointer;
	text-align: center;
	border-radius: 2px;
}

.epaper-thumb-item img {
	display: block;
	width: 100%;
	height: auto;
}

.epaper-thumb-item span {
	display: block;
	font-size: 10px;
	color: #1e2024;
	margin-top: 3px;
	font-weight: 600;
}

.epaper-thumb-item.active,
.epaper-thumb-item:hover {
	border-color: #c41e24;
}

.epaper-reader-stage {
	flex: 1 1 auto;
	display: flex;
	align-items: stretch;
	min-width: 0;
	position: relative;
}

.epaper-edition-reader .epaper-viewer-body {
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
	padding: 0;
	background: #3a3f45;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

#epaper-flip.epaper-edition-flip {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.epaper-stage-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	width: 36px;
	height: 52px;
	border: 0;
	background: rgba(0, 0, 0, .5);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	transition: background .2s ease;
}

.epaper-stage-nav:hover {
	background: rgba(196, 30, 36, .9);
}

.epaper-stage-prev {
	left: 0;
	border-radius: 0 3px 3px 0;
}

.epaper-stage-next {
	right: 0;
	border-radius: 3px 0 0 3px;
}

.epaper-reader-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 14px;
	background: #1a1c1f;
	border-top: 1px solid rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 13px;
}

.epaper-meta-info strong {
	font-weight: 700;
}

.epaper-meta-sep {
	margin: 0 6px;
	opacity: .7;
}

.epaper-meta-btn {
	border: 1px solid rgba(255, 255, 255, .35);
	background: transparent;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 14px;
	border-radius: 3px;
	cursor: pointer;
}

.epaper-meta-btn:hover {
	background: rgba(255, 255, 255, .1);
}

.epaper-meta-nav {
	display: flex;
	gap: 6px;
}

.epaper-edition-canvas-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	text-align: center;
}

.epaper-edition-canvas-wrap.is-zoomed {
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	align-items: flex-start;
}

.epaper-edition-canvas-wrap .epaper-mobile-canvas {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.epaper-edition-canvas-wrap.is-clip-mode {
	cursor: pointer;
}

.epaper-clip-layer {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}

.epaper-edition-canvas-wrap.is-clip-mode .epaper-clip-layer {
	pointer-events: auto;
}

.epaper-clip-zone {
	position: absolute;
	border: 2px solid transparent;
	background: transparent;
	transition: background .15s ease, border-color .15s ease;
	cursor: pointer;
}

.epaper-edition-canvas-wrap.is-clip-mode .epaper-clip-zone:hover,
.epaper-clip-zone.is-active {
	border-color: #0d6efd;
	background: rgba(13, 110, 253, 0.2);
}

.epaper-clip-selection {
	position: absolute;
	border: 2px solid #0d6efd;
	background: rgba(13, 110, 253, 0.22);
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	z-index: 5;
}

.epaper-clip-page-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding-bottom: 2rem;
	box-sizing: border-box;
}

body.biznews-epaper-clip {
	background: #eef1f5;
}

body.biznews-epaper-clip .container,
body.biznews-epaper-clip .container-fluid.mt-5 {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.biznews-epaper-clip .biznews-breadcrumb,
body.biznews-epaper-clip .page-header,
body.biznews-epaper-clip .section-title {
	display: none;
}

.epaper-clip-page--full {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
	min-height: auto;
	background: #3a3f45;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
}

.epaper-clip-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: #1a1c1f;
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.epaper-clip-title {
	font-size: 15px;
	font-weight: 700;
	margin: 0;
	text-transform: uppercase;
}

.epaper-clip-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	position: relative;
}

.epaper-clip-page .epaper-copy-toast {
	position: absolute;
	right: 0;
	top: 100%;
	margin-top: 4px;
	font-size: 12px;
	color: #7dffb0;
	white-space: nowrap;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.epaper-clip-page .epaper-copy-toast.is-visible {
	opacity: 1;
}

.epaper-clip-viewer {
	position: relative;
	min-height: 320px;
	padding: 20px 24px 28px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.epaper-clip-image-wrap {
	width: 100%;
	max-width: 100%;
	text-align: center;
	padding: 16px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.epaper-clip-canvas,
.epaper-clip-fallback-img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	background: #fff;
	box-shadow: 0 2px 20px rgba(0, 0, 0, .25);
}

.epaper-clip-meta {
	padding: 18px 20px 6px;
	background: #3a3f45;
	text-align: center;
}

.epaper-clip-meta-title {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	line-height: 1.45;
	text-transform: uppercase;
}

.epaper-clip-meta-date {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, .78);
	line-height: 1.45;
}

.epaper-clip-footer {
	padding: 16px 20px 20px;
	background: #2f3338;
	border-top: 1px solid rgba(255, 255, 255, .06);
}

@media (max-width: 767px) {
	.epaper-clip-page-wrap {
		padding: 0.75rem 0.5rem 1.25rem;
	}

	.epaper-clip-page--full {
		border-radius: 6px;
	}

	.epaper-clip-viewer {
		padding: 12px 12px 20px;
	}

	.epaper-clip-image-wrap {
		padding: 10px;
	}
}

.epaper-clip-modal .modal-body img {
	box-shadow: 0 2px 16px rgba(0, 0, 0, .15);
}

.epaper-edition-reader:fullscreen {
	border-radius: 0;
	height: 100vh;
}

.epaper-edition-reader:fullscreen .epaper-reader-body {
	height: auto;
	flex: 1 1 auto;
	min-height: 0;
}

@media (max-width: 767.98px) {
	.epaper-reader-body {
		height: calc(100vh - 220px);
		min-height: 320px;
	}

	.epaper-thumb-sidebar {
		width: 0;
		border-right: 0;
	}

	.epaper-thumb-sidebar.is-open {
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		z-index: 12;
		width: 96px;
		border-right: 1px solid rgba(255, 255, 255, .08);
		box-shadow: 4px 0 16px rgba(0, 0, 0, .35);
	}

	.epaper-thumb-sidebar-inner {
		width: 96px;
	}

	.epaper-stage-nav {
		width: 30px;
		height: 44px;
		font-size: 14px;
	}

	.epaper-tool-btn span {
		display: none;
	}

	.epaper-tool-btn {
		min-width: 36px;
		padding: 6px 8px;
	}

	.epaper-meta-info {
		font-size: 11px;
		width: 100%;
	}
}

/* ---------- Edition detail (legacy inline) ---------- */
.epaper-edition-page {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding-bottom: 2rem;
}

.epaper-edition-header h1 {
	line-height: 1.3;
	word-break: break-word;
}

.epaper-inline-panel {
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
	min-height: 520px;
	height: min(78vh, 900px);
}

.epaper-inline-viewer .epaper-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
	padding: 8px;
}

.epaper-inline-panel .epaper-toolbar {
	padding: 10px 12px;
	background: #1e2024;
}

.epaper-inline-panel:fullscreen {
	border-radius: 0;
	height: 100vh;
	max-height: none;
}

.epaper-inline-panel:fullscreen .epaper-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
}

.epaper-inline-panel:fullscreen .epaper-toolbar {
	flex-shrink: 0;
}

@media (max-width: 991.98px) {
	.epaper-inline-panel {
		height: min(72vh, 820px);
		min-height: 460px;
	}
}

@media (max-width: 767.98px) {
	.epaper-edition-page {
		padding-left: 12px;
		padding-right: 12px;
	}

	.epaper-edition-header h1 {
		font-size: 1.1rem;
	}

	.epaper-inline-panel {
		height: min(68vh, 720px);
		min-height: 380px;
		border-radius: 0;
	}

	.epaper-inline-viewer .epaper-modal-body {
		padding: 4px;
	}

	.epaper-inline-panel .epaper-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 8px 10px;
	}

	.epaper-inline-panel .epaper-controls {
		width: 100%;
		justify-content: center;
		flex-wrap: nowrap;
	}

	.epaper-inline-panel .epaper-controls .btn {
		min-width: 36px;
		padding: 6px 8px;
	}

	.epaper-inline-panel .epaper-pageinfo,
	.epaper-inline-panel .epaper-zoominfo {
		min-width: 52px;
		font-size: 13px;
	}

	.epaper-edition-actions {
		width: 100%;
		margin-top: 8px;
		gap: 8px;
	}

	.epaper-edition-actions .btn {
		flex: 1 1 auto;
	}
}

@media (max-width: 399.98px) {
	.epaper-inline-panel .epaper-controls .btn {
		min-width: 32px;
		padding: 5px 6px;
		font-size: 12px;
	}

	.epaper-inline-panel .epaper-pageinfo,
	.epaper-inline-panel .epaper-zoominfo {
		min-width: 44px;
		font-size: 12px;
	}
}

.env-drag-box {
	position: absolute;
	border: 2px dashed #0d6efd;
	background: rgba(13, 110, 253, 0.2);
	pointer-events: none;
	z-index: 9999;
}
