/* Blog Styles - Media Planet */
.nav a.active {
    color: var(--primary-color);
}

.nav a.active::after {
    width: 100%;
}

.blog-hero {
    padding: 8.5rem 0 3.5rem;
    background: var(--gradient-primary);
    color: var(--white);
}

.blog-hero-center {
    text-align: center;
}

.blog-hero .hero-title {
    color: var(--white);
    font-size: clamp(1.85rem, 3.6vw, 2.85rem);
    line-height: 1.25;
    margin-bottom: 1rem;
}

.blog-hero .hero-description {
    color: rgba(255, 255, 255, 0.92);
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.925rem;
    color: rgba(255, 255, 255, 0.9);
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.article-meta-item svg {
    width: 16px;
    height: 16px;
}

.cat-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: background 0.2s;
}

.cat-badge:hover {
    background: rgba(255, 255, 255, 0.3);
}

.blog-section {
    padding: 3.5rem 0 4.5rem;
    background: var(--white);
}

.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 3rem;
    align-items: start;
}

.article-card-shell {
    background: var(--white);
}

.article-body {
    color: var(--text-dark);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.article-body h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    color: var(--text-dark);
    margin: 2.25rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-size: clamp(1.18rem, 2vw, 1.4rem);
    color: var(--text-dark);
    margin: 1.75rem 0 0.75rem;
}

.article-body h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 1.35rem 0 0.6rem;
}

.article-body p {
    color: #374151;
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

.article-body ul,
.article-body ol {
    margin: 1.15rem 0 1.35rem;
    padding-left: 1.6rem;
    color: #374151;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin-bottom: 0.65rem;
    line-height: 1.75;
}

.article-body li > p {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.article-body strong,
.article-body b {
    color: var(--text-dark);
    font-weight: 600;
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-light);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
    color: var(--text-dark);
}

.article-body pre,
.article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.article-body code {
    padding: 0.15rem 0.4rem;
    font-size: 0.9em;
}

.article-body pre {
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.table-wrap {
    overflow-x: auto;
    margin: 1.75rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table-wrap th,
.table-wrap td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.table-wrap th {
    background: var(--bg-secondary);
    color: var(--text-dark);
    font-weight: 600;
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

/* Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 6rem;
}

.sidebar-box {
    background: var(--bg-secondary);
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.sidebar-box h3 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 0.85rem;
}

.sidebar-box p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 1.2rem;
}

.sidebar-cta-btns {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-cta-btns .btn {
    width: 100%;
    justify-content: center;
}

.sidebar-cats {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-cats li + li {
    margin-top: 0.5rem;
}

.sidebar-cats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    background: var(--white);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.sidebar-cats a:hover,
.sidebar-cats a.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-cats span.count {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}

/* Related posts */
.related-section {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.related-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* Index / Archive */
.blog-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.cat-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.cat-pill:hover,
.cat-pill.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
}

.blog-search-wrap {
    position: relative;
    flex: 1 1 280px;
    max-width: 400px;
}

.blog-search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-light);
    color: var(--text-dark);
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.blog-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 92, 246, 0.4);
}

.post-card-cat {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.85rem;
    text-decoration: none;
    width: fit-content;
}

.post-card h2,
.post-card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.65rem;
}

.post-card h2 a,
.post-card h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.post-card h2 a:hover,
.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-card-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.15rem;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-light);
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.post-card-read {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    margin-top: 3rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-link.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
}

.page-ellipsis {
    padding: 0 0.35rem;
    color: var(--text-light);
}

.search-status {
    margin-bottom: 1.25rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    .blog-sidebar {
        position: static;
    }
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .blog-hero {
        padding: 7.25rem 0 2.75rem;
    }
}
