:root {
    /* /* --code-font: "Menlo", "Consolas", monospace; */
    --bg-color: #f8f6f6; 
    --text-color: #1f1e1e;
    --border-radius: 6px;
    --padding: 1.5em;
    --linenumber-width: 9.5ch;
    --label-bg: #e8e8e8;
    --label-color: #1f1e1e;
    --highlight: #9678641a;
    --scrollbar-track: #1818181a;
    --scrollbar-thumb: #1d509d40;
}

/* General pre styles */
pre {
  display: block;
  width: 100%;              /* Full width */
  max-width: 100%;         /* Limit max width */
  margin: 2em auto;         /* Center horizontally and space vertically */
  padding: 1em;             /* Internal padding */
  background-color: #f5f5f5;  /* Light background color */
  border-radius: 8px;       /* Rounded corners */
  border: 1px solid #ddd;   /* Border */
  overflow-x: auto;         /* Horizontal scroll if content overflows */
  overflow-y: auto;         /* Vertical scroll if content overflows */
  font-family: 'Fira Code', monospace; /* Monospace font */
  font-size: 0.95em;        /* Font size */
  line-height: 1.5;         /* Line height */
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);  /* Optional shadow */
}

.code {
  position:relative;
  display: flex;
  flex-direction: column; /* Organise les éléments en colonne */
  justify-content: center; /* Centrage vertical */
  align-items: center; /* Centrage horizontal */
  max-width: 90%;
  margin: 0em auto;
  text-align: left; /* Texte à gauche pour le code */

  /* firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.code-caption {
  display: block;
  width: fit-content;
  margin: 0 auto 0.5em auto; /* centre + espace en dessous */
  background: transparent;
  color: black;
  font-style: italic;
  font-family: monospace;
  text-align: center;
  padding: 0.5em 1em;
  border-top-left-radius: 0.3em;
  border-top-right-radius: 0.3em;
  border: none;
}

.code > pre {
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: normal;
}
  
.code pre > code {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: -0.5em 0em 0em -0.5em;
  box-sizing: border-box;
}
  
.language-label {
  position: absolute;
  top: 0.55em;
  right: 0em; 
  font-size: 0.80em; 
  min-width: 3em;
  background-color: transparent;
  color: #1f1e1e;
  padding: 3px 10px;
  border-radius: 5px;
  z-index: 2;
  width: auto;
  text-align: left;
}

/* this handle the copy button on top right */
.code-btn-clipboard {
  position: absolute;
  top: 0.8em;
  right: 6em;
  font-size: 0.75em;
  background: url(../images/assets/cp.svg) no-repeat left center;
  background-size: 1em 1em; 
  color: #333;
  border: thin;
  padding: 0.3em 0.6em;
  border-radius: 6px;
  cursor: pointer;
  z-index: 3;
}

.code-btn-clipboard::before {
  content: "copy";
  font-size: 1em;
  color: #333;
  margin-left: 1.2em;  /* space between image and text */
}

.code-btn-clipboard.-done::after {
  content: "✔ Copied";
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  background: #eee;
  color: #000;
  padding: 2px 6px;
  font-size: 0.85em;
  border-radius: 5px;
  white-space: nowrap;
}

/* Handling lines numbers */
.code pre.line-numbers {
  position: relative;
  padding-left: var(--linenumber-width);
}


.line-numbers .line-numbers-rows {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0;
  margin: 0;
  text-align: right;  
  font-size: 0.9em;  
  color: #888;  
  user-select: none;
}

.line-numbers .line-numbers-rows span {
  display: block;  /* each number on its line */
}

/* Prism minimal theme */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #72a2d3;
}
.token.punctuation {
    color: #5f5f5f;
}
.token.tag,
.token.constant,
.token.symbol,
.token.deleted,
.token.boolean,
.token.number {
    color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #407b08;
}

.token.docstring,
.token.string.triple-quoted-string {
    color: #ff6347;  /* docstrings */
}

.token.operator,
.token.atrule,
.token.keyword,
.token.entity,
.token.url,
.token.attr-value {
    color: #c72c4c;
}
.token.function {
    color: #07a;
}
.token.regex,
.token.important,
.token.variable {
    color: #f18106;
}
.token.bold {
    font-weight: bold;
}
.token.italic {
    font-style: italic;
}
  