/* =========================================
   PRIME SEO BLOG — CSS
   ========================================= */

/* --- Blog Hero --- */
.blog-hero {
    background: var(--dark);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(99,102,241,0.12) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
    pointer-events: none;
}

.blog-hero .section-badge {
    color: var(--primary-light);
}

.blog-hero .section-title {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-top: 12px;
}

.blog-hero .section-subtitle {
    color: var(--dark-text);
    font-size: 1.15rem;
    max-width: 560px;
    margin: 16px auto 0;
    line-height: 1.7;
}

/* --- Category Filters --- */
.blog-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 36px;
}

.blog-filter-btn {
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-filter-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.05);
}

.blog-filter-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Blog Grid --- */
.blog-listing {
    padding: 60px 0 100px;
    background: var(--bg-light);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* --- Blog Card --- */
.blog-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
    border-color: rgba(99,102,241,0.2);
}

/* --- Card Visual Header (replaces ugly images) --- */
.blog-card-visual {
    height: 200px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category gradients */
.blog-card-visual[data-cat="ai-search"] {
    background: linear-gradient(135deg, #312e81 0%, #4c1d95 50%, #581c87 100%);
}
.blog-card-visual[data-cat="wordpress-seo"] {
    background: linear-gradient(135deg, #1e3a5f 0%, #164e63 50%, #134e4a 100%);
}
.blog-card-visual[data-cat="tutorials"] {
    background: linear-gradient(135deg, #14532d 0%, #065f46 50%, #064e3b 100%);
}

/* Dot grid overlay */
.blog-card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Glow orb */
.blog-card-visual::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.blog-card-visual[data-cat="ai-search"]::after {
    background: #818cf8;
    top: -20px;
    right: -20px;
}
.blog-card-visual[data-cat="wordpress-seo"]::after {
    background: #22d3ee;
    bottom: -20px;
    left: -20px;
}
.blog-card-visual[data-cat="tutorials"]::after {
    background: #34d399;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.blog-card:hover .blog-card-visual::after {
    opacity: 0.6;
}

/* Icon inside visual */
.blog-card-icon {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.3s ease;
}

.blog-card:hover .blog-card-icon {
    transform: scale(1.08);
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
}

.blog-card-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
    opacity: 0.9;
}

/* Category pill on visual */
.blog-card-cat {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 2;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
}

/* Reading time pill */
.blog-card-time {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 2;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --- Card Body --- */
.blog-card-body {
    padding: 24px 24px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.blog-card:hover .blog-card-body h3 {
    color: var(--primary);
}

.blog-card-body p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 16px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.blog-card-date {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
}

.blog-card-read {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.blog-card:hover .blog-card-read {
    gap: 8px;
}

.blog-card-read svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.blog-card:hover .blog-card-read svg {
    transform: translateX(2px);
}

/* --- No Results --- */
.blog-no-results {
    display: none;
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.blog-no-results.visible {
    display: block;
}

.blog-no-results p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* =========================================
   ARTICLE PAGE
   ========================================= */

/* --- Article Hero --- */
.article-hero {
    background: var(--dark);
    padding: 140px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(99,102,241,0.1) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, black 20%, transparent 100%);
    pointer-events: none;
}

.article-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.article-cat {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--primary-light);
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.2);
    margin-bottom: 20px;
}

.article-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--dark-text);
    font-size: 0.88rem;
    font-weight: 500;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* --- Article Layout --- */
.article-layout {
    padding: 60px 0 100px;
    background: var(--bg);
}

.article-layout .container {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 60px;
    max-width: 1100px;
}

/* --- Table of Contents (sticky sidebar) --- */
.article-toc {
    position: sticky;
    top: 100px;
    align-self: start;
}

.article-toc-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 16px;
}

.article-toc a {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-muted);
    padding: 6px 0 6px 16px;
    border-left: 2px solid var(--border);
    transition: all 0.2s ease;
    text-decoration: none;
}

.article-toc a:hover,
.article-toc a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

.article-toc a.toc-h3 {
    padding-left: 28px;
    font-size: 0.78rem;
}

/* --- Article Content --- */
.article-content {
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 48px 0 20px;
    padding-top: 20px;
}

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

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    margin: 36px 0 14px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: var(--primary-hover);
}

.article-content strong {
    font-weight: 700;
    color: var(--text);
}

.article-content em {
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 0 0 20px 24px;
}

.article-content li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.article-content li::marker {
    color: var(--primary);
}

.article-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--primary);
    background: rgba(99,102,241,0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-muted);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.article-content pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    border: 1px solid #1e293b;
}

.article-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
    background: var(--bg-subtle);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--primary);
}

.article-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
}

.article-content th {
    text-align: left;
    font-weight: 700;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.article-content td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    vertical-align: top;
}

.article-content tr:hover td {
    background: rgba(99,102,241,0.02);
}

/* Horizontal rule */
.article-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 40px 0;
}

/* Images in articles */
.article-content img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 24px 0;
}

/* --- CTA Banner (in-article) --- */
.article-cta {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin: 40px 0;
    text-align: center;
    color: #fff;
}

.article-cta h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
}

.article-cta p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.article-cta .btn {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
}

.article-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* --- Author Box --- */
.article-author {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-top: 48px;
}

.article-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.article-author-avatar svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.article-author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.article-author-bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Related Articles --- */
.article-related {
    padding: 80px 0;
    background: var(--bg-light);
}

.article-related .section-header {
    margin-bottom: 36px;
}

.article-related .blog-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* --- Prev/Next Navigation --- */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.article-nav-link {
    display: block;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-nav-link:hover {
    border-color: rgba(99,102,241,0.3);
    background: rgba(99,102,241,0.02);
}

.article-nav-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 6px;
}

.article-nav-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.article-nav-link:hover .article-nav-title {
    color: var(--primary);
}

.article-nav-next {
    text-align: right;
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #fff;
}

.breadcrumb svg {
    width: 12px;
    height: 12px;
    opacity: 0.4;
}

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

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .article-layout .container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .article-toc {
        position: static;
        margin-bottom: 40px;
        padding: 20px 24px;
        background: var(--bg-light);
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }

    .article-related .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 60px;
    }

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

    .blog-card-visual {
        height: 170px;
    }

    .article-hero {
        padding: 120px 0 48px;
    }

    .article-layout {
        padding: 40px 0 60px;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.35rem;
    }

    .article-cta {
        padding: 28px 24px;
    }

    .article-author {
        flex-direction: column;
        text-align: center;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .article-nav-next {
        text-align: left;
    }

    .article-related .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-filters {
        gap: 6px;
    }

    .blog-filter-btn {
        padding: 7px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .blog-card-body {
        padding: 20px 20px 24px;
    }

    .blog-card-body h3 {
        font-size: 1rem;
    }

    .article-content pre {
        padding: 16px;
        font-size: 0.78rem;
        border-radius: var(--radius-sm);
    }

    .article-meta {
        gap: 12px;
        font-size: 0.82rem;
    }
}
