/* Blog Page - Isolated Styles */

/* Grid Container */
.blog-grid-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 1rem 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card Styles */
.news-card {
    background-color: #0a101f;
    /* Fallback if var not available */
    background-color: var(--card-bg-color, #0a101f);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.news-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-date {
    font-size: 0.85rem;
    color: #8899a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-description {
    color: #cfd9e0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    margin-top: auto;
}

.read-more:hover {
    color: #60a5fa;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-grid-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-grid-list {
        grid-template-columns: 1fr;
    }
}

/* Blog Post Page Styles */
.blog-post-container {
    max-width: 800px;
    margin: 120px auto 4rem;
    padding: 0 1.5rem;
    width: 100%;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-back-link {
    display: inline-block;
    color: #3b82f6;
    margin-bottom: 1.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blog-post-back-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.blog-post-date {
    color: #8899a6;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 2rem;
}

.blog-post-image,
.blog-post-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #e2e8f0;
    margin-bottom: 4rem;
}

/* Markdown Element Styles */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    color: #fff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.blog-post-content h1 {
    font-size: 2.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.blog-post-content h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.blog-post-content h3 {
    font-size: 1.5rem;
}

.blog-post-content h4 {
    font-size: 1.25rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
}

.blog-post-content li>ul,
.blog-post-content li>ol {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.blog-post-content strong {
    color: #fff;
    font-weight: 600;
}

.blog-post-content a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.blog-post-content a:hover {
    border-color: #3b82f6;
}

.blog-post-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #94a3b8;
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

.blog-post-content pre {
    background: #1e293b;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-post-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.blog-post-content pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.blog-post-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.blog-post-content th,
.blog-post-content td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.blog-post-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: #fff;
}

.blog-post-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 3rem;
}

.blog-post-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-post-footer-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.blog-post-footer-link:hover {
    color: #fff;
}