/* Média partagé : image validée en priorité, sinon illustration SVG locale du type. */
.entity-media { --media-ink:var(--teal); position:relative; display:block; flex:none; width:82px; height:76px; overflow:hidden; border:1px solid var(--line); background:var(--header); color:var(--media-ink); }
.entity-media img { display:block; width:100%; height:100%; object-fit:cover; }
.entity-media.is-fallback { background:color-mix(in srgb,var(--surface) 76%,var(--teal) 24%); border-color:var(--line); }
.entity-media.is-fallback img { object-fit:cover; object-position:center; }
.entity-media.fit-contain img { padding:6px; }
.entity-media--hero { width:170px; height:118px; }
.entity-media--hero.entity-media--character { width:126px; height:148px; }
.entity-media--hero.entity-media--character.has-image { width:170px; height:210px; }
.entity-media--hero.entity-media--place { width:220px; height:125px; }
.entity-media--graph { width:74px; height:68px; float:right; margin:0 0 8px 12px; }
.entity-card { display:flex; align-items:center; gap:13px; min-width:0; min-height:94px; padding:8px; border:1px solid var(--line); background:var(--surface); color:var(--ink); text-decoration:none; }
.entity-card:hover,.entity-card:focus-visible { border-color:var(--teal); background:var(--inset); }
.entity-card-body { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; }
.entity-card-type { color:var(--muted); font-size:9px; font-weight:600; letter-spacing:.075em; text-transform:uppercase; }
.entity-card strong { max-width:100%; font:normal 19px/1.23 'Palatino Linotype',Georgia,serif; overflow-wrap:anywhere; }
.entity-card-secondary { max-width:100%; color:var(--muted); font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
.entity-card--compact { min-height:70px; padding:6px; gap:10px; }
.entity-card--compact .entity-media { width:55px; height:56px; }
.entity-card--compact strong { font-size:16px; }
.entity-card--compact .entity-card-type { font-size:9px; }
.entity-card .entity-media.is-fallback { align-self:stretch; width:94px; height:auto; min-height:92px; margin:-8px 0 -8px -8px; border:0; border-right:1px solid var(--line); }
.entity-card--compact .entity-media.is-fallback { width:68px; min-height:68px; margin:-6px 0 -6px -6px; }
.entity-media--hero.is-fallback { border:0; }
.entity-media--hero.is-fallback::after { content:"Non illustré"; position:absolute; right:8px; bottom:6px; color:var(--muted); font-size:9px; letter-spacing:.08em; text-transform:uppercase; opacity:.8; }
.entity-media--graph.is-fallback { border:0; }
.entry-heading .entity-media { order:2; }
.entry-search-results .entity-card { height:100%; }
.entry-link-grid .entity-card { height:100%; min-height:82px; }
@media(max-width:700px) {
  .entity-media--hero { width:100px; height:90px; }
  .entity-media--hero.entity-media--character { width:82px; height:102px; }
  .entity-media--hero.entity-media--character.has-image { width:110px; height:142px; }
  .entity-media--hero.entity-media--place { width:114px; height:90px; }
  .entity-card { min-height:78px; }
  .entity-card .entity-media { width:62px; height:62px; }
  .entity-card strong { font-size:17px; }
  .entity-card--compact .entity-media { width:51px; height:52px; }
  .entity-card .entity-media.is-fallback { width:72px; min-height:76px; }
  .entity-card--compact .entity-media.is-fallback { width:58px; min-height:68px; }
  .entity-media--hero.is-fallback::after { font-size:8px; right:5px; bottom:3px; }
}
