/* =====================================================================
 * CV Compagnon — Zone visuelle sidebar (Niveau 3.1)
 * Spec : /000-architecture/26-ASSISTANT-PROACTIF-BANDEAU/08-zone-visuelle-pilotee.md
 *
 * Sidebar sticky droite — image hero d'article + accroche + lien.
 * Pilotée par le moteur Compagnon (intent + profil + signaux).
 * Cohabite avec la barre bottom — palette / typo coordonnées.
 * ===================================================================== */

:root {
  --lf-cv-bg:        #FBFAF5;
  --lf-cv-bg-soft:   #F2EFE7;
  --lf-cv-ink:       #1A2620;
  --lf-cv-title:     #24332A;
  --lf-cv-muted:     #55605A;
  --lf-cv-accent:    #B08867;
  --lf-cv-brand:     #6B7F6C;
  --lf-cv-rule:      #DFDACD;
  --lf-cv-shadow:    0 14px 36px -16px rgba(36, 51, 42, .25);
  --lf-cv-shadow-h:  0 18px 40px -14px rgba(36, 51, 42, .35);
  --lf-cv-radius:    14px;
  --lf-cv-width:     300px;
}

/* ===== Conteneur ===== */
.lf-cv {
  width: 100%;
  max-width: var(--lf-cv-width);
  background: var(--lf-cv-bg);
  border: 1px solid var(--lf-cv-rule);
  border-radius: var(--lf-cv-radius);
  box-shadow: var(--lf-cv-shadow);
  position: relative;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--lf-cv-ink);
  transition: box-shadow .25s ease, transform .25s ease;
}
.lf-cv:hover { box-shadow: var(--lf-cv-shadow-h); transform: translateY(-2px); }

/* ===== Lien englobant (toute la carte cliquable) ===== */
.lf-cv__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.lf-cv__link:hover,
.lf-cv__link:focus { color: inherit; text-decoration: none; }
.lf-cv__link:focus-visible {
  outline: 2px solid var(--lf-cv-accent);
  outline-offset: 2px;
}

/* ===== Image hero ===== */
.lf-cv__image-wrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--lf-cv-bg-soft);
  overflow: hidden;
  position: relative;
}
.lf-cv__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
}
.lf-cv:hover .lf-cv__image { transform: scale(1.04); }
.lf-cv__image--svg { background: var(--lf-cv-title); }

/* ===== Corps du texte ===== */
.lf-cv__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lf-cv__eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lf-cv-accent);
  font-weight: 500;
}
.lf-cv__accroche {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: var(--lf-cv-title);
  margin: 0;
}
.lf-cv__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lf-cv-brand);
  letter-spacing: 0.02em;
}
.lf-cv__cta-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}
.lf-cv:hover .lf-cv__cta-arrow { transform: translateX(3px); }

/* ===== Signature discrète ===== */
.lf-cv__signature {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 10px;
  color: rgba(85, 96, 90, .55);
  letter-spacing: 0.1em;
  pointer-events: none;
}

/* ===== Variantes de format ===== */
.lf-cv--vertical {
  max-width: var(--lf-cv-width);
}
.lf-cv--vertical .lf-cv__image-wrap { aspect-ratio: 3 / 4; }
.lf-cv--vertical .lf-cv__body { padding: 18px 20px 24px; gap: 10px; }
.lf-cv--vertical .lf-cv__accroche { font-size: 18px; }

.lf-cv--compact .lf-cv__image-wrap { aspect-ratio: 2 / 1; }
.lf-cv--compact .lf-cv__body { padding: 12px 14px 16px; gap: 6px; }
.lf-cv--compact .lf-cv__accroche { font-size: 15px; line-height: 1.35; }

/* ===== Format FEATURE : bannière éditoriale pleine largeur =====
 * Layout horizontal grand format (max 1200px), image hero 60% + texte 40% en grid.
 * Pensé pour les footers globaux, les bas de page hubs, les zones éditoriales.
 * Sur mobile : stack vertical (image puis texte) — la carte reste cachée < 768px,
 * mais on prépare la pile pour V3 si on réactive le mobile.
 * ===================================================================== */
.lf-cv--feature {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  background: var(--lf-cv-bg);
  border-radius: var(--lf-cv-radius);
  overflow: hidden;
  box-shadow: var(--lf-cv-shadow);
  position: relative;
}
.lf-cv--feature:hover { box-shadow: var(--lf-cv-shadow-h); transform: translateY(-3px); }

.lf-cv--feature .lf-cv__link {
  display: contents; /* Les enfants directs deviennent items du grid */
}

.lf-cv--feature .lf-cv__image-wrap {
  aspect-ratio: 3 / 2;
  height: 100%;
  width: 100%;
  background: var(--lf-cv-title);
}
.lf-cv--feature .lf-cv__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lf-cv--feature .lf-cv__body {
  padding: 36px 40px 40px;
  gap: 14px;
  justify-content: center;
  display: flex;
  flex-direction: column;
}
.lf-cv--feature .lf-cv__eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.26em;
}
.lf-cv--feature .lf-cv__accroche {
  font-size: 26px;
  line-height: 1.25;
  margin: 0;
}
.lf-cv--feature .lf-cv__cta {
  margin-top: 12px;
  font-size: 14px;
  padding: 10px 0;
}
.lf-cv--feature .lf-cv__cta-arrow {
  width: 16px;
  height: 16px;
}

/* Signature plus discrète, position adaptée */
.lf-cv--feature .lf-cv__signature {
  bottom: 12px;
  right: 20px;
  font-size: 11px;
  color: rgba(85, 96, 90, .4);
}

/* Tablette : pile vertical */
@media (max-width: 1024px) {
  .lf-cv--feature {
    grid-template-columns: 1fr;
  }
  .lf-cv--feature .lf-cv__image-wrap {
    aspect-ratio: 16 / 9;
  }
  .lf-cv--feature .lf-cv__body {
    padding: 28px 32px 32px;
  }
  .lf-cv--feature .lf-cv__accroche {
    font-size: 22px;
  }
}

/* Mobile : conservé display:none comme les autres formats
 * (le selector global @media (max-width: 768px) .lf-cv { display: none } prend déjà soin de ça)
 */

/* ===== État fallback (pool vide) ===== */
.lf-cv.is-fallback .lf-cv__eyebrow { color: var(--lf-cv-muted); }
.lf-cv.is-fallback .lf-cv__cta { color: var(--lf-cv-muted); }

/* ===== Sticky sur sidebar (parent doit être un grid avec align-items:start) ===== */
.lf-cv-sticky-host {
  position: -webkit-sticky;
  position: sticky;
  top: var(--lf-cv-sticky-top, 110px);
  align-self: start;
}

/* ===== Animation d'entrée ===== */
.lf-cv {
  opacity: 0;
  transform: translateY(8px);
  animation: lfCvFadeIn .55s cubic-bezier(.22,.61,.36,1) .2s forwards;
}
@keyframes lfCvFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile : zone désactivée (option B doc 08) ===== */
@media (max-width: 768px) {
  .lf-cv { display: none !important; }
}

/* ===== Respect prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .lf-cv,
  .lf-cv__image,
  .lf-cv__cta-arrow {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Dark variant (théorique — pour futur dark mode site) ===== */
@media (prefers-color-scheme: dark) {
  .lf-cv[data-respect-dark="1"] {
    --lf-cv-bg: #1A2620;
    --lf-cv-bg-soft: #24332A;
    --lf-cv-ink: #FBFAF5;
    --lf-cv-title: #FBFAF5;
    --lf-cv-muted: rgba(251,250,245,.65);
    --lf-cv-rule: rgba(251,250,245,.12);
  }
}
