/* THE DAILY MOVING AVERAGE - Mobile Optimized Print Stock Table Style */

:root {
    --bg-paper: #eae6df; /* Vintage gray/cream print paper */
    --ink-black: #111111; /* Rich newsprint black ink */
    --ink-muted: #4a433d; /* Faint print ink */
    --ink-border: #111111;
    --font-serif: Georgia, 'Times New Roman', Times, serif;
    --font-table: 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    background-color: var(--bg-paper);
    color: var(--ink-black);
    font-family: var(--font-table);
    padding: 12px;
    line-height: 1.25;
    -webkit-font-smoothing: antialiased;
}

/* Paper Container */
.paper-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Simplest Header */
.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double var(--ink-border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.paper-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-link {
    font-family: var(--font-table);
    font-size: 11px;
    font-weight: bold;
    color: var(--ink-black);
    text-decoration: none;
    border: 1px solid var(--ink-black);
    padding: 3px 6px;
    text-transform: uppercase;
}

.edit-link:hover {
    background-color: var(--ink-black);
    color: var(--bg-paper);
}

/* Table Wrapper */
.table-wrapper {
    width: 100%;
}

/* Stock Table styling */
.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
    text-transform: uppercase;
}

.stock-table th {
    border-bottom: 1px solid var(--ink-border);
    font-weight: bold;
    padding: 3px 6px;
    vertical-align: bottom;
}

.stock-table td {
    padding: 2.5px 6px;
    vertical-align: middle;
}

/* Alignments */
.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* High/Low markings */
.stock-table .net-up {
    font-weight: bold;
}

.stock-table .net-down {
    color: #000;
}

.stock-table .crossover-marker {
    background-color: #000;
    color: var(--bg-paper);
    padding: 0 2px;
    font-size: 9px;
    font-weight: bold;
}

/* Hide mobile elements by default */
.mobile-only {
    display: none !important;
}

/* Loader styling */
.table-loader {
    text-align: center;
    padding: 40px 0;
    font-family: var(--font-serif);
    font-size: 14px;
    font-style: italic;
}

/* --- MOBILE SPECIFIC STYLES --- */
@media (max-width: 600px) {
    /* Hide all desktop-only cells and the table header */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: inline-block !important;
    }
    
    .stock-table, 
    .stock-table tbody, 
    .stock-table tr, 
    .stock-table td {
        display: block;
        width: 100%;
    }
    
    .stock-table thead {
        display: none;
    }
    
    /* Style each row as a CSS Grid */
    .stock-table tbody tr {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        padding: 6px 0;
        border-bottom: 1px dashed var(--ink-border);
        background: transparent !important;
    }
    
    /* Make cell alignments cohesive */
    .stock-table td {
        padding: 1px 4px;
        white-space: normal;
    }
    
    /* Position elements */
    .col-stock {
        font-weight: bold;
        font-size: 11px;
    }
    
    .col-close {
        text-align: right;
        font-weight: bold;
        font-size: 11px;
    }
    
    .col-dist {
        text-align: right;
        font-weight: bold;
        font-size: 11px;
    }
    
    /* Stack labels */
    .ticker-sublabel {
        font-size: 9.5px;
        color: var(--ink-muted);
        display: block !important;
        margin-top: 1px;
    }
    
    .ma-sublabel {
        font-size: 9.5px;
        color: var(--ink-muted);
        font-weight: normal;
        display: block !important;
        margin-top: 1px;
    }
    
    .status-sublabel {
        font-size: 9.5px;
        font-weight: bold;
        display: block !important;
        margin-top: 1px;
    }
    
    .status-sublabel.crossover {
        background-color: #000;
        color: var(--bg-paper);
        padding: 0 2px;
        width: max-content;
        float: right;
    }
    
    /* Details metadata block */
    .mobile-details-row {
        grid-column: span 3;
        display: flex !important;
        justify-content: space-between;
        font-size: 9.5px;
        color: var(--ink-muted);
        margin-top: 4px;
        border-top: 1px dotted rgba(0, 0, 0, 0.1);
        padding-top: 3px !important;
    }
}
