/* ==========================================================================
   ABB News — E-Paper reader (chromeless, standalone, dark)
   ========================================================================== */
:root {
	--abb-red: #83040B;
	--abb-red-dark: #72010A;
}
* { box-sizing: border-box; }
html, body.abb-epaper {
	margin: 0; padding: 0; height: 100%;
	background: #1b1b1b; color: #f5f5f5;
	font-family: "Noto Naskh Arabic", system-ui, sans-serif;
	overflow: hidden;
}
body.abb-epaper { display: flex; flex-direction: column; height: 100vh; }

/* Top bar */
.abb-epaper__bar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; padding: 0.6rem 1rem; background: #111; flex: none;
	border-bottom: 2px solid var(--abb-red);
}
.abb-epaper__bar-right, .abb-epaper__bar-left, .abb-epaper__bar-center { display: flex; align-items: center; gap: 0.75rem; }
.abb-epaper__logo img { height: 30px; width: auto; display: block; }
.abb-epaper__title { font-size: 1rem; font-weight: 600; }
.abb-epaper__bar-center { flex-direction: column; gap: 0.1rem; text-align: center; }
.abb-epaper__date { font-size: 0.85rem; color: #ccc; }
.abb-epaper__counter { font-size: 0.8rem; color: #999; }
.abb-epaper__tool {
	display: inline-grid; place-items: center; width: 38px; height: 38px;
	background: #2a2a2a; color: #f5f5f5; border: none; border-radius: 6px;
	font-size: 1.1rem; cursor: pointer; text-decoration: none; transition: background 0.15s;
}
.abb-epaper__tool:hover { background: var(--abb-red); }
.abb-epaper__close:hover { background: var(--abb-red); }

/* Stage */
.abb-epaper__stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 0; }
.abb-epaper__viewport { position: relative; width: 100%; height: 100%; overflow: auto; padding: 1rem; text-align: center; }
.abb-epaper__viewport::before { content: ""; display: inline-block; height: 100%; vertical-align: middle; }
.abb-epaper__page { display: none; margin: 0; max-height: 100%; }
.abb-epaper__page.is-active { display: inline-block; vertical-align: middle; }
.abb-epaper__page img {
	max-width: 100%; max-height: calc(100vh - 220px); height: auto; width: auto; display: block;
	background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.6); cursor: zoom-in;
	transform-origin: top center; transition: transform 0.2s; margin: 0 auto;
}

/* Nav arrows (RTL: next on right visually via inset) */
.abb-epaper__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 48px; height: 72px; background: rgba(0,0,0,0.5); color: #fff;
	border: none; font-size: 2rem; cursor: pointer; z-index: 5; border-radius: 6px;
}
.abb-epaper__nav:hover { background: var(--abb-red); }
.abb-epaper__nav--next { inset-inline-end: 0.5rem; }  /* ‹ forward in RTL */
.abb-epaper__nav--prev { inset-inline-start: 0.5rem; } /* › back in RTL */

/* Thumbnail strip */
.abb-epaper__thumbs {
	flex: none; display: flex; gap: 0.5rem; padding: 0.6rem 1rem;
	background: #141414; overflow-x: auto; border-top: 1px solid #2a2a2a;
}
.abb-epaper__thumb {
	position: relative; flex: none; width: 60px; height: 80px; padding: 0;
	background: none; border: 2px solid transparent; border-radius: 4px; cursor: pointer; overflow: hidden;
}
.abb-epaper__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.abb-epaper__thumb span { position: absolute; bottom: 0; inset-inline-start: 0; background: rgba(0,0,0,0.75); color: #fff; font-size: 0.65rem; padding: 0 4px; }
.abb-epaper__thumb.is-active { border-color: var(--abb-red); }

/* Empty state */
.abb-epaper__empty { margin: auto; text-align: center; padding: 3rem 1rem; }
.abb-epaper__empty h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.abb-epaper__empty p { color: #bbb; margin: 0 0 1.5rem; }
.abb-epaper__empty .abb-btn { display: inline-block; background: var(--abb-red); color: #fff; padding: 0.7rem 1.4rem; border-radius: 6px; text-decoration: none; }
.abb-epaper__empty .abb-btn:hover { background: var(--abb-red-dark); }
.abb-epaper__home { display: block; margin-top: 1rem; color: #999; text-decoration: none; }

@media (max-width: 640px) {
	.abb-epaper__title, .abb-epaper__date { display: none; }
	.abb-epaper__page img { max-height: calc(100vh - 180px); }
	.abb-epaper__thumb { width: 46px; height: 62px; }
}
