/* Minimal styles for the E-Paper viewer and grid */
#epaper-app { font-family: Arial, Helvetica, sans-serif; position: relative; }

/* Date Search Styles */
.epaper-date-search { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.epaper-date-picker { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; min-width: 160px; }
.epaper-search-btn { padding: 8px 16px; background: #0073aa; color: #fff; border: 0; border-radius: 4px; font-size: 14px; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.epaper-search-btn:hover { background: #005a87; }
.epaper-clear-search { padding: 8px 16px; background: #666; color: #fff; border: 0; border-radius: 4px; font-size: 14px; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.epaper-clear-search:hover { background: #444; }

/* Desktop: Position date search in top right */
@media (min-width: 601px) {
    #epaper-app { padding-top: 50px; }
    .epaper-date-search { position: absolute; top: 0; right: 0; margin-bottom: 0; z-index: 10; }
}

/* Mobile: Center the date search at top */
@media (max-width: 600px) {
    .epaper-date-search { justify-content: center; flex-wrap: wrap; }
    .epaper-date-picker { flex: 1; min-width: 140px; }
}
.epaper-grid { display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; }
.epaper-card { width:180px; border:1px solid #e1e1e1; border-radius:4px; overflow:hidden; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,0.04); display:flex; flex-direction:column; }
.epaper-thumb { height:120px; display:flex; align-items:center; justify-content:center; background:#f7f7f7; }
.epaper-thumb-img { max-width:100%; max-height:100%; display:block; }
.epaper-meta { padding:8px; font-size:13px; flex-grow:1; }
.epaper-view { display:block; width:calc(100% - 16px); margin:8px; padding:8px; background:#0073aa; color:#fff; border:0; border-radius:3px; cursor:pointer; margin-top:auto; }

/* Modal */
#epaper-modal.epaper-modal { position:fixed; left:0; top:0; width:100%; height:100%; background:rgba(0,0,0,0.6); display:none; z-index:99999; }
.epaper-modal-inner { position:relative; width:95%; max-width:1000px; height:90vh; margin:3vh auto; background:#fff; border-radius:4px; overflow:hidden; }
.epaper-modal-body { width:100%; height:100%; background:#fff; overflow:auto; }
.epaper-modal-close { position:absolute; right:12px; top:12px; z-index:100000; width:36px; height:36px; background:#fff; border:0; border-radius:50%; font-size:24px; line-height:1; cursor:pointer; color:#000; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,0.3); transition:transform 0.2s; }
.epaper-modal-close:hover { transform:scale(1.1); background:#f5f5f5; }
.epaper-loading { padding:18px; font-size:16px; color:#666; }

/* DFlip container styles */
._df_book { width:100% !important; height:100% !important; min-height:600px; }
/* For modal and single-view use prefer max 70vh to keep controls usable */
#epaper-modal .epaper-modal-body ._df_book,
.epaper-single-viewer ._df_book {
    position:absolute;
    top:0; left:0; right:0; bottom:0;
    height:98% !important;
    /* max-height:70vh !important; */
}

/* DFlip container styles - minimal override */
.df-container .loading-info { display:none !important; }


/* Archive styles */
.epaper-section-title { margin-top:24px; margin-bottom:16px; font-size:24px; color:#333; }
.epaper-year-section { margin-bottom:32px; }
.epaper-year-header { margin-top:0; margin-bottom:16px; font-size:20px; color:#555; border-bottom:2px solid #0073aa; padding-bottom:8px; }
.epaper-month-section { margin-bottom:24px; }
.epaper-month-header { margin-top:0; margin-bottom:12px; font-size:16px; color:#666; font-weight:600; }
.epaper-archive-grid { margin-bottom:16px; }
.epaper-archive-card { opacity:0.9; }
.epaper-archive-card:hover { opacity:1; }

/* Collapsible styles */
.epaper-collapsible { cursor:pointer; user-select:none; transition:color 0.2s; }
.epaper-collapsible:hover { color:#0073aa; }
.epaper-toggle { display:inline-block; width:20px; font-size:12px; }
.epaper-year-content, .epaper-month-content { overflow:hidden; }

/* Single newspaper page styles */
.epaper-single-newspaper { margin-top:24px; margin-bottom:24px; }
.epaper-single-meta { margin-bottom:16px; padding:12px; background:#f7f7f7; border-left:4px solid #0073aa; font-size:14px; }
.epaper-single-viewer { width:100%; min-height:800px; margin-top:16px; background:#f0f0f0; border-radius:4px; overflow:hidden; position:relative; }
.epaper-single-viewer .epaper-loading { text-align:center; padding:48px 24px; font-size:16px; color:#666; }

/* Load More and Archive link */
.epaper-load-more-container { margin-top:24px; text-align:center; }
.epaper-load-more-btn { display:inline-block; padding:12px 32px; background:#0073aa; color:#fff; border:0; border-radius:4px; font-size:16px; cursor:pointer; transition:background 0.2s; }
.epaper-load-more-btn:hover { background:#005a87; }
.epaper-load-more-btn:disabled { background:#ccc; cursor:not-allowed; }
.epaper-all-loaded { margin:12px 0; font-size:14px; color:#666; font-style:italic; }
.epaper-archive-link { margin-top:12px; font-size:13px; color:#666; }
.epaper-archive-link a { color:#0073aa; text-decoration:none; border-bottom:1px dashed #0073aa; }
.epaper-archive-link a:hover { border-bottom-style:solid; }

/* Responsive */
@media (max-width:600px){ .epaper-card { width:48%; } .epaper-modal-inner { width:98%; height:85vh; } .epaper-single-viewer { min-height:600px; } }
