/* Pitechpedia Blog Redesign — Modern Knowledge Hub (M3) */

:root {
    --blog-primary: #1a73e8;
    --blog-primary-hover: #1557b0;
    --blog-surface: #ffffff;
    --blog-bg: #ffffff;
    --blog-text-main: #202124;
    --blog-text-sub: #5f6368;
    --blog-border: #dadce0;
    --blog-pill-bg: #f1f3f4;
    --blog-shadow: 0 1px 3px rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --blog-card-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --blog-radius: 12px;
}

.dark-mode {
    --blog-surface: #2d2e31;
    --blog-bg: #202124;
    --blog-text-main: #e8eaed;
    --blog-text-sub: #bdc1c6;
    --blog-border: #3c4043;
    --blog-pill-bg: #3c4043;
}

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

.blog-main {
    padding-top: 80px; /* Offset for fixed header */
    max-width: 1280px;
    margin: 0 auto;
    padding-inline: 24px;
}

/* =========================================================================
   HERO SECTION
========================================================================= */
.blog-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 80px 0;
    gap: 64px;
}

.hero-content {
    flex: 1;
}

.hero-pill {
    display: inline-block;
    padding: 6px 16px;
    background: #e8f0fe;
    color: var(--blog-primary);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--blog-text-main);
}

.hero-title span.text-blue {
    color: var(--blog-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--blog-text-sub);
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Search Box */
.hero-search-wrapper {
    display: flex;
    gap: 16px;
    align-items: center;
    max-width: 600px;
}

.search-container {
    flex: 1;
    position: relative;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 2px 16px;
    display: flex;
    align-items: center;
}

.search-container span {
    color: var(--blog-text-sub);
    margin-right: 12px;
}

.search-container input {
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 1rem;
    width: 100%;
    outline: none;
    color: var(--blog-text-main);
}

.topic-dropdown {
    padding: 14px 24px;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    background: var(--blog-surface);
    color: var(--blog-text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.hero-image-wrapper {
    flex: 1;
    position: relative;
}

.hero-main-img {
    width: 100%;
    border-radius: 40px;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.1);
}

/* Decorative dots */
.hero-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background-image: radial-gradient(var(--blog-primary) 2px, transparent 2px);
    background-size: 15px 15px;
    z-index: -1;
}

/* =========================================================================
   FILTER BAR
========================================================================= */
.blog-filter-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 48px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.filter-pill {
    padding: 10px 24px;
    border-radius: 100px;
    background: var(--blog-pill-bg);
    color: var(--blog-text-sub);
    font-weight: 600;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill.active {
    background: var(--blog-primary);
    color: white;
}

.filter-pill:hover:not(.active) {
    background: var(--blog-border);
}

/* =========================================================================
   MAIN GRID
========================================================================= */
.blog-content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    margin-bottom: 100px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.article-card {
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-img-link {
    display: block;
    height: 240px;
    overflow: hidden;
}

.card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* Dynamic colors for tags */
.tag-career { background: #e8f0fe; color: #1a73e8; }
.tag-skills { background: #e6f4ea; color: #1e8e3e; }
.tag-internship { background: #fef7e0; color: #f9ab00; }
.tag-ai { background: #f3e5f5; color: #9c27b0; }
.tag-fintech { background: #e0f2f1; color: #009688; }
.tag-hardware { background: #fff3e0; color: #ff9800; }
.tag-default { background: #f1f3f4; color: #5f6368; }

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--blog-text-main);
}

.card-excerpt {
    color: var(--blog-text-sub);
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--blog-border);
    padding-top: 16px;
    font-size: 0.85rem;
    color: var(--blog-text-sub);
}

.read-more {
    color: var(--blog-primary);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================================
   SIDEBAR
========================================================================= */
.sidebar-widget {
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.widget-title span {
    color: #f9ab00;
}

/* Popular Posts */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popular-item {
    display: flex;
    gap: 16px;
    text-decoration: none;
}

.popular-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
}

.popular-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blog-text-main);
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.popular-item:hover h5 {
    color: var(--blog-primary);
}

.popular-date {
    font-size: 0.8rem;
    color: var(--blog-text-sub);
}

/* Newsletter */
.newsletter-widget {
    border: 1px solid var(--blog-border);
}

.newsletter-widget span {
    color: var(--blog-primary) !important;
}

.newsletter-desc {
    color: var(--blog-text-sub);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.newsletter-form input {
    padding: 12px 16px;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    background: var(--blog-pill-bg);
    outline: none;
}

.btn-subscribe {
    padding: 14px;
    background: var(--blog-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-subscribe:hover {
    background: var(--blog-primary-hover);
}

.newsletter-note {
    font-size: 0.75rem;
    color: var(--blog-text-sub);
    margin-top: 12px;
}

/* =========================================================================
   RESPONSIVE
========================================================================= */
@media (max-width: 1024px) {
    .blog-hero { flex-direction: column; text-align: center; gap: 40px; }
    .hero-search-wrapper { margin-inline: auto; flex-direction: column; width: 100%; }
    .blog-content-layout { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero-title { font-size: 2.5rem; }
    .articles-grid { grid-template-columns: 1fr; }
}