/*
 * Argparse/CLI Highlighting Styles
 *
 * Styles for CLI inline roles and argparse help output highlighting.
 * Uses "One Dark" inspired color palette (Python 3.14 argparse style).
 *
 * Color Palette:
 *   Background:    #282C34
 *   Default text:  #CCCED4
 *   Usage label:   #61AFEF (blue, bold)
 *   Program name:  #C678DD (purple, bold)
 *   Subcommands:   #98C379 (green)
 *   Options:       #56B6C2 (teal)
 *   Metavars:      #E5C07B (yellow, italic)
 *   Choices:       #98C379 (green)
 *   Headings:      #E5E5E5 (bright, bold)
 *   Punctuation:   #CCCED4
 */

/* ==========================================================================
   Inline Role Styles
   ========================================================================== */

/*
 * Shared monospace font for all CLI inline roles
 */
.cli-option,
.cli-metavar,
.cli-command,
.cli-default,
.cli-choice {
	font-family: var(--font-stack--monospace);
}

/*
 * CLI Options
 *
 * Long options (--verbose) and short options (-h) both use teal color.
 */
.cli-option-long,
.cli-option-short {
	color: #56b6c2;
}

/*
 * CLI Metavars
 *
 * Placeholder values like FILE, PATH, DIRECTORY.
 * Yellow/amber to indicate "replace me" - distinct from flags (teal).
 */
.cli-metavar {
	color: #e5c07b;
	font-style: italic;
}

/*
 * CLI Commands and Choices
 *
 * Both use green to indicate valid enumerated values.
 * Commands: subcommand names like sync, add, list
 * Choices: enumeration values like json, yaml, table
 */
.cli-command,
.cli-choice {
	color: #98c379;
}

.cli-command {
	font-weight: bold;
}

/*
 * CLI Default Values
 *
 * Default values shown in help text like None, "auto".
 * Subtle styling to not distract from options.
 */
.cli-default {
	color: #ccced4;
	font-style: italic;
}

/* ==========================================================================
   Argparse Code Block Highlighting
   ========================================================================== */

/*
 * These styles apply within Pygments-highlighted code blocks using the
 * argparse, argparse-usage, or argparse-help lexers.
 */

/* Usage heading "usage:" - bold blue */
.highlight-argparse .gh,
.highlight-argparse-usage .gh,
.highlight-argparse-help .gh {
	color: #61afef;
	font-weight: bold;
}

/* Section headers like "positional arguments:", "options:" - neutral bright */
.highlight-argparse .gs,
.highlight-argparse-help .gs {
	color: #e5e5e5;
	font-weight: bold;
}

/* Long options --foo - teal */
.highlight-argparse .nt,
.highlight-argparse-usage .nt,
.highlight-argparse-help .nt {
	color: #56b6c2;
	font-weight: normal;
}

/* Short options -h - teal (same as long) */
.highlight-argparse .na,
.highlight-argparse-usage .na,
.highlight-argparse-help .na {
	color: #56b6c2;
	font-weight: normal;
}

/* Metavar placeholders FILE, PATH - yellow/amber italic */
.highlight-argparse .nv,
.highlight-argparse-usage .nv,
.highlight-argparse-help .nv {
	color: #e5c07b;
	font-style: italic;
}

/* Command/program names - purple bold */
.highlight-argparse .nl,
.highlight-argparse-usage .nl,
.highlight-argparse-help .nl {
	color: #c678dd;
	font-weight: bold;
}

/* Subcommands - bold green */
.highlight-argparse .nf,
.highlight-argparse-usage .nf,
.highlight-argparse-help .nf {
	color: #98c379;
	font-weight: bold;
}

/* Choice values - green */
.highlight-argparse .no,
.highlight-argparse-usage .no,
.highlight-argparse-help .no,
.highlight-argparse .nc,
.highlight-argparse-usage .nc,
.highlight-argparse-help .nc {
	color: #98c379;
}

/* Punctuation [], {}, () - neutral gray */
.highlight-argparse .p,
.highlight-argparse-usage .p,
.highlight-argparse-help .p {
	color: #ccced4;
}

/* Operators like | - neutral gray */
.highlight-argparse .o,
.highlight-argparse-usage .o,
.highlight-argparse-help .o {
	color: #ccced4;
	font-weight: normal;
}

/* ==========================================================================
   Argparse Directive Highlighting (.. argparse:: output)
   ========================================================================== */

/*
 * These styles apply to the argparse directive output which uses custom
 * nodes rendered by sphinx_argparse_neo. The directive adds highlight spans
 * directly to the HTML output.
 */

/*
 * Usage Block (.argparse-usage)
 *
 * The usage block now has both .argparse-usage and .highlight-argparse-usage
 * classes. The .highlight-argparse-usage selectors above already handle the
 * token highlighting. These selectors provide fallback and ensure consistent
 * styling.
 */

/* Usage block container - match Pygments monokai background and code block styling */
pre.argparse-usage {
	background: var(--argparse-code-background);
	padding: 0.625rem 0.875rem;
	line-height: 1.5;
	border-radius: 0.2rem;
	scrollbar-color: var(--color-foreground-border) transparent;
	scrollbar-width: thin;
}

.argparse-usage .gh {
	color: #61afef;
	font-weight: bold;
}

.argparse-usage .nt {
	color: #56b6c2;
	font-weight: normal;
}

.argparse-usage .na {
	color: #56b6c2;
	font-weight: normal;
}

.argparse-usage .nv {
	color: #e5c07b;
	font-style: italic;
}

.argparse-usage .nl {
	color: #c678dd;
	font-weight: bold;
}

.argparse-usage .nf {
	color: #98c379;
	font-weight: bold;
}

.argparse-usage .no,
.argparse-usage .nc {
	color: #98c379;
}

.argparse-usage .o {
	color: #ccced4;
	font-weight: normal;
}

.argparse-usage .p {
	color: #ccced4;
}

/*
 * Argument Name (<dt class="argparse-argument-name">)
 *
 * The argument names in the dl/dt structure are highlighted with
 * semantic spans for options and metavars.
 */
.argparse-argument-name .nt {
	color: #56b6c2;
	font-weight: normal;
}

.argparse-argument-name .na {
	color: #56b6c2;
	font-weight: normal;
}

.argparse-argument-name .nv {
	color: #e5c07b;
	font-style: italic;
}

.argparse-argument-name .nl {
	color: #c678dd;
	font-weight: bold;
}

/* ==========================================================================
   Argument Wrapper and Linking Styles
   ========================================================================== */

/*
 * Argparse-specific code background (monokai #272822)
 * Uses a custom variable to avoid affecting Furo's --color-inline-code-background.
 */
:root {
	--argparse-code-background: #272822;
}

/*
 * Background styling for argument names - subtle background like code.literal
 * This provides visual weight and hierarchy for argument definitions.
 */
.argparse-argument-name {
	background: var(--argparse-code-background);
	border-radius: 0.2rem;
	padding: 0.485rem 0.875rem;
	font-family: var(--font-stack--monospace);
	width: fit-content;
	position: relative;
}

/*
 * Wrapper for linking - enables scroll-margin for fixed header navigation
 * and :target pseudo-class for highlighting when linked.
 */
.argparse-argument-wrapper {
	scroll-margin-top: 2.5rem;
}

/*
 * Headerlink anchor (¶) - hidden until hover
 * Positioned outside the dt element to the right.
 * Follows Sphinx documentation convention for linkable headings.
 */
.argparse-argument-name .headerlink {
	visibility: hidden;
	position: absolute;
	right: -1.5rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--color-foreground-secondary);
	text-decoration: none;
}

/*
 * Show headerlink on hover or when targeted via URL fragment
 */
.argparse-argument-wrapper:hover .headerlink,
.argparse-argument-wrapper:target .headerlink {
	visibility: visible;
}

.argparse-argument-name .headerlink:hover:not(:visited) {
	color: var(--color-foreground-primary);
}

/*
 * Light mode headerlink color overrides
 */
body:not([data-theme="dark"]) .argparse-argument-name .headerlink {
	color: #9ca0a5;

	&:hover:not(:visited) {
		color: #cfd0d0;
	}
}

/*
 * Highlight when targeted via URL fragment
 * Uses Furo's highlight-on-target color for consistency.
 */
.argparse-argument-wrapper:target .argparse-argument-name {
	background-color: var(--color-highlight-on-target);
}

/*
 * Default value styling in metadata
 * Styled like inline code with monokai background.
 */
.argparse-argument-meta .nv {
	background: var(--argparse-code-background);
	border-radius: 0.2rem;
	padding: 0.1405rem 0.3rem;
	font-family: var(--font-stack--monospace);
	font-size: var(--font-size--small);
	color: #e5c07b;
}

/*
 * Help text description
 * Adds spacing above for visual separation from argument name.
 */
.argparse-argument-help {
	padding-block-start: 0.5rem;
}
