/* Premium Frontend CSS for Jagprerna E-Paper Manager */
.jepm-viewer-comp { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.1); border: 1px solid #e5e7eb; margin-bottom: 30px; }
.jepm-v-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px; border-bottom: 1px solid #e5e7eb; background: #fafafa; flex-wrap: wrap; gap: 15px; }
.jepm-v-title h2 { margin: 0 0 5px 0; font-size: 20px; font-weight: 700; color: #111827; }
.jepm-v-meta { font-size: 13px; color: #6b7280; font-weight: 500; }

.jepm-v-actions { display: flex; gap: 10px; position: relative; }
.jepm-v-share-menu { position: absolute; top: 110%; right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); padding: 8px 0; z-index: 100; display: flex; flex-direction: column; min-width: 150px; }
.jepm-v-share-menu a, .jepm-v-share-menu span { padding: 10px 15px; font-size: 14px; color: #374151; text-decoration: none; cursor: pointer; transition: 0.2s; display: block; border-left: 3px solid transparent; }
.jepm-v-share-menu a.sh-wa:hover { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.jepm-v-share-menu a.sh-fb:hover { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.jepm-v-share-menu a.sh-tw:hover { background: #f3f4f6; border-color: #111827; color: #000; }
.jepm-v-share-menu span.sh-cp:hover { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

.jepm-v-toolbar { display: flex; align-items: center; padding: 12px 25px; background: #fff; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; gap: 10px; }
.jepm-v-viewport { background: #1f2937; padding: 20px; overflow: auto; text-align: center; border-radius: 0 0 8px 8px; max-height: 85vh; min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.jepm-v-viewport-wrapper { position: relative; width: 100%; border-radius: 0 0 8px 8px; overflow: hidden; }
.jepm-v-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 35px; line-height: 1; padding: 15px 10px; cursor: pointer; border-radius: 8px; z-index: 100; transition: all 0.3s ease; opacity: 0.7; }
.jepm-v-nav-btn:hover { background: rgba(0,0,0,0.9); opacity: 1; transform: translateY(-50%) scale(1.05); }
.jepm-v-nav-prev { left: 15px; }
.jepm-v-nav-next { right: 15px; }
.jepm-v-board { background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.5); display: block; position: relative; width: 100%; margin: 0 auto; line-height: 0; font-size: 0; border-radius: 6px; }

/* Clickable Areas */
.v_area_box { position: absolute; background: rgba(108, 99, 255, 0.2); border: 2px solid transparent; cursor: pointer; transition: all 0.2s; z-index: 10; border-radius: 6px; }
.v_area_box:hover { background: rgba(108, 99, 255, 0.4); border-color: #6c63ff; box-shadow: 0 0 10px rgba(108, 99, 255, 0.4); z-index: 20; }
.v_area_box::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px); background-size: 10px 10px; opacity: 0; transition: 0.2s; }
.v_area_box:hover::after { opacity: 1; }
.v_area_box::before { content: attr(aria-label); position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 30; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.v_area_box:hover::before { opacity: 1; top: -35px; }

/* Buttons inside Public */
.jepm-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; font-size: 14px; font-weight: 600; border-radius: 6px; border: none; cursor: pointer; transition: 0.2s; text-decoration: none; }
.jepm-primary { background: #6c63ff; color: #fff; }
.jepm-primary:hover { background: #5a52d5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3); color: #fff;}
.jepm-outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.jepm-outline:hover { background: #f3f4f6; color: #111827; }
.jepm-sm { padding: 5px 10px; font-size: 12px; }

/* Grid specific */
.jepm-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; padding: 10px 0; }
.jepm-grid-item { border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.06); transition: 0.3s; border: 1px solid #f3f4f6; }
.jepm-grid-item:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: #e5e7eb; }
.jepm-grid-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.jepm-grid-thumb { height: 260px; background-size: cover; background-position: top center; background-repeat: no-repeat; position: relative; background-color: #f3f4f6;}
.jepm-grid-overlay { position: absolute; inset: 0; background: rgba(108,99,255,0.85); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; opacity: 0; transition: 0.3s; backdrop-filter: blur(2px); text-transform: uppercase; letter-spacing: 1px; }
.jepm-grid-item:hover .jepm-grid-overlay { opacity: 1; }
.jepm-grid-info { padding: 16px; text-align: center; display: flex; flex-direction: column; flex: 1; justify-content: center; }
.jepm-grid-info h4 { margin: 0 0 6px; font-size: 17px; color: #1f2937; font-weight: 700; line-height: 1.3;}
.jepm-grid-date { font-size: 13px; color: #6b7280; font-weight: 500; }

/* Frontend Popup Overwrite */
.jepm-v-modal { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.75); display: flex; justify-content: center; align-items: center; z-index: 100000; padding: 20px; backdrop-filter: blur(4px); animation: fadeIn 0.2s; }
.jepm-v-modal-content { background: #fff; padding: 30px; border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; text-align: center; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.jepm-v-close { position: absolute; top: 15px; right: 20px; font-size: 30px; cursor: pointer; color: #9ca3af; line-height: 1; transition: 0.2s; }
.jepm-v-close:hover { color: #ef4444; }
.v_pop_title { margin: 0 0 15px 0; font-size: 22px; color: #1f2937; font-weight: 700; padding-right: 20px;}


/* --- Inline Viewer Topbar (back to grid) --- */
.jnl-viewer-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; gap: 10px; }
.jnl-back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #475569; text-decoration: none; padding: 6px 14px; border: 1px solid #e2e8f0; border-radius: 20px; background: #fff; transition: background 0.2s, border-color 0.2s; }
.jnl-back-btn:hover { background: #f1f5f9; border-color: #94a3b8; color: #0f172a; }
.jnl-viewer-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #475569; }
.jnl-viewer-meta strong { color: #0f172a; font-weight: 800; }

/* ============================================================
   JAG PRERNA EPAPER LAYOUT  (.jnl-* classes)
   ============================================================ */
.jnl-wrap { max-width: 1280px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #0f172a; background: #fff; }

/* --- TOP HEADER --- */
.jnl-header { display: flex; align-items: center; justify-content: center; padding: 22px 24px 16px; border-bottom: 1px solid #e5e7eb; }
.jnl-header-brand { display: flex; align-items: center; gap: 14px; }
.jnl-brand-light { font-size: 18px; font-weight: 300; color: #6b7280; letter-spacing: 2px; text-transform: uppercase; }
.jnl-brand-divider { width: 1px; height: 32px; background: #cbd5e1; display: inline-block; }
.jnl-brand-name { font-size: 32px; font-weight: 900; color: #0f172a; font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.5px; }

/* --- TOOLBAR --- */
.jnl-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; gap: 10px; flex-wrap: wrap; }
.jnl-toolbar-left, .jnl-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jnl-toolbar-right form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.jnl-tb-guide { font-size: 12px; font-weight: 700; color: #475569; display: flex; align-items: center; gap: 6px; letter-spacing: 0.5px; }

.jnl-tb-filter { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 6px 14px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.jnl-tb-filter:hover { border-color: #94a3b8; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.jnl-tb-filter select { border: none; background: transparent; font-size: 13px; font-weight: 600; color: #0f172a; cursor: pointer; outline: none; appearance: none; padding-right: 2px; }
.jnl-tb-filter svg { flex-shrink: 0; color: #6b7280; }

.jnl-tb-cal { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 6px 14px; transition: border-color 0.2s; }
.jnl-tb-cal:hover { border-color: #94a3b8; }
.jnl-tb-cal input[type="date"] { border: none; background: transparent; font-size: 13px; font-weight: 600; color: #0f172a; cursor: pointer; outline: none; }
.jnl-tb-cal svg { color: #6b7280; }

.jnl-tb-clear { font-size: 11px; font-weight: 700; color: #ef4444; text-decoration: none; padding: 6px 12px; border: 1px solid #fca5a5; border-radius: 20px; background: #fff; transition: background 0.2s; }
.jnl-tb-clear:hover { background: #fef2f2; }

/* --- EDITION HEADING --- */
.jnl-edition-heading { text-align: center; padding: 30px 0 22px; }
.jnl-edition-heading h2 { display: inline-block; font-size: 20px; font-weight: 900; color: #0f172a; text-transform: uppercase; letter-spacing: 3px; margin: 0; padding-bottom: 10px; border-bottom: 3px solid #0f172a; }

/* --- GRID: 5 cols desktop --- */
.jnl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; padding: 4px 20px 48px; }
@media (max-width: 1100px) { .jnl-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px)  { .jnl-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 4px 14px 36px; } }
@media (max-width: 540px)  { .jnl-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 4px 10px 28px; } }

/* --- CARD --- */
.jnl-card { display: flex; flex-direction: column; align-items: stretch; }

.jnl-card-city { font-size: 13px; font-weight: 800; color: #0f172a; margin-bottom: 9px; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.jnl-card-thumb { display: block; width: 100%; position: relative; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 5px; box-shadow: 0 2px 8px rgba(15,23,42,0.08); text-decoration: none; transition: box-shadow 0.25s, transform 0.25s; background: #f1f5f9; aspect-ratio: 3/4; }
.jnl-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.jnl-card-thumb:hover { box-shadow: 0 8px 24px rgba(15,23,42,0.18); transform: translateY(-4px); }
.jnl-card-thumb:hover img { transform: scale(1.04); }

.jnl-card-nothumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 42px; color: #94a3b8; background: #f1f5f9; }

.jnl-pdf-canvas { width: 100%; height: auto; display: none; }

.jnl-card-hover { position: absolute; inset: 0; background: rgba(15,23,42,0.5); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0; transition: opacity 0.25s; }
.jnl-card-thumb:hover .jnl-card-hover { opacity: 1; }

.jnl-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 2px; }
.jnl-card-date { font-size: 11px; color: #64748b; font-weight: 600; }
.jnl-card-share { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 3px; transition: color 0.2s; display: flex; align-items: center; }
.jnl-card-share:hover { color: #0f172a; }

.jnl-empty { text-align: center; padding: 70px 20px; color: #94a3b8; font-size: 16px; font-weight: 500; }

/* Keep old viewer CSS intact below */
.v_img, .v_pdf { display: block !important; width: 100% !important; max-width: none !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; box-sizing: border-box !important; border-radius: 6px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


/* Toolbar */
.jepm-layout-toolbar { background: #e5e7eb; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; margin-bottom: 25px; gap: 12px; flex-wrap: wrap; font-size: 14px; border-radius: 6px; }
.jepm-lt-left, .jepm-lt-right { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.jepm-lt-item { font-weight: 700; color: #374151; }
.jepm-lt-filter { display: flex; align-items: center; gap: 6px; }
.jepm-lt-filter select, .jepm-lt-filter input[type="date"] { border: 1px solid #d1d5db; background: #fff; padding: 4px 8px; border-radius: 5px; font-weight: 600; cursor: pointer; color: #111827; outline: none; font-size: 13px; }
.jepm-lt-reset { color: #ef4444; font-weight: 600; text-decoration: none; font-size: 13px; }
.jepm-lt-reset:hover { color: #b91c1c; }

/* Heading */
.jepm-layout-heading { text-align: center; margin-bottom: 28px; padding-top: 5px; }
.jepm-layout-heading h2 { font-size: 24px; font-weight: 800; color: #111827; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 1px; }
.jepm-lh-line { height: 2px; background: #e5e7eb; width: 100%; max-width: 600px; margin: 0 auto; }

/* Grid – exactly 3 columns */
.jepm-layout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-bottom: 40px; }
@media (max-width: 700px) { .jepm-layout-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; } }
@media (max-width: 480px) { .jepm-layout-grid { grid-template-columns: 1fr; } }

/* Card */
.jepm-layout-card { display: flex; flex-direction: column; align-items: stretch; }
.jepm-lc-city { font-weight: 700; font-size: 15px; margin-bottom: 10px; color: #1f2937; text-align: center; }

/* Thumbnail */
.jepm-lc-thumb { display: block; width: 100%; position: relative; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.jepm-lc-thumb img { width: 100%; height: auto; display: block; }
.jepm-lc-thumb:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.13); }
.jepm-lc-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; font-size: 16px; font-weight: 700; gap: 6px; }
.jepm-lc-thumb:hover .jepm-lc-overlay { opacity: 1; }

/* Footer */
.jepm-lc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 0 2px; }
.jepm-lc-date { font-size: 12px; color: #6b7280; font-weight: 500; }
.jepm-lc-share { background: none; border: none; cursor: pointer; font-size: 15px; opacity: 0.55; transition: opacity 0.2s; padding: 0; }
.jepm-lc-share:hover { opacity: 1; }

.jepm-layout-empty { grid-column: 1 / -1; text-align: center; padding: 50px; color: #6b7280; background: #f9fafb; border-radius: 10px; font-weight: 500; font-size: 16px; }
.v_img, .v_pdf { display: block !important; width: 100% !important; max-width: none !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; box-sizing: border-box !important; border-radius: 6px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
