/* =====================================================================
   Article Recommendation Section — "À lire ensuite" / "Sur le même thème"
   Direction A (editorial card trio, cream/light) from the Claude Design
   handoff bundle (article-recos/version-a.jsx + recos.css), ported to the
   Eleventy site. Sits at the end of an article, after the body.

   Root `.rx` sets `container-type: inline-size`, so the SAME markup reflows
   from desktop to a single mobile column via @container queries — no
   separate mobile markup. The card image is a clean drop zone with NO
   overlay text (per the final design pass: real thumbnails carry their own
   labels). Fonts (Instrument Serif / Sans + JetBrains Mono) are already
   loaded site-wide; tokens here mirror the live AlloRénov palette.
   ===================================================================== */

.rx {
  /* ---- tokens (mirror the live site) ---- */
  --forest-900: oklch(0.22 0.04 155);
  --forest-800: oklch(0.28 0.05 155);
  --forest-700: oklch(0.36 0.06 155);
  --forest-200: oklch(0.88 0.04 155);
  --forest-100: oklch(0.94 0.025 150);
  --cream-50:  oklch(0.985 0.008 95);
  --cream-100: oklch(0.965 0.012 90);
  --cream-200: oklch(0.93 0.018 88);
  --sand-300:  oklch(0.86 0.03 85);
  --yellow-300: oklch(0.93 0.10 95);
  --ink-900: oklch(0.18 0.012 60);
  --ink-700: oklch(0.34 0.012 60);

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  container-type: inline-size;
  font-family: var(--font-sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
}
.rx *, .rx *::before, .rx *::after { box-sizing: border-box; }
.rx p, .rx h2, .rx h3 { margin: 0; }
.rx a { color: inherit; text-decoration: none; }

/* theme context */
.rx--light { background: var(--cream-50); color: var(--ink-900); }

.rx_inner {
  width: 100%;
  max-width: 82rem;
  margin: 0 auto;
  padding: 3.75rem 3rem;
}
@container (width < 760px) {
  .rx_inner { padding: 2.5rem 1.5rem; }
}

/* ---- eyebrow / section head ---- */
.rx_eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in hsl, currentColor 55%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.rx_eyebrow_dot {
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--forest-700);
}
.rx_sephead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid color-mix(in hsl, currentColor 14%, transparent);
}
.rx_title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin-top: 0.9rem;
}
.rx_title em { font-style: italic; color: var(--forest-700); }
.rx_seelink {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--forest-700);
  padding-bottom: 0.2rem;
  transition: gap 200ms var(--ease), color 200ms var(--ease);
}
.rx_seelink svg { width: 0.85rem; height: 0.85rem; transition: transform 200ms var(--ease); }
.rx_seelink:hover { gap: 0.7rem; }
.rx_seelink:hover svg { transform: translateX(0.18rem); }

/* ---- shared editorial card visual (clean image drop zone, no overlay text) ---- */
.rx_visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--forest-100);
  transition: box-shadow 250ms var(--ease);
}
.rx_visual_img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rx_visual_pattern {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in oklch, var(--forest-700) 11%, transparent) 0,
    color-mix(in oklch, var(--forest-700) 11%, transparent) 1px,
    transparent 1px, transparent 12px
  );
}
/* per-topic tints */
.rx_visual.is-pac { background: var(--forest-100); }
.rx_visual.is-iso { background: var(--cream-200); }
.rx_visual.is-ecs { background: color-mix(in oklch, var(--yellow-300) 30%, var(--cream-100)); }
.rx_visual.is-aide { background: var(--sand-300); }
.rx_visual.is-glob { background: var(--forest-200); }

/* shared meta line */
.rx_meta {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.rx_meta_kind { color: var(--forest-700); }
.rx_meta_sep { color: color-mix(in hsl, currentColor 35%, transparent); }
.rx_meta_time { color: color-mix(in hsl, currentColor 55%, transparent); }
.rx_meta_new {
  font-size: 0.58rem;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--yellow-300);
  color: var(--forest-900);
  letter-spacing: 0.1em;
}

/* shared author footer */
.rx_author {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem;
  color: color-mix(in hsl, currentColor 60%, transparent);
}
.rx_author_avatar {
  width: 1.5rem; height: 1.5rem; aspect-ratio: 1 / 1; border-radius: 50%;
  background: var(--forest-100);
  color: var(--forest-800);
  display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-size: 0.72rem;
  flex-shrink: 0;
  overflow: hidden;
}
/* photo fills the fixed square and is cropped to a circle — never stretched */
.rx_author_avatar img {
  width: 100%; height: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 50%; display: block;
}
.rx_arrow {
  width: 1.05rem; height: 1.05rem; flex-shrink: 0;
  color: color-mix(in hsl, currentColor 45%, transparent);
  transition: transform 200ms var(--ease), color 200ms var(--ease);
}

/* =====================================================================
   A — EDITORIAL CARD TRIO (cream / light)
   Header row + 3 full editorial cards.
   ===================================================================== */
.rx-a_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 1.75rem;
  margin-top: 2.5rem;
}
.rx-a_card {
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform 250ms var(--ease);
}
.rx-a_card:hover { transform: translateY(-3px); }
.rx-a_card:hover .rx_visual { box-shadow: 0 14px 34px -18px color-mix(in oklch, var(--forest-900) 40%, transparent); }
.rx-a_card_title {
  font-family: var(--font-display);
  font-weight: 400; font-size: 1.4rem; line-height: 1.14;
  letter-spacing: -0.012em; text-wrap: balance;
}
.rx-a_card_title em { font-style: italic; color: var(--forest-700); }
.rx-a_card_deck {
  font-size: 0.92rem; line-height: 1.5;
  color: var(--ink-700);
  max-width: 40ch;
}
.rx-a_card_foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in hsl, var(--ink-900) 12%, transparent);
}
.rx-a_card:hover .rx_arrow { transform: translateX(0.22rem); color: var(--forest-800); }

@container (width < 880px) {
  .rx-a_grid { grid-template-columns: 1fr; gap: 2.25rem; max-width: 30rem; }
}
