@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700;800;900&family=Noto+Serif+Bengali:wght@400;600;700;800;900&display=swap');

:root {
    --pe-brand-color: #dc2626;
    --pe-brand-dark: #b91c1c;
    --pe-brand-light: #fee2e2;
    --pe-border-color: #dc2626;
    --pe-text-primary: #000000;
    --pe-text-secondary: #222222;
    --pe-bg-page: #f1f5f9;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--pe-bg-page);
    font-family: 'Noto Serif Bengali', serif;
    color: var(--pe-text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* 🎛️ Top Interactive Control Bar */
.pe-control-navbar {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Noto Sans Bengali', sans-serif;
}

.pe-nav-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0;
}

.pe-nav-left, .pe-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.pe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    font-family: 'Noto Sans Bengali', sans-serif;
    white-space: nowrap;
}

.pe-btn-primary {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}
.pe-btn-primary:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

/* 🔴 ব্রান্ড লাল একক সলিড কালার ডাউনলোড বোতাম (কোনো ইফেক্ট বা অ্যানিমেশন ছাড়া) */
.pe-btn-success {
    background-color: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
}
.pe-btn-success:hover {
    background-color: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
}

.pe-btn-dark {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}
.pe-btn-dark:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

.pe-btn-bw-toggle {
    background-color: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}
.pe-btn-bw-toggle:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}
.pe-btn-bw-toggle.active {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.pe-btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #334155;
}
.pe-btn-group .pe-btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid #334155;
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 6px 9px;
    font-size: 12px;
}
.pe-btn-group .pe-btn:last-child {
    border-right: none;
}
.pe-btn-group .pe-btn.active,
.pe-btn-group .pe-btn:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
}

/* 🔽 Download Dropdown Menu (সলিড ব্র্যান্ড থিম - শুধু ক্লিকে ওপেন হবে) */
.pe-dropdown {
    position: relative;
    display: inline-block;
}

.pe-dropdown-toggle {
    cursor: pointer;
}

.pe-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 175px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    z-index: 1050;
    overflow: hidden;
    padding: 4px;
}

.pe-dropdown.active .pe-dropdown-menu {
    display: block !important;
}

.pe-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Sans Bengali', sans-serif;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    box-sizing: border-box;
}

.pe-dropdown-item:hover {
    background-color: #dc2626;
    color: #ffffff;
}

/* 📰 Main Container */
.pe-workspace {
    padding: 30px 15px 70px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 36px;
}

.pe-card-container-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 🖼️ খাঁটি সংবাদপত্রের কাটিং ফ্রেম (সুষম কার্ভ ও ব্র্যান্ড বর্ডার) */
.pe-newspaper-card {
    background: #ffffff;
    border: 4px solid var(--pe-border-color);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 📏 ১ কলাম লেআউট (চিকন খবরের কাগজ কাটিং, নো-ইমেজ) */
.pe-newspaper-card.layout-col-1 {
    width: 360px;
    max-width: 100%;
    border-color: var(--pe-border-color) !important;
}
.pe-newspaper-card.layout-col-1 .pe-featured-image-wrap {
    display: none !important;
}
.pe-newspaper-card.layout-col-1 .pe-headline {
    font-size: 21px;
    line-height: 1.28;
    color: #000000 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: center !important;
}
.pe-newspaper-card.layout-col-1 .pe-header-logo {
    max-height: 32px !important;
    max-width: 160px !important;
    filter: none !important;
}
.pe-newspaper-card.layout-col-1 .pe-header-date-text {
    font-size: 11px !important;
    color: var(--pe-brand-color) !important;
}
.pe-newspaper-card.layout-col-1 .pe-reporter-badge-block {
    border-bottom-color: #dc2626 !important;
}
.pe-newspaper-card.layout-col-1 .pe-reporter-badge-block .pe-reporter-icon {
    color: #dc2626 !important;
}

/* 📏 ২ কলাম লেআউট (মাঝারি ২ কলাম কাটিং) */
.pe-newspaper-card.layout-col-2 {
    width: 580px;
    max-width: 100%;
    border-color: var(--pe-border-color) !important;
}
.pe-newspaper-card.layout-col-2 .pe-featured-image-wrap {
    display: block;
}
.pe-newspaper-card.layout-col-2 .pe-featured-image {
    filter: none !important;
}
.pe-newspaper-card.layout-col-2 .pe-headline {
    font-size: 27px;
    line-height: 1.28;
    color: #000000 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: center !important;
}
.pe-newspaper-card.layout-col-2 .pe-header-logo {
    max-height: 44px !important;
    max-width: 220px !important;
    filter: none !important;
}
.pe-newspaper-card.layout-col-2 .pe-header-date-text {
    font-size: 12px !important;
    color: var(--pe-brand-color) !important;
}
.pe-newspaper-card.layout-col-2 .pe-reporter-badge-block {
    border-bottom-color: #dc2626 !important;
}
.pe-newspaper-card.layout-col-2 .pe-reporter-badge-block .pe-reporter-icon {
    color: #dc2626 !important;
}

/* 📏 ৩ কলাম লেআউট (স্ট্যান্ডার্ড ৩ কলাম কাটিং) */
.pe-newspaper-card.layout-col-3 {
    width: 760px;
    max-width: 100%;
    border-color: var(--pe-border-color) !important;
}
.pe-newspaper-card.layout-col-3 .pe-featured-image-wrap {
    display: block;
}
.pe-newspaper-card.layout-col-3 .pe-featured-image {
    filter: none !important;
}
.pe-newspaper-card.layout-col-3 .pe-headline {
    font-size: 32px;
    line-height: 1.28;
    color: #dc2626 !important;
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: center !important;
}
.pe-newspaper-card.layout-col-3 .pe-header-logo {
    max-height: 54px !important;
    max-width: 270px !important;
    filter: none !important;
}
.pe-newspaper-card.layout-col-3 .pe-header-date-text {
    font-size: 13.5px !important;
    color: var(--pe-brand-color) !important;
}
.pe-newspaper-card.layout-col-3 .pe-reporter-badge-block {
    border-bottom-color: #dc2626 !important;
}
.pe-newspaper-card.layout-col-3 .pe-reporter-badge-block .pe-reporter-icon {
    color: #dc2626 !important;
}

/* 🖤🤍 সাদা-কালো মোড রুলস (টগল বোতামে ক্লিক করলে সক্রিয় হবে - ১, ২, ৩ সব কলামেই) */
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-featured-image {
    filter: grayscale(100%) contrast(105%) !important;
}
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-header-logo {
    filter: grayscale(100%) !important;
}
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-headline {
    color: #000000 !important;
}
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-header-date-text {
    color: #333333 !important;
}
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-reporter-badge-block {
    border-bottom-color: #111111 !important;
}
.pe-workspace.mode-grayscale .pe-newspaper-card .pe-reporter-badge-block .pe-reporter-icon {
    color: #111111 !important;
}

/* 🔹 Card Header (বামে লোগো এবং ডানে সাধারণ টেক্সটে তারিখ - কোনো ব্যাকগ্রাউন্ড বা বক্স ছাড়া) */
.pe-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    gap: 12px;
    width: 100%;
}

.pe-header-logo-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.pe-header-logo {
    max-height: 48px;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

.pe-header-date-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    text-align: right;
}

.pe-header-date-text {
    font-family: 'Noto Sans Bengali', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

/* 🖼️ Featured Image */
.pe-featured-image-wrap {
    width: 100%;
    margin-top: 10px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8fafc;
}

.pe-featured-image {
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: cover;
    display: block;
}

/* 📝 News Headline (প্রথম লাইন ও ফুল লাইন দুই প্রান্তে ইমেজের সাথে জাস্টিফাইড এবং অবশিষ্ট শেষ লাইন সেন্টারে) */
.pe-headline-wrap {
    margin-top: 10px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.pe-headline {
    font-family: 'Noto Serif Bengali', serif;
    font-weight: 900;
    line-height: 1.28;
    color: #000000;
    margin: 0 auto;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: center;
    letter-spacing: -0.2px;
    word-break: break-word;
    box-sizing: border-box;
}

/* 🏷️ Reporter Badge Block (কলামের প্রস্থ জুড়ে আন্ডারলাইনসহ বোল্ড হেডার - সর্বদা ন্যাচারাল বামে অ্যালাইন থাকবে) */
.pe-reporter-badge-block {
    display: block;
    width: 100%;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #dc2626;
    font-family: 'Noto Sans Bengali', sans-serif;
    font-weight: 800;
    font-size: 13.5px;
    color: #000000;
    break-inside: avoid;
    line-height: 1.3;
    text-align: left !important;
    text-align-last: left !important;
    text-justify: auto !important;
}

.pe-reporter-badge-block *,
.pe-reporter-icon,
.pe-reporter-name {
    text-align: left !important;
    text-align-last: left !important;
    text-justify: auto !important;
}

.pe-reporter-badge-block .pe-reporter-icon {
    color: #dc2626;
    margin-right: 4px;
    font-weight: 900;
}

/* 📰 Multi-Column Content Area (একটানা লেখা, নিখুঁত জাস্টিফিকেশন ও ব্যালেন্স) */
.pe-article-content {
    font-family: 'Noto Serif Bengali', serif;
    color: #000000;
    font-size: 16.5px; /* ১ সাইজ বড় ও স্পষ্ট ডিফল্ট ফন্ট সাইজ */
    line-height: 1.62;
    margin-top: 6px;
    box-sizing: border-box;
    width: 100%;
}

.pe-columns-row {
    display: flex;
    gap: 22px;
    width: 100%;
    align-items: flex-start;
    box-sizing: border-box;
}

.pe-newspaper-card.layout-col-1 .pe-columns-row {
    gap: 0 !important;
}

.pe-newspaper-card.layout-col-2 .pe-columns-row {
    gap: 18px !important;
}

.pe-newspaper-card.layout-col-3 .pe-columns-row {
    gap: 22px !important;
}

.pe-column-box {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    font-family: 'Noto Serif Bengali', serif;
    font-size: inherit;
    line-height: 1.62;
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left;
    word-break: normal;
    overflow-wrap: break-word;
    color: #000000;
    box-sizing: border-box;
}

/* 📰 কলাম ১ এবং কলাম ২-এর মূল নিউজ টেক্সটের শেষ লাইন দুই প্রান্ত ছুঁয়ে ১০০% জাস্টিফাইড থাকবে */
.pe-column-box:not(:last-child) > .pe-column-text {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: justify !important;
}

.pe-column-box:last-child > .pe-column-text {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
}

.pe-column-text {
    display: block;
    width: 100%;
    font-family: 'Noto Serif Bengali', serif;
    font-size: inherit;
    line-height: 1.62;
    text-align: justify !important;
    text-justify: inter-word !important;
    word-break: normal;
    overflow-wrap: break-word;
}

.pe-article-content p,
.pe-article-content span:not(.pe-reporter-icon):not(.pe-reporter-name),
.pe-article-content div:not(.pe-reporter-badge-block):not(.pe-columns-row):not(.pe-column-box) {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    text-decoration: none !important;
    border: none !important;
    display: inline;
    text-align: justify !important;
}

/* 🚫 কোনো লিঙ্ক কালার, আন্ডারলাইন বা অবাঞ্ছিত গ্যাপ থাকবে না */
.pe-article-content a,
.pe-article-content a:hover,
.pe-article-content a:visited,
.pe-article-content a:active,
.pe-article-content a:focus {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
}

.pe-article-content * {
    text-decoration: none !important;
}

.pe-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin: 4px 0;
    break-inside: avoid;
    display: block;
}

/* 🔻 Card Footer */
.pe-card-footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-family: 'Noto Sans Bengali', sans-serif;
}

.pe-footer-editor {
    font-size: 13px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 2px 0;
}

.pe-footer-company {
    font-size: 12px;
    font-weight: 500;
    color: #333333;
    margin: 0 0 2px 0;
}

.pe-footer-copyright {
    font-size: 11.5px;
    color: #555555;
    margin: 0;
}

/* 💻 ডেভেলপার ক্রেডিট ফুটার (কার্ডের সাইজ অনুযায়ী উভয় প্রান্তে নিখুঁত অ্যালাইনমেন্ট) */
.system-footer-credits { 
    margin-top: 6px;
    width: 760px;
    max-width: 760px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 11.5px; 
    color: #64748b; 
    font-weight: 500;
    font-family: 'Noto Sans Bengali', sans-serif;
    padding: 0;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

.pe-workspace.layout-mode-1 .system-footer-credits {
    width: 360px !important;
    max-width: 360px !important;
}

.pe-workspace.layout-mode-2 .system-footer-credits {
    width: 580px !important;
    max-width: 580px !important;
}

.pe-workspace.layout-mode-3 .system-footer-credits {
    width: 760px !important;
    max-width: 760px !important;
}

.system-footer-credits a { 
    color: #dc2626; 
    text-decoration: none; 
    font-weight: 600; 
}
.system-footer-credits a:hover { 
    color: #b91c1c; 
    text-decoration: underline;
}

/* 🖨️ Native Print Styles */
@media print {
    .pe-control-navbar,
    .system-footer-credits {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        padding: 0 !important;
    }
    .pe-workspace {
        padding: 0 !important;
        gap: 20px !important;
    }
    .pe-newspaper-card {
        border: 3px solid #000000 !important;
        box-shadow: none !important;
        padding: 12px 16px !important;
        border-radius: 0 !important;
        page-break-after: always;
    }
}

/* 📱 Mobile Responsive View */
@media (max-width: 768px) {
    .pe-control-navbar {
        padding: 8px 10px;
    }
    .pe-nav-container {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .pe-nav-left, .pe-nav-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    .pe-btn {
        padding: 5px 9px;
        font-size: 11.5px;
    }
    .pe-btn-group .pe-btn {
        padding: 5px 8px;
        font-size: 11.5px;
    }
    .pe-workspace {
        padding: 16px 8px 50px 8px;
        gap: 24px;
        overflow-x: hidden;
    }
    .pe-card-container-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 2px;
    }
    .pe-newspaper-card {
        padding: 12px 14px;
        border-width: 3px;
        border-radius: 6px;
    }
    .pe-header-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .pe-header-logo {
        max-height: 34px !important;
        max-width: 160px !important;
    }
    .pe-header-date-text {
        font-size: 11px !important;
    }
    .pe-newspaper-card.layout-col-1 {
        width: 100% !important;
        max-width: 360px !important;
    }
    .pe-newspaper-card.layout-col-2 {
        width: 100% !important;
        max-width: 580px !important;
    }
    .pe-newspaper-card.layout-col-3 {
        width: 100% !important;
        max-width: 760px !important;
    }
    .pe-workspace.layout-mode-1 .system-footer-credits,
    .pe-workspace.layout-mode-2 .system-footer-credits,
    .pe-workspace.layout-mode-3 .system-footer-credits,
    .system-footer-credits {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .pe-control-navbar {
        padding: 6px 4px;
    }
    .pe-nav-container {
        gap: 6px;
    }
    .pe-nav-left, .pe-nav-right {
        gap: 4px;
    }
    .pe-btn {
        padding: 5px 7px;
        font-size: 11px;
        gap: 3px;
    }
    .pe-btn-group .pe-btn {
        padding: 5px 6px;
        font-size: 11px;
    }
    .pe-dropdown-menu {
        min-width: 155px;
        padding: 3px;
    }
    .pe-dropdown-item {
        padding: 7px 10px;
        font-size: 12px;
    }
    .pe-header-logo {
        max-height: 28px !important;
        max-width: 130px !important;
    }
    .pe-header-date-text {
        font-size: 10px !important;
    }
}
