/* ------------------------------------------------------------------ *
 * rust_learn.css
 * Copy buttons + runnable "Try it" example / output / warning blocks
 * for the Rust tutorial pages. Layered on top of basic-go.css.
 * ------------------------------------------------------------------ */

/* ---- Copy button on every code block ---------------------------- */
.rs-code-wrap { position: relative; }

.rs-copy {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    font: 600 0.72rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.02em;
    color: #eaf0ff;
    background: #1e40af;
    border: 1px solid #3b5bd6;
    border-radius: 6px;
    padding: 0.34rem 0.62rem;
    cursor: pointer;
    opacity: 0.82;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    z-index: 2;
}
.rs-code-wrap:hover .rs-copy,
.rs-copy:focus-visible { opacity: 1; }
.rs-copy:hover { background: #1d4ed8; color: #fff; }
.rs-copy.done { background: #059669; border-color: #059669; color: #fff; opacity: 1; }

/* ---- "Try it" runnable example container ------------------------ */
.rs-run {
    margin: 1.25rem 0 0.5rem;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.85rem 1rem 1rem;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.06);
}

.rs-run-label,
.rs-out-label,
.rs-warn-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font: 700 0.72rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0369a1;
    margin: 0 0 0.35rem;
}
.rs-run-label::before  { content: "\25B6"; font-size: 0.72em; }          /* ▶ */

.rs-out-label  { color: #047857; margin-top: 0.9rem; }
.rs-out-label::before  { content: "\2192"; font-size: 1em; }             /* → */

.rs-warn-label { color: #b45309; margin-top: 0.9rem; }
.rs-warn-label::before { content: "\26A0"; font-size: 0.95em; }          /* ⚠ */

/* ---- Program output box ----------------------------------------- */
pre.rs-output {
    background: #0b1120;
    color: #d1fae5;
    border-left: 3px solid #10b981;
    white-space: pre-wrap;
    margin: 0;
}

/* ---- Compiler-warning box --------------------------------------- */
pre.rs-warn {
    background: #1c1917;
    color: #fde68a;
    border-left: 3px solid #f59e0b;
    white-space: pre-wrap;
    margin: 0;
}
pre.rs-warn .wtag { color: #fca5a5; }   /* the word "warning" */
pre.rs-warn .wok  { color: #86efac; }   /* the program's own output line */

/* The "Try it" example's own <pre> shouldn't carry basic-go's top margin */
.rs-run .rs-code-wrap pre,
.rs-run > pre { margin-top: 0.15rem; }
