/* ══════════════════════════════════════════════════════
   CLICKIMP EDITORIAL BLOG & ARTICLE READER STYLES
   Matches exact light theme of about.html & contact.html
   ══════════════════════════════════════════════════════ */

:root {
  --blog-page: #FEFEFE;
  --blog-card: #ffffff;
  --blog-line: #e2e2df;
  --blog-ink: #0f0f0f;
  --blog-muted: #6b6f76;
  --blog-muted-light: #9a9da3;

  --pill-yellow: #ffd23f;
  --pill-blue: #3b5bff;
  --pill-green: #22c55e;

  --display-font: "Instrument Serif", "Playfair Display", serif;
  --body-font: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono-font: "JetBrains Mono", monospace;
}

body.editorial-blog-page {
    background: var(--blog-page);
    color: var(--blog-ink);
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Reading Progress Bar ──────────────────────────── */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: #0f0f0f;
    z-index: 10000;
    width: 0%;
    transition: width 0.1s ease;
}

/* ── Hero Section (matches page-hero in contact/about) ─ */
.blog-hero {
    padding: 140px 24px 40px;
    text-align: center;
    max-width: 840px;
    margin: 0 auto;
}

.blog-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blog-muted);
    margin-bottom: 16px;
}

.blog-hero .eyebrow::before {
    content: '●';
    font-size: 8px;
    color: var(--blog-ink);
}

.blog-hero h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(38px, 5.5vw, 62px);
    font-weight: 800;
    line-height: 1.08;
    color: var(--blog-ink);
    letter-spacing: -0.03em;
    margin: 0 0 18px;
}

.blog-hero h1 em {
    font-family: var(--display-font);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.blog-hero .lede {
    font-size: 18px;
    line-height: 1.6;
    color: var(--blog-muted);
    max-width: 580px;
    margin: 0 auto 36px;
}

/* ── Search & Filter Controls ──────────────────────── */
.blog-controls-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 56px;
    padding: 0 24px;
}

.blog-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--blog-card);
    border: 1px solid var(--blog-line);
    border-radius: 999px;
    padding: 12px 22px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-search-bar:focus-within {
    border-color: var(--blog-ink);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.blog-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--blog-ink);
    font-family: var(--body-font);
    font-size: 15px;
    width: 100%;
}

.blog-search-bar input::placeholder {
    color: var(--blog-muted-light);
}

.blog-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.blog-pill {
    background: var(--blog-card);
    border: 1px solid var(--blog-line);
    color: var(--blog-muted);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.blog-pill:hover {
    border-color: var(--blog-ink);
    color: var(--blog-ink);
}

.blog-pill.active {
    background: var(--blog-ink);
    color: #fff;
    border-color: var(--blog-ink);
    font-weight: 600;
}

/* ── Card Grid (matches contact.html card style) ───── */
.blog-grid-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

.blog-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.blog-post-card {
    background: var(--blog-card);
    border: 1px solid var(--blog-line);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    border-color: var(--blog-ink);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.blog-post-card-cover {
    aspect-ratio: 16 / 9;
    background: #f4f4f2;
    overflow: hidden;
    position: relative;
}

.blog-post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-post-card:hover .blog-post-card-cover img {
    transform: scale(1.03);
}

.blog-post-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--pill-yellow);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
}

.blog-post-card-badge.badge-blue { background: var(--pill-blue); color: #fff; }
.blog-post-card-badge.badge-green { background: var(--pill-green); color: #fff; }

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

.blog-post-card-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--blog-ink);
    line-height: 1.35;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-card-excerpt {
    font-size: 14px;
    color: var(--blog-muted);
    line-height: 1.6;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--blog-line);
    font-size: 12px;
    color: var(--blog-muted-light);
    font-weight: 500;
}

/* ── Single Article Reader (blog-post.html) ────────── */
.article-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 130px 24px 100px;
}

.article-header {
    max-width: 780px;
    margin: 0 auto 36px;
    text-align: center;
}

.article-breadcrumb {
    font-size: 12px;
    color: var(--blog-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.article-breadcrumb a {
    color: var(--blog-ink);
    text-decoration: underline;
    font-weight: 600;
}

.article-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 800;
    color: var(--blog-ink);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.article-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: var(--blog-muted);
}

.article-author-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--blog-ink);
}

.article-cover-wrap {
    max-width: 880px;
    margin: 0 auto 52px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--blog-line);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
}

.article-cover-wrap img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

/* Layout: Article Body + Table of Contents */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 680px) 260px;
    gap: 56px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 960px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
    .article-toc-sidebar {
        display: none;
    }
}

/* ── Typography & Blocks Inside Article ────────────── */
.article-body {
    font-family: var(--body-font);
    color: #27272a;
    font-size: 17px;
    line-height: 1.8;
    word-break: break-word;
}

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

.article-body .blog-h {
    color: var(--blog-ink);
    font-weight: 800;
    margin: 44px 0 16px 0;
    line-height: 1.25;
    scroll-margin-top: 100px;
}

.article-body .blog-h1 { font-size: 32px; }
.article-body .blog-h2 { font-size: 25px; }
.article-body .blog-h3 { font-size: 20px; }

.article-body .blog-quote {
    margin: 36px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--blog-ink);
    background: #f8f8f6;
    border-radius: 0 12px 12px 0;
    font-size: 19px;
    font-style: italic;
    color: var(--blog-ink);
    line-height: 1.6;
}

.article-body .blog-quote-cite {
    display: block;
    font-size: 13px;
    font-style: normal;
    color: var(--blog-muted);
    margin-top: 10px;
}

.article-body .blog-callout {
    display: flex;
    gap: 16px;
    background: #fafaf8;
    border: 1px solid var(--blog-line);
    border-left: 3px solid var(--pill-blue);
    border-radius: 12px;
    padding: 18px 22px;
    margin: 32px 0;
    color: var(--blog-ink);
}

.article-body .blog-callout-icon {
    font-size: 22px;
    line-height: 1;
}

.article-body .blog-figure {
    margin: 40px 0;
}

.article-body .blog-img-box {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--blog-line);
}

.article-body .blog-img {
    width: 100%;
    display: block;
}

.article-body .blog-img-caption {
    text-align: center;
    font-size: 13px;
    color: var(--blog-muted);
    margin-top: 10px;
}

.article-body .blog-video-iframe-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin: 36px 0;
    border: 1px solid var(--blog-line);
}

.article-body .blog-video-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.article-body .blog-divider {
    border: none;
    border-top: 1px solid var(--blog-line);
    margin: 48px 0;
}

.article-body .blog-list {
    margin: 0 0 24px 24px;
    padding: 0;
}

.article-body .blog-list li {
    margin-bottom: 8px;
}

.article-body .blog-code-container {
    background: #101114;
    border-radius: 10px;
    margin: 32px 0;
    overflow: hidden;
}

.article-body .blog-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    font-size: 11px;
    color: #e5ff7d;
    font-family: monospace;
}

.article-body .blog-code-copy {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.article-body .blog-pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: #f4f4f5;
    line-height: 1.5;
}

/* Inline marks */
.run-bold { font-weight: 700; color: var(--blog-ink); }
.run-italic { font-style: italic; }
.run-underline { text-decoration: underline; text-underline-offset: 3px; }
.run-strike { text-decoration: line-through; color: var(--blog-muted-light); }
.run-code { background: #f0f0ed; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.9em; color: var(--blog-ink); }
.run-hl-yellow { background: #fef08a; padding: 1px 4px; border-radius: 3px; }
.run-hl-neon { background: #dcfce7; padding: 1px 4px; border-radius: 3px; }
.blog-inline-link { color: var(--blog-ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ── Table of Contents Sticky Sidebar ──────────────── */
.article-toc-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    padding: 20px;
    background: #fbfbf9;
    border: 1px solid var(--blog-line);
    border-radius: 14px;
}

.article-toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--blog-muted);
    margin-bottom: 12px;
}

.article-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-toc-link {
    font-size: 13px;
    color: var(--blog-muted);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s ease;
    display: block;
}

.article-toc-link:hover,
.article-toc-link.active {
    color: var(--blog-ink);
    font-weight: 600;
}

.article-toc-link.level-3 {
    padding-left: 12px;
    font-size: 12px;
}

/* ── Social Share & Footer ─────────────────────────── */
.article-share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    margin-top: 48px;
    border-top: 1px solid var(--blog-line);
    border-bottom: 1px solid var(--blog-line);
}

.article-share-btns {
    display: flex;
    gap: 8px;
}

.article-share-btn {
    background: var(--blog-card);
    border: 1px solid var(--blog-line);
    color: var(--blog-ink);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.article-share-btn:hover {
    border-color: var(--blog-ink);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
