/* Dessin du véhicule (tools/gen/vehicule.py) : états visuels des pièces et pastilles.
   Le JavaScript ne bascule que l'attribut data-state ("g" griffé, "b" bosselé). */

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.car, svg.thumb {
  display: block;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  --vh-g: #0a8fd5;
  --vh-b: #f07f1a;
  --vh-hover: #0079b8;
}
svg.thumb { background: #f4f6f8; }

/* ------------------------------------------------------------ pièces
   L'illustration reste visible : au repos la zone est transparente, une pièce choisie
   reçoit une teinte semi-transparente et son motif (hachures ou pois). */
.part .p-base { fill: transparent; fill-opacity: 1; mix-blend-mode: multiply; transition: fill-opacity .15s ease; }
.part .p-hatch, .part .p-dots { opacity: 0; pointer-events: none; }
.part .p-line { stroke: transparent; stroke-width: 1px; }

.part[data-state="g"] .p-base { fill: var(--vh-g); fill-opacity: .82; }
.part[data-state="g"] .p-hatch { opacity: 1; }
.part[data-state="b"] .p-base { fill: var(--vh-b); fill-opacity: .9; }
.part[data-state="b"] .p-dots { opacity: 1; }
.part[data-state] .p-line { stroke: rgba(11, 26, 41, .55); stroke-width: 2px; }

.viewer .part { cursor: pointer; }
.viewer .part:focus { outline: none; }
@media (hover: hover) {
  .viewer .part:not([data-state]):hover .p-base,
  .viewer .part.is-hover:not([data-state]) .p-base { fill: var(--vh-hover); fill-opacity: .22; }
  /* Contour masqué comme la teinte : seule sa moitié intérieure reste, d'où le trait doublé. */
  .viewer .part:hover .p-line, .viewer .part.is-hover .p-line { stroke: var(--vh-g); stroke-width: 3.2px; }
  .viewer .part[data-state]:hover .p-base, .viewer .part.is-hover[data-state] .p-base { fill-opacity: .96; }
}
.viewer .part:not([data-state]):focus-visible .p-base { fill: var(--vh-hover); fill-opacity: .16; }
.viewer .part[data-state]:focus-visible .p-base { fill-opacity: .96; }
.viewer .part:focus-visible .p-line { stroke: #0b1a29; stroke-width: 5px; }

/* ------------------------------------------------------------ pastilles */
.pin { cursor: pointer; }
.pin .pin-hit { fill: transparent; }
.pin .pin-bg { fill: #fff; stroke: #59616a; stroke-width: 1.2; transition: fill .15s ease; }
.pin .pin-plus { stroke: #1b1f23; }
.pin .pin-check { opacity: 0; }
.pin[data-state] .pin-plus { opacity: 0; }
.pin[data-state] .pin-check { opacity: 1; }
.pin[data-state] .pin-bg { stroke: #fff; stroke-width: 1.6; }
.pin[data-state="g"] .pin-bg { fill: var(--vh-g, #0079b8); }
.pin[data-state="b"] .pin-bg { fill: var(--vh-b, #d9661a); }
@media (hover: hover) {
  .viewer .pin:hover .pin-bg { stroke: #0079b8; stroke-width: 1.8; }
  .viewer .pin[data-state]:hover .pin-bg { stroke: #fff; }
}
.viewer .pin:focus { outline: none; }
.viewer .pin:focus-visible .pin-bg { stroke: #0b1a29; stroke-width: 2.6; }

@media print {
  .pin:not([data-state]) { display: none; }
  .part .p-base { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .part .p-base, .pin .pin-bg { transition: none; }
}

/* Petit écran : pastilles agrandies (la zone de touche reste bornée à la pièce). */
@media (max-width: 640px) {
  svg.car .pin > :not(.pin-hit):not(title) { transform: scale(1.45); }
}
