/* Blog Main Styles - Nucleo Studio */

:root {
    --blog-bg: #0f0f0f;
    --blog-card-bg: rgba(20, 20, 25, 0.7);
    --blog-accent: var(--color-principal, #66ff00);
    --blog-text-muted: rgba(255, 255, 255, 0.6);
    --blog-border: rgba(255, 255, 255, 0.08);
    --blog-glow: rgba(102, 255, 0, 0.15);
}

body {
    background-color: var(--blog-bg);
}

/* --- Hero Section --- */
.blog-hero {
    position: relative;
    padding: 6rem 0 4rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(15,15,15,1) 100%);
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, var(--blog-glow) 0%, transparent 70%);
    pointer-events: none;
}

.blog-hero h1 {
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: uppercase;
}

/* --- Blog Cards --- */
.blog-card {
    background: var(--blog-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(102, 255, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--blog-glow);
}

.blog-card-image {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
}

.blog-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.blog-card-body {
    padding: 2rem;
    flex-grow: 1;
}

.blog-card-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-card-text {
    font-size: 1rem;
    color: var(--blog-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Single Post View --- */
.post-container {
    margin-top: -6rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
}

.post-content-wrapper {
    background: var(--blog-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--blog-border);
    border-radius: 30px;
    padding: 4rem;
}

@media (max-width: 991.98px) {
    .post-container {
        margin-top: -3rem;
    }
    .post-content-wrapper {
        padding: 2.5rem 1.5rem;
    }
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    color: var(--blog-accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.post-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body h2, .post-body h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: #fff;
}

/* Fix images and media inside content */
.post-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 15px;
    margin: 2rem 0;
    display: block;
}

/* Ensure iframes, videos and embeds are responsive */
.post-body iframe,
.post-body video,
.post-body embed,
.post-body object {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: 15px;
    margin: 2rem 0;
    display: block;
    border: none;
}

.post-body table {
    width: 100% !important;
    margin-bottom: 2rem;
    color: #fff;
    border-collapse: collapse;
}

.post-body table td, .post-body table th {
    padding: 1rem;
    border: 1px solid var(--blog-border);
}

/* --- Sidebar Widgets --- */
.widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.widget-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--blog-accent);
    display: inline-block;
    color: #fff;
}

/* --- Author Widget Specifics --- */
.author-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.author-avatar {
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    object-fit: cover;
}

.author-widget:hover .author-avatar {
    border-color: var(--blog-accent);
    box-shadow: 0 0 20px var(--blog-glow);
    transform: scale(1.02);
}

.author-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--blog-border);
    border-radius: 50%;
    color: var(--blog-text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.1rem;
}

.author-social-link:hover {
    background: var(--blog-accent);
    color: #000 !important;
    border-color: var(--blog-accent);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px var(--blog-glow);
}

.category-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.5rem;
}

.category-link:hover {
    background: rgba(102, 255, 0, 0.1);
    color: var(--blog-accent);
    transform: translateX(5px);
}

.tag-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--blog-border);
    color: var(--blog-text-muted);
    text-decoration: none;
    margin: 0.2rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    border-color: var(--blog-accent);
    color: var(--blog-accent);
    background: rgba(102, 255, 0, 0.05);
}

/* --- Pagination --- */
.pagination-dark .page-link {
    background: var(--blog-card-bg) !important;
    border-color: var(--blog-border) !important;
    color: #fff !important;
    border-radius: 10px;
    margin: 0 4px;
    padding: 0.6rem 1rem;
}

.pagination-dark .page-item.active .page-link {
    background: var(--blog-accent) !important;
    color: #000 !important;
    border-color: var(--blog-accent) !important;
}

/* --- Comments Styling --- */
.comments-section {
    margin-top: 4rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
    padding: 3rem;
    border: 1px solid var(--blog-border);
    color: #fff;
}

.comments-section h3, 
.comments-section label {
    color: #fff !important;
}

.comments-section .form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--blog-border) !important;
    border-radius: 15px !important;
    color: #fff !important;
    padding: 1rem 1.25rem !important;
    transition: all 0.3s ease !important;
}

.comments-section .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

.comments-section .form-control:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--blog-accent) !important;
    box-shadow: 0 0 15px var(--blog-glow) !important;
    outline: none !important;
}

.comment-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--blog-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.comment-card .comment-author {
    color: var(--blog-accent) !important;
    font-weight: 600;
}

.comment-card .comment-date {
    color: var(--blog-text-muted) !important;
    font-size: 0.85rem;
}

/* Global Blog Text Overrides */
.text-muted {
    color: var(--blog-text-muted) !important;
}
