/* Massa Motors — editorial company map. Scoped to .cm-* only. */
#company-map {
  --cm-paper: #f4f0e8;
  --cm-ink: #202623;
  --cm-accent: #a62d2d;
  --cm-line: #d7d0c6;
  width: 100%;
  height: clamp(280px, 43vh, 420px);
  max-height: 430px;
  font-family: 'Outfit', sans-serif;
  color: var(--cm-ink);
}
.cm-canvas { position: relative; width: 100%; height: 100%; isolation: isolate; }
.cm-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.cm-link { fill: none; stroke: var(--cm-line); stroke-width: 1.4; vector-effect: non-scaling-stroke; transition: stroke .25s ease, stroke-width .25s ease; }
.cm-link.cm-selected { stroke: var(--cm-accent); stroke-width: 2; }
.cm-core { position: absolute; left: 35%; top: 26%; width: 30%; height: 43%; margin: 0; background: var(--cm-paper); border: 1px solid var(--cm-line); z-index: 1; overflow: hidden; }
.cm-core img { display: block; width: 100%; height: 76%; object-fit: cover; object-position: center 38%; filter: saturate(.7); }
.cm-core figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 24%; padding: 0 12px; border-top: 2px solid var(--cm-accent); background: var(--cm-paper); }
.cm-core strong { font-size: clamp(11px, 1.15vw, 16px); font-weight: 650; letter-spacing: -.025em; white-space: nowrap; }
.cm-core small { font-size: clamp(9px, .8vw, 11px); color: #665f58; text-align: right; line-height: 1.1; }
.cm-node { position: absolute; display: grid; grid-template-columns: 18px 1fr 12px; align-items: center; column-gap: 8px; height: 18%; width: 24%; margin: 0; padding: 10px 13px; border: 1px solid var(--cm-line); border-radius: 0; background: #fbf9f4; color: var(--cm-ink); box-shadow: none; text-align: left; font: inherit; cursor: pointer; z-index: 2; transition: background .2s ease, color .2s ease, border-color .2s ease; -webkit-tap-highlight-color: transparent; }
.cm-node:hover { border-color: var(--cm-accent); background: #eee5db; }
.cm-node:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 4px; }
.cm-node.cm-selected { background: var(--cm-accent); border-color: var(--cm-accent); color: #fffaf2; }
.cm-index { align-self: start; padding-top: 3px; color: var(--cm-accent); font-size: 10px; font-weight: 500; letter-spacing: .02em; }
.cm-node.cm-selected .cm-index, .cm-node.cm-selected .cm-copy small { color: #fff5eb; }
.cm-copy { display: grid; gap: 4px; min-width: 0; }
.cm-copy strong { font-size: clamp(12px, 1.4vw, 19px); line-height: 1.05; font-weight: 550; letter-spacing: -.025em; }
.cm-copy small { font-size: clamp(10px, .93vw, 12px); line-height: 1.1; color: #6b635b; }
.cm-arrow { align-self: center; font-size: 14px; line-height: 1; }
.cm-node[data-area='direzione'] { top: 0; left: 38%; width: 24%; height: 17%; }
.cm-node[data-area='ricerca'] { top: 25%; left: 0; }
.cm-node[data-area='commerciale'] { top: 25%; right: 0; }
.cm-node[data-area='marketing'] { top: 59%; left: 0; }
.cm-node[data-area='operazioni'] { top: 59%; right: 0; }
.cm-node[data-area='economia'] { bottom: 0; left: 24%; width: 24%; height: 17%; }
.cm-node[data-area='digitale'] { bottom: 0; right: 24%; width: 24%; height: 17%; }
.cm-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Compact form keeps the same centre and relationships; labels remain touch sized. */
#company-map[data-layout='compact'] { height: 390px; min-height: 390px; max-height: none; }
#company-map[data-layout='compact'] .cm-core { left: 24%; top: 17%; width: 52%; height: 25%; }
#company-map[data-layout='compact'] .cm-core img { height: 72%; }
#company-map[data-layout='compact'] .cm-core figcaption { height: 28%; padding: 0 8px; }
#company-map[data-layout='compact'] .cm-core strong { font-size: 11px; }
#company-map[data-layout='compact'] .cm-core small { display: none; }
#company-map[data-layout='compact'] .cm-node { width: 46%; height: 14%; grid-template-columns: 12px 1fr 10px; gap: 5px; padding: 8px 9px; }
#company-map[data-layout='compact'] .cm-copy strong { font-size: clamp(12px, 3.5vw, 14px); line-height: 1.05; }
#company-map[data-layout='compact'] .cm-copy small { font-size: 10px; }
#company-map[data-layout='compact'] .cm-index { font-size: 9px; padding-top: 2px; }
#company-map[data-layout='compact'] .cm-arrow { font-size: 12px; }
#company-map[data-layout='compact'] .cm-node[data-area='direzione'] { top: 0; left: 25%; width: 50%; height: 13%; }
#company-map[data-layout='compact'] .cm-node[data-area='ricerca'] { top: 48%; left: 0; right: auto; }
#company-map[data-layout='compact'] .cm-node[data-area='commerciale'] { top: 48%; right: 0; left: auto; }
#company-map[data-layout='compact'] .cm-node[data-area='marketing'] { top: 67%; left: 0; right: auto; }
#company-map[data-layout='compact'] .cm-node[data-area='operazioni'] { top: 67%; right: 0; left: auto; }
#company-map[data-layout='compact'] .cm-node[data-area='economia'] { top: 86%; bottom: auto; left: 0; right: auto; }
#company-map[data-layout='compact'] .cm-node[data-area='digitale'] { top: 86%; bottom: auto; right: 0; left: auto; }
#company-map[data-density='tight'] .cm-node { grid-template-columns: 1fr; }
#company-map[data-density='tight'] .cm-index, #company-map[data-density='tight'] .cm-arrow { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cm-node, .cm-link { transition: none; }
}
