/* =========================================
   Riva Journal, blog styles, v1
   Tokens come from ../styles.css (:root)
   ========================================= */

/* ---------- Shared shell ---------- */

.nav .nav-link-active { color: var(--azur) !important; }

/* No-JS safety: reveal must never hide content when scripts are absent */
html:not(.js) .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* Cards define their own hover transition, which would override the reveal
   transition from styles.css. Re-declare both so the card fades in on scroll
   and still lifts snappily on hover. */
.blog-card.reveal {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), box-shadow 0.3s var(--ease);
}
.blog-card.reveal.in {
  transition: opacity 0.8s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* ---------- Meta line (cards, featured, articles) ---------- */

.blog-card-meta,
.blog-featured-meta {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--azur);
  margin-bottom: 0.75rem;
}

/* ---------- Index hero ---------- */

.blog-hero {
  background: var(--bg);
  padding: clamp(6rem, 12vw, 9rem) 0 clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}
.blog-hero .eyebrow { color: var(--azur); }
.blog-hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  margin: 0.5rem 0 1.25rem;
  letter-spacing: -0.015em;
}
.blog-hero .lede {
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--text-muted);
}

/* ---------- Featured article ---------- */

.blog-featured {
  max-width: 1200px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}
.blog-featured-link {
  display: grid;
  grid-template-columns: 3fr 2fr;
  background: var(--bg-cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.blog-featured-img-wrap {
  overflow: hidden;
  border-radius: var(--radius);
}
.blog-featured-img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.9s var(--ease);
}
.blog-featured:hover .blog-featured-img,
.blog-featured:hover img { transform: scale(1.05); }
.blog-featured-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.blog-featured-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
}
.blog-featured-excerpt {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Editorial grid ---------- */

.blog-grid-section {
  padding: clamp(2rem, 4vw, 4rem) 0 clamp(4rem, 8vw, 7rem);
  background: var(--bg);
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */

.blog-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  min-width: 0;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}
.blog-card-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.blog-card-img-wrap { overflow: hidden; }
.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background-size: cover;
  background-position: center;
  transition: transform 0.9s var(--ease);
}
.blog-card:hover .blog-card-img { transform: scale(1.05); }
.blog-card-body { padding: 1.75rem; }
.blog-card-body h2,
.blog-card-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1.8vw, 1.625rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.blog-card-body > p:not(.blog-card-meta) {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 500;
}
.blog-card-cta .arrow,
.blog-featured-cta .arrow { transition: transform 0.3s var(--ease); }
.blog-card:hover .arrow,
.blog-featured:hover .arrow { transform: translateX(4px); }
.blog-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 500;
}

/* ---------- More guides list ---------- */

.blog-more {
  max-width: 1200px;
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
}
.blog-more-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 1.25rem;
  color: var(--text);
}
.blog-more-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}
.blog-more-row:last-of-type { border-bottom: 1px solid var(--line); }
.blog-more-row h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.35rem;
  color: var(--text);
  transition: color 0.3s var(--ease);
}
.blog-more-row .blog-card-meta { margin-bottom: 0; }
.blog-more-row .arrow {
  font-size: 1.25rem;
  color: var(--text);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
}
.blog-more-row:hover h3 { color: var(--azur); }
.blog-more-row:hover .arrow { transform: translateX(4px); }

/* ---------- Bottom CTA (index) + article CTA card ---------- */

.blog-cta-wrap {
  max-width: 1200px;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
}
.blog-cta-wrap .post-cta { margin: 0; }

.post-cta {
  background: var(--bg-cream);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 3rem 0 0;
  text-align: center;
}
.post-cta h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  margin-bottom: 0.875rem;
}
.post-cta p { margin-bottom: 1.5rem; }
.post-cta .btn {
  display: inline-block;
  background: var(--azur);
  color: #fff;
  padding: 1rem 2.25rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.post-cta .btn:hover {
  background: var(--azur-deep);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(46, 92, 138, 0.3);
}
.post-cta .cta-trust {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.25rem 0 0;
}

/* ---------- Article: hero ---------- */

.post-hero {
  background: var(--bg);
  padding: clamp(7rem, 13vw, 10rem) 0 clamp(2rem, 4vw, 3rem);
}
.post-hero-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.post-breadcrumb {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 1rem;
}
.post-breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.post-breadcrumb a:hover { color: var(--azur); }
.post-meta {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--azur);
  margin-bottom: 1.25rem;
}
.post-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}
.post-subtitle {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.5rem;
}
.post-byline img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.post-byline-name {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}
.post-byline-role {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Works both as background div (legacy) and as real img (new markup) */
.post-hero-img {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  margin: clamp(2rem, 4vw, 3.5rem) auto;
  max-width: 1100px;
  border-radius: var(--radius-lg);
  display: block;
}
img.post-hero-img {
  width: min(1100px, calc(100% - 2 * var(--pad)));
  object-fit: cover;
}

/* ---------- Article: body ---------- */

.post-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 8vw, 7rem);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}
.post-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  margin: 3rem 0 1rem;
  line-height: 1.2;
}
.post-body h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.005em;
  margin: 2rem 0 0.75rem;
}
.post-body p {
  margin-bottom: 1.25rem;
  color: var(--text);
}
.post-body p strong { font-weight: 500; }
.post-body a {
  color: var(--azur);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.post-body li { margin-bottom: 0.5rem; }
.post-body blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Article: table of contents ---------- */

.post-toc {
  background: var(--bg-cream);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 2.5rem;
}
.post-toc-title {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--azur);
  margin-bottom: 0.875rem;
}
.post-toc ol {
  margin: 0;
  padding-left: 1.375rem;
}
.post-toc li { margin-bottom: 0.4rem; }
.post-toc a {
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.post-toc a:hover {
  color: var(--azur);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Article: wide in-body images ---------- */

.post-img-wide {
  width: min(1000px, calc(100vw - 2 * var(--pad)));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 2.5rem 0;
}
.post-img-wide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
.post-img-wide.ratio-3x2 img { aspect-ratio: 3 / 2; }
.post-img-wide figcaption {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-top: 0.75rem;
  text-align: center;
}

/* ---------- Article: prev / next pager ---------- */

.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.post-pager a {
  display: block;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}
.post-pager-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
.post-pager-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--text);
  transition: color 0.3s var(--ease);
}
.post-pager a:hover .post-pager-title { color: var(--azur); }
.post-pager-next { text-align: right; }

/* ---------- Related posts ---------- */

.related-posts {
  max-width: 1100px;
  margin: 0 auto clamp(4rem, 8vw, 7rem);
  padding: 0 var(--pad);
}
.related-posts h2,
.related-posts h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  text-align: center;
  margin-bottom: 2rem;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  gap: 1.5rem;
}
.related-posts .blog-card-body { padding: 1.5rem; }
.related-posts .blog-card-body h2,
.related-posts .blog-card-body h3 {
  font-size: 1.25rem;
  text-align: left;
  margin-bottom: 0.75rem;
}

/* ---------- Footer ---------- */

.blog-footer { margin-top: 0; }

/* ---------- Focus visibility ---------- */

a.blog-card-link:focus-visible,
.blog-featured-link:focus-visible,
.blog-more-row:focus-visible,
.post-pager a:focus-visible,
.post-cta .btn:focus-visible,
.post-toc a:focus-visible {
  outline: 2px solid var(--azur);
  outline-offset: 3px;
  border-radius: inherit;
}

/* ---------- Responsive: 900 to 1100 ---------- */

@media (max-width: 1100px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  .related-posts-grid { gap: 1.25rem; }
}

/* ---------- Responsive: under 900 ---------- */

@media (max-width: 900px) {
  .blog-featured-link { grid-template-columns: 1fr; }
  .blog-featured-img {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
  }
  .blog-featured-body { padding: 1.5rem; }

  /* Related posts switch to a scroll-snap carousel */
  .related-posts-grid {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 0.5rem;
    scroll-padding-left: var(--pad);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .related-posts-grid::-webkit-scrollbar { display: none; }
  .related-posts .blog-card {
    flex: 0 0 78vw;
    max-width: 340px;
    scroll-snap-align: start;
  }
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .blog-card-body { padding: 1.5rem; }
  .post-body {
    font-size: 1rem;
    line-height: 1.7;
  }
  /* Tables can be wider than the screen; body has overflow-x hidden,
     so let the table itself scroll instead of clipping columns */
  .post-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .post-cta { padding: 1.75rem; }
  .post-img-wide {
    width: 100vw;
    margin: 2rem 0;
  }
  .post-img-wide img { border-radius: 0; }
  .post-pager { grid-template-columns: 1fr; gap: 0; }
  .post-pager-next { text-align: left; }
  .blog-more-row h3 { font-size: 1.125rem; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-img,
  .blog-featured-img,
  .arrow,
  .reveal,
  .post-cta .btn,
  .blog-more-row h3,
  .post-pager-title {
    transition: none !important;
    transform: none !important;
  }
  .reveal { opacity: 1 !important; }
}

/* ====== v2 : filtres de catégories + grille dense ====== */
.blog-filters{display:flex;gap:10px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
  max-width:1200px;margin:26px auto 6px;padding:0 24px 6px}
.blog-filters::-webkit-scrollbar{display:none}
.bf{flex:none;font-family:'Inter',sans-serif;font-size:.78rem;font-weight:500;letter-spacing:.04em;
  padding:.55rem 1.1rem;border-radius:999px;border:1px solid rgba(26,26,26,.18);
  background:transparent;color:#1A1A1A;cursor:pointer;transition:all .2s}
.bf:hover{border-color:#2E5C8A;color:#2E5C8A}
.bf.on{background:#2E5C8A;border-color:#2E5C8A;color:#fff}
.bf-hide{display:none !important}
@media (min-width: 1100px){ .blog-grid{grid-template-columns:repeat(3,1fr)} }
@media (max-width: 700px){ .blog-filters{margin-top:18px} }

/* ====== GEO : bloc réponse-directe, table de prix, ligne de fraîcheur ====== */
.quick-answer{border-left:2px solid #2E5C8A;background:rgba(46,92,138,.04);
  padding:1.4rem 1.6rem;margin:0 0 2.6rem;border-radius:2px}
.quick-answer-label{font-family:'Inter',sans-serif;font-size:.68rem;font-weight:600;
  letter-spacing:.16em;text-transform:uppercase;color:#2E5C8A;margin:0 0 .6rem}
.quick-answer p:last-child{margin:0;font-size:1rem;line-height:1.75;color:#1A1A1A}
.price-table{width:100%;border-collapse:collapse;margin:1.6rem 0 .8rem;
  font-family:'Inter',sans-serif;font-size:.92rem}
.price-table caption{caption-side:top;text-align:left;font-size:.8rem;color:#6b6b6b;
  padding-bottom:.8rem;line-height:1.5}
.price-table th{text-align:left;font-weight:600;font-size:.74rem;letter-spacing:.09em;
  text-transform:uppercase;color:#6b6b6b;border-bottom:1px solid rgba(26,26,26,.16);padding:.7rem .9rem .7rem 0}
.price-table td{padding:.85rem .9rem .85rem 0;border-bottom:1px solid rgba(26,26,26,.07);color:#1A1A1A}
.price-table td:last-child{font-weight:600;white-space:nowrap}
.freshness{font-size:.82rem;color:#6b6b6b;font-style:italic}
@media (max-width:640px){
  .price-table{font-size:.84rem}
  .price-table th,.price-table td{padding-right:.5rem}
  .quick-answer{padding:1.1rem 1.2rem}
}

/* ====== GEO : bloc sources + encadré auteur ====== */
.article-sources{margin:3rem 0 0;padding:1.6rem 1.8rem;background:rgba(46,92,138,.04);
  border-radius:2px;border-left:2px solid #2E5C8A}
.article-sources h2{font-size:1.15rem !important;margin:0 0 .6rem !important}
.article-sources p{font-size:.9rem;color:#6b6b6b;margin:0 0 1rem;line-height:1.6}
.article-sources ul{margin:0;padding-left:1.1rem}
.article-sources li{font-size:.9rem;line-height:1.65;margin-bottom:.5rem;color:#1A1A1A}
.article-sources a{color:#2E5C8A;text-decoration:underline;text-underline-offset:2px}
.article-author{margin:1.8rem 0 0;padding-top:1.4rem;border-top:1px solid rgba(26,26,26,.1)}
.article-author-name{font-family:'Inter',sans-serif;font-size:.74rem;font-weight:600;
  letter-spacing:.14em;text-transform:uppercase;color:#2E5C8A;margin:0 0 .5rem}
.article-author p:last-child{font-size:.92rem;color:#6b6b6b;line-height:1.7;margin:0}
@media (max-width:640px){.article-sources{padding:1.2rem 1.3rem}}
