/* ============================================================
   blog.css — ilovepdf.tn blog styles
   ============================================================ */

/* ── BLOG INDEX ───────────────────────────────────────────── */
.blog-hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
  text-align: center;
}
.blog-hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  letter-spacing: -.8px;
  margin-bottom: 12px;
}
.blog-hero h1 em { font-style: italic; color: var(--red); }
.blog-hero p { font-size: 16px; color: var(--muted); max-width: 480px; margin: 0 auto; line-height: 1.6; }

.blog-main { max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px; }

/* Filter tabs */
.blog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--white);
  color: var(--muted);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--red); color: var(--red); }
.filter-btn.active { background: var(--red); border-color: var(--red); color: white; }

/* Articles grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.blog-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  animation: fadeUp .4s ease both;
}
.blog-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-red);
  transform: translateY(-3px);
}

.blog-card-header {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
}
.blog-card-header::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

/* Color variants per category */
.blog-card[data-cat="Conversion"] .blog-card-header { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.blog-card[data-cat="OCR"]        .blog-card-header { background: linear-gradient(135deg, #14b8a6, #0891b2); }
.blog-card[data-cat="Guide"]      .blog-card-header { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.blog-card[data-cat="Mobile"]     .blog-card-header { background: linear-gradient(135deg, #f59e0b, #d97706); }

.blog-card-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.blog-card-cat {
  display: inline-block;
  background: rgba(255,255,255,.2);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.blog-card-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.blog-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.blog-card-meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.blog-card-read {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
}
.blog-card-read::after { content: '→'; }

/* Featured first card */
.blog-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.blog-card.featured .blog-card-header {
  width: 280px;
  flex-shrink: 0;
  border-radius: 0;
  padding: 32px 28px;
}
.blog-card.featured .blog-card-icon { font-size: 48px; margin-bottom: 16px; }
.blog-card.featured .blog-card-title { font-size: 20px; -webkit-line-clamp: 3; }
.blog-card.featured .blog-card-desc { -webkit-line-clamp: 3; }

/* Newsletter */
.blog-newsletter {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-radius: 18px;
  padding: 40px 48px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.blog-newsletter h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  color: white;
  margin-bottom: 6px;
}
.blog-newsletter p { font-size: 14px; color: #9ca3af; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-input {
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 240px;
}
.newsletter-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.newsletter-btn:hover { background: var(--red-dark); }

/* ── ARTICLE PAGE ─────────────────────────────────────────── */
.article-page { max-width: 1100px; margin: 0 auto; }

.article-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
}
.article-header-inner { max-width: 720px; margin: 0 auto; }

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.article-breadcrumb a { color: var(--muted); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--red); }
.article-breadcrumb span { color: var(--border); }

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.article-category {
  background: var(--red-light);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}
.article-dot { color: var(--border); }
.article-reading, .article-date { font-size: 12.5px; color: var(--muted); }

.article-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 16px;
}
.article-intro {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 40px 24px 80px;
  align-items: start;
}

/* Article body */
.article-body { min-width: 0; }

.article-body h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  margin: 36px 0 14px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  letter-spacing: -.3px;
}
.article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.article-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.8;
  margin-bottom: 8px;
}
.article-text ul, .article-text ol { padding-left: 20px; margin: 12px 0; }
.article-text li { margin-bottom: 8px; line-height: 1.7; }
.article-text strong { color: var(--text); font-weight: 700; }
.article-text a { color: var(--red); text-decoration: none; font-weight: 500; }
.article-text a:hover { text-decoration: underline; }

/* Inline CTA */
.article-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--red-light);
  border: 1.5px solid rgba(232,71,63,.2);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.article-cta-icon { font-size: 28px; flex-shrink: 0; }
.article-cta-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.article-cta-desc { font-size: 12px; color: var(--muted); }
.article-cta-btn {
  margin-left: auto;
  background: var(--red);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.article-cta-btn:hover { background: var(--red-dark); }

/* Tags */
.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.tag {
  padding: 5px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Share */
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.article-share span { font-size: 13px; color: var(--muted); font-weight: 500; }
.share-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.share-btn:hover { opacity: .85; }
.share-fb { background: #1877f2; color: white; }
.share-wa { background: #25d366; color: white; }
.share-li { background: #0a66c2; color: white; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.article-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-widget {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.sidebar-widget-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* TOC */
.toc { display: flex; flex-direction: column; gap: 6px; }
.toc a {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all .15s;
  line-height: 1.4;
}
.toc a:hover { color: var(--red); background: var(--red-light); border-left-color: var(--red); }
.toc a.active { color: var(--red); background: var(--red-light); border-left-color: var(--red); font-weight: 600; }

/* Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: transparent;
  text-align: center;
}
.sidebar-cta-icon { font-size: 32px; margin-bottom: 8px; }
.sidebar-cta-title { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; }
.sidebar-cta-desc { font-size: 11.5px; color: rgba(255,255,255,.7); margin-bottom: 14px; }
.sidebar-cta-btn {
  display: block;
  background: white;
  color: var(--red);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: opacity .15s;
}
.sidebar-cta-btn:hover { opacity: .9; }

/* Sidebar tools */
.sidebar-tools { display: flex; flex-direction: column; gap: 6px; }
.sidebar-tool {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-tool:hover { background: var(--red-light); color: var(--red); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .blog-card.featured { flex-direction: column; }
  .blog-card.featured .blog-card-header { width: 100%; border-radius: 0; }
  .blog-newsletter { flex-direction: column; padding: 28px 24px; }
  .newsletter-form { flex-direction: column; width: 100%; }
  .newsletter-input { width: 100%; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .article-cta { flex-direction: column; text-align: center; }
  .article-cta-btn { margin-left: 0; width: 100%; text-align: center; }
}
