@font-face {
    font-family: 'SolaimanLipi';
    src: local('SolaimanLipi'),
         url('https://cdn.jsdelivr.net/gh/ataberk/solaimanlipi@master/SolaimanLipi.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/ataberk/solaimanlipi@master/SolaimanLipi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.cep-frontend-wrap {
    max-width: 1340px;
    margin: 20px auto;
    padding: 0 15px;
    font-family: 'SolaimanLipi', sans-serif;
    box-sizing: border-box;
}

.cep-frontend-wrap *,
.cep-modal * {
    box-sizing: border-box;
}

/* Top Control Bar */
.cep-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.cep-top-left-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cep-head-btn,
.cep-head-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #111827;
    font-family: 'SolaimanLipi', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cep-head-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.cep-head-badge {
    cursor: default;
    background: #ffffff;
    color: #1f2937;
}

.cep-head-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #374151;
}

/* Edition Dropdown */
.cep-edition-dropdown-wrap {
    position: relative;
}

.cep-caret {
    font-size: 11px;
    color: #4b5563;
    margin-left: 2px;
}

.cep-edition-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    list-style: none;
    margin: 0;
    padding: 5px 0;
    z-index: 60;
}

.cep-edition-dropdown-wrap.open .cep-edition-menu {
    display: block;
}

.cep-edition-menu li a {
    display: block;
    padding: 8px 14px;
    color: #1f2937;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.cep-edition-menu li a:hover {
    background: #eff6ff;
    color: #1a73e8;
}

.cep-edition-menu li a.is-active {
    background: #1a73e8;
    color: #ffffff;
}

/* Top Social Share Circles */
.cep-top-share-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.cep-social-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.cep-social-circle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.cep-soc-fb {
    background: #eef4ff;
    color: #1877f2;
    font-family: Arial, sans-serif;
}

.cep-soc-x {
    background: #f3f4f6;
    color: #111827;
    font-family: Arial, sans-serif;
}

.cep-soc-wa {
    background: #ecfdf5;
    color: #16a34a;
    font-family: Arial, sans-serif;
}

.cep-soc-mail {
    background: #fef2f2;
    color: #dc2626;
    font-family: Arial, sans-serif;
}

/* Page Numbers (< 1 2 >) */
.cep-page-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.cep-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1f2937;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    font-family: 'SolaimanLipi', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.cep-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.cep-page-btn.active {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}
.cep-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Three-Column Main Layout: Left Thumbnails + Center Page + Right Calendar/Ads/FB */
.cep-reader-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Left Sidebar Column ("সকল পাতা") */
.cep-thumbs-sidebar {
    width: 155px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.cep-thumbs-header {
    background: #1a73e8;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    padding: 7px 10px;
}
.cep-thumbs-list {
    max-height: 82vh;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cep-thumbs-list::-webkit-scrollbar {
    width: 5px;
}
.cep-thumbs-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.cep-thumb-item {
    position: relative;
    border: 2px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    border-radius: 3px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cep-thumb-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}
.cep-thumb-item.active {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.35);
}
.cep-thumb-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.cep-thumb-item.active .cep-thumb-badge {
    background: #1a73e8;
}
.cep-thumb-item canvas,
.cep-thumb-item img {
    display: block;
    width: 100%;
    height: auto;
}
.cep-thumb-placeholder {
    height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 13px;
    background: #f1f5f9;
}

/* Center Main Page Stage */
.cep-main-stage-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.cep-page-stage {
    position: relative;
    border: 1px solid #d1d5db;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    min-height: 360px;
}

.cep-empty-edition-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 24px;
    min-height: 360px;
    background: #f9fafb;
    color: #374151;
}

.cep-empty-edition-notice .cep-empty-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 12px;
}

.cep-empty-edition-notice h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    font-family: 'SolaimanLipi', sans-serif;
}

.cep-empty-edition-notice p {
    margin: 0;
    font-size: 16px;
    color: #4b5563;
    font-family: 'SolaimanLipi', sans-serif;
}
.cep-page-stage img,
.cep-page-stage canvas {
    display: block;
    width: 100%;
    height: auto;
}

.cep-stage-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 34px;
    height: 44px;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.cep-stage-arrow:hover {
    background: #b91c1c;
}
.cep-stage-prev { left: 6px; }
.cep-stage-next { right: 6px; }

.cep-hotspot {
    position: absolute;
    cursor: pointer;
    transition: background 0.15s ease, border 0.15s ease;
}
.cep-hotspot:hover {
    background: rgba(220, 38, 38, 0.18);
    border: 2px solid rgba(220, 38, 38, 0.75);
}

/* Right Sidebar Column */
.cep-right-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cep-gradient-banner {
    background: linear-gradient(90deg, #3730a3 0%, #0e7490 100%);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    padding: 9px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.cep-calendar-card {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.cep-cal-header {
    background: linear-gradient(90deg, #3730a3 0%, #0e7490 100%);
    color: #fff;
    border-radius: 6px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}
.cep-cal-nav-btn {
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cep-cal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.48);
}
.cep-cal-weekdays,
.cep-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.cep-cal-weekdays div {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    padding-bottom: 4px;
}
.cep-cal-day {
    height: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    background: #f9fafb;
    cursor: default;
    text-decoration: none;
}
.cep-cal-day.empty {
    border-color: transparent;
    background: transparent;
}
.cep-cal-day.has-issue {
    color: #111827;
    background: #eff6ff;
    border-color: #93c5fd;
    font-weight: 700;
    cursor: pointer;
}
.cep-cal-day.has-issue:hover {
    background: #dbeafe;
    border-color: #2563eb;
}
.cep-cal-day.active-issue {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
    font-weight: 700;
}

.cep-ad-box-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cep-ad-slot {
    min-height: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}
.cep-ad-slot img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
.cep-ad-placeholder-text {
    color: #9ca3af;
    font-size: 13px;
}

.cep-fb-box-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cep-fb-link-btn {
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.cep-fb-link-btn:hover {
    opacity: 0.92;
    color: #fff;
}
.cep-fb-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    color: #1e3a8a;
    font-weight: 900;
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.cep-fb-feed-container {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.cep-fb-feed-container iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: none;
    overflow: hidden;
}

/* Unified News Popup Modal */
.cep-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    font-family: 'SolaimanLipi', sans-serif;
}
.cep-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}
.cep-modal-dialog {
    position: relative;
    z-index: 2;
    max-width: 880px;
    max-height: 92vh;
    margin: 3vh auto;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cep-modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    font-size: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}
.cep-modal-body {
    padding: 18px;
    overflow-y: auto;
    text-align: center;
    background: #f3f4f6;
}
.cep-modal-body canvas#cep-composite-canvas {
    max-width: 100%;
    height: auto;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.14);
    border: 1px solid #d1d5db;
    display: block;
    margin: 0 auto;
}
.cep-loading-msg {
    padding: 30px;
    font-weight: 600;
    color: #444;
    font-family: 'SolaimanLipi', sans-serif;
}
.cep-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}
.cep-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cep-btn {
    border: none;
    padding: 8px 13px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: 'SolaimanLipi', sans-serif;
    transition: opacity 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
}
.cep-btn:hover {
    opacity: 0.92;
}
.cep-btn-download { background: #1e7e34; }
.cep-btn-download:hover { background: #155724; }
.cep-btn-fb { background: #1877f2; }
.cep-btn-fb:hover { background: #0d65d9; }
.cep-btn-wa { background: #25d366; color: #fff; }
.cep-btn-wa:hover { background: #1da851; }
.cep-btn-copy { background: #4b5563; }
.cep-btn-copy:hover { background: #374151; }
.cep-btn-print { background: #0f766e; }
.cep-btn-print:hover { background: #115e59; }
.cep-jump-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'SolaimanLipi', sans-serif;
    white-space: nowrap;
}
.cep-jump-btn:hover {
    background: #005177;
}

/* Print Container (Hidden on screen) */
.cep-print-container {
    display: none;
}

@media print {
    body > *:not(#cep-print-container) {
        display: none !important;
    }
    .cep-print-container {
        display: block !important;
        width: 100%;
    }
    .cep-print-page {
        page-break-after: always;
        break-after: page;
        text-align: center;
        margin: 0;
        padding: 0;
    }
    .cep-print-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
    .cep-print-page img {
        max-width: 100%;
        width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .cep-reader-layout {
        flex-wrap: wrap;
    }
    .cep-right-sidebar {
        width: 100%;
    }
}

/* Mobile Responsive Layout */
@media (max-width: 768px) {
    .cep-frontend-wrap {
        padding: 0 10px;
        margin: 12px auto;
    }

    .cep-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-bottom: 10px;
    }

    .cep-top-left-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .cep-head-btn,
    .cep-head-badge {
        height: 36px;
        padding: 0 9px;
        font-size: 13px;
        gap: 5px;
        justify-content: center;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cep-head-icon {
        width: 15px;
        height: 15px;
    }

    /* Order in mobile grid:
       1: অনলাইন ভার্সন | 2: প্রথম সংস্করণ
       3: আজকের পত্রিকা | 4: প্রিন্ট
       5: Social icons row */
    #cep-online-version-btn { order: 1; }
    .cep-edition-dropdown-wrap { order: 2; width: 100%; }
    #cep-today-paper-btn { order: 3; }
    #cep-print-paper-btn { order: 4; }

    .cep-edition-menu {
        width: 100%;
        min-width: 0;
    }

    /* Remove Date & Weekday badge on mobile */
    #cep-issue-date-badge {
        display: none !important;
    }

    /* Social icons row centered across full width */
    .cep-top-share-group {
        order: 5;
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-left: 0;
        padding-top: 2px;
    }

    .cep-social-circle {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    /* Page navigation centered & clean */
    .cep-page-nav {
        justify-content: center;
        gap: 4px;
        width: 100%;
    }

    .cep-page-btn {
        min-width: 31px;
        height: 31px;
        padding: 0 7px;
        font-size: 13.5px;
    }

    .cep-reader-layout {
        flex-direction: column;
        gap: 12px;
    }
    .cep-thumbs-sidebar {
        width: 100%;
        position: static;
        order: 2;
    }
    .cep-main-stage-wrap {
        order: 1;
        width: 100%;
    }
    .cep-right-sidebar {
        order: 3;
        width: 100%;
    }
    .cep-thumbs-list {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        gap: 8px;
    }
    .cep-thumb-item {
        width: 92px;
        flex-shrink: 0;
    }

    /* Popup Modal Responsive Layout */
    .cep-modal-dialog {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        max-height: 92vh;
        margin: 4vh auto;
        border-radius: 8px;
    }

    .cep-modal-close {
        right: 8px;
        top: 8px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .cep-modal-body {
        padding: 10px;
    }

    .cep-modal-footer {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cep-action-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
    }

    .cep-btn-download {
        grid-column: 1 / -1;
        width: 100%;
        padding: 9px 12px;
        font-size: 13.5px;
    }

    .cep-action-buttons .cep-btn:not(.cep-btn-download) {
        width: 100%;
        padding: 8px 10px;
        font-size: 13px;
    }

    #cep-modal-jump-area {
        width: 100%;
    }

    .cep-jump-btn {
        width: 100%;
        padding: 9px 12px;
        font-size: 13.5px;
        text-align: center;
    }
}
