/* ==========================================================
   ScholarlyPress Academic Archival Theme
   Colors: Parchment (#F2EFEA), Off-white (#FAF8F5), Charcoal (#1A1A1A)
   Typography: Playfair Display / Merriweather / Inter
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-parchment: #F2EFEA;
    --bg-panel: #FAF8F5;
    --bg-card: #FFFFFF;
    --text-charcoal: #1A1A1A;
    --text-muted: #5A5A5A;
    --text-subtle: #7A7A7A;
    --border-warm: #E2DDD5;
    --border-subtle: #ECE8E1;
    --accent-crimson: #8B1E1E;
    --accent-navy: #1E3A8A;
    --accent-forest: #065F46;
    --accent-amber: #B45309;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-reading: 'Merriweather', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-parchment);
    color: var(--text-charcoal);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.font-serif {
    font-family: var(--font-serif);
}

.font-reading {
    font-family: var(--font-reading);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Card & Panels */
.scholarly-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scholarly-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.panel-white {
    background-color: #FFFFFF;
    border: 1px solid var(--border-warm);
}

/* Academic Masthead */
.masthead-border {
    border-bottom: 2px solid var(--text-charcoal);
}

.masthead-double-border {
    border-bottom: 3px double var(--text-charcoal);
}

/* Article Reading Mode */
.article-body {
    font-family: var(--font-reading);
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #222222;
}

.article-body h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
    color: var(--text-charcoal);
    border-bottom: 1px solid var(--border-warm);
    padding-bottom: 0.35rem;
}

.article-body h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-body p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

.article-body strong {
    color: #000000;
}

/* Math blocks */
.math-block {
    background-color: #F8F6F0;
    border-left: 3px solid var(--accent-navy);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-reading);
    font-style: italic;
    border-radius: 0 6px 6px 0;
    overflow-x: auto;
}

.data-availability-box {
    background-color: #F0F7F4;
    border: 1px solid #C4E3D5;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
}

.data-availability-box h4 {
    font-weight: 700;
    color: var(--accent-forest);
    margin-bottom: 0.35rem;
}

/* Badges & Pills */
.oa-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.doi-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.doi-pill:hover {
    background-color: #DBEAFE;
}

/* Kanban Queue Styling */
.kanban-col {
    background-color: #EFECE6;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    min-height: 480px;
}

.kanban-item {
    background-color: #FFFFFF;
    border: 1px solid var(--border-warm);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.875rem;
    transition: all 0.2s ease;
}

.kanban-item:hover {
    border-color: #B5AFA5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Modals */
.modal-backdrop {
    background-color: rgba(26, 26, 26, 0.65);
    backdrop-filter: blur(3px);
}

/* XML Preview Box */
.xml-pre {
    background-color: #18181B;
    color: #E4E4E7;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 1.25rem;
    border-radius: 6px;
    max-height: 450px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

.toast {
    background: #1A1A1A;
    color: #FFFFFF;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.25s ease forwards;
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Step Wizard Navigation */
.step-bubble {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step-bubble.active {
    background-color: var(--text-charcoal);
    color: #FFFFFF;
}

.step-bubble.completed {
    background-color: var(--accent-forest);
    color: #FFFFFF;
}

.step-bubble.pending {
    background-color: #E2DDD5;
    color: var(--text-muted);
}

/* ==========================================================
   Mobile Responsiveness & Touch Optimization
   ========================================================== */

/* Word Break & Overflow Protection */
.doi-pill {
    max-width: 100%;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Hide scrollbar while allowing touch scrolling */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Kanban Layout */
@media (max-width: 768px) {
    .kanban-col {
        min-height: auto !important;
    }
}

/* Mobile Drawer Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideDown {
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive Table Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Touch Optimization */
@media (max-width: 640px) {
    /* Improve button and interactive element tap comfort */
    button, input[type="submit"], a.btn {
        touch-action: manipulation;
    }

    /* Modal Canvas Padding on Phones */
    .scholarly-modal-body {
        padding: 1rem !important;
    }

    /* Step bubble compact sizing on narrow phones */
    .step-bubble {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
}

