* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    color: #f9fafb;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-width: 320px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Wrapper to push footer down */
.content-wrapper {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* NAV / HEADER */
.welcome-area {
    min-height: auto !important;
    height: auto !important;
    background: #111827 !important;
}
.navbar-nobg { 
    background: transparent !important; 
}
.navbar-nav > li > a {
    color: #f9fafb !important;
    transition: color .3s ease;
    font-size: 15px;
}
.navbar-nav > li > a:hover,
.navbar-nav > li.active > a { 
    color: #f89a59 !important; 
}
.logo p { 
    color: #f9fafb !important;
    font-size: 24px;
}
.logo p .theme-color { 
    color: #f89a59 !important; 
}

/* HERO SECTION - FIXED */
.ai-hero.blogs-hero {
    position: relative;
    background: #111827;
    overflow: hidden;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
}

.hero-image-container {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(17,24,39,0.8), rgba(31,41,55,0.7));
    z-index: 2;
}

.ai-hero.blogs-hero .container {
    position: relative;
    z-index: 3;
    padding: 60px 15px;
}

.ai-hero.blogs-hero .hero-content {
    text-align: center;
    color: white;
    max-width: 900px;
    margin: 0 auto;
}

.ai-hero.blogs-hero .hero-title {
    font-size: clamp(1.75rem, 4vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    padding: 0 20px;
}

.ai-hero.blogs-hero .hero-meta {
    color: #f89a59;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 500;
}

.ai-hero.blogs-hero .hero-meta i {
    margin-right: 8px;
}

/* MAIN LAYOUT */
.blog-detail-container {
    margin: 0 auto;
    padding: 0 15px 60px;
    max-width: 1400px;
    width: 100%;
}

.blog-detail-container .row {
    margin-left: -15px;
    margin-right: -15px;
}

.blog-detail-container [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* ARTICLE BODY - FIXED FONT SIZES */
.article-body {
    background: #1f2937;
    border-radius: 12px;
    padding: clamp(25px, 4vw, 40px);
    color: #e5e7eb;
    line-height: 1.8;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    margin-bottom: 30px;
    min-height: 300px;
}

.article-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 20px;
    line-height: 1.3;
    text-align: center;
}

.article-meta-bar {
    margin-bottom: 30px;
    color: #9ca3af;
    font-size: 1rem;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #374151;
}

.article-meta-bar i { 
    margin-right: 6px; 
}

.article-body h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: #f9fafb;
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 700;
    line-height: 1.3;
}

.article-body h2 {
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
    color: #f9fafb;
    margin-top: 1.8em;
    margin-bottom: 0.7em;
    font-weight: 700;
    line-height: 1.3;
}

.article-body h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    color: #f9fafb;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    font-weight: 700;
    line-height: 1.4;
}

.article-body p { 
    margin-bottom: 1.5em;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
}

.article-body ul,
.article-body ol { 
    margin: 0 0 1.5em 2em;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body a { 
    color: #60a5fa; 
    text-decoration: underline;
    transition: color 0.2s;
}

.article-body a:hover {
    color: #93c5fd;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

/* SIDEBAR WIDGETS */
.sidebar-widget {
    background: #1f2937;
    border-radius: 12px;
    padding: clamp(20px, 3vw, 25px);
    margin-bottom: 25px;
}

.sidebar-title {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: 700;
    color: #f89a59;
    margin: 0 0 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-search-input {
    background: #111827;
    border: 1px solid #4b5563;
    border-radius: 6px;
    padding: 12px 15px;
    color: #f9fafb;
    width: 100%;
    font-size: 1rem;
}

.blog-search-input:focus {
    outline: none;
    border-color: #f89a59;
    box-shadow: 0 0 0 3px rgba(248,154,89,0.25);
}

.blog-search-btn {
    background: #f89a59;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.blog-search-btn:hover { 
    background: #ff8a65;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248,154,89,0.3);
}

.tag-badge {
    display: inline-block;
    margin: 0 8px 10px 0;
    padding: 8px 16px;
    background: #111827;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #e5e7eb;
    border: 1px solid #4b5563;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag-badge:hover {
    background: #f89a59;
    border-color: #f89a59;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(248,154,89,0.3);
}

/* RELATED POSTS - FIXED */
.related-posts {
    margin-top: 40px;
    padding: clamp(25px, 3vw, 30px);
    background: #1f2937;
    border-radius: 12px;
}

.related-title {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #f89a59;
    margin-bottom: 25px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(20px, 3vw, 25px);
}

.related-post-card {
    background: #111827;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.related-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-post-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.08);
}

.related-post-date {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(248, 154, 89, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.related-post-content {
    padding: clamp(15px, 2.5vw, 20px);
}

.related-post-title {
    font-size: clamp(1rem, 1.8vw, 1.1rem);
    font-weight: 600;
    color: #f9fafb;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.related-post-excerpt {
    font-size: clamp(0.9rem, 1.5vw, 0.95rem);
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}


/* =====================  RESPONSIVE  ===================== */

/* Large Desktop - Better scaling */
@media (min-width: 1400px) {
    .blog-detail-container {
        max-width: 1600px;
    }

    .article-body {
        font-size: 1.25rem;
    }

    .article-body p,
    .article-body ul,
    .article-body ol {
        font-size: 1.25rem;
    }
}

/* Desktop optimization */
@media (min-width: 992px) and (max-width: 1399px) {
    .blog-detail-container {
        max-width: 1200px;
    }
}

/* Tablet */
@media (max-width: 991px) {
    .ai-hero.blogs-hero {
        min-height: 400px;
    }
    
    .blog-detail-container {
        padding: 0 15px 50px;
    }
    
    .article-body {
        padding: 30px 25px;
        font-size: 1.0625rem;
    }

    .sidebar-widget {
        margin-top: 25px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ai-hero.blogs-hero {
        min-height: 350px;
        margin-bottom: 30px;
    }
    
    .ai-hero.blogs-hero .container {
        padding: 40px 15px;
    }
    
    .article-body {
        padding: 25px 20px;
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .article-body p,
    .article-body ul,
    .article-body ol {
        font-size: 1rem;
    }

    .article-meta-bar {
        font-size: 0.9rem;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .sidebar-widget {
        margin-top: 20px;
        padding: 20px;
    }

    .sidebar-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .tag-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
        margin: 0 6px 8px 0;
    }
    
    .related-posts {
        padding: 25px 20px;
        margin-top: 30px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .related-post-image {
        height: 160px;
    }

    .related-post-content {
        padding: 15px;
    }

    .related-post-title {
        font-size: 1rem;
    }

    .related-post-excerpt {
        font-size: 0.9rem;
    }
    
    .comments-section {
        padding: 25px 20px;
        margin-top: 30px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .btn-submit {
        padding: 10px 24px;
        font-size: 0.95rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .ai-hero.blogs-hero {
        min-height: 300px;
    }

    .ai-hero.blogs-hero .container {
        padding: 30px 15px;
    }

    .article-body {
        padding: 20px 15px;
        font-size: 0.95rem;
    }

    .article-body p,
    .article-body ul,
    .article-body ol {
        font-size: 0.95rem;
    }

    .sidebar-widget {
        padding: 15px;
    }

    .blog-search-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .related-posts {
        padding: 20px 15px;
    }

    .related-post-image {
        height: 140px;
    }

    .comments-section {
        padding: 20px 15px;
    }
}
