/* =============================================================
   adamjohnlea.com — terminal theme
   ============================================================= */

:root {
  --bg:          #0d0d0d;
  --surface:     #0a1a0a;
  --border:      #1a3a1a;
  --green:       #00ff41;
  --green-bright:#39ff14;
  --green-dim:   #00cc33;
  --green-muted: #4a7a4a;
  --red:         #ff4141;
  --amber:       #ffb000;
  --font-mono:   'Courier New', Courier, monospace;
  --glow:        0 0 8px rgba(0,255,65,0.6), 0 0 16px rgba(0,255,65,0.3);
  --glow-sm:     0 0 4px rgba(0,255,65,0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* CRT scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--green-bright);
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s, text-shadow 0.15s;
}
a:hover {
  color: var(--green-bright);
  text-shadow: var(--glow-sm);
}

strong { color: var(--green-bright); }
em { color: var(--green-dim); font-style: normal; text-decoration: underline dotted; }

code, pre {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--green-bright);
}
code { padding: 0.1em 0.35em; border-radius: 2px; font-size: 0.9em; }
pre  { padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
pre code { border: none; background: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--green-dim);
  padding-left: 1rem;
  color: var(--green-muted);
  margin-bottom: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
hr::before {
  content: '--- // ---';
  display: block;
  text-align: center;
  color: var(--green-muted);
  font-size: 0.8rem;
  margin-top: -0.65rem;
  background: var(--bg);
  width: fit-content;
  margin-inline: auto;
  padding: 0 0.5rem;
}

img { max-width: 100%; height: auto; border: 1px solid var(--border); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

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

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; padding: 2rem 0; }

/* =============================================================
   Header
   ============================================================= */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 0;
}

.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--green-bright);
  text-shadow: var(--glow);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.site-title:hover { text-shadow: 0 0 12px rgba(57,255,20,0.9), 0 0 24px rgba(57,255,20,0.5); color: var(--green-bright); }

.site-tagline {
  color: var(--green-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* Blinking cursor */
.cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--green);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* =============================================================
   Navigation
   ============================================================= */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--green-muted);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  transition: color 0.15s;
  border-right: 1px solid var(--border);
}
.site-nav a:first-child { padding-left: 0; }
.site-nav a:hover,
.site-nav a.active { color: var(--green-bright); text-shadow: var(--glow-sm); }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--green-muted);
  font-size: 0.8rem;
}
.site-footer a { color: var(--green-muted); }
.site-footer a:hover { color: var(--green); }

/* =============================================================
   Badges
   ============================================================= */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1em 0.4em;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.badge--type    { color: var(--green-dim); border-color: var(--green-dim); }
.badge--status  { color: var(--amber); border-color: var(--amber); }
.badge--published { color: var(--green); border-color: var(--green); }
.badge--draft   { color: var(--green-muted); border-color: var(--green-muted); }
.badge--cat     { color: var(--green-muted); border-color: var(--border); }
.badge--tech    { color: var(--green-dim); border-color: var(--border); font-size: 0.7rem; }

/* =============================================================
   Entry cards
   ============================================================= */

.entry-list { list-style: none; padding: 0; }

.entry-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.entry-card::before {
  content: '>';
  position: absolute;
  left: -1.2rem;
  top: 1.4rem;
  color: var(--green-muted);
  font-weight: bold;
}
.entry-card:hover {
  border-color: var(--green-dim);
  box-shadow: var(--glow-sm);
}

.entry-card__meta {
  font-size: 0.8rem;
  color: var(--green-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.entry-card__title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.entry-card__title a {
  text-decoration: none;
  color: var(--green-bright);
}
.entry-card__title a:hover { text-shadow: var(--glow-sm); }

.entry-card__excerpt {
  color: var(--green-dim);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.entry-card__footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* =============================================================
   Entry (single post)
   ============================================================= */

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

.entry-title {
  font-size: 2rem;
  color: var(--green-bright);
  text-shadow: var(--glow-sm);
  margin-bottom: 0.75rem;
}

.entry-meta {
  font-size: 0.85rem;
  color: var(--green-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}

.entry-content {
  max-width: 72ch;
}
.entry-content h2 { margin: 1.5rem 0 0.75rem; }
.entry-content h3 { margin: 1.25rem 0 0.5rem; }
.entry-content p  { margin-bottom: 1rem; }
.entry-content img { margin: 1rem 0; }

.entry-featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* =============================================================
   Project card
   ============================================================= */

.project-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}
.project-card:hover { border-color: var(--green-dim); }

.project-card__title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.project-card__title a { color: var(--green-bright); text-decoration: none; }

.project-card__links { font-size: 0.85rem; margin-bottom: 0.75rem; }
.project-card__links a { margin-right: 1rem; }

.project-card__stack { display: flex; flex-wrap: wrap; gap: 0.35rem; }

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

.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.pagination a {
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--green);
  transition: border-color 0.15s;
}
.pagination a:hover { border-color: var(--green); box-shadow: var(--glow-sm); }
.pagination .current { color: var(--green-muted); }

/* =============================================================
   Category tree
   ============================================================= */

.category-tree { list-style: none; padding: 0; }
.category-tree li { margin-bottom: 0.35rem; }
.category-tree a  { text-decoration: none; color: var(--green-dim); }
.category-tree a:hover { color: var(--green); }
.category-tree .children { padding-left: 1.5rem; list-style: none; margin-top: 0.25rem; }
.category-tree .children a { color: var(--green-muted); font-size: 0.9rem; }
.category-tree .count { color: var(--green-muted); font-size: 0.8rem; }

/* =============================================================
   Breadcrumb
   ============================================================= */

.breadcrumb {
  font-size: 0.85rem;
  color: var(--green-muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.breadcrumb a { color: var(--green-muted); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb__sep { color: var(--border); }

/* =============================================================
   Search
   ============================================================= */

.search-box {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
}
.search-box input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}
.search-box input::placeholder { color: var(--green-muted); }
.search-box input:focus { border-color: var(--green-dim); }
.search-box button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  color: var(--green);
  font-family: var(--font-mono);
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.search-box button:hover { border-color: var(--green); color: var(--green-bright); }

/* =============================================================
   Embed container
   ============================================================= */

.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.embed-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* =============================================================
   Terminal prompt decoration
   ============================================================= */

.prompt::before {
  content: '$ ';
  color: var(--green-muted);
}

.section-header {
  color: var(--green-muted);
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.section-header strong { color: var(--green-bright); }

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

.error-page {
  text-align: center;
  padding: 4rem 0;
}
.error-code {
  font-size: 6rem;
  color: var(--green-bright);
  text-shadow: var(--glow);
  display: block;
  margin-bottom: 1rem;
}
.error-msg { color: var(--green-muted); margin-bottom: 2rem; }

/* =============================================================
   Responsive
   ============================================================= */

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .entry-title { font-size: 1.5rem; }
  .site-title { font-size: 1.3rem; }
  .site-nav a { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
  .entry-card::before { display: none; }
}

/* =============================================================
   Photo gallery
   ============================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* =============================================================
   Print
   ============================================================= */

@media print {
  body::before { display: none; }
  body { background: white; color: black; }
}
