/* 
 * Theme Enhancement Styles - Optimized Version
 * Purpose: Enhance theme styling with proper CSS specificity
 * Last Updated: 2025-08-26
 */

/* Article Card Enhancement Styles - Using higher specificity instead of !important */
body .content .card .content,
.article .card .content,
article.card .content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body .content .card .content strong,
.article .card .content strong {
    color: #FF6F3C;
    font-weight: 600;
}

body .content .card .content p,
.article .card .content p {
    margin-bottom: 1rem;
    text-align: justify;
}

body .content .card .title,
.article .card .title,
article.card .title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

body .content .card .title a,
.article .card .title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

body .content .card .title a:hover,
body .content .card .title a:focus,
.article .card .title a:hover {
    color: #FF6F3C;
}

/* Card Layout Optimization - Using cascading specificity */
body .content .card,
.article-list .card,
.timeline .card {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

body .content .card:hover,
.article-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: rgba(255, 111, 60, 0.2);
}

body .content .card .card-content,
.article .card .card-content {
    padding: 1.8rem;
    position: relative;
}

/* Read More Button Optimization - Specific targeting */
.content a.article-more,
.card a.article-more,
.article-more-link a.article-more {
    background: linear-gradient(45deg, #FF6F3C, #FF8C69);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 111, 60, 0.3);
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
}

.content a.article-more:hover,
.content a.article-more:focus,
.card a.article-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 111, 60, 0.4);
    background: linear-gradient(45deg, #FF8C69, #FF6F3C);
    color: white;
}

/* Mobile Optimizations */
@media (max-width: 769px) {
    body .content .card .content,
    .article .card .content {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    body .content .card .title,
    .article .card .title {
        font-size: 1.2rem;
    }
    
    body .content .card .card-content,
    .article .card .card-content {
        padding: 1.2rem;
    }
    
    .content a.article-more,
    .card a.article-more {
        font-size: 0.9rem;
        padding: 8px 20px;
    }
}

/* Sticky Sidebar Enhancement */
@media screen and (min-width: 769px) {
    .layout-wrap .column-left.is-sticky,
    .layout-wrap .column-right.is-sticky,
    .container .column-left.is-sticky,
    .container .column-right.is-sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 1rem;
        align-self: flex-start;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        z-index: 20;
    }
    
    .column-left .card,
    .column-right .card,
    .widget .card {
        margin-bottom: 1.5rem;
    }
}

/* Dark Mode Optimization */
@media (prefers-color-scheme: dark) {
    body.dark .card,
    html[data-theme="dark"] .card {
        background: #2d3748;
        border-color: rgba(255,255,255,0.1);
    }
    
    body.dark .card .content,
    html[data-theme="dark"] .card .content {
        color: #e2e8f0;
    }
    
    body.dark .card .title a,
    html[data-theme="dark"] .card .title a {
        color: #ffffff;
    }
}

/* Performance Optimizations - DISABLED content-visibility to fix height flickering */
.card {
    /* content-visibility: auto; */
}

/* Reduce font loading impact */
.content, .card-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar Logo Styles - Moved from inline styles */
.navbar .navbar-brand {
    height: auto;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.navbar .navbar-brand img, 
.navbar .navbar-brand svg {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}