/* 
 * Terminal/Manpage Theme for tillvonahnen.de
 * Authentic zsh terminal / man page aesthetic
 */

:root {
  /* Terminal colors - Tokyo Night inspired */
  --term-bg: #1a1b26;
  --term-fg: #a9b1d6;
  --term-fg-dim: #565f89;
  --term-fg-bright: #c0caf5;
  
  /* ANSI colors */
  --term-black: #414868;
  --term-red: #f7768e;
  --term-green: #9ece6a;
  --term-yellow: #e0af68;
  --term-blue: #7aa2f7;
  --term-magenta: #bb9af7;
  --term-cyan: #7dcfff;
  --term-white: #c0caf5;
  
  --term-max-width: 80ch;
  --term-font: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', 'Consolas', monospace;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--term-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--term-fg);
  background-color: var(--term-bg);
  min-height: 100vh;
  padding: 1rem;
}

/* Terminal window wrapper */
.terminal {
  max-width: var(--term-max-width);
  margin: 0 auto;
  padding: 0;
}

/* Prompt line styling */
.prompt {
  color: var(--term-fg-dim);
  margin-bottom: 0.5rem;
}

.prompt-user {
  color: var(--term-green);
}

.prompt-host {
  color: var(--term-blue);
}

.prompt-path {
  color: var(--term-cyan);
}

.prompt-char {
  color: var(--term-magenta);
}

/* Command output header - like running a command */
.cmd-header {
  margin: 2rem 0 1rem 0;
  color: var(--term-fg-dim);
}

.cmd-header::before {
  content: '$ ';
  color: var(--term-green);
}

/* Man page section headers */
.man-section {
  color: var(--term-bold);
  font-weight: bold;
  margin: 1.5rem 0 0.5rem 0;
  text-transform: uppercase;
}

/* Man page content indentation */
.man-content {
  padding-left: 4ch;
  margin-bottom: 1rem;
}

.man-content p {
  margin-bottom: 0.5rem;
}

/* Synopsis styling */
.synopsis {
  padding-left: 4ch;
  margin-bottom: 1rem;
}

.synopsis-cmd {
  color: var(--term-fg-bright);
  font-weight: bold;
}

.synopsis-arg {
  color: var(--term-cyan);
}

.synopsis-opt {
  color: var(--term-fg-dim);
}

/* Options list - like --help output */
.options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.option-item {
  margin-bottom: 1rem;
  padding-left: 4ch;
}

.option-flag {
  color: var(--term-green);
  font-weight: bold;
  margin-left: -4ch;
}

.option-desc {
  color: var(--term-fg);
  padding-left: 4ch;
  display: block;
  margin-top: 0.25rem;
}

/* Links styled as underlined terminal text */
a {
  color: var(--term-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--term-fg-bright);
}

/* Bold = bright white */
strong, b {
  color: var(--term-fg-bright);
  font-weight: bold;
}

/* Italic = yellow (like warnings) */
em, i {
  color: var(--term-yellow);
  font-style: normal;
}

/* Navigation as command menu */
.nav-menu {
  border-bottom: 1px solid var(--term-black);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.nav-prompt {
  color: var(--term-fg-dim);
  margin-bottom: 0.5rem;
}

/* Tree output styling */
.tree-output {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--term-fg-dim);
}

.tree-output a {
  color: var(--term-blue);
  text-decoration: none;
}

.tree-output a:hover {
  color: var(--term-cyan);
  text-decoration: underline;
}

/* Blog post list - like ls -la output or file listing */
.file-list {
  margin: 1rem 0;
}

.file-entry {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 2ch;
  padding: 0.25rem 0;
  border-bottom: 1px dotted var(--term-black);
}

.file-entry:last-child {
  border-bottom: none;
}

.file-date {
  color: var(--term-fg-dim);
}

.file-name {
  color: var(--term-cyan);
}

.file-name a {
  color: var(--term-cyan);
  text-decoration: none;
}

.file-name a:hover {
  text-decoration: underline;
}

.file-desc {
  color: var(--term-fg-dim);
  grid-column: 2;
  padding-left: 0;
  font-size: 0.9rem;
}

/* Article content */
.article {
  max-width: var(--term-max-width);
}

.article h1 {
  color: var(--term-fg-bright);
  font-weight: bold;
  font-size: 1rem;
  text-transform: uppercase;
  margin: 1.5rem 0 1rem 0;
  text-align: center;
}

.article h2 {
  color: var(--term-fg-bright);
  font-weight: bold;
  font-size: 1rem;
  text-transform: uppercase;
  margin: 1.5rem 0 0.5rem 0;
}

.article h3 {
  color: var(--term-fg-bright);
  font-weight: bold;
  font-size: 1rem;
  margin: 1rem 0 0.5rem 0;
}

.article h4, .article h5, .article h6 {
  color: var(--term-fg);
  font-weight: bold;
  font-size: 1rem;
  margin: 1rem 0 0.5rem 0;
}

.article p {
  margin-bottom: 1rem;
  text-align: justify;
}

.article ul, .article ol {
  margin: 0 0 1rem 4ch;
}

.article li {
  margin-bottom: 0.25rem;
}

.article li::marker {
  color: var(--term-fg-dim);
}

/* Code blocks */
pre {
  background: #13141c;
  border: 1px solid var(--term-black);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.9rem;
}

code {
  font-family: var(--term-font);
  font-size: 0.9em;
}

p code, li code {
  background: #13141c;
  padding: 0.1em 0.3em;
  color: var(--term-yellow);
}

/* Blockquote - like quoted text */
blockquote {
  border-left: 2px solid var(--term-fg-dim);
  padding-left: 2ch;
  color: var(--term-fg-dim);
  margin: 1rem 0;
  font-style: italic;
}

/* Images */
.article img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid var(--term-black);
}

/* Table of Contents */
.toc {
  margin: 1rem 0;
  padding: 1rem;
  background: #13141c;
  border: 1px solid var(--term-black);
}

.toc-title {
  color: var(--term-fg-bright);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding-left: 2ch;
}

.toc li {
  margin: 0.25rem 0;
}

.toc a {
  color: var(--term-fg);
  text-decoration: none;
}

.toc a:hover {
  color: var(--term-cyan);
}

/* Contact / Key-value list */
.kv-list {
  margin: 1rem 0;
}

.kv-item {
  display: grid;
  grid-template-columns: 12ch 1fr;
  gap: 2ch;
  padding: 0.25rem 0;
}

.kv-key {
  color: var(--term-green);
}

.kv-value {
  color: var(--term-fg);
}

.kv-value a {
  margin-right: 2ch;
}

/* Footer - like command completion */
.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--term-black);
  color: var(--term-fg-dim);
  font-size: 0.9rem;
}

/* Article meta/footer */
.article-meta {
  color: var(--term-fg-dim);
  margin: 1rem 0;
  font-size: 0.9rem;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--term-black);
  color: var(--term-fg-dim);
}

/* Selection */
::selection {
  background: var(--term-blue);
  color: var(--term-bg);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--term-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--term-black);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--term-fg-dim);
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }
  
  .file-entry {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .file-desc {
    grid-column: 1;
  }
  
  .kv-item {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Giallo syntax highlighter */
.giallo-l {
  display: inline-block;
  min-height: 1lh;
  width: 100%;
}

.giallo-ln {
  display: inline-block;
  user-select: none;
  margin-right: 0.4em;
  padding: 0 0.4em;
  min-width: 3ch;
  text-align: right;
  color: var(--term-fg-dim);
}

/* Utility */
.text-dim { color: var(--term-fg-dim); }
.text-green { color: var(--term-green); }
.text-cyan { color: var(--term-cyan); }
.text-yellow { color: var(--term-yellow); }
.text-red { color: var(--term-red); }
.text-magenta { color: var(--term-magenta); }
.text-bold { color: var(--term-fg-bright); font-weight: bold; }
