/* Pygments GitHub Dark Theme with Copy Button */

/* ============================================
   COLOR PALETTE - Easy Configuration
   ============================================ */
:root {
    /* Background Colors */
    --bg-primary: #141414;
    --bg-code: #141414;
    --bg-code-inline: #1a1a1a;
    --bg-hover: #2d2d2d;
    
    /* Text Colors */
    --text-primary: #c9c9c9;
    --text-muted: #a0a0a0;
    --text-code: #e6edf3;
    --text-bright: #ffffff;
    
    /* Border Colors */
    --border-primary: #3e3e3e;
    --border-code: #3e3e3e;
    --border-subtle: #2a2a2a;
    
    /* Accent Colors */
    --accent-red: #ff6b6b;
    --accent-cyan: #4ec9b0;
    --accent-blue: #569cd6;
    --accent-green: #238636;
    
    /* Syntax Highlighting */
    --syntax-comment: #8b949e;
    --syntax-keyword: #ff7b72;
    --syntax-string: #a5d6ff;
    --syntax-function: #d2a8ff;
    --syntax-class: #f0883e;
    --syntax-number: #a5d6ff;
    --syntax-tag: #7ee787;
    --syntax-constant: #79c0ff;
}

/* Code block container */
pre { 
    line-height: 125%; 
    margin-top: 1rem; 
    margin-bottom: 1rem; 
}

/* Line numbers styling */
td.linenos .normal { 
    color: var(--text-muted); 
    background-color: var(--bg-code); 
    padding-left: 5px; 
    padding-right: 5px; 
}

span.linenos { 
    color: var(--text-muted); 
    background-color: var(--bg-code); 
    padding-left: 5px; 
    padding-right: 5px; 
}

td.linenos .special { 
    color: #e6edf3; 
    background-color: #6e7681; 
    padding-left: 5px; 
    padding-right: 5px; 
}

span.linenos.special { 
    color: #e6edf3; 
    background-color: #6e7681; 
    padding-left: 5px; 
    padding-right: 5px; 
}

/* Code highlight container */
.codehilite .hll { 
    background-color: #6e7681; 
}

.codehilite { 
    background-color: var(--bg-code);
    color: var(--text-code); 
    padding: 1rem; 
    border-radius: 0.375rem; 
    overflow-x: auto;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(78, 201, 176, 0.15);
    position: relative;
    margin-top: 1rem; 
    margin-bottom: 1rem; 
    border: 1px solid var(--border-code);
}

/* Syntax highlighting colors - GitHub Dark theme */
.codehilite .c { color: var(--syntax-comment); font-style: italic; } /* Comment */
.codehilite .err { color: #f85149; } /* Error */
.codehilite .esc { color: var(--text-code); } /* Escape */
.codehilite .g { color: var(--text-code); } /* Generic */
.codehilite .k { color: var(--syntax-keyword); } /* Keyword */
.codehilite .l { color: var(--syntax-string); } /* Literal */
.codehilite .n { color: var(--text-code); } /* Name */
.codehilite .o { color: #ff7b72; font-weight: bold; } /* Operator */
.codehilite .x { color: #e6edf3; } /* Other */
.codehilite .p { color: #e6edf3; } /* Punctuation */
.codehilite .ch { color: #8b949e; font-style: italic; } /* Comment.Hashbang */
.codehilite .cm { color: #8b949e; font-style: italic; } /* Comment.Multiline */
.codehilite .cp { color: #8b949e; font-weight: bold; font-style: italic; } /* Comment.Preproc */
.codehilite .cpf { color: #8b949e; font-style: italic; } /* Comment.PreprocFile */
.codehilite .c1 { color: #8b949e; font-style: italic; } /* Comment.Single */
.codehilite .cs { color: #8b949e; font-weight: bold; font-style: italic; } /* Comment.Special */
.codehilite .gd { color: #ffa198; background-color: #490202; } /* Generic.Deleted */
.codehilite .ge { color: #e6edf3; font-style: italic; } /* Generic.Emph */
.codehilite .ges { color: #e6edf3; font-weight: bold; font-style: italic; } /* Generic.EmphStrong */
.codehilite .gr { color: #ffa198; } /* Generic.Error */
.codehilite .gh { color: #79c0ff; font-weight: bold; } /* Generic.Heading */
.codehilite .gi { color: #56d364; background-color: #0f5323; } /* Generic.Inserted */
.codehilite .go { color: #8b949e; } /* Generic.Output */
.codehilite .gp { color: #8b949e; } /* Generic.Prompt */
.codehilite .gs { color: #e6edf3; font-weight: bold; } /* Generic.Strong */
.codehilite .gu { color: #79c0ff; } /* Generic.Subheading */
.codehilite .gt { color: #ff7b72; } /* Generic.Traceback */
.codehilite .g-Underline { color: #e6edf3; text-decoration: underline; } /* Generic.Underline */
.codehilite .kc { color: #79c0ff; } /* Keyword.Constant */
.codehilite .kd { color: #ff7b72; } /* Keyword.Declaration */
.codehilite .kn { color: #ff7b72; } /* Keyword.Namespace */
.codehilite .kp { color: #79c0ff; } /* Keyword.Pseudo */
.codehilite .kr { color: #ff7b72; } /* Keyword.Reserved */
.codehilite .kt { color: #ff7b72; } /* Keyword.Type */
.codehilite .ld { color: #79c0ff; } /* Literal.Date */
.codehilite .m { color: #a5d6ff; } /* Literal.Number */
.codehilite .s { color: #a5d6ff; } /* Literal.String */
.codehilite .na { color: #e6edf3; } /* Name.Attribute */
.codehilite .nb { color: #e6edf3; } /* Name.Builtin */
.codehilite .nc { color: #f0883e; font-weight: bold; } /* Name.Class */
.codehilite .no { color: #79c0ff; font-weight: bold; } /* Name.Constant */
.codehilite .nd { color: #d2a8ff; font-weight: bold; } /* Name.Decorator */
.codehilite .ni { color: #ffa657; } /* Name.Entity */
.codehilite .ne { color: #f0883e; font-weight: bold; } /* Name.Exception */
.codehilite .nf { color: #d2a8ff; font-weight: bold; } /* Name.Function */
.codehilite .nl { color: #79c0ff; font-weight: bold; } /* Name.Label */
.codehilite .nn { color: #ff7b72; } /* Name.Namespace */
.codehilite .nx { color: #e6edf3; } /* Name.Other */
.codehilite .py { color: #79c0ff; } /* Name.Property */
.codehilite .nt { color: #7ee787; } /* Name.Tag */
.codehilite .nv { color: #79c0ff; } /* Name.Variable */
.codehilite .ow { color: #ff7b72; font-weight: bold; } /* Operator.Word */
.codehilite .pm { color: #e6edf3; } /* Punctuation.Marker */
.codehilite .w { color: #6e7681; } /* Text.Whitespace */
.codehilite .mb { color: #a5d6ff; } /* Literal.Number.Bin */
.codehilite .mf { color: #a5d6ff; } /* Literal.Number.Float */
.codehilite .mh { color: #a5d6ff; } /* Literal.Number.Hex */
.codehilite .mi { color: #a5d6ff; } /* Literal.Number.Integer */
.codehilite .mo { color: #a5d6ff; } /* Literal.Number.Oct */
.codehilite .sa { color: #79c0ff; } /* Literal.String.Affix */
.codehilite .sb { color: #a5d6ff; } /* Literal.String.Backtick */
.codehilite .sc { color: #a5d6ff; } /* Literal.String.Char */
.codehilite .dl { color: #79c0ff; } /* Literal.String.Delimiter */
.codehilite .sd { color: #a5d6ff; } /* Literal.String.Doc */
.codehilite .s2 { color: #a5d6ff; } /* Literal.String.Double */
.codehilite .se { color: #79c0ff; } /* Literal.String.Escape */
.codehilite .sh { color: #79c0ff; } /* Literal.String.Heredoc */
.codehilite .si { color: #a5d6ff; } /* Literal.String.Interpol */
.codehilite .sx { color: #a5d6ff; } /* Literal.String.Other */
.codehilite .sr { color: #79c0ff; } /* Literal.String.Regex */
.codehilite .s1 { color: #a5d6ff; } /* Literal.String.Single */
.codehilite .ss { color: #a5d6ff; } /* Literal.String.Symbol */
.codehilite .bp { color: #e6edf3; } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #d2a8ff; font-weight: bold; } /* Name.Function.Magic */
.codehilite .vc { color: #79c0ff; } /* Name.Variable.Class */
.codehilite .vg { color: #79c0ff; } /* Name.Variable.Global */
.codehilite .vi { color: #79c0ff; } /* Name.Variable.Instance */
.codehilite .vm { color: #79c0ff; } /* Name.Variable.Magic */
.codehilite .il { color: #a5d6ff; } /* Literal.Number.Integer.Long */

/* Copy button styling - First instance (keep this one) */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    display: none;
}

@media (min-width: 768px) {
    .copy-button {
        display: block;
    }
}

.codehilite:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background-color: var(--border-primary);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button.copied {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--text-bright);
}

/* Markdown article styling */
article h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

article h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

article a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-decoration-color: var(--border-primary);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

article a:hover {
    color: var(--accent-blue);
    text-decoration-color: var(--accent-blue);
}

article p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
    color: var(--text-primary);
}

article ul, article ol {
    margin-left: 1.75rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

article li {
    margin-bottom: 0.625rem;
    line-height: 1.75;
}

article blockquote {
    border-left: 4px solid var(--accent-red);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.75;
}

article code:not(.codehilite code) {
    background-color: var(--bg-code-inline);
    color: var(--accent-cyan);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    border: 1px solid var(--border-subtle);
    font-weight: 500;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

article th, article td {
    border: 1px solid var(--border-primary);
    padding: 0.75rem;
    text-align: left;
}

article th {
    background-color: var(--bg-hover);
    font-weight: 600;
    color: var(--text-bright);
}

article img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-subtle);
}
