/* ============================================================
   SMART TOPO — journal
   Mise en page de l'index et des articles.
   Chargée uniquement sur les pages du blog.
   ============================================================ */

/* ============================================================
   index
   ============================================================ */

.posts {
  display: grid;
  gap: var(--s-7) var(--gutter);
}
@media (min-width: 52rem) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 76rem) { .posts { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
  padding-top: var(--s-5);
}
.post-card__media {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
  margin-bottom: var(--s-5);
}
.post-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease-out);
}
.post-card:hover .post-card__media img { transform: scale(1.04); }

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.post-card__meta b { color: var(--accent-text); font-weight: 500; }

.post-card__t {
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 500;
  letter-spacing: -.018em;
  line-height: 1.14;
  margin-top: var(--s-4);
}
.post-card:hover .post-card__t { color: var(--accent-text); }
.post-card__t a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }

.post-card__d {
  margin-top: var(--s-3);
  font-size: var(--t-sm);
  color: var(--fg-muted);
}
.post-card__f {
  margin-top: auto;
  padding-top: var(--s-5);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* l'article mis en avant occupe toute la largeur */
.post-card--lead { grid-column: 1 / -1; }
@media (min-width: 52rem) {
  .post-card--lead {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--gutter);
    align-items: center;
  }
  .post-card--lead .post-card__media { margin-bottom: 0; }
  .post-card--lead .post-card__media img { aspect-ratio: 4 / 3; }
  .post-card--lead .post-card__t { font-size: var(--t-xl); }
  .post-card--lead .post-card__d { font-size: var(--t-base); max-width: 46ch; }
}

/* ============================================================
   article
   ============================================================ */

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.4rem;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.post__meta b { color: var(--accent-text); font-weight: 500; }

/* --- sommaire --- */
.post__toc {
  margin: 0 0 var(--s-8);
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.post__toc h2 {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--s-4);
}
.post__toc ol { counter-reset: toc; display: grid; gap: .55rem; }
.post__toc li { counter-increment: toc; }
.post__toc a {
  display: flex;
  gap: .9rem;
  font-size: var(--t-sm);
  transition: color .25s, padding-left .35s var(--ease-out);
}
.post__toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--accent-text);
  flex: none;
}
.post__toc a:hover { color: var(--accent-text); padding-left: .4rem; }

/* --- corps de l'article --- */
.post__body { max-width: 42rem; }

.post__body > p {
  margin-top: 1.15em;
  font-size: var(--t-md);
  line-height: 1.72;
}
.post__body > p:first-child { margin-top: 0; }

.post__body h2 {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.14;
  margin-top: 2.4em;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.post__body h3 {
  font-size: var(--t-md);
  font-weight: 500;
  margin-top: 2em;
  letter-spacing: -.005em;
}
.post__body h2 + p, .post__body h3 + p { margin-top: .8em; }

.post__body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--brass-deep);
  transition: color .25s, text-decoration-color .25s;
}
.post__body a:hover { color: var(--accent-text); text-decoration-color: var(--accent-text); }

.post__body strong { font-weight: 600; }

.post__body ul, .post__body ol { margin-top: 1.1em; display: grid; gap: .55rem; }
.post__body li {
  position: relative;
  padding-left: 1.5rem;
  font-size: var(--t-base);
  line-height: 1.62;
}
.post__body ul > li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: .45rem; height: .45rem;
  border-left: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: translateY(-50%);
}
.post__body ol { counter-reset: step; }
.post__body ol > li { counter-increment: step; }
.post__body ol > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: .1em;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--accent-text);
}

/* --- encadré --- */
.callout {
  margin-top: 2em;
  padding: var(--s-5) var(--s-5) var(--s-5) var(--s-6);
  border-left: 2px solid var(--accent);
  background: var(--field);
}
.callout h3 {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 var(--s-3);
}
.callout p { font-size: var(--t-sm); line-height: 1.65; }
.callout p + p { margin-top: .7em; }

/* --- citation --- */
.post__body blockquote {
  margin: 2.2em 0 0;
  padding: 0;
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--fg);
}
.post__body blockquote::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 1px;
  background: var(--accent);
  margin-bottom: var(--s-4);
}

/* --- tableau --- */
.post__table { margin-top: 2em; overflow-x: auto; }
.post__table table { border-collapse: collapse; width: 100%; min-width: 30rem; }
.post__table th, .post__table td {
  text-align: left;
  padding: .85rem 1rem .85rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-sm);
  vertical-align: top;
}
.post__table th {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom-color: var(--fg-muted);
}
.post__table td:first-child { font-weight: 500; }

/* --- figure dans l'article --- */
.post__body figure { margin: 2.2em 0 0; }
.post__body figure img { width: 100%; display: block; }
.post__body figcaption {
  margin-top: .8rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .08em;
  color: var(--fg-muted);
}

/* --- signature de fin --- */
.post__sign {
  margin-top: var(--band-s);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: var(--s-3);
}
.post__sign p { font-size: var(--t-sm); color: var(--fg-muted); max-width: 46rem; }

/* --- articles liés --- */
.post__more { display: grid; gap: var(--s-6) var(--gutter); }
@media (min-width: 52rem) { .post__more { grid-template-columns: repeat(2, 1fr); } }

/* --- avis de langue --- */
.lang-note {
  margin-bottom: var(--s-6);
  padding: .9rem 1.1rem;
  border: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: .1em;
  color: var(--fg-muted);
}
html[lang="fr"] .lang-note { display: none; }

/* ============================================================
   affinage mobile
   ============================================================ */

@media (max-width: 48rem) {
  /* les tableaux à deux colonnes tiennent dans l'écran plutôt que
     de défiler sans que rien ne l'annonce */
  .post__table table { min-width: 0; }
  .post__table th, .post__table td { padding: .7rem .7rem .7rem 0; }
  .post__table th:last-child, .post__table td:last-child { padding-right: 0; }

  .post__toc a { padding-block: .45rem; }
  .post-card__t a { display: inline-block; padding-block: .2rem; }
}

@media (max-width: 48rem) {
  .post__toc a { min-height: 44px; align-items: center; }
}
