/* Print edition viewer (app/Views/front/edition-viewer.php): a full-screen reading page for the daily PDF. */
@font-face { font-family: "Cairo"; src: url("/assets/fonts/cairo-arabic-wght-normal.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root { --navy: #0b1f3a; --navy-2: #13305a; --red: #d7172f; --red-2: #b01226; --bg: #1c2433; --panel: #111a29; --line: rgba(255,255,255,.12); --txt: #e8edf4; --mut: #9ba7b9; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body.ev { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--txt); font-family: "Cairo", "Inter", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="ltr"] .ev-prev .icon, [dir="rtl"] .ev-next .icon { transform: scaleX(-1); }

/* ---------- top bar */
.ev-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--navy); border-bottom: 3px solid var(--red); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.ev-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; white-space: nowrap; }
.ev-brand b { color: #ff5a6e; font-weight: 900; }
.ev-brand img { background: #fff; border-radius: 50%; }
.ev-title { flex: 1 1 260px; min-width: 0; text-align: center; }
.ev-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: #ffd2d8; letter-spacing: .02em; }
.ev-tag .icon { width: 15px; height: 15px; }
.ev-title h1 { margin: 2px 0 0; font-size: 1.05rem; font-weight: 800; line-height: 1.4; }
.ev-no { background: var(--red); color: #fff; border-radius: 4px; padding: 0 8px 2px; margin-inline-end: 6px; }
.ev-date { color: #dfe6f0; font-weight: 700; }
.ev-actions { display: flex; align-items: center; gap: 6px; }
.ev-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 6px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .15s; }
.ev-btn:hover { background: rgba(255,255,255,.14); }
.ev-btn--icon { width: 40px; padding: 0; }
.ev-btn--accent { background: var(--red); border-color: var(--red); }
.ev-btn--accent:hover { background: var(--red-2); }
@media (max-width: 760px) {
  .ev-bar { gap: 8px 10px; padding: 8px 12px; }
  .ev-title { order: 3; flex-basis: 100%; }
  .ev-actions { margin-inline-start: auto; }
  .ev-btn span { display: none; }
  .ev-btn { width: 40px; padding: 0; }
  .ev-brand span { display: none; }
}

/* ---------- pages */
.ev-main { flex: 1; padding: 24px 12px 40px; overflow-x: auto; }
.ev-pages { display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: min-content; }
.ev-sheet { position: relative; flex: none; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.ev-sheet canvas { display: block; width: 100%; height: 100%; }
.ev-sheet__no { position: absolute; bottom: -16px; inset-inline-end: 0; font-size: .72rem; color: var(--mut); transform: translateY(100%); }
.ev-status { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40vh; color: var(--mut); font-weight: 700; text-align: center; }
.ev-status[hidden] { display: none; }
.ev-status--error { flex-direction: column; color: #ffd2d8; }
.ev-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--red); animation: ev-spin .8s linear infinite; }
@keyframes ev-spin { to { transform: rotate(360deg); } }

/* ---------- footer: stories in the issue */
.ev-foot { background: var(--panel); border-top: 1px solid var(--line); padding: 24px 16px 32px; }
.ev-index { max-width: 900px; margin: 0 auto 20px; }
.ev-index h2 { font-size: 1.05rem; margin: 0 0 12px; padding-inline-start: 12px; border-inline-start: 4px solid var(--red); }
.ev-index h2 small { color: var(--mut); font-weight: 600; font-size: .8rem; margin-inline-start: 8px; }
.ev-index ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.ev-index li { color: var(--mut); }
.ev-index a { color: var(--txt); font-weight: 700; line-height: 1.6; }
.ev-index a:hover { color: #ff8796; }
.ev-links { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; color: var(--mut); font-weight: 700; font-size: .9rem; }
.ev-links a { display: inline-flex; align-items: center; gap: 6px; }
.ev-links a:hover { color: #fff; }
.ev-page { margin-inline-start: auto; }

/* ---------- printing: only the rendered pages, one per sheet */
.ev-print { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.ev { background: #fff; display: block; }
  body.ev > *:not(.ev-print) { display: none !important; }
  .ev-print { display: block; }
  .ev-print img { display: block; width: 210mm; height: 297mm; object-fit: contain; break-after: page; }
  .ev-print img:last-child { break-after: auto; }
}
