/* =========================
   _code-extras.css
   Code blocks: no background, only left hairline
   ========================= */

/* 1) Variabili globali: sfondo e bordo trasparenti */
:root,
body,
.quarto-light,
.quarto-dark {
  --bs-font-monospace: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                       "Liberation Mono", "DejaVu Sans Mono", monospace;
  --quarto-font-monospace: var(--bs-font-monospace);
  --bs-code-bg: transparent;
  --quarto-inline-code-bg: transparent;
  --quarto-code-block-bg: transparent;
  --quarto-code-block-border-color: transparent;
  --quarto-code-block-border-radius: 0;
  --quarto-code-bg: transparent;
}

/* 2) Togli sfondo/bordi a TUTTI i wrapper */
.code-with-copy,
.code-with-filename,
.code-with-copy .sourceCode,
.code-with-filename .sourceCode,
div.sourceCode,
pre.sourceCode,
pre.sourceCode > code,
.cell-output pre,
pre,
code {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0 !important;
}

/* 3) Riattiva SOLO la hairline sul <pre> sorgente */
pre.sourceCode,
pre.code-with-copy-target {
  border-left: 2px solid #00000026 !important; /* nero al ~15% */
  padding-left: 0.85rem;
  margin: 1rem 0;
  overflow-x: auto;
}

/* 4) Inline code sobrio */
p code, li code, figcaption code, dd code {
  background: transparent !important;
  border: none !important;
  padding: 0 0.1em;
}

/* 5) Monospazio = Fira Code con legature */
pre.sourceCode,
code,
kbd,
samp {
  font-family: var(--bs-font-monospace) !important;
  font-feature-settings: "calt" 1, "liga" 1;
  font-variant-ligatures: contextual common-ligatures;
  font-size: 0.94em;
  line-height: 1.5;
}

/* 6) Numeri di riga (se attivi) discreti */
pre.numberSource .sourceLine::before { color: #00000059; }


/* Hairline appena più tenue su display densi */
@media (min-resolution: 2dppx) {
  pre.sourceCode, pre.code-with-copy-target {
    border-left-color: #0000001f !important;
  }
}

/* Allinea il bordo del codice alla colonna del testo */
pre.sourceCode, pre.code-with-copy-target {
  padding-left: 0.9rem; /* armonizza con blockquote */
}


/* Tab width uniforme (codice più “a stampa”) */
pre.sourceCode, pre.code-with-copy-target, code {
  tab-size: 4;
}

/* Hairline: usa currentColor e adatta al dark mode */
pre.sourceCode, pre.code-with-copy-target {
  border-left: 2px solid color-mix(in srgb, currentColor 16%, transparent) !important;
}

/* Numeri riga leggermente più leggibili ma discreti */
pre.numberSource .sourceLine::before {
  color: color-mix(in srgb, currentColor 45%, transparent);
}


/* _code-extras.css - aggiornamenti */

/* Bordo più sottile e ornamentale */
pre.sourceCode,
pre.code-with-copy-target {
  border-left: 3px solid color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 0 3px 3px 0;
  padding-left: 1rem;
  margin: 1.618rem 0;
  position: relative;
}

/* Etichetta di linguaggio ornamentale */
.code-with-filename .code-filename {
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: color-mix(in srgb, currentColor 70%, transparent);
  font-variant-caps: small-caps;
  letter-spacing: 0.5px;
  font-size: 0.8em;
  border-radius: 3px 3px 0 0;
  border: none;
}

/* Claude */

pre.sourceCode {
  border-left: 4px solid color-mix(in srgb, currentColor 15%, #8B4513);
  background: color-mix(in srgb, currentColor 2%, transparent);
}

.code-with-filename .code-filename {
  background: color-mix(in srgb, currentColor 8%, #8B4513);
  color: #fdfcf8;
  font-variant: small-caps;
}


