/* =========================================================================
   OpenTahr — blog (index + articles)
   Éditorial monochrome, hérite des tokens de style.css.
   ========================================================================= */

/* ---------- Index du blog ---------- */
.blog-hero { padding-block: clamp(2.4rem, 2rem + 3vw, 4.5rem) clamp(1.6rem, 1.2rem + 2vw, 3rem); }
.blog-title {
  font-family: var(--serif); font-weight: 330; letter-spacing: -0.03em;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem); line-height: 1.04;
}
.blog-intro { color: var(--ink-2); max-width: 52ch; margin-top: 1rem; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); }

/* Barre de filtres catégories (/blog + pages /blog/categorie/<slug>/) */
.blog-cats { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: clamp(1.6rem, 1.2rem + 2vw, 2.6rem); }
.blog-cats a {
  display: inline-flex; align-items: center; padding: .4rem .9rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: var(--step--1); font-weight: 600; letter-spacing: .02em;
  color: var(--ink-2); text-decoration: none; background: transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.blog-cats a:hover { color: var(--ink); border-color: var(--ink); }
.blog-cats a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Fil d'Ariane visible dans la hero des pages catégories */
.blog-hero .eyebrow a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.blog-hero .eyebrow a:hover { border-bottom-color: currentColor; }

/* Pagination (/blog + pages catégories) */
.blog-pager { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
.blog-pager:empty { display: none; }
.blog-pager a, .blog-pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.3rem; padding: .4rem .6rem;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: var(--step--1); font-weight: 600; color: var(--ink-2);
  text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.blog-pager a:hover { color: var(--ink); border-color: var(--ink); }
.blog-pager .pg-cur { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.blog-pager .pg-prev, .blog-pager .pg-next { padding-inline: .9rem; }

.post-list { display: grid; gap: 0; padding-bottom: clamp(2.5rem, 2rem + 3vw, 5rem); }
.post-card {
  display: grid; grid-template-columns: minmax(0, 26rem) 1fr;
  gap: clamp(1.4rem, 1rem + 2.5vw, 3rem); align-items: center;
  padding-block: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem);
  border-top: 1px solid var(--line); text-decoration: none; color: inherit;
}
.post-card:last-child { border-bottom: 1px solid var(--line); }
.post-thumb {
  aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--line);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.post-card:hover .post-thumb img { transform: scale(1.03); }
.post-meta { display: flex; gap: .7rem; align-items: center; font-size: var(--step--1); color: var(--ink-3); font-weight: 500; letter-spacing: .03em; }
.post-card h2 {
  font-family: var(--serif); font-weight: 360; letter-spacing: -0.02em;
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15; margin-top: .55rem;
  text-wrap: balance;
}
.post-card:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-card p.excerpt { color: var(--ink-2); margin-top: .6rem; max-width: 58ch; }
.post-more { display: inline-block; margin-top: .85rem; font-weight: 600; font-size: var(--step--1); letter-spacing: .02em; }

/* ---------- Article ---------- */
.art-head { padding-block: clamp(2.2rem, 1.8rem + 2.5vw, 4rem) clamp(1.4rem, 1rem + 1.5vw, 2.2rem); max-width: 52rem; }
.art-cat { color: var(--ink-3); font-weight: 600; font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; }
.art-title {
  font-family: var(--serif); font-weight: 330; letter-spacing: -0.028em;
  font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3.4rem); line-height: 1.08; margin-top: .9rem;
  text-wrap: balance;
}
.art-standfirst {
  font-family: var(--serif); font-style: italic; font-weight: 340;
  color: var(--ink-2); font-size: clamp(1.05rem, 1rem + .45vw, 1.3rem);
  line-height: 1.5; margin-top: 1.1rem; max-width: 46ch;
}
.art-byline { display: flex; align-items: center; gap: .85rem; margin-top: 1.5rem; }
.art-byline img { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); }
.art-byline .who { font-size: var(--step--1); line-height: 1.45; }
.art-byline .who a { font-weight: 600; text-decoration: none; }
.art-byline .who a:hover { text-decoration: underline; }
.art-byline .when { color: var(--ink-3); }

.art-figure { margin: 0; }
.art-figure img {
  width: 100%; height: auto; display: block; border-radius: 14px;
  border: 1px solid var(--line);
}
.art-figure figcaption {
  margin-top: .6rem; font-size: var(--step--1); color: var(--ink-3);
  font-family: var(--serif); font-style: italic;
}

.art-layout {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2rem, 1.5rem + 3vw, 5rem); align-items: start;
  padding-block: clamp(1.8rem, 1.4rem + 2vw, 3rem) clamp(2.5rem, 2rem + 3vw, 5rem);
}

/* Prose */
.art-body { max-width: 44rem; font-size: clamp(1rem, .97rem + .2vw, 1.1rem); }
.art-body > * + * { margin-top: 1.1em; }
.art-body h2 {
  font-family: var(--serif); font-weight: 380; letter-spacing: -0.02em;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); line-height: 1.2;
  margin-top: 2.2em; display: flex; gap: .8rem; align-items: baseline;
}
.art-body h2 .no { font-style: italic; font-weight: 340; color: var(--ink-3); font-size: .72em; }
.art-body h3 { font-weight: 700; font-size: 1.06em; margin-top: 1.8em; }
.art-body p { color: var(--ink-2); }
.art-body strong { color: var(--ink); font-weight: 600; }
.art-body a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; } /* lien distinguable sans la couleur (WCAG 1.4.1) */
.art-body a:not(.btn):hover { text-decoration-thickness: 2px; }
.art-body ul, .art-body ol { color: var(--ink-2); padding-left: 1.2rem; display: grid; gap: .45rem; }
.art-body ul li::marker { color: var(--ink-3); }
.art-body figure { margin: 2em 0; }

/* Encadré « l'essentiel » */
.art-keys {
  border: 1px solid var(--line-strong); border-radius: 14px;
  padding: clamp(1.1rem, 1rem + .8vw, 1.7rem); background: var(--paper-2);
}
.art-keys h2 { margin-top: 0 !important; font-size: 1.15rem !important; }
.art-keys ul { margin-top: .8rem; }

/* Tableaux */
.art-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.art-table caption { text-align: left; font-size: var(--step--1); color: var(--ink-3); padding-bottom: .5rem; font-style: italic; font-family: var(--serif); }
.art-table th, .art-table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.art-table thead th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); }
.art-table td:not(:first-child), .art-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.art-table .hl td { font-weight: 600; color: var(--ink); }

/* Citation */
.art-body blockquote {
  border-left: 2px solid var(--ink); padding-left: 1.2rem; margin-block: 1.6em;
  font-family: var(--serif); font-style: italic; font-size: 1.1em; color: var(--ink);
}
.art-body blockquote footer { font-size: .8em; color: var(--ink-3); font-style: normal; font-family: var(--sans); margin-top: .5rem; }

/* Note de transparence */
.art-note {
  border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: .9rem 1.1rem; font-size: .92em; color: var(--ink-2);
}

/* Références */
.art-refs { font-size: .9em; }
.art-refs ol { display: grid; gap: .5rem; }
.art-refs a { word-break: break-word; }

/* CTA fin d'article */
.art-cta {
  margin-top: 2.5em; border-top: 1px solid var(--line); padding-top: 1.6em;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.art-cta p { max-width: 34ch; font-weight: 500; color: var(--ink); }

/* ---------- Partage ---------- */
.art-byline-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 1.6rem; flex-wrap: wrap; margin-top: 1.5rem;
}
.art-byline-row .art-byline { margin-top: 0; }
.art-share { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.art-share .share-label {
  font-size: .7rem; color: var(--ink-3); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; margin-right: .25rem;
}
.art-share a, .art-share button {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: transparent; cursor: pointer; text-decoration: none; padding: 0;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .15s var(--ease);
}
.art-share a:hover, .art-share button:hover,
.art-share a:focus-visible, .art-share button:focus-visible {
  background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px);
}
.art-share svg { width: 15px; height: 15px; display: block; }
/* La confirmation « Lien copié » passe à la ligne pour ne jamais casser la rangée de boutons. */
.art-share .share-note { flex-basis: 100%; font-size: var(--step--1); color: var(--ink-3); font-family: var(--serif); font-style: italic; margin-top: .2rem; }

/* Bloc de fin d'article : centré, soigné, avec titre au-dessus. */
.art-share-end {
  margin-top: 2.6em; border-top: 1px solid var(--line); padding-top: 1.6em;
  display: flex; align-items: center; justify-content: center; gap: .45rem; flex-wrap: wrap;
}
.art-share-end .share-label { flex-basis: 100%; text-align: center; margin: 0 0 .5rem; }
.art-share-end .share-note { text-align: center; }

[data-share] { display: none; }
html.js [data-share="copy"] { display: inline-flex; }
html.can-share [data-share="native"] { display: inline-flex; }

/* Mobile : le partage du haut passe sous l'auteur, pleine largeur, cibles tactiles confortables. */
@media (max-width: 560px) {
  .art-byline-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .art-byline-row .art-share { width: 100%; }
  .art-share a, .art-share button { width: 40px; height: 40px; }
  .art-share-end { justify-content: flex-start; }
  .art-share-end .share-label { text-align: left; }
}

/* ---------- Articles liés ---------- */
.art-related { border-top: 1px solid var(--line); margin-top: 2.6rem; padding-top: 1.7rem; }
.art-body .related-title {
  margin-top: 0; font-family: var(--serif); font-weight: 360; letter-spacing: -0.02em;
  font-size: clamp(1.3rem, 1.15rem + .8vw, 1.7rem); line-height: 1.2;
}
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: clamp(1.2rem, 1rem + 1.2vw, 2rem); margin-top: 1.3rem;
}
.related-card { display: block; text-decoration: none; color: inherit; }
.related-card .post-thumb { display: block; }
.related-card .post-meta { margin-top: .65rem; }
.art-body .related-card h3 {
  font-family: var(--serif); font-weight: 390; font-size: 1.1rem; line-height: 1.3;
  letter-spacing: -0.015em; margin-top: .45rem; text-wrap: balance;
}
.related-card:hover h3, .related-card:focus-visible h3 {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .art-layout { grid-template-columns: 1fr; }
  .art-layout .legal-toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
}
@media (max-width: 720px) {
  .post-card { grid-template-columns: 1fr; gap: 1rem; }
  .art-table { font-size: .82em; }
  .art-table th, .art-table td { padding: .5rem .5rem; }
}
