/* blog-magic.css — genius-tier blog polish (index + articles) */

/* ============================================================
   A) BLOG INDEX (blog.html)
   ============================================================ */

/* Hero refonte */
.bm-hero { padding: 4rem 0 2rem; position: relative; }
.bm-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  line-height: 1.05;
}
.bm-hero .bm-punch {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--text-light, #4a5a52);
  max-width: 640px;
  margin: 0 0 1.8rem;
}
.bm-hero-tools {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin: 1.5rem 0 0.5rem;
}
.bm-search {
  flex: 1 1 280px;
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(26,78,48,0.15);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  transition: border-color .2s, box-shadow .2s;
  backdrop-filter: blur(6px);
}
.bm-search:focus-within {
  border-color: var(--gold, #C9A044);
  box-shadow: 0 0 0 3px rgba(201,160,68,0.18);
}
.bm-search input {
  border: none; outline: none; background: transparent;
  font: inherit; flex: 1; color: inherit;
}
.bm-search svg { flex: 0 0 18px; opacity: 0.55; }
.bm-rss-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: rgba(201,160,68,0.12); color: var(--gold, #C9A044);
  text-decoration: none; font-size: 0.9rem; font-weight: 600;
  border: 1px solid rgba(201,160,68,0.3);
  transition: background .2s;
}
.bm-rss-btn:hover { background: rgba(201,160,68,0.22); }

/* Pills */
.bm-pills {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 1.2rem 0 0;
}
.bm-pill {
  border: 1px solid rgba(26,78,48,0.2);
  background: transparent; color: var(--text, #14241b);
  padding: 0.45rem 1rem; border-radius: 999px;
  font: inherit; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all .2s;
}
.bm-pill:hover { border-color: var(--gold, #C9A044); }
.bm-pill.is-active {
  background: var(--gold, #C9A044); color: #fff;
  border-color: var(--gold, #C9A044);
}

/* Featured */
.bm-featured {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 0; border-radius: 22px; overflow: hidden;
  margin: 2rem 0 2.5rem;
  background: linear-gradient(135deg, #0d3320 0%, #1A4E30 55%, #2d6b40 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 14px 40px -18px rgba(13,51,32,0.4);
  transition: transform .3s, box-shadow .3s;
  position: relative;
}
.bm-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px -20px rgba(13,51,32,0.5);
}
.bm-featured-visual {
  position: relative; min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(201,160,68,0.35), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08), transparent 60%);
  font-size: 7rem;
}
.bm-featured-body { padding: 2.4rem 2.6rem; display: flex; flex-direction: column; gap: 0.8rem; justify-content: center; }
.bm-featured-badge {
  display: inline-block; align-self: flex-start;
  background: var(--gold, #C9A044); color: #1a1a1a;
  font-size: 0.72rem; letter-spacing: 0.14em; font-weight: 700;
  padding: 0.35rem 0.8rem; border-radius: 999px;
}
.bm-featured h2 {
  font-family: 'Fraunces', serif; font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 500; line-height: 1.15; margin: 0; color: #fff;
}
.bm-featured p { color: rgba(255,255,255,0.85); margin: 0; line-height: 1.55; }
.bm-featured-cta {
  margin-top: 0.4rem; color: var(--gold, #C9A044);
  font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem;
}
@media (max-width: 768px) {
  .bm-featured { grid-template-columns: 1fr; }
  .bm-featured-visual { min-height: 180px; font-size: 5rem; }
  .bm-featured-body { padding: 1.6rem; }
}

/* Card grid v2 */
.bm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.6rem;
}
.bm-card {
  display: flex; flex-direction: column;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(26,78,48,0.08);
  border-radius: 18px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  cursor: pointer;
}
.bm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(201,160,68,0.45);
  border-color: rgba(201,160,68,0.4);
}
.bm-card:focus-visible { outline: 2px solid var(--gold, #C9A044); outline-offset: 3px; }
.bm-card-cover {
  position: relative; height: 150px;
  background: linear-gradient(135deg, #0d3320 0%, #1A4E30 100%);
  display: flex; align-items: center; justify-content: center;
}
.bm-card-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(201,160,68,0.18), transparent 60%);
}
.bm-card-emoji {
  position: absolute; top: 12px; left: 12px;
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,0.92); color: #0d3320;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; backdrop-filter: blur(6px); z-index: 2;
}
.bm-card-body { padding: 1.2rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.bm-card-tag {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; color: var(--gold, #C9A044);
}
.bm-card h3 {
  font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 500;
  line-height: 1.25; margin: 0;
}
.bm-card-excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text-light, #4a5a52);
  font-size: 0.94rem; line-height: 1.5; margin: 0;
}
.bm-card-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.8rem; border-top: 1px solid rgba(26,78,48,0.08);
  font-size: 0.86rem; color: var(--text-light, #4a5a52);
}
.bm-card-read { color: var(--gold, #C9A044); font-weight: 600; display: inline-flex; gap: 0.3rem; align-items: center; }
.bm-card-read .bm-arr { transition: transform .25s; }
.bm-card:hover .bm-arr { transform: translateX(4px); }

.bm-empty {
  padding: 3rem 1rem; text-align: center;
  color: var(--text-light); font-style: italic;
}

/* Sticky widget */
.bm-stick {
  position: fixed; right: 24px; bottom: 90px;
  width: 240px; padding: 1rem;
  background: #fff; border: 1px solid rgba(26,78,48,0.12);
  border-radius: 14px; box-shadow: 0 14px 30px -12px rgba(0,0,0,0.18);
  font-size: 0.88rem; z-index: 50;
  transform: translateY(8px); opacity: 0;
  transition: opacity .35s, transform .35s;
}
.bm-stick.is-in { opacity: 1; transform: translateY(0); }
.bm-stick-label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold, #C9A044); font-weight: 700; }
.bm-stick h4 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.05rem; margin: 0.4rem 0 0.5rem; line-height: 1.25; }
.bm-stick a { color: inherit; text-decoration: none; }
.bm-stick-meta { font-size: 0.78rem; color: var(--text-light); }
@media (max-width: 1099px) { .bm-stick { display: none; } }

/* ============================================================
   B) ARTICLES (blog/*.html)
   ============================================================ */

/* TOC */
.bm-toc {
  position: fixed; left: 24px; top: 130px;
  width: 220px; max-height: calc(100vh - 180px); overflow: auto;
  font-size: 0.88rem; z-index: 40;
  padding-right: 0.4rem;
}
.bm-toc-title {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold, #C9A044); font-weight: 700; margin-bottom: 0.7rem;
}
.bm-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid rgba(26,78,48,0.15); }
.bm-toc li { margin: 0; }
.bm-toc a {
  display: block; padding: 0.35rem 0.8rem;
  color: var(--text-light, #4a5a52); text-decoration: none;
  border-left: 2px solid transparent; margin-left: -1px;
  line-height: 1.35; transition: color .2s, border-color .2s;
}
.bm-toc a:hover { color: var(--text, #14241b); }
.bm-toc a.is-active { color: var(--gold, #C9A044); border-left-color: var(--gold, #C9A044); font-weight: 600; }
.bm-toc li.lvl3 a { padding-left: 1.4rem; font-size: 0.84rem; }
@media (max-width: 1199px) { .bm-toc { display: none; } }

/* Mobile TOC accordion */
.bm-toc-mobile {
  max-width: 780px; margin: 0 auto 2rem;
  border: 1px solid rgba(26,78,48,0.15); border-radius: 12px;
  background: rgba(26,78,48,0.03);
}
.bm-toc-mobile summary {
  padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.bm-toc-mobile summary::-webkit-details-marker { display: none; }
.bm-toc-mobile summary::after { content: '▾'; transition: transform .2s; color: var(--gold); }
.bm-toc-mobile[open] summary::after { transform: rotate(180deg); }
.bm-toc-mobile ol { margin: 0; padding: 0 1.1rem 1rem 2rem; }
.bm-toc-mobile a { color: inherit; text-decoration: none; }
.bm-toc-mobile a:hover { color: var(--gold, #C9A044); }
@media (min-width: 1200px) { .bm-toc-mobile { display: none; } }

/* Reading badge */
.bm-readbadge {
  display: inline-flex; gap: 0.5rem; align-items: center;
  background: rgba(201,160,68,0.12); color: var(--gold, #C9A044);
  padding: 0.4rem 0.9rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600;
  margin: 0.6rem auto 1.2rem;
}

/* Highlight pulse */
@keyframes bmHighlight {
  0% { background-size: 0 6px; }
  100% { background-size: 100% 6px; }
}
.bm-highlight {
  background: linear-gradient(transparent 65%, rgba(201,160,68,0.45) 65%);
  background-repeat: no-repeat; background-size: 0 100%;
  animation: bmHighlight .9s ease-out forwards;
  padding: 0 0.1em;
}

/* Share toolbar */
.bm-share {
  position: fixed; left: 24px; bottom: 24px;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 45;
}
.bm-share button {
  width: 42px; height: 42px; border-radius: 12px;
  background: #fff; border: 1px solid rgba(26,78,48,0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text, #14241b);
  transition: transform .2s, background .2s, color .2s;
  position: relative;
}
.bm-share button:hover { background: var(--gold, #C9A044); color: #fff; transform: translateY(-2px); }
.bm-share button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #14241b; color: #fff; font-size: 0.74rem;
  padding: 0.3rem 0.55rem; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.bm-share button:hover::after { opacity: 1; }
@media (max-width: 1199px) {
  .bm-share {
    left: 0; right: 0; bottom: 0; flex-direction: row;
    justify-content: center; padding: 0.6rem; gap: 0.5rem;
    background: rgba(255,255,255,0.94); backdrop-filter: blur(8px);
    border-top: 1px solid rgba(26,78,48,0.1);
  }
  .bm-share button[data-tooltip]::after { display: none; }
}

/* End CTA */
.bm-endcta {
  max-width: 780px; margin: 3rem auto;
  background: linear-gradient(135deg, #1A4E30 0%, #0d3320 100%);
  color: #fff; border-radius: 22px; padding: 2.5rem;
  text-align: center; position: relative; overflow: hidden;
}
.bm-endcta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(201,160,68,0.25), transparent 60%);
  pointer-events: none;
}
.bm-endcta h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.7rem; margin: 0 0 0.6rem; color: #fff; }
.bm-endcta p { color: rgba(255,255,255,0.9); margin: 0 auto 1.5rem; max-width: 540px; line-height: 1.55; }
.bm-endcta-btn {
  display: inline-block; padding: 0.9rem 1.6rem;
  background: var(--gold, #C9A044); color: #1a1a1a;
  border-radius: 999px; text-decoration: none; font-weight: 700;
  transition: transform .2s, box-shadow .2s;
}
.bm-endcta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(201,160,68,0.6); }

/* Author footer */
.bm-author {
  max-width: 780px; margin: 2rem auto;
  display: flex; gap: 1.2rem; align-items: center;
  padding: 1.4rem; border-radius: 16px;
  background: rgba(26,78,48,0.04);
  border: 1px solid rgba(26,78,48,0.08);
}
.bm-author-pic {
  width: 72px; height: 72px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--gold, #C9A044), #a07d2c);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600;
}
.bm-author-pic img { width: 100%; height: 100%; object-fit: cover; }
.bm-author-info strong { display: block; font-size: 1.05rem; }
.bm-author-info p { margin: 0.2rem 0 0.4rem; color: var(--text-light); font-size: 0.92rem; }
.bm-author-info a { color: var(--gold, #C9A044); text-decoration: none; font-size: 0.88rem; font-weight: 600; }

/* Reading mode toggle */
.bm-readmode {
  position: fixed; right: 24px; top: 90px;
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(26,78,48,0.15);
  cursor: pointer; z-index: 45;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: transform .2s, background .2s;
}
.bm-readmode:hover { background: var(--gold, #C9A044); color: #fff; transform: scale(1.05); }
body.bm-fs-large .article-content { font-size: 1.08rem; }
body.bm-fs-xlarge .article-content { font-size: 1.18rem; }

/* Inline newsletter */
.bm-inline-news {
  max-width: 780px; margin: 2rem auto; padding: 1.4rem 1.6rem;
  border: 1px dashed rgba(201,160,68,0.5); border-radius: 14px;
  background: rgba(201,160,68,0.06);
  display: flex; flex-direction: column; gap: 0.8rem;
}
.bm-inline-news p { margin: 0; font-size: 0.96rem; }
.bm-inline-news form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bm-inline-news input[type=email] {
  flex: 1 1 220px; padding: 0.7rem 1rem; border-radius: 999px;
  border: 1px solid rgba(26,78,48,0.2); font: inherit;
}
.bm-inline-news button {
  padding: 0.7rem 1.4rem; border-radius: 999px; border: none;
  background: var(--gold, #C9A044); color: #1a1a1a; font: inherit; font-weight: 700;
  cursor: pointer;
}

/* Lightbox */
.bm-lightbox {
  position: fixed; inset: 0; background: rgba(10,15,12,0.94);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.bm-lightbox.is-open { opacity: 1; pointer-events: auto; }
.bm-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.bm-lightbox-close, .bm-lightbox-prev, .bm-lightbox-next {
  position: absolute; background: rgba(255,255,255,0.12); color: #fff;
  border: none; width: 48px; height: 48px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer;
}
.bm-lightbox-close { top: 24px; right: 24px; }
.bm-lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.bm-lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.article-content img { cursor: zoom-in; }

/* Code blocks */
.bm-code-wrap { position: relative; margin: 1.4rem 0; }
.bm-code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(201,160,68,0.18); color: var(--gold, #C9A044);
  border: none; padding: 0.3rem 0.7rem; border-radius: 6px;
  font-size: 0.78rem; cursor: pointer;
}
.bm-code-copy:hover { background: var(--gold, #C9A044); color: #fff; }
.bm-line-num { display: inline-block; width: 2.4em; opacity: 0.4; user-select: none; }

/* Streak toast */
.bm-streak {
  position: fixed; right: 24px; bottom: 100px;
  background: linear-gradient(135deg, #1A4E30, #0d3320);
  color: #fff; padding: 1rem 1.3rem; border-radius: 14px;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,0.3);
  font-size: 0.94rem; z-index: 60;
  transform: translateY(20px); opacity: 0;
  transition: opacity .35s, transform .35s;
  max-width: 280px;
}
.bm-streak.is-in { opacity: 1; transform: translateY(0); }

/* Related restyle */
.rv-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}
.rv-related-card {
  border-radius: 16px; padding: 1.4rem; background: #fff;
  border: 1px solid rgba(26,78,48,0.08);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  display: block; text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.rv-related-card::before {
  content: attr(data-emoji);
  position: absolute; top: 12px; right: 14px;
  font-size: 1.8rem; opacity: 0.35;
}
.rv-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -16px rgba(201,160,68,0.45);
  border-color: rgba(201,160,68,0.4);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bm-card, .bm-featured, .rv-related-card, .bm-stick, .bm-streak,
  .bm-arr, .bm-readmode, .bm-share button {
    transition: none !important; animation: none !important;
  }
  .bm-highlight { animation: none !important; background-size: 100% 100% !important; }
}

/* Print */
@media print {
  .navbar, .footer, .bm-share, .bm-toc, .bm-toc-mobile, .bm-readmode, .bm-streak,
  .bm-endcta, .rv-related, .scroll-top, .rv-read-progress, #rvPreloader,
  .cta-banner, .bm-stick, .bm-rss-btn, .bm-pills, .bm-search, .bm-inline-news {
    display: none !important;
  }
  body { font-family: Georgia, 'Times New Roman', serif; color: #000; background: #fff; }
  .article-content { max-width: 100% !important; font-size: 11pt; }
  .article-content::before {
    content: 'Article RestauVert : ' attr(data-print-url);
    display: block; font-size: 9pt; color: #555; margin-bottom: 1rem;
    border-bottom: 1px solid #ccc; padding-bottom: 0.5rem;
  }
  a { color: #000; text-decoration: underline; }
  h1, h2, h3 { page-break-after: avoid; }
}
