/* MAIN GLOBAL STYLES */

/* Sticky header behavior */
.cm-custom-header {
    position: sticky !important;
    top: 0;
    z-index: 99999 !important;
}

/* Base link behavior */
a {
    color: var(--bitcoin-orange) !important;
    text-decoration: underline !important; /* Make links obvious by default */
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--text-color) !important;
    text-decoration: none !important;
}

/* Site container */
#page.site {
    display: block !important;
    background-color: var(--bg-color) !important;
}

/* Crypto Noticias PRO specific adjustments (Global) */
:root {
    --bitcoin-orange: #f7931a;
    --dark-bg: #1a1a1a;
    
    /* Light Theme Variables */
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #ffffff;
    --footer-bg: #1a1a1a;
    --card-bg: #ffffff;
    --section-bg: #f9f9f9;
    --border-color: #eeeeee;
    --link-color: #333333;
    --meta-color: #999999;
}

/* Dark Theme Variables */
.dark-mode {
    --bg-color: #0f172a; /* Глубокий темно-синий/черный */
    --text-color: #f8fafc; /* Почти белый для отличной читаемости */
    --header-bg: #1e293b;
    --footer-bg: #020617;
    --card-bg: #1e293b;
    --section-bg: #1e293b;
    --border-color: #334155;
    --link-color: #ffffff;
    --meta-color: #94a3b8; /* Светло-серый для мета-данных */
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
}

/* Global Link Hover Color for Headers and Text */
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
.news-card-content h3 a:hover,
.hero-secondary-item h3 a:hover,
.footer-column a:hover {
    color: var(--bitcoin-orange) !important;
}

/* Fix for icons transition */
.theme-toggle span {
    transition: all 0.3s ease !important;
}

/* Post Content & Page Titles Visibility */
.entry-content, 
.entry-summary, 
.post-content, 
.page-content,
.single-post-content,
.cm-post-content,
.page-header h1,
.page-title,
.archive-title,
.entry-title,
.widget-title,
article p, 
article li, 
article h1, 
article h2, 
article h3, 
article h4, 
article h5, 
article h6 {
    color: var(--text-color) !important;
}

/* Fix Sidebar & Content Layout in Single Posts */
.single-post .site-content > .container,
.single-post #content > .container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* Prevent wrapping unless mobile */
    gap: 40px !important;
    align-items: flex-start !important;
}

/* Content Area - Ensure it doesn't shrink too much */
#primary.content-area,
.single-post .content-area {
    flex: 1 !important;
    width: auto !important;
    max-width: calc(100% - 360px) !important; /* Total width minus sidebar and gap */
    min-width: 0; /* Allow flex to work correctly */
}

/* Sidebar Area - Strictly fixed width */
#secondary.widget-area,
.single-post .widget-area,
aside.sidebar {
    flex: 0 0 320px !important;
    width: 320px !important;
    max-width: 320px !important;
}

/* Mobile adjustments for Single Posts */
@media (max-width: 1024px) {
    .single-post .site-content > .container,
    .single-post #content > .container {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }
    
    #primary.content-area,
    .single-post .content-area,
    #secondary.widget-area,
    .single-post .widget-area {
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }
}
