/* ============================================================
   blog.css — Styles du blog MonAuditCyber.fr
   Dépend de style.css (variables, header, footer, btn-primary…)
   ============================================================ */

/* ─── Variables locales ────────────────────────────────────── */
:root {
  --blog-max: 780px;
  --blog-sidebar: 320px;
  --blog-gap: 48px;
  --blog-radius: 12px;
  --text-body: #2D3748;
  --text-muted: #718096;
  --border-light: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-light: #F7FAFC;
  --brand-blue: #1A3C5E;
  --brand-light: #2E86C1;
  --accent: #E53E3E;
  --code-bg: #1A202C;
}

/* ─── Blog Hero ─────────────────────────────────────────────── */
.blog-hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f4fd 100%);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.blog-hero-badge .material-symbols-outlined {
  font-size: 16px;
}

.blog-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 16px;
  line-height: 1.15;
}

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

/* ─── Blog Listing ──────────────────────────────────────────── */
.blog-listing {
  padding: 64px 0 80px;
  background: var(--bg-light);
  min-height: 50vh;
}

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

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--blog-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
  box-shadow: 0 8px 32px rgba(26, 60, 94, 0.10);
  transform: translateY(-2px);
}

.blog-card-img-link {
  display: block;
}

.blog-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

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

.blog-card-category {
  background: #EBF8FF;
  color: var(--brand-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.blog-card-date,
.blog-card-read {
  font-size: 12px;
  color: var(--text-muted);
}

.blog-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.blog-card-title a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color 0.15s;
}

.blog-card-title a:hover {
  color: var(--brand-light);
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  flex-grow: 1;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-light);
  text-decoration: none;
  margin-top: 4px;
  transition: gap 0.15s;
}

.blog-card-link:hover {
  gap: 10px;
}

.blog-card-link .material-symbols-outlined {
  font-size: 18px;
}

/* ─── Article Header ────────────────────────────────────────── */
.blog-article-header {
  padding: 60px 0 48px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f4fd 100%);
  border-bottom: 1px solid var(--border-light);
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.15s;
}

.blog-back:hover { color: var(--brand-blue); }
.blog-back .material-symbols-outlined { font-size: 18px; }

.blog-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.blog-article-header h1 {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  color: var(--brand-blue);
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 820px;
}

.blog-article-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 700px;
}

/* ─── Article Body (2 colonnes) ─────────────────────────────── */
.blog-article-body {
  padding: 56px 0 80px;
  background: var(--bg-light);
}

.blog-container {
  display: grid;
  grid-template-columns: 1fr var(--blog-sidebar);
  gap: var(--blog-gap);
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Markdown Content ──────────────────────────────────────── */
.blog-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--blog-radius);
  padding: 48px 52px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
}

.blog-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-blue);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}

.blog-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: #2E4057;
  margin: 32px 0 12px;
}

.blog-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-blue);
  margin: 24px 0 8px;
}

.blog-content p {
  margin-bottom: 16px;
}

.blog-content ul,
.blog-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.blog-content li {
  margin-bottom: 8px;
}

/* Checkboxes (task lists) */
.blog-content input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--brand-light);
}

/* Liens */
.blog-content a {
  color: var(--brand-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.blog-content a:hover { opacity: 0.75; }

/* Blockquote (témoignages) */
.blog-content blockquote {
  background: #EBF8FF;
  border-left: 4px solid var(--brand-light);
  border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
  padding: 20px 24px;
  margin: 28px 0;
  font-style: italic;
  color: #2D3748;
}

.blog-content blockquote p { margin-bottom: 6px; }
.blog-content blockquote strong { font-style: normal; color: var(--brand-blue); }

/* Tables */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.blog-content th {
  background: var(--brand-blue);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
}

.blog-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
}

.blog-content tr:nth-child(even) td { background: var(--bg-light); }
.blog-content tr:last-child td { border-bottom: none; }

/* Code */
.blog-content code {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

.blog-content pre {
  background: var(--code-bg);
  border-radius: var(--blog-radius);
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.blog-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
}

/* Ligne de séparation finale (sources) */
.blog-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 40px 0 24px;
}

.blog-content p:last-child em {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.blog-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-cta {
  background: var(--brand-blue);
  color: #fff;
  border-radius: var(--blog-radius);
  padding: 28px 24px;
  text-align: center;
}

.sidebar-cta-icon {
  font-size: 36px;
  color: #7EC8E3;
  display: block;
  margin-bottom: 12px;
}

.sidebar-cta h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.sidebar-cta p {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
  line-height: 1.5;
}

.sidebar-cta .btn-primary {
  width: 100%;
  justify-content: center;
  font-size: 14px;
}

.sidebar-guarantee {
  font-size: 12px !important;
  color: rgba(255,255,255,0.5) !important;
  margin-top: 10px !important;
  margin-bottom: 0 !important;
}

.sidebar-share {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--blog-radius);
  padding: 20px;
}

.sidebar-share > p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.share-btn:hover { opacity: 0.85; }

.share-linkedin {
  background: #0A66C2;
  color: #fff;
}

.share-twitter {
  background: #000;
  color: #fff;
}

/* ─── Article Footer ────────────────────────────────────────── */
.blog-article-footer {
  padding: 32px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
}

/* ─── 404 ────────────────────────────────────────────────────── */
.blog-404 {
  padding: 120px 0;
  text-align: center;
}

/* ─── CTA Section ────────────────────────────────────────────── */
.blog-cta {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1a5276 100%);
  padding: 72px 0;
  text-align: center;
}

.blog-cta h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.blog-cta p {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
}

.blog-cta .cta-icon {
  font-size: 48px;
  color: #7EC8E3;
  display: block;
  margin-bottom: 16px;
}

/* Nav active state */
nav .nav-active {
  color: var(--brand-light);
  font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-container {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-content {
    padding: 28px 20px;
  }

  .blog-article-header {
    padding: 40px 0 32px;
  }

  .blog-card-img {
    height: 160px;
  }
}
