/*
Theme Name: Modern ePaper Pro 2026
Theme URI: https://example.com/modern-epaper
Author: Custom Engineering
Description: Complete, modern, full-featured Bengali ePaper Newspaper Theme with Custom Fields Support (page_number, hotspots_json) and automatic post integration.
Version: 3.0.0
License: GNU General Public License v2 or later
Text Domain: modern-epaper
*/

:root {
  --primary: #0f172a;
  --primary-accent: #1e3a8a;
  --brand: #dc2626;
  --brand-hover: #b91c1c;
  --bg-light: #f1f5f9;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
}

* { box-sizing: border-box; }

body {
  font-family: 'SolaimanLipi', 'Noto Sans Bengali', Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* Header Navbar */
.epaper-top-header {
  background: #ffffff;
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.epaper-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.epaper-logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.epaper-date-badge {
  font-size: 14px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--text-dark);
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

/* Page Navigation Bar */
.epaper-controls-bar {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 20px;
}

.epaper-controls-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.page-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-selector-group select {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.epaper-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.epaper-btn:hover {
  background: var(--brand-hover);
}

.epaper-btn-secondary {
  background: #334155;
}

.epaper-btn-secondary:hover {
  background: #1e293b;
}

/* Main Viewer Layout */
.epaper-main-container {
  max-width: 1280px;
  margin: 25px auto;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 25px;
}

@media (max-width: 992px) {
  .epaper-main-container {
    grid-template-columns: 1fr;
  }
}

.epaper-canvas-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.epaper-viewer-frame {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.epaper-page-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Hotspot Interactive Overlay */
.epaper-hotspot {
  position: absolute;
  border: 2px dashed transparent;
  cursor: pointer;
  background: rgba(37, 99, 235, 0.03);
  transition: all 0.2s ease-in-out;
}

.epaper-hotspot:hover {
  border-color: var(--brand);
  background: rgba(220, 38, 38, 0.15);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.epaper-hotspot-label {
  position: absolute;
  top: 5px;
  left: 5px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  display: none;
}

.epaper-hotspot:hover .epaper-hotspot-label {
  display: block;
}

/* Sidebar Thumbnails */
.epaper-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-widget {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 15px;
}

.widget-title {
  font-size: 18px;
  font-weight: bold;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 8px;
  margin-bottom: 12px;
  color: var(--primary);
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.page-thumb-card {
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s;
  background: #fff;
}

.page-thumb-card:hover, .page-thumb-card.active {
  border-color: var(--brand);
}

.page-thumb-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.page-thumb-card span {
  font-size: 12px;
  font-weight: bold;
  padding: 4px;
  display: block;
  background: #f8fafc;
}

/* News Article Modal */
.epaper-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.epaper-modal-box {
  background: #ffffff;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
  overflow-y: auto;
  position: relative;
  animation: modalFadeIn 0.25s ease-out;
}

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

.modal-header-bar {
  padding: 15px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-close-btn {
  background: #e2e8f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--brand);
  color: #fff;
}

.modal-body-content {
  padding: 25px;
}

.modal-news-title {
  font-size: 24px;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 15px;
  line-height: 1.4;
}

.modal-news-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 1px solid #e2e8f0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}
/* Header & Logo Mobile Fix */
.epaper-logo,
.custom-logo-link {
    display: inline-block !important;
    max-width: 100% !important;
}

.epaper-logo img,
.custom-logo,
a.custom-logo-link img {
    max-width: 280px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

@media (max-width: 768px) {
    .epaper-header-inner {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 10px !important;
    }

    .epaper-logo img,
    .custom-logo,
    a.custom-logo-link img {
        max-width: 180px !important;
    }
}.epaper-date-badge {
    margin-top: 15px !important;
}
/* Desktop Header Alignment Fix */
.epaper-top-header {
    padding: 15px 0;
}

.epaper-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.epaper-logo {
    margin: 0 auto !important;
}

.epaper-date-badge {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}

@media (max-width: 768px) {
    .epaper-header-inner {
        flex-direction: column !important;
    }
    .epaper-date-badge {
        position: static !important;
        transform: none !important;
        margin-top: 10px !important;
    }
}/* Desktop Header Alignment Fix */
.epaper-top-header {
    padding: 15px 0;
}

.epaper-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.epaper-logo {
    margin: 0 auto !important;
}

.epaper-date-badge {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}

@media (max-width: 768px) {
    .epaper-header-inner {
        flex-direction: column !important;
    }
    .epaper-date-badge {
        position: static !important;
        transform: none !important;
        margin-top: 10px !important;
    }
}/* Desktop Header Alignment Fix */
.epaper-top-header {
    padding: 15px 0;
}

.epaper-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.epaper-logo {
    margin: 0 auto !important;
}

.epaper-date-badge {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}

@media (max-width: 768px) {
    .epaper-header-inner {
        flex-direction: column !important;
    }
    .epaper-date-badge {
        position: static !important;
        transform: none !important;
        margin-top: 10px !important;
    }
}/* Desktop Header Alignment Fix */
.epaper-top-header {
    padding: 15px 0;
}

.epaper-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.epaper-logo {
    margin: 0 auto !important;
}

.epaper-date-badge {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
}
}
/* Force All Items in One Line (Exact Fix) */
@media screen and (max-width: 768px) {
    /* কালো প্যারেন্ট কন্টেইনার ফ্লেক্স করা */
    div[style*="background"],
    .epaper-top-header + div {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        padding: 10px 4px !important;
    }

    /* পৃষ্ঠা নির্বাচন টেক্সট */
    div[style*="background"] span,
    div[style*="background"] label {
        font-size: 11px !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }

    /* ড্রপডাউন বক্স */
    div[style*="background"] select {
        width: auto !important;
        max-width: 110px !important;
        font-size: 11px !important;
        padding: 3px 4px !important;
        margin: 0 !important;
    }

    /* বাটনগুলোর প্যারেন্ট র‍্যাপার সারণী ব্লক মুক্ত করা */
    div[style*="background"] > div,
    div[style*="background"] form,
    div[style*="background"] p {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* জুম ও প্রিন্ট বাটন প্রফেশনাল পিল শেপ */
    div[style*="background"] button,
    div[style*="background"] .btn,
    div[style*="background"] a {
        border-radius: 20px !important;
        padding: 4px 10px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        margin: 0 !important;
        height: 32px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
}