/* Blog Specific Styles */
:root {
    --blog-content-width: 800px;
    --sidebar-width: 350px;
    --gap: 2rem;
}

/* Layout */
.blog-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 60px 1.5rem;
    align-items: flex-start;
}

.blog-main {
    flex: 1;
    min-width: 0;
    /* Fix flex child overflow */
}

.blog-sidebar {
    width: 100%;
    max-width: var(--sidebar-width);
}

@media (max-width: 900px) {
    .blog-sidebar {
        max-width: 100%;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 20px 0;
    color: var(--light-gray);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--light-gray);
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs span {
    margin: 0 5px;
}

.breadcrumb_active {
    color: var(--primary);
}

/* Article Header */
.article-header {
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: var(--light-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    align-items: center;
}

.article-category {
    background-color: rgba(46, 250, 197, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 2.5rem;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

/* Article Content */
.article-content {
    color: #e0e0e0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.8rem;
    color: var(--white);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-content h3 {
    font-size: 1.4rem;
    color: var(--white);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

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

.article-content li {
    margin-bottom: 0.5rem;
    color: #d0d0d0;
}

.article-content strong {
    color: var(--white);
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(46, 250, 197, 0.3);
}

.article-content a:hover {
    text-decoration-color: var(--primary);
}

/* Images */
.blog-image {
    width: 100%;
    max-width: 100%;
    margin: 2rem 0;
    /* Slightly reduced margin */
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    /* Softer shadow */
}

.blog-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* Ensure no stretching */
}

/* Remove hover scale effect if it distracts reading, or keep subtle */
.blog-image:hover img {
    transform: scale(1.01);
    /* Very subtle zoom */
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--medium-gray);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sticky Sidebar */
.blog-sidebar {
    width: 100%;
    max-width: var(--sidebar-width);
    position: sticky;
    top: 100px;
    /* Adjust based on navbar height */
    height: fit-content;
}

.widget-title {
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rec-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    /* Context for clickable overlay */
    transition: var(--transition);
}

.rec-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 8px;
}

.rec-item:last-child {
    border-bottom: none;
}

.rec-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.3rem;
    line-height: 1.4;
    transition: var(--transition);
}

/* Make Sidebar Item Clickable via Title Link expansion */
.rec-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.rec-info {
    display: flex;
    flex-direction: column;
}

.rec-date {
    font-size: 0.8rem;
    color: var(--light-gray);
}

/* Bottom Recommendations & Grid Cards */
.bottom-recs-section {
    background-color: var(--dark-gray);
    padding: 80px 0;
    margin-top: 4rem;
}

.recs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.rec-card {
    background-color: var(--medium-gray);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    /* Context for clickable overlay */
    text-decoration: none !important;
    color: inherit;
}

.rec-card * {
    text-decoration: none !important;
}

/* Hide Language Switcher - Disabled by request, now handling inline in template */
/* #lang-select-container, #lang-select {
    display: none !important;
} */

/* Active Nav Link Override for Blog Section */
.nav-link.active {
    color: var(--primary) !important;
    font-weight: 700;
}

.nav-link.active::after {
    width: 100% !important;
}

.rec-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(46, 250, 197, 0.4);
}

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

.rec-card-tag {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.rec-card-title {
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.rec-card-desc {
    font-size: 0.95rem;
    color: var(--light-gray);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    line-height: 1.6;
}

.read-more-btn {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Make Card Fully Clickable */
.read-more-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.read-more-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.rec-card:hover .read-more-btn i {
    transform: translateX(5px);
}

/* Blog Index specific */
.blog-hero {
    text-align: center;
    padding: 100px 0 60px;
    background: radial-gradient(circle at 50% 0%, rgba(46, 250, 197, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
}

.blog-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.blog-hero p {
    color: var(--light-gray);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Code Blocks */
pre {
    background-color: #0d1117;
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: #e6edf3;
}