/* ─── Blog List Page ─────────────────────────────────────────────── */

.blog-hero {
    padding: 120px 24px 56px;
    border-bottom: 1px solid var(--border);
}

.blog-hero-inner {
    max-width: 780px;
}

.blog-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 16px;
}

.blog-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: var(--text-dark);
    line-height: 1.2;
}

.blog-hero p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 560px;
}

/* ─── Filter Bar ─────────────────────────────────────────────────── */

.blog-filter {
    padding: 28px 24px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.18s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* ─── Article Grid ───────────────────────────────────────────────── */

.blog-grid-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

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

/* ─── Article Card ───────────────────────────────────────────────── */

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.article-card.hidden { display: none; }

.card-cover {
    height: 160px;
    background: linear-gradient(135deg, rgba(0,85,255,0.08) 0%, rgba(0,85,255,0.03) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.card-cover-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(0, 85, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
}

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

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.card-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: rgba(0, 85, 255, 0.07);
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
}

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

.card-read-time {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.65;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-tag {
    font-size: 0.72rem;
    color: var(--text-light);
    background: var(--accent);
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 500;
}

/* ─── Empty State ────────────────────────────────────────────────── */

.blog-empty {
    text-align: center;
    padding: 80px 0;
    display: none;
    grid-column: 1 / -1;
}

.blog-empty i {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 16px;
    display: block;
}

.blog-empty p { font-size: 0.95rem; color: var(--text-light); }

/* ─── Article Page ───────────────────────────────────────────────── */

.article-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 96px 24px 60px;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-light);
    transition: color 0.2s;
}

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

.breadcrumb-sep {
    color: var(--border);
    font-size: 0.7rem;
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-back {
    display: none; /* replaced by breadcrumb */
}

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

.article-header .card-meta { margin-bottom: 16px; }

.article-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.article-header .article-excerpt {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ─── Article Body ───────────────────────────────────────────────── */

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

.article-body h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 40px 0 16px;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--text-dark);
}

.article-body p { margin-bottom: 18px; }

.article-body ul,
.article-body ol {
    padding-left: 24px;
    margin-bottom: 18px;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }

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

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

.article-body code {
    font-family: 'Fira Code', monospace;
    font-size: 0.82em;
    background: var(--accent);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--text-dark);
}

.article-body pre {
    background: #1e2130;
    border-radius: 12px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
    font-size: 0.83rem;
    color: #e2e8f0;
    line-height: 1.75;
}

.article-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(0, 85, 255, 0.04);
    border-radius: 0 8px 8px 0;
    color: var(--text-light);
    font-style: italic;
}

.article-tip {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 20px 0;
}

.article-tip i { flex-shrink: 0; margin-top: 2px; }

.article-tip.info {
    background: rgba(0, 85, 255, 0.05);
    border: 1px solid rgba(0, 85, 255, 0.15);
    color: #1e3a8a;
}
.article-tip.info i { color: var(--primary); }

.article-tip.warn {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #92400e;
}
.article-tip.warn i { color: #f59e0b; }

/* ─── Download CTA (end of article) ─────────────────────────────── */

.article-download-cta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, rgba(0,85,255,0.06) 0%, rgba(0,85,255,0.02) 100%);
    border: 1.5px solid rgba(0, 85, 255, 0.18);
    border-radius: 16px;
    margin: 48px 0 0;
}

.article-cta-icon {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.article-cta-text { flex: 1; }

.article-cta-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.article-cta-text p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.article-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--primary);
    color: white !important;           /* override .article-body a { color } */
    text-decoration: none !important;  /* override .article-body a { underline } */
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.article-cta-btn:hover { background: var(--primary-hover); color: white !important; }

/* ─── Floating Download CTA (bottom-right) ───────────────────────── */

.float-cta {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 500;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 16px 20px;
    width: 240px;
    transition: opacity 0.3s, transform 0.3s;
}

.float-cta.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.float-cta-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.float-cta-desc {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 14px;
}

.float-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 0;
    background: var(--primary);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s;
}

.float-cta-btn:hover { background: var(--primary-hover); color: white !important; }

.float-cta-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s;
}

.float-cta-close:hover { color: var(--text-dark); }

/* ─── Article Footer ─────────────────────────────────────────────── */

.article-footer {
    /* Reset global: footer { background: white; padding: 80px 0 40px } */
    background: transparent;
    padding: 24px 0 0;
    margin-top: 32px;
    border-top: 1px solid var(--border);
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.article-tag {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--accent);
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 500;
}

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

.article-nav-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 0;
    text-decoration: none;
    color: inherit;
    transition: color 0.18s ease;
}

.article-nav-card.prev { padding-right: 24px; }

.article-nav-card.next {
    text-align: right;
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

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

.article-nav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.article-nav-card.next .article-nav-label { justify-content: flex-end; }

.article-nav-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.45;
    transition: color 0.18s ease;
}

/* ─── Related Articles ───────────────────────────────────────────── */

#relatedArticles {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.related-header {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

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

.related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(0, 85, 255, 0.08);
}

.related-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.related-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.45;
    margin: 0;
}

.related-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

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

@media (max-width: 640px) {
    .blog-hero h1 { font-size: 1.8rem; }
    .blog-hero { padding-top: 100px; }
    .blog-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.6rem; }
    .article-nav { grid-template-columns: 1fr; }
    .article-download-cta { flex-direction: column; align-items: flex-start; gap: 14px; }
    .float-cta { width: calc(100vw - 48px); bottom: 16px; right: 24px; }
    .related-grid { grid-template-columns: 1fr; }
}
