/**
 * Single article (single.php) — "Détail Article" layout.
 *
 * Loaded only on single posts (see inc/enqueue.php, is_single()). Header is the
 * shared inner-page header, footer is the shared site footer — this file styles
 * the article body (header, cover, two-column body + sticky sidebar, related,
 * tags, share). Ported from the prototype
 * (demo/Détail Article (autonome) (3).html). The .rv reveals and .va-up entrance
 * are pure CSS (view-timeline / keyframes), no JS.
 */

/* Shared helpers (normally in contact.css / voix.css, which don't load here). */
.serif {
  font-family: Castoro, Georgia, serif;
  font-weight: 400;
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e9511c;
  background: #e9511c;
  color: #f8feff;
  border-radius: 15px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f8feff;
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.arr {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Entrance + scroll reveal */
.va-up { animation: vup 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.va-up.d1 { animation-delay: 0.08s; }
.va-up.d2 { animation-delay: 0.16s; }
.va-up.d3 { animation-delay: 0.26s; }
.va-up.d4 { animation-delay: 0.36s; }

@keyframes vup {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: none; }
}

/* .rv is set on the parts we render ourselves; the article body is written in
   the back office, so its direct children get the same reveal without asking
   the editor for a class. */
@supports (animation-timeline: view()) {
  .rv,
  .art-body > * {
    animation: vup 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }
}

/* ---- Article header ------------------------------------------------------ */
.ah {
  padding: 44px 20px 46px;
  max-width: none;
  margin: 0;
}

/* Tablet + mobile: inner banner is hidden and the fixed .ui-menu-mobile bar
   takes over (position:fixed), so push the article down to clear it. */
@media (max-width: 1280px) {
  .ah { margin-top: 104px; padding-top: 0; }
}

/* The bar ends at 51px here: the "Retour" link sits 24px under it, as on the
   biography pages (css/bio-detail.css). */
@media (max-width: 767px) {
  .ah { margin-top: 75px; }
}

.ah-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
}

.pill {
  border-radius: 15px;
  padding: 4px 11px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #70cbd3;
  border: 1px solid #70cbd3;
  color: #000;
}

.msep { color: rgba(0, 0, 0, 0.3); }

.ah-title {
  font-size: clamp(44px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-top: 22px;
  max-width: none;
}

.ah-title i { color: #e9511c; }

.ah-lede {
  font-size: 16.5px;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.65);
  max-width: none;
  margin: 28px 0 0;
}

/* b and strong both: the back office writes <strong>, older saved copy <b>. */
.ah-lede b,
.ah-lede strong { color: #000; }

/* ---- Byline -------------------------------------------------------------- */
/* The row holds one .by-person per auteur·rice, then the share slot: the wider
   column gap separates two co-signers, the 16px inside each one keeps a portrait
   against its own name. */
.byline {
  display: flex;
  align-items: center;
  gap: 18px 30px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-top: 36px;
  padding-top: 22px;
}

.by-person {
  display: flex;
  align-items: center;
  gap: 16px;
}

.by-ava {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #d0eff2;
  flex: none;
}

/* Uploaded portraits fill their round frame whatever their own ratio. */
.by-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.by-name { font-size: 14px; font-weight: 700; }

.by-role {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 2px;
}

.by-share { margin-left: auto; display: flex; gap: 6px; }

.shb {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #d0eff2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s, color 0.3s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.shb:hover { background: #e9511c; color: #f8feff; transform: translateY(-2px); }
.shb svg { width: 15px; height: 15px; flex: none; }
.shb .ic-check { display: none; }
.shb.ok .ic-link { display: none; }
.shb.ok .ic-check { display: block; }

/* Share row inside the sidebar card. */
.art-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ---- Cover --------------------------------------------------------------- */
.cover {
  margin: 0 20px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 7;
  background: repeating-linear-gradient(135deg, #b4e4e8, #b4e4e8 10px, #d0eff2 10px, #d0eff2 20px);
}

/* Featured image, cropped to the 16/7 box; without one the striped .cover
   background stays visible, as in the prototype. */
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-cap {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  background: #f8feff;
  border-radius: 15px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  pointer-events: none;
}

/* ---- Layout -------------------------------------------------------------- */
.art-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 70px;
  padding: 64px 20px 80px;
  max-width: none;
  margin: 0;
  align-items: start;
}

.art-layout.solo { grid-template-columns: minmax(0, 1fr); max-width: none; }

/* ---- Article body typography -------------------------------------------- */
.art-body { max-width: none; }

.art-body p {
  font-size: 16.5px;
  line-height: 1.9;
  color: rgba(0, 0, 0, 0.7);
  margin: 0 0 26px;
}

.art-body p strong { color: #000; font-weight: 700; }

.art-body h2 {
  font-family: Castoro, Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 54px 0 22px;
  scroll-margin-top: 90px;
}

/* <em> too: that is what the editor's italic button produces. */
.art-body h2 i,
.art-body h2 em { color: #e9511c; }

.art-body h3 {
  font-family: Castoro, Georgia, serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
  scroll-margin-top: 90px;
}

.art-body h4 { font-size: 16px; font-weight: 700; margin: 32px 0 12px; }

.art-body a {
  color: #e9511c;
  border-bottom: 1px solid rgba(233, 81, 28, 0.4);
  transition: border-color 0.25s;
}

.art-body a:hover { border-color: #e9511c; }

.art-body ul,
.art-body ol {
  margin: 0 0 26px;
  padding-left: 24px;
  display: grid;
  gap: 10px;
}

.art-body li { font-size: 16.5px; line-height: 1.8; color: rgba(0, 0, 0, 0.7); }
.art-body ul li::marker { color: #e9511c; }
.art-body ol li::marker { color: #e9511c; font-weight: 700; }

.art-body hr { border: none; height: 1px; background: rgba(0, 0, 0, 0.15); margin: 48px 0; }
.art-body img { max-width: 100%; border-radius: 15px; }

.art-body table { width: 100%; border-collapse: collapse; margin: 0 0 26px; font-size: 14.5px; }
.art-body th {
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #d0eff2;
  padding: 12px 14px;
}
.art-body td { padding: 12px 14px; border-bottom: 1px solid rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.7); line-height: 1.6; }

.art-body pre {
  background: #f8feff;
  border: 1px solid #70cbd3;
  border-radius: 15px;
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  margin: 0 0 26px;
}

.art-body code { font-size: 0.92em; background: #d0eff2; border-radius: 6px; padding: 2px 6px; }
.art-body pre code { background: none; padding: 0; }

.art-body blockquote { margin: 36px 0; padding: 4px 0 4px 24px; border-left: 3px solid #e9511c; }
.art-body blockquote p { font-style: italic; color: rgba(0, 0, 0, 0.75); margin: 0 0 10px; }
.art-body blockquote cite { font-style: normal; font-size: 14px; color: rgba(0, 0, 0, 0.5); }

.art-body figure { margin: 44px 0; }

.fig-img {
  border-radius: 15px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(135deg, #70cbd3, #70cbd3 8px, #92d8de 8px, #92d8de 16px);
}

.art-body figcaption {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 12px;
  padding-left: 2px;
}

/* Images inserted from the WYSIWYG field: the media button wraps a captioned
   image in [caption] (figure.wp-caption + p.wp-caption-text, with an inline
   pixel width) and carries the alignment as a class. */
.art-body .wp-caption {
  max-width: 100%;
  margin: 44px 0;
}

.art-body .wp-caption img { display: block; }

.art-body .wp-caption-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(0, 0, 0, 0.5);
  margin: 12px 0 0;
  padding-left: 2px;
  line-height: 1.5;
}

.art-body .alignnone { margin: 44px 0; }
.art-body .aligncenter { display: block; margin-left: auto; margin-right: auto; }

.art-body .alignleft {
  float: left;
  margin: 8px 30px 20px 0;
  max-width: 50%;
}

.art-body .alignright {
  float: right;
  margin: 8px 0 20px 30px;
  max-width: 50%;
}

.art-body::after { content: ""; display: block; clear: both; }

@media (max-width: 640px) {
  .art-body .alignleft,
  .art-body .alignright {
    float: none;
    margin: 30px 0;
    max-width: 100%;
  }
}

/* Password-protected article: the core form, in the theme's controls. */
.art-body .post-password-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  max-width: 620px;
}

.art-body .post-password-form p { width: 100%; margin: 0 0 4px; }
.art-body .post-password-form label { display: block; font-size: 14px; font-weight: 600; }

.art-body .post-password-form input[type="password"] {
  font-family: inherit;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 15px;
  padding: 11px 16px;
  margin-top: 8px;
  min-width: 240px;
}

.art-body .post-password-form input[type="submit"] {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 15px;
  background: #70cbd3;
  color: #000;
  padding: 12px 22px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.art-body .post-password-form input[type="submit"]:hover { background: #e9511c; color: #f8feff; }

/* Page links of an article split with the "page break" block. */
.art-pages {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin: 36px 0 0;
}

.art-pages a { border: none; }

/* ---- Tags ---------------------------------------------------------------- */
.art-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-top: 52px;
  padding-top: 26px;
}

.atag {
  border: 1px solid #70cbd3;
  border-radius: 15px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s, color 0.3s;
}

.atag:hover { background: #70cbd3; color: #000; }

/* ---- Sidebar ------------------------------------------------------------- */
.art-side {
  position: sticky;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: #f8feff;
  border: 1px solid #70cbd3;
  border-radius: 15px;
  padding: 26px;
}

.side-card.blue { background: #d0eff2; border-color: #d0eff2; }

.side-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 18px;
}

.side-label::before { content: ""; width: 26px; height: 1px; background: #000; }

.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color 0.25s, color 0.25s;
  counter-increment: toc;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-size: 14px; font-weight: 700; color: #e9511c; flex: none; }
.toc a:hover { background: rgba(112, 203, 211, 0.25); color: #000; }

.rel {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  /* The global `a` rule (styles.css) only drops the underline, so without
     this the titles took the browser's default link blue. */
  color: #000;
}

.rel:first-of-type { border-top: none; padding-top: 0; }

.rel-th {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  background: repeating-linear-gradient(135deg, #b4e4e8, #b4e4e8 8px, #d0eff2 8px, #d0eff2 16px);
}

.rel-th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rel-tag { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(0, 0, 0, 0.5); }
.rel-t { font-size: 14px; font-weight: 600; line-height: 1.4; margin-top: 4px; transition: color 0.25s; }
.rel:hover .rel-t { color: #e9511c; }

.shl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid #70cbd3;
  border-radius: 15px;
  background: transparent;
  padding: 11px 14px;
  font-family: Montserrat;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.shl:hover { background: #e9511c; border-color: #e9511c; color: #f8feff; }
.shl .ic {
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

/* ---- Prev / next nav ----------------------------------------------------- */
.anav { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 0 15px 15px; }
.anav-item {
  border-radius: 15px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8feff;
  border: 1px solid #70cbd3;
  transition: transform 0.35s, box-shadow 0.35s;
}
.anav-item.nx { background: #d0eff2; border-color: #d0eff2; text-align: right; align-items: flex-end; }
.anav-item:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.1); color: #000; }
.anav-dir {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.anav-t { font-family: Castoro, Georgia, serif; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.2; transition: color 0.25s; }
.anav-item:hover .anav-t { color: #e9511c; }
.anav-item:hover .arr { transform: translateX(6px); }
.anav-item.pv:hover .arr { transform: translateX(-6px); }

@media (max-width: 1000px) {
  .art-layout { grid-template-columns: 1fr; gap: 50px; }
  .art-side { position: static; }
  .anav { grid-template-columns: 1fr; }
  .cover { aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
  .ah { padding: 0 20px 38px; }
  .art-layout { padding: 44px 20px 60px; }
  .art-body blockquote { padding: 28px 22px 24px; }
}
