/* ============================================================
   Hugo Terminal Theme
   Color palette from web-terminal by Ronald Baldwin
   ============================================================ */

:root {
  --bgcolor:       #0a0f0a;
  --promptcolor:   #33ff33;
  --textcolor:     #e0e0e0;
  --linkcolor:     #ffb000;
  --successcolor:  #39ff14;
  --errorcolor:    #ff4444;
  --dimcolor:      #aaaaaa;
  --dircolor:      #4da3ff;
  --border:        rgba(51, 255, 51, 0.25);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bgcolor);
  color: var(--textcolor);
  font-family: "Courier Prime", monospace;
  font-size: clamp(13px, 1.5vw, 17px);
  line-height: 1.65;
  min-height: 100vh;
}

/* CRT scanline + vignette overlay — matches web-terminal body::after */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(57, 255, 20, 0.03) 2px,
      rgba(57, 255, 20, 0.03) 3px
    ),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
  z-index: 999;
}

/* ============================================================
   Layout Shell
   ============================================================ */

#terminal {
  max-width: 1100px;
  margin: 0;
  padding: 0.5rem 1rem 3rem;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

#output {
  flex: 1;
}

/* ============================================================
   Typography utilities
   ============================================================ */

.dim {
  color: var(--dimcolor);
}

.error-red {
  color: var(--errorcolor);
}

a {
  color: var(--linkcolor);
  text-decoration: none;
}

a:hover {
  text-shadow: 0 0 8px var(--linkcolor);
  text-decoration: underline;
}

pre,
code {
  font-family: "Noto Sans Mono", monospace;
}

/* ============================================================
   Header — web-terminal style ASCII banner + links
   ============================================================ */

#site-header {
  width: 100%;
  background: var(--bgcolor);
  margin-bottom: 2rem;
  padding-top: 0.75rem;
}

#banner-wrap {
  display: block;
  width: 100%;
  background: var(--bgcolor);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  text-decoration: none;
}

#banner-wrap::-webkit-scrollbar {
  display: none;
}

#site-banner-desktop,
#site-banner-mobile {
  margin: 0 0 12px 0;
  padding: 0 1rem;
  color: var(--successcolor);
  white-space: pre;
  font-family: "Noto Sans Mono", monospace;
  font-size: clamp(13px, 1.5vw, 18px);
  line-height: 1;
  letter-spacing: 0;
}

#site-banner-mobile {
  display: none;
}

#site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 1rem 0.5rem;
}

#site-nav a {
  font-family: "Courier Prime", monospace;
  font-size: 18px;
  color: var(--linkcolor);
  text-decoration: none;
  display: inline-block;
  margin-right: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#site-nav a:hover {
  text-shadow: 0 0 8px var(--linkcolor);
  text-decoration: underline;
}

#site-nav a[aria-current="page"] {
  color: var(--promptcolor);
  text-shadow: 0 0 6px var(--promptcolor);
}

@media (max-width: 1040px) {
  #site-banner-desktop {
    display: none;
  }

  #site-banner-mobile {
    display: block;
  }
}

/* Legacy .prompt / .nav-links kept for any overriding partials */
.prompt {
  color: var(--promptcolor);
  text-shadow: 0 0 8px var(--promptcolor);
  white-space: pre;
  font-weight: bold;
  font-family: "Courier Prime", monospace;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.nav-links a {
  color: var(--linkcolor);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-links a:hover {
  text-shadow: 0 0 8px var(--linkcolor);
}

.nav-links a[aria-current="page"] {
  color: var(--promptcolor);
  text-shadow: 0 0 6px var(--promptcolor);
}

/* ============================================================
   Footer
   ============================================================ */

#site-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer-line {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.5rem;
}

.social-links a {
  color: var(--linkcolor);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================================
   Command line prompt display (decorative)
   ============================================================ */

.cmd-line {
  margin-bottom: 0.75rem;
}

.prompt-text {
  color: var(--promptcolor);
  text-shadow: 0 0 6px var(--promptcolor);
  font-family: "Courier Prime", monospace;
}

/* ============================================================
   ASCII Banner (home page)
   ============================================================ */

.banner {
  color: var(--successcolor);
  font-family: "Noto Sans Mono", monospace;
  font-size: clamp(5px, 0.85vw, 11px);
  line-height: 1.15;
  margin: 0 0 2rem 0;
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: none;
}

.banner::-webkit-scrollbar {
  display: none;
}

/* ============================================================
   Post list (home + list pages)
   ============================================================ */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.post-entry {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.2rem 0;
  flex-wrap: wrap;
}

.post-date {
  min-width: 10ch;
  flex-shrink: 0;
  white-space: nowrap;
}

.file-perms {
  min-width: 12ch;
  flex-shrink: 0;
  font-size: 0.85em;
  white-space: nowrap;
}

.post-link {
  color: var(--linkcolor);
  text-decoration: none;
  flex-shrink: 0;
}

.post-link:hover {
  text-shadow: 0 0 8px var(--linkcolor);
  text-decoration: underline;
}

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

.more-link {
  margin-top: 0.75rem;
}

.more-link a {
  color: var(--promptcolor);
  text-shadow: 0 0 5px var(--promptcolor);
}

.more-link a:hover {
  text-decoration: underline;
}

/* ============================================================
   Welcome / description (home page)
   ============================================================ */

.welcome-msg {
  color: var(--textcolor);
  margin: 0 0 2rem 0;
  max-width: 65ch;
}

/* Directory listing header */
.dir-header {
  margin-bottom: 1rem;
  font-size: 0.9em;
  line-height: 1.8;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.pagination a {
  color: var(--promptcolor);
  text-decoration: none;
}

.pagination a:hover {
  text-shadow: 0 0 6px var(--promptcolor);
  text-decoration: underline;
}

/* ============================================================
   Single Post
   ============================================================ */

.post-header {
  margin-bottom: 2rem;
}

.post-meta {
  line-height: 2;
}

.meta-label {
  color: var(--promptcolor);
}

.post-title-display {
  color: var(--textcolor);
  font-weight: bold;
}

.tag,
.category {
  color: var(--dircolor);
  text-decoration: none;
  margin-right: 0.25rem;
}

.tag:hover,
.category:hover {
  text-shadow: 0 0 6px var(--dircolor);
}

.separator {
  color: var(--dimcolor);
  margin: 1rem 0;
  letter-spacing: 0.1em;
}

/* Post navigation */
.post-footer {
  margin-top: 2rem;
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.back-link {
  color: var(--promptcolor);
  text-decoration: none;
  text-shadow: 0 0 5px var(--promptcolor);
}

.back-link:hover {
  text-decoration: underline;
}

.nav-prev,
.nav-next {
  color: var(--linkcolor);
}

/* ============================================================
   Post content typography
   ============================================================ */

.post-content {
  max-width: 72ch;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--promptcolor);
  font-weight: bold;
  margin-top: 2rem;
}

.post-content h1::before { content: "# "; }
.post-content h2::before { content: "## "; }
.post-content h3::before { content: "### "; }
.post-content h4::before { content: "#### "; }

.post-content p {
  margin: 1rem 0;
}

.post-content a {
  color: var(--linkcolor);
}

.post-content a:hover {
  text-shadow: 0 0 8px var(--linkcolor);
}

/* Inline code */
.post-content code {
  color: var(--successcolor);
  background: rgba(57, 255, 20, 0.07);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  font-size: 0.92em;
}

/* Code blocks */
.post-content pre {
  background: rgba(57, 255, 20, 0.04);
  border-left: 2px solid var(--promptcolor);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--textcolor);
  font-size: inherit;
}

/* Blockquote */
.post-content blockquote {
  border-left: 2px solid var(--linkcolor);
  color: var(--dimcolor);
  margin: 1.5rem 0;
  margin-left: 0;
  padding-left: 1.25rem;
}

/* Lists */
.post-content ul,
.post-content ol {
  padding-left: 2rem;
  margin: 1rem 0;
}

.post-content li {
  margin: 0.25rem 0;
}

.post-content li::marker {
  color: var(--promptcolor);
}

/* Horizontal rule */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Tables */
.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.9em;
}

.post-content th {
  color: var(--promptcolor);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem 0.5rem 0;
  text-align: left;
}

.post-content td {
  border-bottom: 1px solid rgba(51, 255, 51, 0.1);
  padding: 0.4rem 1rem 0.4rem 0;
  color: var(--textcolor);
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Strong / em */
.post-content strong {
  color: var(--textcolor);
}

.post-content em {
  color: var(--dimcolor);
}

/* ============================================================
   404 Page
   ============================================================ */

.error-page {
  margin-top: 2rem;
}

.error-output {
  color: var(--errorcolor);
  font-family: "Noto Sans Mono", monospace;
  margin: 1rem 0;
  font-size: 0.9em;
}

.error-code {
  margin: 1rem 0;
}

/* ============================================================
   Tags / taxonomy list
   ============================================================ */

.tags-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.tags-list a {
  color: var(--dircolor);
}

.tags-list a:hover {
  text-shadow: 0 0 6px var(--dircolor);
}

/* ============================================================
   Cursor blink animation (applied via JS)
   ============================================================ */

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

.cursor-blink::after {
  content: "_";
  color: var(--promptcolor);
  animation: cursor-blink 1.1s step-start infinite;
  margin-left: 1px;
}

/* ============================================================
   Scrollbar styling
   ============================================================ */

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

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

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--promptcolor) var(--bgcolor);
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  #site-nav a {
    letter-spacing: 0.05em;
    margin-right: 8px;
  }

  #terminal {
    padding: 1rem 1rem 2rem;
  }

  .banner {
    font-size: 4px;
  }

  .nav-links a {
    letter-spacing: 0.05em;
  }

  .post-entry {
    gap: 0.5rem;
  }

  .post-title-hint {
    display: none;
  }

  .file-perms {
    display: none;
  }

  .post-content {
    max-width: 100%;
  }

  .post-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}
