/* zsh theme — color vars injected by Hugo, never hardcoded here */

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

html {
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
}

:root {
  --font-mono: "JetBrains Mono", "Fira Mono", "Cascadia Code", "Consolas", "Courier New", monospace;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  max-width: 90ch;
  margin: 0 auto;
  padding: 1em 1ch;
}

a {
  color: var(--color-link);
  text-decoration: none;
}
a:visited {
  color: var(--color-link-visited);
}
a:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

/* ── Prompt line ────────────────────────── */

.prompt-line {
  display: flex;
  align-items: baseline;
  gap: 0.5ch;
  margin-bottom: 0.1em;
  flex-wrap: wrap;
}

.prompt-user   { color: var(--color-user); font-weight: bold; }
.prompt-at     { color: var(--color-fg-dim); }
.prompt-host   { color: var(--color-host); font-weight: bold; }
.prompt-sep    { color: var(--color-fg-dim); }
.prompt-path   { color: var(--color-path); }
.prompt-branch { color: var(--color-branch); font-size: 0.85em; }
.prompt-branch::before { content: " git:("; color: var(--color-fg-dim); }
.prompt-branch::after  { content: ")";      color: var(--color-fg-dim); }
.prompt-char   { color: var(--color-accent); margin-right: 0.5ch; }

.prompt-command {
  color: var(--color-fg-dim);
  font-style: italic;
}

/* ── Output block (what follows a command) ── */

.output {
  margin-bottom: 2em;
}

/* ── ls-style post listing ──────────────── */

.ls-header {
  color: var(--color-fg-dim);
  font-size: 0.85em;
  margin-bottom: 0.25em;
  padding-left: 0;
}

.ls-row {
  display: grid;
  grid-template-columns: 6ch 12ch 1fr;
  gap: 0 2ch;
  align-items: baseline;
  padding: 0.1em 0;
  cursor: default;
}

.ls-row:hover {
  background-color: var(--color-select-bg);
}

.ls-row:hover .ls-title a {
  color: var(--color-select-fg);
  text-decoration: none;
}

.ls-perms {
  color: var(--color-fg-dim);
  font-size: 0.9em;
  white-space: nowrap;
}

.ls-date {
  color: var(--color-fg-dim);
  font-size: 0.9em;
  white-space: nowrap;
}

.ls-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ls-title a {
  color: var(--color-link);
}

.ls-tags {
  color: var(--color-fg-dim);
  font-size: 0.8em;
}

/* ── Single post — cat style ────────────── */

.cat-output {
  margin-bottom: 2em;
}

.cat-filename {
  color: var(--color-fg-dim);
  margin-bottom: 0.5em;
}

.cat-filename span {
  color: var(--color-accent);
}

.post-meta-line {
  color: var(--color-fg-dim);
  font-size: 0.85em;
  margin-bottom: 1.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--color-fg-dim);
  opacity: 0.5;
}

.post-content {
  --post-content-width: 80ch;
  max-width: min(100%, var(--post-content-width));
  margin: 0 auto;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--color-accent);
  margin: 1.5em 0 0.5em;
  font-weight: bold;
}

.post-content h1::before { content: "# ";   color: var(--color-fg-dim); }
.post-content h2::before { content: "## ";  color: var(--color-fg-dim); }
.post-content h3::before { content: "### "; color: var(--color-fg-dim); }

.post-content p           { margin-bottom: 1em; }
.post-content ul,
.post-content ol          { margin: 0.5em 0 1em 2ch; }
.post-content li::marker  { color: var(--color-fg-dim); }

.post-content blockquote {
  border-left: 1px solid var(--color-fg-dim);
  padding-left: 1ch;
  color: var(--color-fg-dim);
  margin: 1em 0;
}

.post-content code {
  color: var(--color-accent);
  background-color: var(--color-select-bg);
  padding: 0 0.4ch;
}

.post-content pre {
  background-color: var(--color-select-bg);
  width: 100%;
  padding: 1em 1ch;
  overflow-x: auto;
  margin: 1em 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) var(--color-bg);
}

.post-content pre::-webkit-scrollbar {
  height: 0.7em;
  width: 0.7em;
}

.post-content pre::-webkit-scrollbar-track {
  background-color: var(--color-bg);
}

.post-content pre::-webkit-scrollbar-thumb {
  background-color: var(--color-fg-dim);
  border: 1px solid var(--color-bg);
}

.post-content pre::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-accent);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--color-fg);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-fg-dim);
  opacity: 0.3;
  margin: 2em 0;
}

.post-content table {
  border-collapse: collapse;
  margin: 1em 0;
}

.post-content th,
.post-content td {
  padding: 0.2em 2ch 0.2em 0;
  text-align: left;
}

.post-content th {
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-fg-dim);
}

/* ── Nav / post navigation ──────────────── */

.post-nav {
  margin-top: 2em;
  display: flex;
  justify-content: space-between;
  color: var(--color-fg-dim);
  font-size: 0.9em;
}

/* ── Tags ───────────────────────────────── */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1ch;
  margin-top: 0.5em;
}

.tag-entry {
  color: var(--color-fg-dim);
}

.tag-entry a {
  color: var(--color-link);
}

.tag-entry a:hover {
  color: var(--color-accent);
}

/* ── Cursor ─────────────────────────────── */

.cursor {
  display: inline-block;
  background-color: var(--color-fg);
  width: 1ch;
  height: 1em;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Footer ─────────────────────────────── */

footer {
  margin-top: auto;
  padding-top: 2em;
  color: var(--color-fg-dim);
  font-size: 0.8em;
  opacity: 0.6;
}

/* ── Responsive ─────────────────────────── */

@media (max-width: 600px) {
  html { font-size: 13px; }
  body { padding: 0.5em 1ch; }

  .ls-row {
    grid-template-columns: 10ch 1fr;
  }
  .ls-perms { display: none; }

  .prompt-branch { display: none; }
}

.post-title {
  color: var(--color-accent);
  font-size: 1.2em;
  margin: 0.5em 0 1em;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2em;
  padding-top: 0.5em;
  border-top: 1px solid var(--color-fg-dim);
  opacity: 0.5;
  font-size: 0.9em;
  gap: 1ch;
}

.post-nav a { color: var(--color-link); }
.post-nav-home { text-align: center; }
.post-nav-next { text-align: right; }
