/* ==========================================================================
   Insights (Blog) Specific Styles
   ========================================================================== */

/* Mapping Insights variables to Global Theme */
:root {
    --card-bg: var(--bg-secondary);
    --border-color: var(--border-light);
    --text-color: var(--text-secondary);
    --text-muted: var(--text-tertiary);
    --white: var(--text-primary);
    --accent-color: #00FFAA;
    --accent-secondary: #FF6B35;
    --accent-light: #66FFCC;
    --black: var(--bg-primary);
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-poppins: var(--font-primary);
}

/* Insights Grid (for insights.html) */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 2rem 0;
}

.insight-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-color);
}

.insight-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 112, 243, 0.1);
}

.insight-card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--black);
}

.insight-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.insight-card:hover .insight-card-image {
    transform: scale(1.05);
}

.insight-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.insight-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-family: var(--font-poppins);
}

.insight-card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--white);
    line-height: 1.4;
    font-weight: 600;
}

.insight-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.insight-card-link {
    color: var(--accent-secondary);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s;
    font-family: var(--font-poppins);
    font-size: 0.9rem;
    margin-top: auto;
}

.insight-card:hover .insight-card-link {
    color: var(--accent-light);
}

/* Single Insight Article (for insight.html) */
.article-hero-section {
    padding: 12vh 0 5vh;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    font-family: var(--font-poppins);
    display: inline-block;
}

.back-link:hover {
    color: var(--white);
}

.insight-date {
    font-family: var(--font-poppins);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-image-section {
    padding-bottom: 3rem;
}

.article-image-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: var(--card-bg);
}

.insight-featured-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Rich Text Content Styling */
.article-content-section {
    padding-top: 2rem;
}

.rich-text-content {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
}

.rich-text-content h1, 
.rich-text-content h2, 
.rich-text-content h3, 
.rich-text-content h4 {
    color: var(--white);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.rich-text-content h2 {
    font-size: 2rem;
}

.rich-text-content h3 {
    font-size: 1.5rem;
}

.rich-text-content p {
    margin-bottom: 1.5rem;
}

.rich-text-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: all 0.3s ease;
}

.rich-text-content a:hover {
    color: var(--accent-light);
    border-bottom-style: solid;
}

.rich-text-content ul, 
.rich-text-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.rich-text-content li {
    margin-bottom: 0.5rem;
}

.rich-text-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--white);
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.rich-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.rich-text-content pre {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.rich-text-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

/* Loading state */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility to extract excerpt */
.hidden-content {
    display: none !important;
}
