/* dashboard.css - Bloomberg Style Layout */

:root {
    --bb-bg: #ffffff;
    --bb-text: #121212;
    --bb-meta: #555;
    --bb-link-hover: #0056b3;
    --bb-text-muted: #555555; /* Medium Grey for snippets */
    --bb-border: #e0e0e0;     /* Light Grey for borders */
    --bb-accent: #0056b3;     /* Bloomberg Blue */
    --bb-nav-bg: #000000;     /* Nav is always black */
    --bb-nav-text: #cccccc;
    --bb-font-serif: 'Georgia', 'Times New Roman', serif;
    --bb-font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bb-bg: #121212;
        --bb-text: #e0e0e0;
        --bb-meta: #a0a0a0;
        --bb-accent: #333;
        --bb-link-hover: #ff6600;
    }
}

html {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: var(--bb-bg); /* Ensure background fills screen */
}

body.bb-dashboard-body { 
    max-width: 100% !important;     /* Override 700px limit */
    width: 100% !important;         /* Ensure full width */
    margin: 0 !important; 
    padding: 0 !important;
    font-size: 22px;
    background-color: var(--bb-bg); 
    color: var(--bb-text); 
    font-family: var(--bb-font-sans); 
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--bb-link-hover); }

/* NAV BAR */
.bb-nav-bar {
    background: #000; color: #fff; padding: 0 20px;
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: center; height: 50px;
    overflow-x: auto; white-space: nowrap; border-bottom: 4px solid var(--bb-link-hover);
    box-sizing: border-box; 
}
.bb-brand { font-weight: 900; font-size: 1.2em; margin-right: 20px; }
.bb-nav-item { font-size: 0.65em; font-weight: 700; text-transform: uppercase; margin-right: 15px; color: #ccc; }
.bb-nav-item:hover { color: #fff; }
.bb-nav-item.home { border-right: 1px solid #333; padding-right: 15px; margin-right: 15px; }
.bb-nav-item.archive { color: #888; border-right: 1px solid #333; padding-right: 15px; margin-right: 15px; }
.bb-nav-item.archive:hover { color: #fff; }

/* LAYOUT */
.bb-container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; box-sizing: border-box; }

/* HERO SECTION */
.bb-hero-grid { 
    display: grid; grid-template-columns: 2fr 1fr; gap: 40px; 
    margin-bottom: 60px; border-bottom: 1px solid var(--bb-accent); padding-bottom: 40px; 
}
.bb-lead-story { border-right: 1px solid var(--bb-accent); padding-right: 40px; }
.bb-lead-tag { color: #d0021b; font-weight: 700; text-transform: uppercase; font-size: 0.5em; margin-bottom: 10px; display: block; }
.bb-lead-headline { font-family: var(--bb-font-serif); font-size: 2em; font-weight: 900; line-height: 1.1; margin-bottom: 15px; }
.bb-lead-snippet { font-size: 1.1em; color: var(--bb-meta); line-height: 1.6; }
.bb-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.bb-lead-time { margin-top: 15px; font-size: 0.8em; color: var(--bb-meta); display: block; }
.bb-meta-row .bb-lead-time { margin-top: 0; }
.bb-article-length { font-size: 0.72em; color: #d0021b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* SIDEBAR */
.bb-sidebar-header { 
    font-weight: 900; text-transform: uppercase; font-size: 1em; 
    border-bottom: 2px solid var(--bb-text); margin-bottom: 15px; padding-bottom: 5px; 
}
.bb-side-item { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--bb-accent); }
.bb-side-item:last-child { border: none; }
.bb-side-time { font-size: 0.75em; color: #d0021b; font-weight: 700; display: block; }
.bb-meta-row .bb-side-time { display: inline; }
.bb-side-headline { font-weight: 700; font-size: 1em; line-height: 1.3; }

/* CATEGORIES */
.bb-cat-section { margin-bottom: 50px; }
.bb-cat-header { 
    font-weight: 900; font-size: 1.5em; text-transform: uppercase; 
    border-top: 4px solid var(--bb-text); padding-top: 10px; margin-bottom: 20px; 
    display: flex; justify-content: space-between; 
}
.bb-cat-header a { font-size: 0.6em; color: var(--bb-link-hover); }

.bb-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.bb-card-small { border-right: 1px solid var(--bb-accent); padding-right: 20px; }
.bb-card-small:last-child { border: none; }
.bb-card-headline { font-weight: 700; font-size: 1em; margin-bottom: 8px; display: block; }
.bb-card-snippet { font-size: 0.85em; color: var(--bb-meta); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.bb-card-small .bb-meta-row { margin-top: 10px; }

/* --- MOBILE TWEAKS --- */
@media (max-width: 768px) {
    .bb-container { padding: 20px 15px; } /* Reduce padding */
    .bb-hero-grid { grid-template-columns: 1fr; border-right: none; }
    .bb-lead-story { 
        border-right: none; 
        padding-right: 0; 
        border-bottom: 1px solid var(--bb-accent); 
        padding-bottom: 30px; 
    }
    
    /* FIX: Reduce headline size significantly for mobile */
    .bb-lead-headline { font-size: 1.75em; } 
    .bb-lead-snippet { font-size: 1em; }
    .bb-cat-grid { grid-template-columns: 1fr; }
    .bb-card-small { border-right: none; border-bottom: 1px solid var(--bb-accent); padding-bottom: 15px; }
}

/* MARKET WIDGET CONTAINER */
.tradingview-widget-container {
    width: 100%;
    
    /* FIX: Set a safe fixed height. 50px covers the bar + scrollbar buffer */
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    
    margin-bottom: 20px; /* Push the news down */
    border-bottom: 1px solid var(--bb-border);
    z-index: 1;
    background-color: var(--bb-bg);
    
    /* CRITICAL: Cuts off anything that tries to stick out */
    overflow: hidden; 

    display: flex !important;
    align-items: center !important; 
    justify-content: center !important;
}

.tradingview-widget-container iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Mobile Tweak: Ensure no negative margins pull content up */
@media (max-width: 768px) {
    .tradingview-widget-container {
        height: 68px !important;
        min-height: 68px !important;
        max-height: 68px !important;        
        margin-top: 0;
    }
}
