/* =============================================================
   blog.css — PumpIQ Blog Styles
   Extends style.css without modifying it.
   Uses the same CSS variables: --primary, --bg-card, etc.
   ============================================================= */

/* ── Logo link reset ───────────────────────────────────── */
.logo-link { text-decoration: none; color: inherit; }

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 8px; opacity: 0.5; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb li[aria-current="page"] { color: var(--text-main); font-weight: 500; }

/* ── Blog Hero ─────────────────────────────────────────── */
.blog-hero { position: relative; padding-bottom: 40px; }
.blog-hero-text { max-width: 700px; }
.blog-hero-text h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; margin-bottom: 16px; }
.blog-hero-text p { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; }

/* ── Search ────────────────────────────────────────────── */
.blog-search-wrapper { margin-top: 32px; max-width: 560px; }
.blog-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.blog-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.blog-search-box svg { color: var(--text-muted); flex-shrink: 0; }
.blog-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}
.blog-search-box input::placeholder { color: var(--text-muted); }
.search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    transition: color 0.2s;
}
.search-clear:hover { color: var(--primary); }

/* ── Section Label ─────────────────────────────────────── */
.section-label {
    margin-bottom: 24px;
}
.section-label span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(255, 123, 0, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(255, 123, 0, 0.2);
}

/* ── Featured Card ─────────────────────────────────────── */
.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 360px;
}
.featured-card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(255, 123, 0, 0.15); }
.featured-card-img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    position: relative;
}
.featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.featured-card:hover .featured-card-img img { transform: scale(1.04); }
.featured-card-body {
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}
.featured-title { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 700; line-height: 1.25; color: var(--text-main); }
.featured-excerpt { color: var(--text-muted); line-height: 1.7; flex: 1; }
.featured-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.read-more-btn { font-size: 0.9rem; padding: 10px 22px; white-space: nowrap; }

@media (max-width: 768px) {
    .featured-card { grid-template-columns: 1fr; }
    .featured-card-img { min-height: 220px; }
    .featured-card-body { padding: 28px 24px; }
}

/* ── Category Pills ────────────────────────────────────── */
.blog-filters { padding: 20px 0 8px; }
.category-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Post Card Grid ────────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}
.post-card {
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12); }
.post-card-img-link { display: block; overflow: hidden; }
.post-card-img { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-img img { transform: scale(1.06); }
.post-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.post-card-title { font-size: 1.15rem; font-weight: 600; line-height: 1.35; margin: 0; }
.post-card-title a { color: var(--text-main); text-decoration: none; transition: color 0.2s; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { color: var(--text-muted); font-size: 0.9rem; line-height: 1.65; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ── Post Meta (shared) ────────────────────────────────── */
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-category {
    font-size: 0.75rem; font-weight: 600; color: var(--primary);
    text-transform: uppercase; letter-spacing: 1px;
    background: rgba(255, 123, 0, 0.1);
    padding: 3px 10px; border-radius: 50px;
}
.post-reading-time { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.post-date { font-size: 0.8rem; color: var(--text-muted); }

/* ── Tags ──────────────────────────────────────────────── */
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    font-size: 0.75rem; color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
    padding: 3px 10px; border-radius: 50px;
    transition: all 0.2s;
}
[data-theme="dark"] .tag-chip { background: rgba(255, 255, 255, 0.05); }
.tag-chip:hover { color: var(--primary); border-color: var(--primary); }
.tag-chip.small { font-size: 0.7rem; padding: 2px 8px; }

/* ── Author Info ───────────────────────────────────────── */
.post-author-info { display: flex; align-items: center; gap: 12px; }
.author-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), #ff4d00);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; color: white;
    flex-shrink: 0;
}
.author-name { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }

/* ── No Results / Empty ────────────────────────────────── */
.no-results, .empty-blog {
    text-align: center; padding: 80px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.no-results svg, .empty-blog svg { color: var(--text-muted); opacity: 0.4; }
.no-results h3, .empty-blog h2 { color: var(--text-main); font-size: 1.4rem; }
.no-results p, .empty-blog p { color: var(--text-muted); }
.empty-blog { border-radius: 16px; }

/* ── RSS Banner ────────────────────────────────────────── */
.rss-section { padding: 40px 0 80px; }
.rss-banner {
    display: flex; align-items: center; gap: 20px; padding: 24px 32px;
    border-radius: 16px; flex-wrap: wrap;
}
.rss-icon { color: #f26522; font-size: 1.5rem; flex-shrink: 0; }
.rss-banner > div { flex: 1; }
.rss-banner strong { display: block; font-size: 1rem; margin-bottom: 4px; color: var(--text-main); }
.rss-banner p { color: var(--text-muted); font-size: 0.875rem; margin: 0; }

/* ══════════════════════════════════════════════════════════
   BLOG POST PAGE
   ══════════════════════════════════════════════════════════ */

/* ── Post Layout ───────────────────────────────────────── */
.blog-post-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
    padding-top: 48px;
    padding-bottom: 80px;
}
@media (max-width: 1024px) {
    .blog-post-layout { grid-template-columns: 1fr; }
    .blog-toc-sidebar { display: none; }
}

/* ── Post Header ───────────────────────────────────────── */
.post-header { margin-bottom: 40px; }
.post-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700; line-height: 1.2;
    color: var(--text-main); margin: 16px 0 20px;
}
.post-header-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.reading-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: var(--text-muted);
    background: rgba(255, 123, 0, 0.08); border: 1px solid rgba(255, 123, 0, 0.2);
    padding: 4px 12px; border-radius: 50px;
}
.reading-badge svg { color: var(--primary); }

/* ── Hero Image ────────────────────────────────────────── */
.post-hero-img {
    width: 100%; border-radius: 16px; overflow: hidden;
    margin-bottom: 40px; aspect-ratio: 16/7;
}
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }

/* ── Article Body ──────────────────────────────────────── */
.article-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-main);
}
.article-body h2 {
    font-size: 1.7rem; font-weight: 700;
    margin: 48px 0 16px; color: var(--text-main);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--glass-border);
}
.article-body h3 {
    font-size: 1.3rem; font-weight: 600;
    margin: 32px 0 12px; color: var(--text-main);
}
.article-body h4 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 8px; }
.article-body p { margin-bottom: 20px; }
.article-body a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(255,123,0,0.4); transition: text-decoration-color 0.2s; }
.article-body a:hover { text-decoration-color: var(--primary); }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 8px; color: var(--text-muted); }
.article-body strong { color: var(--text-main); font-weight: 600; }
.article-body blockquote {
    border-left: 4px solid var(--primary);
    margin: 24px 0; padding: 16px 24px;
    background: rgba(255, 123, 0, 0.04);
    border-radius: 0 8px 8px 0;
    font-style: italic; color: var(--text-muted);
}
.article-body hr { border: none; border-top: 1px solid var(--glass-border); margin: 40px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; border-radius: 8px; overflow: hidden; }
.article-body th {
    background: rgba(255, 123, 0, 0.1); color: var(--text-main);
    font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 2px solid rgba(255,123,0,0.2);
}
.article-body td { padding: 10px 16px; border-bottom: 1px solid var(--glass-border); color: var(--text-muted); }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td { background: rgba(255, 123, 0, 0.03); }

/* ── Code Blocks ───────────────────────────────────────── */
.article-body code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    background: rgba(255, 123, 0, 0.08);
    color: #e65100;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 123, 0, 0.15);
}
[data-theme="dark"] .article-body code {
    background: rgba(255, 123, 0, 0.12);
    color: #ff9940;
    border-color: rgba(255, 123, 0, 0.2);
}
.article-body pre {
    margin: 24px 0; border-radius: 12px; overflow-x: auto;
    border: 1px solid var(--glass-border);
}
.article-body pre code {
    background: transparent; color: inherit;
    padding: 0; border: none; font-size: 0.9rem;
    display: block;
}
/* Pygments code highlight wrapper */
.article-body .highlight {
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--glass-border);
    margin: 24px 0;
    position: relative;
}
.article-body .highlight pre {
    margin: 0; padding: 24px; border: none; border-radius: 0;
    background: #1e1e2e !important;
    overflow-x: auto;
}
.article-body .highlight code {
    background: transparent; color: #cdd6f4;
    padding: 0; border: none;
    font-size: 0.88rem; line-height: 1.7;
}
/* Light mode code block */
[data-theme="light"] .article-body .highlight pre { background: #1e1e2e !important; }

/* ── Images in Article ─────────────────────────────────── */
.article-body .blog-figure { margin: 32px 0; text-align: center; }
.article-body .blog-figure figcaption {
    font-size: 0.85rem; color: var(--text-muted);
    margin-top: 10px; font-style: italic;
}
.article-body .blog-img {
    max-width: 100%; height: auto; border-radius: 12px;
    border: 1px solid var(--glass-border);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-body .blog-img:hover { transform: scale(1.01); box-shadow: 0 8px 32px rgba(0,0,0,0.15); }

/* ── Callout / Admonition Blocks ───────────────────────── */
.blog-callout {
    margin: 28px 0; border-radius: 10px;
    padding: 16px 20px;
    border-left: 4px solid;
}
.blog-callout .callout-header {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px;
}
.blog-callout .callout-icon { font-size: 1.1rem; }
.blog-callout .callout-body { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; }
.blog-callout .callout-body p:last-child { margin-bottom: 0; }

.callout-tip    { background: rgba(34, 197, 94, 0.08);  border-color: #22c55e; }
.callout-tip    .callout-header { color: #16a34a; }
[data-theme="dark"] .callout-tip    .callout-header { color: #4ade80; }

.callout-note   { background: rgba(59, 130, 246, 0.08); border-color: #3b82f6; }
.callout-note   .callout-header { color: #2563eb; }
[data-theme="dark"] .callout-note   .callout-header { color: #60a5fa; }

.callout-warning { background: rgba(245, 158, 11, 0.08); border-color: #f59e0b; }
.callout-warning .callout-header { color: #d97706; }
[data-theme="dark"] .callout-warning .callout-header { color: #fbbf24; }

.callout-caution  { background: rgba(239, 68, 68, 0.08); border-color: #ef4444; }
.callout-caution  .callout-header { color: #dc2626; }
[data-theme="dark"] .callout-caution  .callout-header { color: #f87171; }

.callout-important { background: rgba(168, 85, 247, 0.08); border-color: #a855f7; }
.callout-important .callout-header { color: #9333ea; }
[data-theme="dark"] .callout-important .callout-header { color: #c084fc; }

/* ── ToC Sidebar ───────────────────────────────────────── */
.blog-toc-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 16px;
    scrollbar-width: thin;
}
.toc-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.blog-toc-sidebar .toc {
    font-size: 0.875rem;
}
.blog-toc-sidebar .toc ul { list-style: none; padding: 0; }
.blog-toc-sidebar .toc li { margin: 0; }
.blog-toc-sidebar .toc a {
    display: block; padding: 5px 0 5px 12px;
    color: var(--text-muted); text-decoration: none;
    border-left: 2px solid transparent;
    line-height: 1.45; font-size: 0.85rem;
    transition: all 0.2s ease;
    border-radius: 0 4px 4px 0;
}
.blog-toc-sidebar .toc a:hover { color: var(--primary); border-left-color: var(--primary); }
.blog-toc-sidebar .toc a.toc-active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.blog-toc-sidebar .toc ul ul a { padding-left: 24px; font-size: 0.82rem; }

/* ── Share Buttons ─────────────────────────────────────── */
.share-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--glass-border); }
.share-title { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 14px; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; font-family: inherit;
    cursor: pointer; text-decoration: none; border: 1px solid var(--glass-border);
    background: var(--bg-card); color: var(--text-main);
    transition: all 0.2s ease;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.share-btn.twitter:hover  { background: #1da1f2; border-color: #1da1f2; color: white; }
.share-btn.whatsapp:hover { background: #25d366; border-color: #25d366; color: white; }
.share-btn.linkedin:hover { background: #0a66c2; border-color: #0a66c2; color: white; }
.share-btn.copy:hover     { background: var(--primary); border-color: var(--primary); color: white; }

/* ── Prev / Next Navigation ────────────────────────────── */
.post-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    margin-top: 48px; padding-top: 32px;
    border-top: 1px solid var(--glass-border);
}
.post-nav-item {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px; border-radius: 12px;
    text-decoration: none; color: inherit;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    transition: all 0.25s ease;
}
.post-nav-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,123,0,0.1); }
.post-nav-item.next { text-align: right; }
.nav-direction { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 600; }
.nav-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }

/* ── Related Articles ──────────────────────────────────── */
.related-section { margin-top: 60px; }
.related-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; color: var(--text-main); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.related-card {
    text-decoration: none; color: inherit; display: block;
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    transition: all 0.25s ease;
}
.related-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(255,123,0,0.1); }
.related-card-img { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.related-card:hover .related-card-img img { transform: scale(1.05); }
.related-card-body { padding: 16px; }
.related-card-title { font-size: 0.95rem; font-weight: 600; color: var(--text-main); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-post-layout { padding-top: 24px; }
    .post-header h1 { font-size: 1.7rem; }
    .article-body { font-size: 1rem; }
    .article-body h2 { font-size: 1.4rem; }
    .post-nav { grid-template-columns: 1fr; }
    .share-buttons { gap: 8px; }
}

/* ── Reading Progress Bar ──────────────────────────────── */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}
.reading-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s;
}

/* ── Responsive Iframes / YouTube ──────────────────────── */
.article-body iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 12px;
    margin: 24px 0;
}

/* ── Task Lists (Checklists) ───────────────────────────── */
.article-body .task-list-item {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.article-body .task-list-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    background: transparent;
}
.article-body .task-list-item input[type="checkbox"]:checked {
    background: var(--primary);
}
.article-body .task-list-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ── Facebook Share Button ─────────────────────────────── */
.share-btn.facebook:hover { background: #1877f2; border-color: #1877f2; color: white; }

/* ── Section Wrapper ───────────────────────────────────── */
.blog-section-wrapper {
    margin-bottom: 40px;
}

