/**
 * Techbari Print News - Full E-Paper & Print Stylesheet
 * Author: techbari.com
 */

:root {
    --primary-color: #005b96;
    --body-font: 'SolaimanLipi', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --serif-font: 'Noto Serif Bengali', 'SolaimanLipi', serif;
    --epaper-navy: #004b87;
    --epaper-subbar: #005b96;
    --epaper-red: #d32f2f;
    --epaper-yellow: #ffe500;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body-font);
    background-color: #cbd5e1;
    color: #0f172a;
    line-height: 1.65;
    padding-bottom: 120px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Viewport Container for Mobile Scaling & Pan */
.epaper-viewport-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    padding: 18px 0;
}

/* Base Card Container */
.print-paper-wrapper {
    width: 600px;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(0,0,0,0.22);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    flex-shrink: 0;
}

/* ===================================================
   1. PREMIER: CLASSIC BROADSHEET E-PAPER
   =================================================== */
.design-classic_epaper {
    border: 3px solid var(--epaper-subbar) !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    width: 600px;
    max-width: 100%;
    min-height: auto;
    box-sizing: border-box;
    position: relative;
}

.classic-epaper-layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
    justify-content: flex-start;
    box-sizing: border-box;
}

.classic-epaper-layout .epaper-article-grid {
    flex: 1 0 auto;
}

/* 1.1 Masthead Header */
.epaper-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    gap: 10px;
    position: relative;
    box-sizing: border-box;
    min-height: 98px;
}

/* Left: Spacer / Book Logo */
.epaper-masthead-left {
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
}

.epaper-sparkle-star {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 14px;
    height: 14px;
}

.epaper-book-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center: Centered Dynamic Logo & Tagline */
.epaper-masthead-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
}

.epaper-dynamic-logo {
    max-height: 88px;
    width: auto;
    max-width: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.epaper-newspaper-name {
    font-size: 38px;
    font-weight: 900;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.name-part-en {
    color: #003865;
    font-family: Arial, 'Noto Serif Bengali', sans-serif;
    font-weight: 900;
}

.name-part-bn {
    color: #007a3d;
    font-family: 'SolaimanLipi', 'Hind Siliguri', serif;
    font-weight: 900;
}

.epaper-tagline-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    margin-top: 3px;
}

.epaper-tagline-line {
    flex: 1;
    height: 2.5px;
    background: #e50914;
}

.epaper-tagline-text {
    font-size: 13.5px;
    font-weight: 800;
    color: #003865;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Right: Pen Nib + Divider + Angled / Rotated Upward Text */
.epaper-masthead-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    text-align: left;
    position: relative;
    padding-right: 8px;
    overflow: visible;
}

.epaper-nib-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.epaper-right-divider {
    width: 2px;
    height: 48px;
    background: #005b96;
    flex-shrink: 0;
    margin: 0 3px 0 1px;
}

.epaper-right-text-block {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    transform: rotate(-14deg);
    transform-origin: 0% 50%;
    white-space: nowrap;
    margin-left: 3px;
    margin-top: 10px;
}

.epaper-edition-badge {
    font-size: 17.5px;
    font-weight: 900;
    color: #003865;
    line-height: 1.05;
    margin-bottom: 2px;
    font-family: 'SolaimanLipi', 'Hind Siliguri', sans-serif;
    letter-spacing: -0.2px;
}

.epaper-date-text {
    font-size: 12px;
    font-weight: 800;
    color: #003865;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.epaper-day-text {
    font-size: 11.5px;
    font-weight: 800;
    color: #003865;
    line-height: 1.15;
    letter-spacing: -0.2px;
}

/* 1.2 Sub-Header Blue Strip */
.epaper-infobar {
    background: var(--epaper-subbar);
    color: #ffffff;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 700;
}

.epaper-infobar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.epaper-pipe {
    color: #ffffff;
    opacity: 0.8;
    font-weight: 300;
}

.epaper-info-item {
    white-space: nowrap;
}

/* 1.3 Featured Photo & Caption Box */
.epaper-photo-frame {
    margin: 10px 12px 10px 12px;
    border: 1px solid #64748b;
    background: #ffffff;
}

.epaper-photo-frame img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.epaper-photo-caption {
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    border-top: 1px solid #64748b;
    background: #ffffff;
    text-align: center;
    line-height: 1.45;
    font-family: 'SolaimanLipi', 'Hind Siliguri', sans-serif;
}

/* 1.4 Lead Headline Banner (Solid Navy with White & Yellow) */
.epaper-lead-headline {
    background: var(--epaper-navy);
    padding: 10px 14px 12px 14px;
    margin: 0 12px 10px 12px;
    border-radius: 0;
    text-align: center;
}

.epaper-headline-line1 {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
    font-family: 'SolaimanLipi', 'Hind Siliguri', serif;
}

.epaper-headline-line2 {
    font-size: 29px;
    font-weight: 900;
    color: var(--epaper-yellow);
    line-height: 1.25;
    margin: 3px 0 0 0;
    letter-spacing: -0.2px;
    font-family: 'SolaimanLipi', 'Hind Siliguri', serif;
}

/* 1.5 3-Column Newspaper Body with Guaranteed Column Dividers */
.epaper-article-container {
    position: relative;
    margin: 0 12px;
    width: calc(100% - 24px);
    box-sizing: border-box;
}

.epaper-article-grid {
    padding: 0;
    column-count: 3;
    column-gap: 24px;
    column-rule: none;
    text-align: justify;
    text-justify: inter-word;
    font-size: 14px;
    line-height: 1.48;
    color: #0f172a;
    font-family: 'SolaimanLipi', 'Hind Siliguri', sans-serif;
}

.epaper-col-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background-color: #84baba;
    pointer-events: none;
    z-index: 2;
}

.epaper-col-divider-1 {
    left: calc(33.333% - 4px);
}

.epaper-col-divider-2 {
    left: calc(66.666% + 4px);
}

.epaper-reporter-tag {
    border-left: 5px solid #e50914;
    padding-left: 9px;
    padding-top: 2px;
    padding-bottom: 7px;
    margin-bottom: 10px;
    border-bottom: 1.5px solid #84baba;
    display: block;
    width: 100%;
}

.epaper-reporter-name {
    font-weight: 800;
    color: #000000;
    font-size: 14.5px;
    line-height: 1.35;
}

.epaper-reporter-date {
    font-size: 12.5px;
    color: #334155;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 4px;
    margin-bottom: 5px;
}

.epaper-article-grid p {
    margin-bottom: 6px;
    line-height: 1.48;
    text-indent: 0;
}

.epaper-article-grid p:empty,
.epaper-article-grid p:blank {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}

.epaper-article-grid img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
}

/* 1.6 Bottom Panoramic Ornamental Ribbon */
.epaper-footer-ribbon {
    background: #f1f5f9;
    color: var(--epaper-navy);
    border-top: 2px solid var(--epaper-navy);
    border-bottom: 2px solid var(--epaper-navy);
    padding: 5px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
    margin-top: 16px;
    min-height: 44px;
}

.epaper-footer-logo-center {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6px;
}

.epaper-footer-dynamic-logo {
    max-height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    background: transparent;
}

.epaper-footer-motto {
    font-size: 15px;
    font-weight: 800;
    color: var(--epaper-navy);
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-align: center;
    flex-grow: 1;
    font-family: 'SolaimanLipi', 'Hind Siliguri', serif;
}

.epaper-footer-art-left, .epaper-footer-art-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ===================================================
   STANDARD LAYOUT ELEMENTS (FOR OTHER 10 DESIGNS)
   =================================================== */
.print-header {
    text-align: center;
    margin-bottom: 15px;
}

.print-header img {
    max-height: 90px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.print-date-bar {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.print-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 12px;
    text-align: left;
}

.print-meta-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: #4b5563;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.print-meta-info .category-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 13px;
}

.print-featured-image {
    text-align: center;
    margin-bottom: 20px;
}

.print-featured-image img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 4px;
}

.print-featured-image .image-caption {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    font-style: italic;
}

.article-body-content {
    font-size: 18px;
    color: #1f2937;
    text-align: justify;
}

.article-body-content p {
    margin-bottom: 8px;
    line-height: 1.55;
}

.article-body-content p:empty,
.article-body-content p:blank {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}

.article-body-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: 4px;
}

.print-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
    text-align: center;
    font-size: 14px;
    color: #4b5563;
}

.print-footer p {
    margin-bottom: 4px;
}

/* PRESET ALTERNATIVE LAYOUTS */
.design-online {
    padding: 24px;
}
.design-online .print-title { text-align: center; }

.design-epaper_2col {
    padding: 24px;
}
.design-epaper_2col .article-body-content {
    column-count: 2;
    column-gap: 28px;
    column-rule: 1px solid #e5e7eb;
}

.design-epaper_3col {
    padding: 24px;
}
.design-epaper_3col .article-body-content {
    column-count: 3;
    column-gap: 22px;
    column-rule: 1px solid #e5e7eb;
}

.design-magazine {
    padding: 26px;
    border-top: 6px solid var(--primary-color);
}
.design-magazine .print-title {
    font-size: 32px;
    color: #000000;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}
.design-magazine .article-body-content p:first-of-type::first-letter {
    font-size: 42px;
    float: left;
    line-height: 1;
    padding-right: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

.design-vintage {
    font-family: var(--serif-font);
    border: 6px double #111827;
    padding: 25px;
}
.design-vintage .print-title {
    font-family: var(--serif-font);
    font-size: 30px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.design-vintage .print-date-bar {
    background-color: #111827;
}

.design-royal_frontpage {
    border: 2px solid var(--primary-color);
    padding: 35px;
    background: #ffffff;
    position: relative;
}
.design-royal_frontpage .print-header {
    background: var(--primary-color);
    padding: 15px;
    margin: -35px -35px 20px -35px;
    text-align: center;
}
.design-royal_frontpage .print-header img {
    filter: brightness(0) invert(1);
}
.design-royal_frontpage .print-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    line-height: 1.3;
    margin: 15px 0;
}
.design-royal_frontpage .article-body-content {
    column-count: 2;
    column-gap: 30px;
    column-rule: 1px solid #cbd5e1;
}

.design-editorial_times {
    border-top: 8px solid var(--primary-color);
    padding: 30px 25px;
    font-family: var(--serif-font);
}
.design-editorial_times .print-title {
    font-family: var(--serif-font);
    font-size: 30px;
    font-weight: 700;
    color: #111827;
    text-align: left;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.design-dark_press {
    background: #0f172a;
    color: #f8fafc;
    border-top: 5px solid var(--primary-color);
    padding: 30px;
}
.design-dark_press .print-title {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
}
.design-dark_press .article-body-content {
    color: #cbd5e1;
}
.design-dark_press .print-meta-info {
    border-bottom-color: #334155;
    color: #94a3b8;
}
.design-dark_press .print-footer {
    border-top-color: #334155;
    color: #94a3b8;
}

.design-metro_brief {
    position: relative;
    padding: 24px;
    padding-top: 0;
    overflow: hidden;
}
.design-metro_brief::before {
    content: '';
    display: block;
    height: 10px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #2563eb 100%);
    margin: -30px -30px 20px -30px;
}
.design-metro_brief .print-title {
    background: #f8fafc;
    padding: 15px;
    border-left: 6px solid var(--primary-color);
    font-size: 28px;
    margin-bottom: 20px;
}
.design-metro_brief .article-body-content {
    column-count: 2;
    column-gap: 25px;
}

.design-official_gazette {
    border: 4px double #1f2937;
    outline: 1px solid var(--primary-color);
    outline-offset: 4px;
    padding: 35px;
    font-family: var(--serif-font);
}

/* ===================================================
   FLOATING CONTROL TOOLBAR (NON-PRINTABLE)
   =================================================== */
.print-toolbar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    max-width: 96vw;
    overflow-x: auto;
    white-space: nowrap;
}

.tb-btn {
    background: #334155;
    color: #ffffff;
    border: none;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: var(--body-font);
    white-space: nowrap;
    text-decoration: none;
}

.tb-btn:hover {
    background: #475569;
    color: #ffffff;
}

.tb-btn.btn-print {
    background: #004b87;
}
.tb-btn.btn-print:hover {
    background: #003865;
}

.tb-btn.btn-save {
    background: #2563eb;
}
.tb-btn.btn-save:hover {
    background: #1d4ed8;
}

.tb-btn.btn-fit {
    background: #0d9488;
}
.tb-btn.btn-fit:hover {
    background: #0f766e;
}

.tb-select {
    background: #334155;
    color: #ffffff;
    border: 1px solid #475569;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--body-font);
    outline: none;
}

.tb-divider {
    width: 1px;
    height: 22px;
    background: #475569;
    flex-shrink: 0;
}

/* Optional QR Code Box in footer */
.epaper-qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}
.epaper-qr-wrapper .qr-caption {
    font-size: 10px;
    color: #64748b;
}

/* Print Media Queries */
@media print {
    body {
        background: #ffffff !important;
        padding-bottom: 0 !important;
    }

    .no-print, .print-toolbar {
        display: none !important;
    }

    .epaper-viewport-wrapper {
        padding: 0 !important;
        display: block !important;
        height: auto !important;
    }

    .print-paper-wrapper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: none !important;
        transform: none !important;
    }

    .design-classic_epaper {
        border: 3px solid #005b96 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }

    .epaper-lead-headline, .epaper-infobar, .epaper-footer-ribbon {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
