/* ============================================
   Consultant Portfolio – Custom Styles
   ============================================ */

/* --- Rouge Syntax Highlighting (Dark Theme) --- */

/* Outer wrapper generated by Jekyll/Rouge */
.highlighter-rouge {
  margin: 1.5rem 0;
}

.highlighter-rouge .highlight,
.highlight {
  background: #0f172a !important;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
}

.highlighter-rouge pre,
.highlight pre {
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: #e2e8f0;
}

.highlighter-rouge pre code,
.highlight pre code {
  background: transparent !important;
  padding: 0;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: inherit;
}

/* Inline code (not inside highlight blocks) */
:not(pre) > code {
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.85em;
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
}

/* --- Token Colors (high specificity to override Tailwind preflight) --- */

/* Comments */
.highlight pre code .c,
.highlight pre code .c1,
.highlight pre code .cm,
.highlight pre code .cs,
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs   { color: #64748b !important; font-style: italic; }

/* Keywords (def, val, var, import, class, trait, object, if, else, for, yield, match, case) */
.highlight pre code .k,
.highlight pre code .kd,
.highlight pre code .kn,
.highlight pre code .kp,
.highlight pre code .kr,
.highlight pre code .kt,
.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt   { color: #c084fc !important; }

/* Strings */
.highlight pre code .s,
.highlight pre code .s1,
.highlight pre code .s2,
.highlight pre code .sb,
.highlight pre code .sc,
.highlight pre code .sh,
.highlight pre code .sx,
.highlight pre code .dl,
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sh,
.highlight .sx,
.highlight .dl   { color: #34d399 !important; }

/* Numbers */
.highlight pre code .mi,
.highlight pre code .mf,
.highlight pre code .mh,
.highlight pre code .mo,
.highlight pre code .il,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .il   { color: #f97316 !important; }

/* Attributes */
.highlight pre code .na,
.highlight .na   { color: #22d3ee !important; }

/* Class names, module/namespace names */
.highlight pre code .nc,
.highlight pre code .nn,
.highlight .nc,
.highlight .nn   { color: #22d3ee !important; }

/* Function/method names */
.highlight pre code .nf,
.highlight pre code .fm,
.highlight .nf,
.highlight .fm   { color: #60a5fa !important; }

/* Operators (+, -, =, =>, <-, ::) */
.highlight pre code .o,
.highlight pre code .ow,
.highlight .o,
.highlight .ow   { color: #f472b6 !important; }

/* Punctuation (braces, parens, brackets, commas) */
.highlight pre code .p,
.highlight .p    { color: #94a3b8 !important; }

/* Names, variables, identifiers (default text) */
.highlight pre code .n,
.highlight pre code .nb,
.highlight pre code .ni,
.highlight pre code .nv,
.highlight pre code .bp,
.highlight .n,
.highlight .nb,
.highlight .ni,
.highlight .nv,
.highlight .bp   { color: #e2e8f0 !important; }

/* Errors */
.highlight pre code .err,
.highlight .err  { color: #f87171 !important; background: transparent !important; }

/* --- Shell/Bash specific --- */

/* Shell built-ins and commands */
.highlight pre code .nb,
.highlight .nb   { color: #60a5fa !important; }

/* Shell variables ($VAR) */
.highlight pre code .nv,
.highlight .nv   { color: #22d3ee !important; }

/* --- SQL specific --- */

/* SQL keywords (SELECT, FROM, WHERE, etc.) are covered by .k rules above */

/* SQL function names */
.highlight pre code .n + .p,
.highlight .nf   { color: #60a5fa !important; }

/* --- Language label for code blocks --- */
.highlighter-rouge::before {
  content: attr(data-lang);
}

.language-scala .highlight::before { content: "scala"; }
.language-sql .highlight::before { content: "sql"; }
.language-bash .highlight::before,
.language-shell .highlight::before { content: "bash"; }

.highlighter-rouge .highlight::before,
.language-scala .highlight::before,
.language-sql .highlight::before,
.language-bash .highlight::before,
.language-shell .highlight::before {
  display: block;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #475569;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Scrollbar styling for code blocks --- */
.highlight::-webkit-scrollbar {
  height: 6px;
}

.highlight::-webkit-scrollbar-track {
  background: #0f172a;
}

.highlight::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

/* --- MathJax overrides --- */
mjx-container {
  color: #e2e8f0 !important;
  overflow-x: auto;
}

/* --- Smooth scroll offset for fixed nav --- */
:target {
  scroll-margin-top: 5rem;
}

/* --- Selection color --- */
::selection {
  background: rgba(34, 211, 238, 0.25);
  color: #f1f5f9;
}
