/* ==========================================================================
   ePaper Digital Portal - Clean Unified Design System & Reader Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --------------------------------------------------------------------------
   1. Theme System & Variables
   -------------------------------------------------------------------------- */
:root {
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: var(--font-body);

    /* Primary Palette Default Tokens */
    --theme-primary: #0b499d;
    --theme-primary-dark: #082856;
    --theme-secondary: #ffc709;
    --theme-secondary-hover: #e0ac00;
    
    --bg-main: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-elevated: #eef2f6;

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);

    --transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    --color-danger: #ef4444;
    --color-info: #0284c7;
    --color-warning: #ffc107;
    --color-success: #059669;
    --text-on-primary: #ffffff;
    --text-on-secondary: #000000;
    --bg-dark-surface: #0f172a;
}

/* Color Themes */
body.theme-classic_blue,
body.theme-sakshi {
    --theme-primary: #0b499d;
    --theme-primary-dark: #082856;
    --theme-secondary: #ffc709;
}

body.theme-purple {
    --theme-primary: #8e24aa;
    --theme-primary-dark: #6a1b9a;
    --theme-secondary: #ffc107;
}

body.theme-executive_blue,
body.theme-eenadu {
    --theme-primary: #0266c8;
    --theme-primary-dark: #014385;
    --theme-secondary: #ffc709;
}

body.theme-crimson {
    --theme-primary: #dc2626;
    --theme-primary-dark: #991b1b;
    --theme-secondary: #ffc107;
}

body.theme-onyx {
    --theme-primary: #1e293b;
    --theme-primary-dark: #0f172a;
    --theme-secondary: #f59e0b;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.45;
    font-size: 0.85rem;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Common Unified Buttons & Badges */
.btn-base,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none !important;
    font-family: var(--font-body);
    white-space: nowrap;
    user-select: none;
}
.btn:hover,
.btn-base:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.btn:active,
.btn-base:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--theme-primary);
    color: #ffffff !important;
}
.btn-primary:hover {
    background: var(--theme-primary-dark);
}

.btn-secondary {
    background: var(--theme-secondary);
    color: #000000 !important;
}
.btn-secondary:hover {
    background: var(--theme-secondary-hover);
}

.btn-success {
    background: #10b981;
    color: #ffffff !important;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff !important;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: #0ea5e9;
    color: #ffffff !important;
}
.btn-info:hover {
    background: #0284c7;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
}

.btn-admin.btn-outline,
.btn-outline {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.btn-admin.btn-outline:hover,
.btn-outline:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--border-strong) !important;
}

.btn-admin.btn-sm,
.btn-sm {
    padding: 5px 10px !important;
    font-size: 0.76rem !important;
}

/* Unified Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    line-height: 1.25;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-pill { border-radius: var(--radius-full); }

.badge-primary   { background: var(--theme-primary); color: #ffffff; }
.badge-secondary { background: var(--theme-secondary); color: #000000; }
.badge-neutral   { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-color); }
.badge-info      { background: var(--color-info); color: #ffffff; }
.badge-success   { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-warning   { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.badge-danger    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-purple    { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }

/* --------------------------------------------------------------------------
   3. Header Utility Bar & Masthead
   -------------------------------------------------------------------------- */
.top-header-bar {
    background: var(--theme-primary-dark);
    color: #ffffff;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 500;
}

.top-header-bar-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-header-bar .date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--theme-secondary);
}

.top-header-bar .top-social-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-btn {
    color: #cbd5e1;
    font-size: 0.85rem;
    transition: var(--transition);
}

.social-btn:hover {
    color: var(--theme-secondary);
}

.publisher-portal-badge {
    background: var(--theme-secondary);
    color: #000000;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.74rem;
    text-transform: uppercase;
}

/* Brand Masthead Container */
.portal-masthead {
    background-color: var(--theme-primary);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color: #ffffff;
    padding: 16px 20px;
    border-bottom: 3px solid var(--theme-secondary);
    min-height: 100px;
}

.portal-masthead-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-masthead-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: #ffffff;
    max-width: 100%;
}

.site-logo-img {
    max-height: 70px;
    max-width: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.site-logo-img[data-shape="square"] {
    max-height: 65px;
    max-width: 65px;
    aspect-ratio: 1 / 1;
}

.site-logo-img[data-shape="rectangle"] {
    max-height: 65px;
    max-width: 260px;
}

.site-title-tagline-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-text-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.1;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.site-tagline-sub {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--theme-secondary);
    letter-spacing: 0.5px;
    margin-top: 3px;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. Navigation Bar & Submenu Dropdowns
   -------------------------------------------------------------------------- */
.portal-navbar {
    background: var(--theme-primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.portal-navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
}

.mobile-nav-toggle {
    display: none;
    background: var(--theme-secondary);
    color: #000000;
    border: none;
    padding: 6px 12px;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.portal-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

.portal-nav-menu li a {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-nav-menu li.active a,
.portal-nav-menu li a:hover {
    background: var(--theme-secondary);
    color: #000000;
    border-radius: var(--radius-sm);
}

.nav-dropdown-item {
    position: relative;
}

.dropdown-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--theme-primary-dark);
    min-width: 240px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    list-style: none;
    padding: 6px 0;
    z-index: 2500;
    border: 1.5px solid var(--theme-secondary);
}

.nav-dropdown-item:hover > .dropdown-submenu,
.nav-dropdown-item.expanded > .dropdown-submenu {
    display: block !important;
}

.dropdown-submenu li a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-submenu li a:hover {
    background: var(--theme-secondary) !important;
    color: #000000 !important;
}

.portal-navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.portal-search-box span {
    color: var(--theme-secondary);
    font-size: 0.78rem;
    margin-right: 6px;
}

.portal-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    width: 130px;
}

.portal-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   4b. Continuous Infinite News Ticker Component (Theme-Aware)
   -------------------------------------------------------------------------- */
.news-ticker-bar {
    background: var(--theme-primary-dark, #082856);
    color: #ffffff;
    border-bottom: 2px solid var(--theme-secondary, #ffc709);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 990;
    overflow: hidden;
}

.news-ticker-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    min-height: 38px;
}

.ticker-label-badge {
    padding: 0 16px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
    position: relative;
    flex-shrink: 0;
}

/* Theme-Aware Ticker Label Badge Styles */
.ticker-style-red_pulse .ticker-label-badge {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
}

.ticker-style-gold_glow .ticker-label-badge {
    background: var(--theme-primary, #0b499d);
    color: var(--theme-secondary, #ffc709);
    border-right: 2px solid var(--theme-secondary, #ffc709);
}

.ticker-style-dark_badge .ticker-label-badge {
    background: #1e293b;
    color: #38bdf8;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.ticker-style-emerald_badge .ticker-label-badge {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
}

.ticker-style-neon_purple .ticker-label-badge {
    background: linear-gradient(135deg, #8e24aa 0%, #4a148c 100%);
    color: #ffffff;
}

.ticker-track-viewport {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
}

.ticker-track-wrapper {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    animation: marqueeScroll 25s linear infinite;
}

.news-ticker-bar:hover .ticker-track-wrapper {
    animation-play-state: paused;
}

.ticker-item-group {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 600;
    color: #e2e8f0;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* --------------------------------------------------------------------------
   5. Calendar Widget Popover
   -------------------------------------------------------------------------- */
.calendar-trigger-btn {
    background: var(--theme-secondary);
    color: #000000;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-picker-popover {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    width: 290px;
    padding: 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    z-index: 1100;
}

.calendar-picker-popover.active {
    display: block;
}

.calendar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-month-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--theme-primary);
}

.calendar-nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.calendar-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: #ffffff;
    cursor: default;
    position: relative;
    user-select: none;
}

.cal-day-cell.empty-cell {
    background: transparent !important;
    border: none !important;
}

.cal-day-cell.published {
    color: var(--text-primary);
    font-weight: 800;
    background: #f1f5f9;
    cursor: pointer;
    border: 1px solid var(--theme-primary, #0b499d);
}

.cal-day-cell.published::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 5px;
    height: 5px;
    background: #10b981;
    border-radius: 50%;
}

.cal-day-cell.published:hover {
    background: var(--theme-primary);
    color: #ffffff;
}

.cal-day-cell.selected {
    background: var(--theme-primary);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cal-day-cell.disabled {
    opacity: 0.28;
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed !important;
    pointer-events: none !important;
    border: 1px solid transparent;
}

/* --------------------------------------------------------------------------
   6. Homepage Main Grid & Card Covers
   -------------------------------------------------------------------------- */
.main-wrapper {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}

.content-column {
    min-width: 0;
}

.section-block {
    margin-bottom: 28px;
}

.section-header-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--theme-primary);
    padding-bottom: 6px;
    margin-bottom: 16px;
}

.section-header-title h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--theme-primary);
    text-transform: uppercase;
}

.epaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px 16px;
    padding-top: 10px;
}

@media (max-width: 480px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 14px 10px;
    }
}

.epaper-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.epaper-card:hover {
    border-color: var(--theme-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.epaper-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 0.72;
    background: #0f172a;
    overflow: hidden;
    border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

.epaper-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.epaper-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    gap: 8px;
    transition: var(--transition);
}

.epaper-card:hover .epaper-card-overlay {
    opacity: 1;
}

.card-action-btn {
    background: var(--theme-secondary);
    color: #000000;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.epaper-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--theme-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

/* ==========================================================================
   ePaper Edition Badge Styles & Motion Animations (Admin Configurable)
   ========================================================================== */

/* Card Container Overflow Rules depending on badge style */
.badge-style-ribbon_3d .epaper-card,
.badge-style-diagonal_stitched .epaper-card,
.badge-style-page_curl .epaper-card {
    position: relative !important;
    overflow: hidden !important;
}

.badge-style-pill_overlap .epaper-card {
    position: relative !important;
    overflow: visible !important;
}

.epaper-card-status-badge {
    position: absolute;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 100 !important;
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
}

/* --- LEFT CORNER POSITIONING (badge-pos-left / default) --- */
.badge-pos-left.badge-style-ribbon_3d .epaper-card-status-badge,
.badge-style-ribbon_3d:not(.badge-pos-right) .epaper-card-status-badge {
    top: 18px;
    left: -36px;
    right: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(-45deg);
    padding: 5px 0;
    border-radius: 0;
}

.badge-pos-left.badge-style-diagonal_stitched .epaper-card-status-badge,
.badge-style-diagonal_stitched:not(.badge-pos-right) .epaper-card-status-badge {
    top: 20px;
    left: -35px;
    right: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(-45deg);
    padding: 4px 0;
    border-radius: 0;
}

.badge-pos-left.badge-style-page_curl .epaper-card-status-badge,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge {
    top: 0;
    left: 0;
    right: auto;
    width: 60px;
    height: 60px;
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge::before,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge::before {
    top: 0;
    left: 0;
    right: auto;
    border-width: 58px 58px 0 0;
    filter: drop-shadow(3px 4px 6px rgba(0, 0, 0, 0.45));
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge::after,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge::after {
    top: 0;
    left: 0;
    right: auto;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge span.badge-text,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge span.badge-text {
    top: 13px;
    left: 3px;
    right: auto;
    transform: rotate(-45deg);
}

.badge-pos-left.badge-style-pill_overlap .epaper-card-status-badge,
.badge-style-pill_overlap:not(.badge-pos-right) .epaper-card-status-badge {
    top: -10px;
    left: 10px;
    right: auto;
}

/* --- RIGHT CORNER POSITIONING (badge-pos-right) --- */
.badge-pos-right.badge-style-ribbon_3d .epaper-card-status-badge {
    top: 18px;
    right: -36px;
    left: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(45deg);
    padding: 5px 0;
    border-radius: 0;
}

.badge-pos-right.badge-style-diagonal_stitched .epaper-card-status-badge {
    top: 20px;
    right: -35px;
    left: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(45deg);
    padding: 4px 0;
    border-radius: 0;
}

.badge-pos-right.badge-style-page_curl .epaper-card-status-badge {
    top: 0;
    right: 0;
    left: auto;
    width: 60px;
    height: 60px;
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge::before {
    top: 0;
    right: 0;
    left: auto;
    border-width: 58px 0 0 58px;
    filter: drop-shadow(-3px 4px 6px rgba(0, 0, 0, 0.45));
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge::after {
    top: 0;
    right: 0;
    left: auto;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge span.badge-text {
    top: 13px;
    right: 3px;
    left: auto;
    transform: rotate(45deg);
}

.badge-pos-right.badge-style-pill_overlap .epaper-card-status-badge {
    top: -10px;
    right: 10px;
    left: auto;
}

/* --- Style 1: 3D Corner Ribbon Fold --- */
.badge-style-ribbon_3d .epaper-card-status-badge {
    font-size: 0.60rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.badge-style-ribbon_3d .epaper-card-status-badge::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 0;
}
.badge-style-ribbon_3d .epaper-card-status-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 0 6px;
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today {
    background: linear-gradient(180deg, #10b981 0%, #059669 65%, #047857 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today::before,
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today::after {
    border-color: #064e3b transparent transparent transparent;
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 65%, #0369a1 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest::before,
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest::after {
    border-color: #075985 transparent transparent transparent;
}

/* --- Style 2: Stitched Diagonal Corner Band --- */
.badge-style-diagonal_stitched .epaper-card-status-badge {
    font-size: 0.60rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.badge-style-diagonal_stitched .epaper-card-status-badge::before,
.badge-style-diagonal_stitched .epaper-card-status-badge::after {
    display: none !important;
}
.badge-style-diagonal_stitched .epaper-card-status-badge.badge-today {
    background: #059669;
    color: #ffffff;
    border-top: 1.5px dashed rgba(255, 255, 255, 0.95);
    border-bottom: 1.5px dashed rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.badge-style-diagonal_stitched .epaper-card-status-badge.badge-latest {
    background: #0284c7;
    color: #ffffff;
    border-top: 1.5px dashed rgba(255, 255, 255, 0.95);
    border-bottom: 1.5px dashed rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* --- Style 3: Curled Corner Page Ear Fold --- */
.badge-style-page_curl .epaper-card-status-badge {
    padding: 0;
    display: flex;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.badge-style-page_curl .epaper-card-status-badge::before {
    content: '';
    position: absolute;
    border-style: solid;
}
.badge-style-page_curl .epaper-card-status-badge::after {
    content: '';
    position: absolute;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.05) 40%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}
.badge-style-page_curl .epaper-card-status-badge.badge-today::before {
    border-color: #059669 transparent transparent transparent;
}
.badge-style-page_curl .epaper-card-status-badge.badge-latest::before {
    border-color: #0284c7 transparent transparent transparent;
}
.badge-style-page_curl .epaper-card-status-badge span.badge-text {
    position: absolute;
    font-size: 0.56rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 12;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* --- Style 4: Overlapping Floating Pill --- */
.badge-style-pill_overlap .epaper-card-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.badge-style-pill_overlap .epaper-card-status-badge::before,
.badge-style-pill_overlap .epaper-card-status-badge::after {
    display: none !important;
}
.badge-style-pill_overlap .epaper-card-status-badge.badge-today {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border: 2px solid #ffffff;
}
.badge-style-pill_overlap .epaper-card-status-badge.badge-latest {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    border: 2px solid #ffffff;
}

/* ==========================================================================
   Motion Animations
   ========================================================================== */

/* 1. Pulse Glow Keyframe */
@keyframes badgePulseKey {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    50% {
        transform: scale(1.07);
        filter: drop-shadow(0 6px 14px rgba(16, 185, 129, 0.7));
    }
}
.badge-anim-pulse .epaper-card-status-badge {
    animation: badgePulseKey 2.2s infinite ease-in-out;
}

/* 2. Soft Bounce Keyframe */
@keyframes badgeBounceKey {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2.5px);
    }
}
.badge-anim-bounce .epaper-card-status-badge {
    animation: badgeBounceKey 2.5s infinite;
}

/* 3. Metallic Shimmer Sweep Keyframe */
@keyframes badgeShineKey {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
.badge-anim-shine .epaper-card-status-badge {
    background-size: 200% 100% !important;
}
.badge-anim-shine .epaper-card-status-badge.badge-today {
    background-image: linear-gradient(110deg, #059669 0%, #10b981 35%, #ffffff 50%, #10b981 65%, #059669 100%) !important;
    animation: badgeShineKey 2.8s infinite linear;
}
.badge-anim-shine .epaper-card-status-badge.badge-latest {
    background-image: linear-gradient(110deg, #0284c7 0%, #38bdf8 35%, #ffffff 50%, #38bdf8 65%, #0284c7 100%) !important;
    animation: badgeShineKey 2.8s infinite linear;
}

/* 4. Static / No Animation */
.badge-anim-none .epaper-card-status-badge {
    animation: none !important;
}


.epaper-card-strip {
    padding: 10px 12px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Sidebar Widgets */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--theme-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.sidebar-quick-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.sidebar-quick-link:hover {
    background: var(--theme-primary);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Newsletter & Daily ePaper Alert Card (Theme-Aware Component)
   -------------------------------------------------------------------------- */
.newsletter-card {
    background: linear-gradient(135deg, var(--theme-primary-dark, #0f172a) 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-md, 8px);
    padding: 20px 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: var(--theme-secondary);
    opacity: 0.12;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}

.newsletter-card h4 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--theme-secondary, #ffc107);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.newsletter-card p {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 14px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.84rem;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.newsletter-form input[type="email"]::placeholder {
    color: #94a3b8;
}

.newsletter-form input[type="email"]:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--theme-secondary, #ffc107);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.newsletter-form button[type="submit"] {
    width: 100%;
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.newsletter-form button[type="submit"]:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

/* --------------------------------------------------------------------------
   7. Reader Viewport & Vertical Thumbnails Column
   -------------------------------------------------------------------------- */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

.reader-workspace-area {
    max-width: 1320px;
    margin: 12px auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    align-items: start;
}

.reader-thumbs-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 50px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.thumb-card {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.thumb-card:hover,
.thumb-card.active {
    border-color: var(--theme-primary);
    box-shadow: 0 0 10px rgba(11, 73, 157, 0.4);
    transform: scale(1.02);
}

.thumb-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

.thumb-caption {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
    display: block;
}

.reader-canvas-viewport {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.reader-top-control-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--theme-primary-dark, #0f172a);
    color: #ffffff;
    padding: 8px 14px;
    border-bottom: 2px solid var(--theme-secondary, #ffc107);
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.reader-control-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
}

.reader-left-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.reader-select-page {
    padding: 5px 10px;
    background: var(--theme-primary-dark);
    color: #ffffff;
    border: 1px solid var(--theme-secondary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}

.page-numbers-strip {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
}

.page-num-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.page-num-btn.active,
.page-num-btn:hover {
    background: var(--theme-secondary);
    color: #000000;
    border-color: var(--theme-secondary);
}

.reader-right-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.reader-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    white-space: nowrap;
}

.reader-action-btn.btn-pdf {
    background: var(--color-danger);
    color: var(--text-on-primary);
}

.reader-action-btn.btn-clip {
    background: var(--theme-secondary);
    color: #000000;
}

.edition-active-banner {
    background: var(--theme-primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.88rem;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.paper-image-wrapper {
    background: #ffffff;
    padding: 8px;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.btn-float-nav {
    position: fixed;
    top: 55%;
    transform: translateY(-50%);
    z-index: 850;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.btn-float-prev {
    left: 16px;
}

.btn-float-next {
    right: 16px;
}

.btn-float-nav:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    transform: translateY(-50%) scale(1.1);
}

.flipbook-pages-spread-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
    gap: 4px;
}

.flipbook-page-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
}

.flipbook-pages-spread-container.flipbook-double-spread .flipbook-page-wrap {
    width: 50% !important;
    max-width: 50% !important;
    flex: 1 1 50% !important;
}

.paper-display-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    user-select: none;
}

/* --------------------------------------------------------------------------
   8. Hotspot Overlays & Mouseover Hover Tooltips
   -------------------------------------------------------------------------- */
.hotspot-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 95;
}

.hotspot-interactive-box {
    position: absolute;
    border: 1.5px solid #2563eb;
    background: rgba(37, 99, 235, 0.12);
    border-radius: 3px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
}

.hotspot-interactive-box:hover {
    background: rgba(37, 99, 235, 0.25) !important;
    border: 2px solid #1d4ed8 !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    z-index: 100;
}

.hotspot-title-tag {
    position: absolute;
    top: -22px;
    left: 2px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: none;
    transition: all 0.15s ease;
    opacity: 0.92;
}

.public-clip-hover-tooltip {
    position: fixed;
    z-index: 9999;
    background: #0f172a;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    pointer-events: none;
    display: none;
    flex-direction: column;
    gap: 3px;
    max-width: 280px;
    animation: fadeInTooltip 0.15s ease-out;
}

.public-clip-hover-tooltip .tooltip-title {
    font-weight: 700;
    color: #ffc107;
    font-size: 0.82rem;
    line-height: 1.25;
}

.public-clip-hover-tooltip .tooltip-hint {
    font-size: 0.7rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* === Clip Mode Visual Styles === */
.paper-image-wrapper.clip-mode-active {
    cursor: crosshair !important;
    overflow: visible !important; /* Allow marquee box to extend beyond padding */
}

.paper-image-wrapper.clip-mode-active .paper-display-img {
    cursor: crosshair !important;
}

.clip-mode-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 130;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 5px 16px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.5);
    animation: clipIndicatorPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.clip-mode-indicator.active {
    display: inline-flex;
}

@keyframes clipIndicatorPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(255, 193, 7, 0.5); }
    50% { box-shadow: 0 4px 22px rgba(255, 193, 7, 0.85); }
}

@keyframes marchingAnts {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 16; }
}

#publicClipMarqueeBox {
    position: absolute;
    border: 2px dashed #ffc107 !important;
    background: rgba(255, 193, 7, 0.15) !important;
    box-shadow: 0 0 0 1px rgba(8, 40, 86, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    pointer-events: none;
    z-index: 120;
    display: none;
}

.public-clip-action-bar {
    display: none;
    position: absolute;
    z-index: 125;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 193, 7, 0.4);
    backdrop-filter: blur(8px);
    max-width: calc(100vw - 24px);
    white-space: nowrap;
    align-items: center;
}

.clip-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: #ffffff;
}

.clip-act-btn.btn-act-download {
    background: #dc2626;
}

.clip-act-btn.btn-act-share {
    background: #0284c7;
}

.clip-act-btn.btn-act-save {
    background: #059669;
}

.clip-act-btn.btn-act-cancel {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px;
}

.clip-act-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

@media (max-width: 650px) {
    .public-clip-action-bar {
        padding: 4px;
        gap: 5px;
        border-radius: 24px;
    }

    .clip-act-btn {
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0.95rem;
    }

    .clip-act-btn .act-text-label {
        display: none !important;
    }
}


/* Floating Navigation Arrows */
.btn-float-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.btn-float-nav:hover {
    background: var(--theme-secondary);
    color: #000000;
}

.btn-float-prev { left: 8px; }
.btn-float-next { right: 8px; }

/* --------------------------------------------------------------------------
   8b. 3D Flipbook Magazine Reader View Mode
   -------------------------------------------------------------------------- */
.paper-display-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    background-color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   8b. 3D Flipbook Magazine Reader View Mode
   -------------------------------------------------------------------------- */
.paper-image-wrapper.has-double-spread {
    max-width: 1240px !important;
}

.flipbook-pages-spread-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    margin: 0 auto;
    background-color: #ffffff !important;
    perspective: 1400px;
    transform-style: preserve-3d;
}

.flipbook-pages-spread-container.flipbook-double-spread.flip-anim-next {
    animation: flipNextSmooth 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.flipbook-pages-spread-container.flipbook-double-spread.flip-anim-prev {
    animation: flipPrevSmooth 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes flipNextSmooth {
    0% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    45% {
        transform: perspective(1400px) rotateY(-14deg) scale(0.985);
        box-shadow: -22px 15px 42px rgba(0, 0, 0, 0.35);
    }
    100% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

@keyframes flipPrevSmooth {
    0% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    45% {
        transform: perspective(1400px) rotateY(14deg) scale(0.985);
        box-shadow: 22px 15px 42px rgba(0, 0, 0, 0.35);
    }
    100% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

.flipbook-pages-spread-container.flipbook-double-spread {
    gap: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #ffffff !important;
    border-radius: 4px;
    overflow: hidden;
}

.flipbook-double-spread .flipbook-page-left {
    width: 50% !important;
    max-width: 50% !important;
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1;
    box-shadow: inset -10px 0 15px -8px rgba(0, 0, 0, 0.1);
}

.flipbook-double-spread .flipbook-page-right {
    width: 50% !important;
    max-width: 50% !important;
    display: block !important;
    background-color: #ffffff !important;
    border-left: 1px solid #cbd5e1;
    box-shadow: inset 10px 0 15px -8px rgba(0, 0, 0, 0.1);
}

.flipbook-mode-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.flipbook-mode-btn.active,
.flipbook-mode-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
}

/* --------------------------------------------------------------------------
   9. Crop Modal & Social Sharing Box
   -------------------------------------------------------------------------- */
.crop-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.crop-modal-backdrop.active {
    display: flex;
}

.crop-modal-box {
    background: #ffffff;
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border: 2px solid var(--theme-primary, #0f172a);
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--theme-primary-dark, #0f172a), #1e293b);
    color: #ffffff;
}

.crop-modal-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    color: #ffc107;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crop-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.crop-modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.crop-preview-body {
    text-align: center;
    max-height: 55vh;
    overflow-y: auto;
    background: #fdfbf7;
    padding: 14px;
    border-bottom: 2px solid var(--theme-primary, #0f172a);
}

.crop-preview-body canvas {
    max-width: 100%;
    border: 3px solid #ffc107;
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: #fdfbf7;
}

.crop-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
}

.crop-social-strip,
.crop-actions-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crop-share-heading {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e293b;
    margin-right: 2px;
}

.crop-share-btn,
.crop-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #ffffff;
}

.btn-share-wa { background: #25D366; box-shadow: 0 2px 6px rgba(37,211,102,0.3); }
.btn-share-insta { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); box-shadow: 0 2px 6px rgba(220,39,67,0.3); }
.btn-share-fb { background: #1877F2; box-shadow: 0 2px 6px rgba(24,119,242,0.3); }
.btn-share-tw { background: #000000; }
.btn-share-copy { background: #475569; }

.icon-fallback-tw {
    display: none;
}
.fa-x-twitter:not(:defined) + .icon-fallback-tw,
.fa-x-twitter:empty + .icon-fallback-tw {
    display: inline-block;
}

.btn-crop-save { background: #0b499d; box-shadow: 0 3px 8px rgba(11,73,157,0.3); }
.btn-crop-download { background: #059669; box-shadow: 0 3px 8px rgba(5,150,105,0.3); }

.crop-share-btn:hover,
.crop-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

@media (max-width: 600px) {
    .crop-modal-box {
        max-width: 96vw;
        border-radius: 10px;
    }
    
    .crop-modal-header {
        padding: 10px 12px;
    }

    .crop-modal-title {
        font-size: 0.88rem;
    }

    .crop-preview-body {
        max-height: 48vh;
        padding: 8px;
    }

    .crop-modal-footer {
        padding: 8px 10px;
        justify-content: center;
        gap: 8px;
    }

    .crop-share-heading {
        display: none !important;
    }

    .crop-share-btn {
        width: 34px;
        height: 34px;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0.9rem;
    }

    .crop-btn-text {
        display: none !important;
    }

    .crop-action-btn {
        padding: 6px 12px;
        font-size: 0.76rem;
    }

    .crop-action-btn .crop-btn-text {
        display: inline !important;
    }
}

/* --------------------------------------------------------------------------
   10. Mobile Fixed Bottom Toolbar
   -------------------------------------------------------------------------- */
.mobile-sticky-bottom-toolbar {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--theme-primary-dark, #0b2545);
    padding: 8px 12px;
    z-index: 1050;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.mobile-tb-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    text-decoration: none !important;
    cursor: pointer;
}

.mobile-tb-btn.btn-pdf-mobile {
    background: var(--color-danger);
    color: var(--text-on-primary);
    border: none;
}

.mobile-tb-btn.btn-clip-mobile {
    background: var(--theme-secondary);
    color: #000000;
    border: none;
}

.mobile-tb-btn.btn-cal-mobile {
    background: var(--color-info);
    color: var(--text-on-primary);
    border: none;
}

.mobile-tb-select {
    background: var(--theme-primary-dark);
    color: #ffffff;
    border: 1px solid var(--theme-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
}

/* --------------------------------------------------------------------------
   11. Public Footer
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   11. Public Footer (Theme-Aware & Responsive)
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--theme-primary-dark, #0b2545);
    color: #cbd5e1;
    padding: 32px 0 20px 0;
    border-top: 3px solid var(--theme-secondary, #ffc107);
    margin-top: 36px;
}

.site-footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.mobile-footer-content {
    display: none;
}

.desktop-footer-content {
    display: block;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.footer-col p {
    font-size: 0.8rem;
    line-height: 1.5;
}

.site-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   12. Comprehensive Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .reader-workspace-area {
        grid-template-columns: 1fr;
    }

    .reader-thumbs-column {
        display: none !important;
    }
    
    .site-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .portal-nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--theme-primary-dark);
        padding: 10px 16px;
        z-index: 2500;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border-bottom: 3px solid var(--theme-secondary);
    }
    
    .portal-nav-menu.active,
    .portal-nav-menu.mobile-open {
        display: flex !important;
    }

    .nav-dropdown-item.expanded .dropdown-submenu {
        display: block;
        position: static;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        padding-left: 16px;
    }
    
    .portal-search-box input {
        width: 90px;
    }

    .site-logo-img {
        max-height: 50px;
    }

    .logo-text-title {
        font-size: 1.2rem;
    }

    .reader-top-control-bar {
        display: none !important;
    }

    .mobile-sticky-bottom-toolbar {
        display: flex !important;
    }

    body {
        padding-bottom: 65px;
    }

    /* Mobile News Ticker Responsiveness */
    .news-ticker-container {
        min-height: 34px;
    }

    .ticker-label-badge {
        height: 34px;
        padding: 0 10px;
        font-size: 0.72rem;
        letter-spacing: 0.4px;
    }

    .ticker-track-viewport {
        height: 34px;
    }

    .ticker-item-group {
        font-size: 0.78rem;
    }

    /* Ultra-Compact & Minimal Mobile Footer Layout */
    /* Ultra-Compact & Tight Mobile Footer Layout */
    .site-footer {
        padding: 8px 0 52px 0 !important;
        margin-top: 10px !important;
        border-top-width: 2px !important;
    }

    .desktop-footer-content {
        display: none !important;
    }

    .mobile-footer-content {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 3px !important;
        padding: 2px 10px !important;
    }

    .mobile-footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 2px 8px;
        font-size: 0.74rem;
    }

    .mobile-footer-links a {
        color: #e2e8f0;
        text-decoration: none;
        font-weight: 600;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        transition: var(--transition);
    }

    .mobile-footer-links a:hover {
        color: var(--theme-secondary, #ffc107);
    }

    .mobile-footer-links .mob-sep {
        color: rgba(255, 255, 255, 0.3);
        font-size: 0.7rem;
    }

    .mobile-footer-bottom-row {
        font-size: 0.72rem;
        color: #94a3b8;
        text-align: center;
        line-height: 1.25;
        margin-top: 1px;
    }

    .mob-credit-link {
        color: var(--theme-secondary, #ffc107) !important;
        font-weight: 800;
        text-decoration: none;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .crop-modal-box {
        padding: 12px;
    }

    .ticker-label-badge {
        padding: 0 7px;
        font-size: 0.68rem;
    }

    .ticker-label-badge i {
        font-size: 0.7rem;
    }

    .news-ticker-bar {
        border-bottom-width: 1.5px;
    }

    .portal-search-box input {
        width: 75px;
        font-size: 0.75rem;
    }
}

/* --- Clean Flipbook View Mode Toggle Buttons --- */
.flipbook-mode-btn {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flipbook-mode-btn.active,
.flipbook-mode-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    border-color: var(--theme-secondary, #ffc107);
}

/* --------------------------------------------------------------------------
   Interactive Cropper Marquee Resizing & Repositioning Handles
   -------------------------------------------------------------------------- */
#publicClipMarqueeBox {
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
    user-select: none;
    touch-action: none;
    pointer-events: auto;
}

.crop-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border: 2px solid #2563eb;
    border-radius: 50%;
    z-index: 130;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    touch-action: none;
    pointer-events: auto;
}

.crop-resize-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-resize-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-resize-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-resize-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-resize-handle.n  { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.crop-resize-handle.s  { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.crop-resize-handle.e  { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.crop-resize-handle.w  { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }

/* --------------------------------------------------------------------------
   Fixed-Bottom Daily News Alert Floating Component
   -------------------------------------------------------------------------- */
.newsletter-card.floating-bottom-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    max-width: calc(100vw - 32px);
    z-index: 1050;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--theme-secondary, #ffc107);
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.newsletter-card.floating-bottom-alert.minimized {
    transform: translateY(calc(100% - 48px));
}

.alert-toggle-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.alert-toggle-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
}

@media (max-width: 768px) {
    .newsletter-card.floating-bottom-alert {
        bottom: 68px;
        right: 14px;
        left: 14px;
        width: auto;
        max-width: none;
    }
}

/* --------------------------------------------------------------------------
   Mobile Navbar Share Edition Button
   -------------------------------------------------------------------------- */
.mobile-share-btn {
    display: none;
    align-items: center;
    gap: 5px;
    background: #25d366;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .calendar-trigger-btn {
        display: none !important;
    }
    .portal-navbar-container {
        display: flex;
        align-items: center;
        gap: 12px !important;
    }
    .portal-navbar-actions {
        gap: 10px !important;
    }
    .mobile-share-btn {
        display: inline-flex;
        margin-left: auto;
        padding: 7px 14px;
        gap: 6px;
    }
    .calendar-picker-popover {
        position: fixed !important;
        bottom: 56px !important;
        right: 8px !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 255px !important;
        max-width: calc(100vw - 16px) !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5) !important;
        z-index: 999999 !important;
    }
    .calendar-picker-popover #calEditionSelect {
        padding: 4px 6px !important;
        font-size: 0.72rem !important;
        margin-bottom: 4px !important;
    }
    .calendar-picker-popover .calendar-nav-header {
        margin-bottom: 4px !important;
        padding-bottom: 4px !important;
    }
    .calendar-picker-popover .calendar-month-title {
        font-size: 0.8rem !important;
    }
    .calendar-picker-popover .calendar-nav-btn {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.7rem !important;
    }
    .calendar-picker-popover .calendar-weekdays-grid {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }
    .calendar-picker-popover .cal-day-cell {
        font-size: 0.72rem !important;
    }
}
