/* Late '70s / Early '80s Minimalist Computer Scene Styles */

/* Custom Fonts */
@font-face {
  font-family: 'VT323';
  src: url('../fonts/VT323.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* CSS Reset - minimal modern reset */
*, *::before, *::after {
  box-sizing: border-box;
}

*, body, html {
  margin: 0;
  padding: 0;
}

/* CSS Custom Properties */
:root {
  --bg-color: #0a0a0a;
  --text-color: #e0e0e0;
  --accent-color: #00ff41;
  --border-color: #333333;
  --code-bg: #111111;
  --muted-color: #888888;
}

/* Base styles */
body {
  font-family: 'VT323', 'Courier New', 'Lucida Console', Monaco, monospace;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 18px;
  min-height: 100vh;
}

/* Main container with wide margins */
#content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 15% 4rem;
}

/* Site branding - top h3 */
#content > h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

/* Navigation */
nav {
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

nav li {
  margin: 0;
}

nav a {
  color: var(--muted-color);
  border-bottom: 1px dotted var(--accent-color);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

nav a:hover {
  color: var(--accent-color);
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 2px solid var(--accent-color);
  margin: 2rem 0;
}

/* Main content area */
main {
  margin: 2rem 0;
}

/* Headers */
h1 {
  font-size: 2.5rem;
  margin: 2rem 0 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

h3 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Post/article headers within main */
header.summary h1,
article header h3 {
  margin-top: 0;
}

article header h3 a {
  color: var(--text-color);
  border-bottom: 1px solid var(--border-color);
}

article header h3 a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Paragraphs */
p {
  margin-bottom: 1.5rem;
  text-align: justify;
  hyphens: auto;
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-color);
  transition: border-color 0.1s ease, color 0.1s ease;
}

a:hover {
  color: var(--accent-color);
  border-bottom: 1px solid var(--accent-color);
}

/* Metadata section */
.metadata {
  margin: 1rem 0 2rem;
  padding: 1rem;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

/* Hide metadata divs that have no element children (ignoring whitespace) */
div.metadata:not(:has(> *)) {
  display: none;
}

.metadata p {
  margin-bottom: 0.5rem;
}

.metadata p:last-child {
  margin-bottom: 0;
}

.field {
  display: inline;
  color: var(--muted-color);
}

.field-value {
  color: var(--text-color);
}

/* Tags */
.tags {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tags a {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
}

.tags a:hover {
  background: var(--border-color);
}

/* Collection - for blog index pages */
article.collection {
  margin-bottom: 2rem;
}

article.collection h2 {
  font-size: 1.75rem;
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

section.post {
  margin: 1.5rem 0;
  padding: 1rem 0;
}

section.post header {
  margin-bottom: 0.5rem;
}

/* Code blocks */
pre {
  background: var(--code-bg);
  padding: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

code {
  font-family: 'VT323', 'Courier New', 'Lucida Console', Monaco, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-color);
  color: var(--accent-color);
}

pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-color);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--accent-color);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  color: var(--muted-color);
  background: var(--code-bg);
  border-right: 1px solid var(--border-color);
}

/* Lists */
ul, ol {
  margin-bottom: 1.5rem;
  margin-left: 2rem;
}

li {
  margin-bottom: 0.75rem;
}

ul {
  list-style-type: square;
}

ul li::marker,
ol li::marker {
  color: var(--accent-color);
  font-weight: bold;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border: none;
}

.icon {
  width: 24px;
  height: 24px;
  fill: var(--accent-color);
  vertical-align: middle;
  filter: invert(100%);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background: var(--code-bg);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

tr:nth-child(even) {
  background: var(--code-bg);
}

/* Neighbors navigation (prev/next posts) */
.neighbors {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
  #content {
    padding: 2rem 12% 4rem;
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  #content {
    padding: 2rem 8% 3rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  nav ul {
    flex-direction: row;
    gap: 1.5rem;
    justify-content: flex-start;
  }

  .metadata {
    padding: 0.75rem;
  }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
  body {
    font-size: 18px;
  }

  #content {
    padding: 1.5rem 1.25rem 2.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  nav ul {
    gap: 1rem;
  }

  nav a {
    font-size: 0.8rem;
  }

  p {
    text-align: left;
  }

  pre {
    padding: 1rem;
    overflow-x: scroll;
  }

  code {
    font-size: 0.85em;
  }

  .tags {
    gap: 0.4rem;
  }

  .tags a {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
  }
}

/* Large screens - 26" or larger desktop screens */
@media (min-width: 1440px) {
  #content {
    max-width: 1300px;
  }
}

@media (min-width: 1920px) {
  #content {
    max-width: 1500px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  #content {
    padding: 1rem;
  }

  nav, hr, .metadata, .icon {
    display: none;
  }

  a {
    color: inherit;
    border-bottom: none;
    text-decoration: underline;
  }
}
