/* ==================================================================
    REPL HELP BLOCKS
================================================================== */

.repl-help {
    background-color: lightgray;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 1px;
    padding-bottom: 1px;
    border-radius: 10px;
    margin-bottom: 1em;
  }
  
  .repl-help h1,h2,h3 {
    font-size: 1em;
    font-weight: 500;
  }

/* ==================================================================
    BADGES
================================================================== */

.im-badge {text-align: center;}
.im-badge img {
    height: 1em;
    object-fit: scale-down;
}

/* Custom CSS required to display the docs|stable badge on the landing page */
img[alt=badge] {
  height: 1em;
  width: auto;
  display: inline;
  margin: 0;
  padding: 0 0.5ex;
}

/* ==================================================================
    Admonitions
================================================================== */

.tldr {
  background-color: rgba(34, 139, 34, 0.291);
  border-radius: 10px;
  padding: 0.5em;
  margin-bottom: 1em;
}

.tldr p {
  margin-bottom: 0em;
}

.advanced {
  background: #334acb7a;
  border-radius: 10px;
  padding: 0.5em;
  margin-bottom: 1em;
}

.warning {
  background: #cb33337a;
  border-radius: 10px;
  padding: 0.5em;
  margin-bottom: 1em;
}

.vscode {
  background-color: #9558b248;
  border-radius: 10px;
  padding: 0.5em;
  margin-bottom: 1em;
}

.construction {
  background-color: rgba(255, 165, 0, 0.35);
  border-left: 4px solid #ff8c00;
  border-radius: 10px;
  padding: 0.75em;
  margin-bottom: 1em;
}

.construction p {
  margin-bottom: 0em;
}

.construction-tag {
  font-size: 0.8em;
  opacity: 0.7;
  margin-left: 0.25em;
}


/* ==================================================================
    HIDE REPL RESULTS (per-page toggle)
================================================================== */

/* Activated when a page sets `hide_repl_results = true` in its frontmatter.
   The wrapping <span class="repl-result"> is added at runtime by the JS in
   `_layout/foot_highlight.html`. Prompt lines stay visible. */
body.hide-repl-results pre code.julia-repl .repl-result,
body.hide-repl-results pre code.julia-repl-pkg .repl-result,
body.hide-repl-results pre code.julia-repl-help .repl-result,
body.hide-repl-results pre code.julia-repl-shell .repl-result,
body.hide-repl-results pre code.language-julia-repl .repl-result {
  display: none;
}

/* Floating button injected by foot_highlight.html */
.repl-toggle-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c9d1d9;
  background-color: #27303c;
  border: 1px solid #444c56;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background-color 0.15s ease-in-out;
}
.repl-toggle-btn:hover {
  background-color: #3a4453;
}
.repl-toggle-btn[aria-pressed="true"] {
  color: #7ee787;
  border-color: #2ea043;
}

/* ==================================================================
    WIDE IMAGES
================================================================== */

/* Use the full content-column width (overrides the default 70% for img)
   so dense figures stay legible without breaking the page layout. */
.franklin-content .img-wide img {
  width: 100%;
  padding-left: 0;
  display: block;
}

/* ==================================================================
    HLJS CODE BLOCKS
================================================================== */

.hljs {
  position: relative;
  font-size: var(--small);
  line-height: 1.35em;
  border-radius: 10px;
}

.hljs-meta { font-weight: bold;}

/* Use colors from theme specified in style.html */
.hljs-meta.prompt_ {color: #7ee787;}
.hljs-meta.help_ {color: #f2cc60;}
.hljs-meta.shell_ {color: #ff7b72;}
.hljs-meta.infiltrator_ {color: #ffa657;}
.hljs-meta.debugger_ {color: #ffa657;}
.hljs-meta.debuggereval_ {color: #ffa657;}

/* ANSI sgr* spans emitted by Xranklin inside REPL blocks (we keep its
   markup instead of letting hljs reflow the block). These mirror the
   prompt colors above plus a few extras for Pkg's output. */
pre code .sgr1  { font-weight: bold; }
pre code .sgr31 { color: #ff7b72; }            /* red — shell prompt */
pre code .sgr32 { color: #7ee787; }            /* green — julia prompt, Pkg "Resolving"/"Updating" */
pre code .sgr33 { color: #f2cc60; }            /* yellow — help prompt */
pre code .sgr34 { color: #79c0ff; }            /* blue — pkg prompt */
pre code .sgr36 { color: #56d4dd; }            /* cyan */
pre code .sgr90 { color: #8b949e; }            /* bright black / gray */
pre code .sgr91 { color: #ff7b72; }            /* bright red — Pkg "- removed" */
pre code .sgr92 { color: #7ee787; }            /* bright green — Pkg "+ added" */
pre code .sgr93 { color: #f2cc60; }            /* bright yellow */
pre code .sgr94 { color: #79c0ff; }            /* bright blue */
pre code .sgr96 { color: #56d4dd; }            /* bright cyan */

/* Add language name to code blocks */
.hljs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.2rem 0.5rem 0.1rem;
  background-color: #27303c; /* brighter than #0d1117 */
  border-bottom-right-radius:10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Define language names shown in code blocks */
.language-bash::before       {content: "Shell";}
.language-toml::before       {content: "TOML";}
.language-ini::before       {content: "TOML";}
.language-julia::before      {content: "Julia";}
/* Special Franklin tags for Julia REPL modes */ 
.language-julia-repl::before {content: "Julia REPL";}
.julia-repl::before          {content: "Julia REPL";}
.julia-repl-pkg::before      {content: "Julia REPL: Pkg mode";}
.julia-repl-help::before     {content: "Julia REPL: Help mode";}
.julia-repl-shell::before    {content: "Julia REPL: Shell mode";}
/* Julia code after REPL prompts doesn't need a language tag */
.language-julia-repl .language-julia::before {content: "";}
.julia-repl          .language-julia::before {content: "";}
.julia-repl-pkg      .language-julia::before {content: "";}
.julia-repl-help     .language-julia::before {content: "";}
.julia-repl-shell    .language-julia::before {content: "";}
/* Julia code in doc strings printed via REPL Help mode is sometimes incorrectly
recognized as Ruby code. Since we don't have any Ruby code in MJW, this is a quick fix.
TODO: remove when not required in Xranklin.
*/
.language-ruby::before {content: "Julia";}

/* ==================================================================
    COPY-TO-CLIPBOARD BUTTON ON CODE BLOCKS
================================================================== */

pre.has-copy-btn {
  position: relative;
}

.copy-code-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: #c9d1d9;
  background-color: #27303c; /* matches the language label background */
  border: 1px solid #444c56;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

pre.has-copy-btn:hover .copy-code-btn,
.copy-code-btn:focus {
  opacity: 1;
}

.copy-code-btn:hover {
  background-color: #3a4453;
}

.copy-code-btn.copied {
  color: #7ee787;
  border-color: #2ea043;
  opacity: 1;
}

/* On touch devices (no hover), keep the button visible. */
@media (hover: none) {
  .copy-code-btn { opacity: 1; }
}

