/**
 * Blog MAGE — minimal, charte mint / vert (#366C5D, #bfe9dd, #e8f4ef)
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");
@import url("./mage-brand.css");

:root {
  --mage-green: #366c5d;
  --mage-green-dark: #2d584b;
  --mage-mint: #bfe9dd;
  --mage-mint-soft: #e8f4ef;
  --mage-mint-bg: #f4faf7;
  --mage-ink: #1a2e28;
  --mage-muted: #5a6f68;
  --mage-muted-light: #8a9a94;
  --mage-border: rgba(54, 108, 93, 0.1);
  --mage-border-strong: rgba(54, 108, 93, 0.18);
  --blog-radius: 20px;
  --blog-radius-sm: 12px;
  --blog-max: 1120px;
  --blog-read: 42rem;
  --blog-font: "DM Sans", system-ui, sans-serif;
}

.blog-page {
  font-family: var(--blog-font);
  background: var(--mage-mint-bg);
  color: var(--mage-ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────── */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 4vw, 32px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mage-border);
}

.blog-header .mage-brand-wordmark {
  font-size: 1.65rem;
}

.blog-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mage-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.blog-nav a:hover {
  color: var(--mage-green-dark);
  background: var(--mage-mint-soft);
}

.blog-nav a.is-active {
  color: var(--mage-green-dark);
  background: var(--mage-mint-soft);
}

.blog-back {
  font-family: var(--mage-font-brand);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mage-green);
  text-decoration: none;
}

.blog-back:hover {
  color: var(--mage-green-dark);
}

/* ── Layout ───────────────────────────────────────── */
.blog-main {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 56px) clamp(20px, 4vw, 32px) 80px;
}

.blog-main--article {
  max-width: calc(var(--blog-read) + 64px);
}

/* ── Hero liste ───────────────────────────────────── */
.blog-hero {
  margin-bottom: clamp(36px, 5vw, 52px);
  padding-bottom: clamp(28px, 4vw, 40px);
  border-bottom: 1px solid var(--mage-border);
}

.blog-hero .eyebrow {
  font-family: var(--mage-font-brand);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mage-green);
  margin: 0 0 12px;
  font-weight: 400;
}

.blog-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--mage-ink);
}

.blog-hero .lead {
  margin: 14px 0 0;
  max-width: 36ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--mage-muted);
  font-weight: 400;
}

/* ── Grille articles ──────────────────────────────── */
.blog-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--blog-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--mage-border);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--mage-border-strong);
  box-shadow: 0 12px 40px rgba(54, 108, 93, 0.08);
}

.blog-card-cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, var(--mage-mint-soft) 0%, #dceee6 100%);
  overflow: hidden;
}

.blog-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

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

.blog-card-cover-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card-cover-wrap--empty::after {
  content: "";
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(54, 108, 93, 0.08);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
  gap: 8px;
}

.blog-card-date {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mage-muted-light);
}

.blog-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--mage-ink);
}

.blog-card-excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--mage-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-cta {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mage-green);
}

.blog-card:hover .blog-card-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── États ────────────────────────────────────────── */
.blog-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--mage-muted);
  font-size: 0.95rem;
}

.blog-state--error h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--mage-ink);
}

.blog-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px;
  color: var(--mage-muted);
  font-size: 0.9rem;
}

.blog-loading[hidden],
.blog-grid[hidden],
.blog-article[hidden],
.blog-state[hidden],
.blog-article-cover-wrap[hidden] {
  display: none !important;
}

.blog-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--mage-mint);
  border-top-color: var(--mage-green);
  border-radius: 50%;
  animation: blog-spin 0.7s linear infinite;
}

@keyframes blog-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Article ──────────────────────────────────────── */
.blog-article {
  animation: blog-fade 0.4s ease;
}

@keyframes blog-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.blog-article-header {
  margin-bottom: clamp(28px, 4vw, 40px);
}

.blog-article-meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mage-muted-light);
  margin: 0 0 14px;
}

.blog-article-title {
  margin: 0;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--mage-ink);
}

.blog-article-cover-wrap {
  margin: 0 0 clamp(32px, 4vw, 44px);
  border-radius: var(--blog-radius);
  overflow: hidden;
  border: 1px solid var(--mage-border);
  background: var(--mage-mint-soft);
}

.blog-article-cover {
  display: block;
  width: 100%;
  max-height: min(52vh, 480px);
  object-fit: cover;
}

.blog-article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--mage-ink);
}

.blog-article-body > *:first-child {
  margin-top: 0;
}

.blog-article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
  color: var(--mage-green-dark);
}

.blog-article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

.blog-article-body p {
  margin: 0 0 1.25rem;
  color: var(--mage-ink);
}

.blog-article-body a {
  color: var(--mage-green);
  font-weight: 500;
  text-underline-offset: 3px;
}

.blog-article-body a:hover {
  color: var(--mage-green-dark);
}

.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.blog-article-body li {
  margin-bottom: 0.4rem;
}

.blog-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--blog-radius-sm);
  margin: 1.75rem 0;
  border: 1px solid var(--mage-border);
}

.blog-article-body .blog-embed-wrap,
.blog-article-body .blog-html-embed-wrap {
  margin: 1.75rem 0;
  border-radius: var(--blog-radius-sm);
  overflow: hidden;
  border: 1px solid var(--mage-border);
  background: #fff;
}

.blog-article-body iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: min(50vw, 360px);
}

.blog-article-body iframe.blog-html-embed-iframe {
  min-height: 200px;
}

.blog-article-body blockquote {
  margin: 1.5rem 0;
  padding: 0 0 0 1.25rem;
  border: none;
  border-left: 2px solid var(--mage-mint);
  color: var(--mage-muted);
  font-size: 1.05rem;
  font-style: italic;
}

.blog-article-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--mage-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blog-article-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mage-green);
  text-decoration: none;
}

.blog-article-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Footer site ──────────────────────────────────── */
.blog-footer {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 32px) 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--mage-muted-light);
  border-top: 1px solid var(--mage-border);
}

.blog-footer a {
  color: var(--mage-muted);
  text-decoration: none;
}

.blog-footer a:hover {
  color: var(--mage-green);
}

/* ── SEO : fil d'Ariane, thématiques, index statique ─ */
.blog-breadcrumb {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 12px clamp(20px, 4vw, 32px) 0;
}

.blog-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--mage-muted);
}

.blog-breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 6px;
  color: var(--mage-muted-light);
}

.blog-breadcrumb a {
  color: var(--mage-green);
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.blog-topics a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mage-green-dark);
  background: var(--mage-mint-soft);
  border: 1px solid var(--mage-border);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.blog-topics a:hover {
  background: var(--mage-mint);
  border-color: var(--mage-border-strong);
}

.blog-prerender {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--mage-border);
  border-radius: var(--blog-radius-sm);
}

.blog-prerender-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.blog-prerender-list a {
  color: var(--mage-green-dark);
  font-weight: 500;
  text-decoration: none;
}

.blog-prerender-list a:hover {
  text-decoration: underline;
}

.blog-seo-footer {
  margin-top: clamp(40px, 6vw, 56px);
  padding-top: clamp(28px, 4vw, 36px);
  border-top: 1px solid var(--mage-border);
}

.blog-seo-footer h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--mage-ink);
}

.blog-seo-footer p {
  margin: 0;
  max-width: 52ch;
  line-height: 1.6;
  color: var(--mage-muted);
  font-size: 0.95rem;
}

.blog-seo-footer a {
  color: var(--mage-green);
  font-weight: 500;
  text-decoration: none;
}

.blog-seo-footer a:hover {
  text-decoration: underline;
}

.blog-article-footer-links {
  font-size: 0.85rem;
  color: var(--mage-muted);
}

.blog-article-footer-links a {
  color: var(--mage-green);
  text-decoration: none;
  font-weight: 500;
}

.blog-article-footer-links a:hover {
  text-decoration: underline;
}
