/*
Theme Name: Derek Bloggs
Theme URI: https://derekbloggs.com
Author: Derek Boggs
Author URI: https://derekbloggs.com
Description: A dark editorial theme for a tech minister who runs on Wendy's.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: derekbloggs
Tags: dark, blog, minimalist, custom-colors, custom-logo
*/

/* ============================================================
   GOOGLE FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;1,6..72,300;1,6..72,400&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg:          #080808;
  --surface:     #101010;
  --surface-2:   #181818;
  --border:      #222222;
  --border-light:#2e2e2e;
  --text:        #e2ddd0;
  --text-muted:  #7a7670;
  --text-dim:    #4a4845;
  --accent:      #e9a93a;
  --accent-dim:  #a0721e;
  --accent-glow: rgba(233, 169, 58, 0.15);
  --red:         #e05252;

  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Newsreader', Georgia, serif;

  --radius: 3px;
  --max-w: 720px;
  --max-w-wide: 1100px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}
a:hover { color: #fff; }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   SCANLINE GRAIN OVERLAY
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.03) 2px,
    rgba(255,255,255,0.03) 4px
  );
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 2rem;
  max-width: var(--max-w-wide);
  margin: 0 auto;
}

.site-branding {}

.site-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-title a { color: var(--text); }
.site-title a:hover { color: var(--accent); }
.site-title .blink {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.site-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.site-nav a:hover,
.site-nav a.current-page {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ============================================================
   HERO BANNER (homepage only)
   ============================================================ */
.site-hero {
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
  background: 
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(233,169,58,0.06) 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-bio {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
}

.hero-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  white-space: nowrap;
  min-width: 200px;
}
.hero-status .status-line {
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.hero-status .status-line:last-child { margin-bottom: 0; }
.hero-status .status-val { color: var(--accent); }
.hero-status .status-ok  { color: #6dd17d; }
.hero-status .status-warn { color: #e9a93a; }

/* ============================================================
   MAIN CONTENT + SIDEBAR LAYOUT
   ============================================================ */
.site-main {
  flex: 1;
}

.content-area {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

/* ============================================================
   POST LOOP (homepage)
   ============================================================ */
.posts-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.posts-header-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.posts-header-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.post-card {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}
.post-card:last-child { border-bottom: none; }
.post-card:first-child { padding-top: 0; }

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.post-card-meta .sep { color: var(--border-light); }
.post-card-meta .cat { color: var(--accent-dim); }

.post-card-title {
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.65rem;
}
.post-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.15s;
}
.read-more::after { content: '→'; }
.read-more:hover { gap: 0.7rem; color: var(--accent); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 80px;
}

.widget {
  margin-bottom: 2.5rem;
}

.widget-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.widget-title::before {
  content: '//';
  color: var(--accent);
  font-weight: 700;
}

.widget ul {
  list-style: none;
}
.widget ul li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: color 0.15s;
}
.widget ul li a:hover { color: var(--accent); }

/* Search widget */
.search-form {
  display: flex;
  gap: 0;
}
.search-form input[type="search"] {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.search-form input[type="search"]:focus {
  border-color: var(--accent);
}
.search-form input[type="search"]::placeholder {
  color: var(--text-dim);
}
.search-form button {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
  transition: background 0.15s;
}
.search-form button:hover { background: #fff; border-color: #fff; }

/* About widget */
.widget-about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.widget-about p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-header {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 3rem 2rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.5rem;
}

.post-meta-bar {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.post-meta-bar a { color: var(--accent-dim); }
.post-meta-bar a:hover { color: var(--accent); }
.post-meta-bar .sep { color: var(--border-light); }

.single-post-title {
  font-family: var(--font-body);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text);
  max-width: 700px;
}

.post-content {
  max-width: var(--max-w);
  padding: 3rem 0;
}

.post-content p { margin-bottom: 1.5rem; }
.post-content h2 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.post-content h2::before { content: '##'; color: var(--text-dim); }
.post-content h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}
.post-content ul, .post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}
.post-content li { margin-bottom: 0.5rem; color: var(--text-muted); }
.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 2rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  color: var(--accent);
}
.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-dim);
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
.post-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Post navigation */
.post-nav {
  display: flex;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.post-nav a {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.15s;
}
.post-nav a:hover {
  border-color: var(--accent);
  color: var(--text);
}
.post-nav .nav-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.35rem;
}
.post-nav .nav-next { text-align: right; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.footer-copy a { color: var(--text-dim); }
.footer-copy a:hover { color: var(--accent); }
.footer-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .content-area {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .sidebar { position: static; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-status { display: none; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 1rem; }
  .site-nav { display: none; }
  .single-post-header, .content-area { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.comments-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.comment { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.comment-author { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 0.5rem; }
.comment-date { color: var(--text-dim); font-size: 0.65rem; margin-left: 0.5rem; }
.comment-content p { font-size: 0.9rem; color: var(--text-muted); }
.comment-form input, .comment-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea { height: 130px; resize: vertical; }
.comment-form input[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  width: auto;
  padding: 0.6rem 1.5rem;
  transition: background 0.15s;
}
.comment-form input[type="submit"]:hover { background: #fff; border-color: #fff; }

/* ============================================================
   404 / NO RESULTS
   ============================================================ */
.not-found {
  text-align: center;
  padding: 6rem 2rem;
}
.not-found .error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 700;
  color: var(--border-light);
  line-height: 1;
  margin-bottom: 1rem;
}
.not-found h1 {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.not-found p { color: var(--text-dim); font-size: 0.9rem; }
