/*
Theme Name: The Quick Brown Coder
Theme URI: https://thequickbrowncoder.com
Author: The Quick Brown Coder
Author URI: https://thequickbrowncoder.com
Description: A dark, minimal, terminal-inspired WordPress theme for developer blogs.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tqbc
Tags: blog, dark, minimal, developer, monospace
*/

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; }

/* ─── Design Tokens ──────────────────────────────── */
:root {
  --bg:          #0d1117;
  --bg-card:     #141820;
  --bg-header:   #10131a;
  --border:      #1e2330;
  --ink:         #e8e6de;
  --ink-muted:   #8a8f9c;
  --ink-dim:     #4a4f5a;
  --amber:       #f2a93b;
  --teal:        #3fb8af;
  --red:         #e05252;
  --mono:        'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;
  --sans:        'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ─── Base ───────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; transition: color .15s; }
a:hover { color: var(--amber); }
h1, h2, h3, h4, h5, h6 { font-family: var(--mono); font-weight: 500; line-height: 1.3; color: var(--ink); }
p { margin-bottom: 1.25rem; color: var(--ink-muted); }
p:last-child { margin-bottom: 0; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; color: var(--ink-muted); }
li { margin-bottom: .4rem; }
blockquote { border-left: 3px solid var(--amber); padding: .75rem 1.25rem; margin: 1.5rem 0; background: rgba(242,169,59,.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
blockquote p { margin: 0; color: var(--ink); font-style: italic; }
pre, code { font-family: var(--mono); }
pre { background: #0a0d12; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1.5rem 0; font-size: 13px; line-height: 1.6; color: #a8c0e8; }
code { font-size: .875em; background: rgba(63,184,175,.1); color: var(--teal); padding: .15em .4em; border-radius: 4px; }
pre code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 14px; }
th { font-family: var(--mono); font-size: 11px; color: var(--teal); text-align: left; padding: .6rem .875rem; border-bottom: 1px solid var(--border); letter-spacing: .04em; }
td { padding: .6rem .875rem; border-bottom: 1px solid var(--border); color: var(--ink-muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card); }
img { border-radius: var(--radius-sm); }

/* ─── Layout ─────────────────────────────────────── */
.tqbc-container { max-width: 1060px; margin: 0 auto; padding: 0 2rem; }
.tqbc-container--narrow { max-width: 760px; margin: 0 auto; padding: 0 2rem; }

/* ─── Navigation ─────────────────────────────────── */
#masthead {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  height: 52px; display: flex; align-items: center;
  padding: 0 2rem; gap: 2rem;
}
.site-branding { flex: 1; }
.site-title { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .02em; }
.site-title a { color: var(--amber); text-decoration: none; }
.site-title a:hover { color: var(--ink); }
.site-description { display: none; }

#primary-navigation ul { display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
#primary-navigation a { font-size: 13px; color: var(--ink-muted); text-decoration: none; transition: color .15s; }
#primary-navigation a:hover, #primary-navigation .current-menu-item > a { color: var(--ink); }

/* ─── Window Chrome ──────────────────────────────── */
.tqbc-chrome { display: flex; gap: 7px; margin-bottom: 1.5rem; }
.tqbc-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e3340; }
.tqbc-dot--r { background: var(--red); }
.tqbc-dot--y { background: var(--amber); }
.tqbc-dot--g { background: var(--teal); }

/* ─── Hero (front page) ──────────────────────────── */
.tqbc-hero {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem 3.5rem;
}
.tqbc-hero__inner { max-width: 740px; margin: 0 auto; }
.tqbc-hero__eyebrow { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .05em; margin-bottom: .75rem; }
.tqbc-hero__title { font-family: var(--mono); font-size: clamp(1.4rem, 4vw, 2.25rem); font-weight: 500; color: #f2f0e8; margin-bottom: 1rem; }
.tqbc-hero__cursor { color: var(--amber); animation: tqbc-blink 1s steps(2) infinite; }
@keyframes tqbc-blink { 50% { opacity: 0; } }
.tqbc-hero__sub { font-size: 15px; color: var(--ink-muted); max-width: 520px; margin-bottom: 1.25rem; }
.tqbc-hero__tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.tqbc-pill { font-family: var(--mono); font-size: 11px; color: var(--teal); background: rgba(63,184,175,.1); border: 1px solid rgba(63,184,175,.2); padding: .25rem .625rem; border-radius: 20px; }

/* ─── Section Label ──────────────────────────────── */
.tqbc-label { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .05em; margin-bottom: 1.5rem; }

/* ─── Post Grid ──────────────────────────────────── */
.tqbc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.tqbc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.tqbc-card:hover { border-color: #2e3a50; transform: translateY(-2px); }
.tqbc-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.tqbc-card__thumb { height: 140px; background: var(--bg-header); overflow: hidden; }
.tqbc-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tqbc-card__body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.tqbc-card__cat { font-family: var(--mono); font-size: 10px; color: var(--teal); background: rgba(63,184,175,.1); border: 1px solid rgba(63,184,175,.18); padding: .2rem .5rem; border-radius: 4px; width: fit-content; letter-spacing: .03em; }
.tqbc-card__title { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; font-family: var(--sans); }
.tqbc-card__excerpt { font-size: 12px; color: var(--ink-muted); line-height: 1.6; flex: 1; margin: 0; }
.tqbc-card__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }

/* ─── Buttons ────────────────────────────────────── */
.tqbc-btn {
  display: inline-block; font-family: var(--mono); font-size: 13px;
  background: var(--amber); color: #1c1304;
  padding: .6rem 1.375rem; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 500; border: none;
  cursor: pointer; transition: background .15s;
}
.tqbc-btn:hover { background: #e89a26; color: #1c1304; }
.tqbc-btn--outline {
  background: transparent; color: var(--teal);
  border: 1px solid var(--teal); padding: .55rem 1.25rem;
}
.tqbc-btn--outline:hover { background: rgba(63,184,175,.08); color: var(--teal); }

/* ─── Terminal Block ─────────────────────────────── */
.tqbc-terminal { background: var(--bg-header); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.tqbc-terminal__chrome { display: flex; gap: 7px; margin-bottom: 1rem; }
.tqbc-terminal__line { font-family: var(--mono); font-size: 13px; color: #c8c5ba; line-height: 1.8; }
.tqbc-terminal__prompt { color: var(--amber); margin-right: .5rem; }
.tqbc-terminal__comment { color: var(--ink-dim); }
.tqbc-terminal__teal { color: var(--teal); }

/* ─── Section Spacing ────────────────────────────── */
.tqbc-section { padding: 3rem 0; }
.tqbc-section + .tqbc-section { border-top: 1px solid var(--border); }

/* ─── Single Post ────────────────────────────────── */
.tqbc-post-hero { background: var(--bg-header); border-bottom: 1px solid var(--border); padding: 3rem 2rem; }
.tqbc-post-hero__inner { max-width: 760px; margin: 0 auto; }
.tqbc-post-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tqbc-post-meta time { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.tqbc-entry-title { font-size: clamp(1.375rem, 3.5vw, 2.125rem); font-weight: 500; color: #f2f0e8; margin-bottom: 1rem; }
.tqbc-post-intro { font-size: 16px; color: var(--ink-muted); margin: 0; }

.tqbc-entry-content { max-width: 760px; margin: 0 auto; padding: 3rem 2rem; }
.tqbc-entry-content h2 { font-size: 1.125rem; margin: 2.5rem 0 1rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.tqbc-entry-content h3 { font-size: .9375rem; color: var(--amber); margin: 1.75rem 0 .625rem; }
.tqbc-entry-content h4 { font-size: .875rem; color: var(--teal); margin: 1.25rem 0 .5rem; }
.tqbc-entry-content > * + * { margin-top: 1rem; }
.tqbc-entry-content h2, .tqbc-entry-content h3, .tqbc-entry-content h4 { margin-top: 0; }

/* ─── Page Hero ──────────────────────────────────── */
.tqbc-page-hero { background: var(--bg-header); border-bottom: 1px solid var(--border); padding: 2.5rem 2rem; }
.tqbc-page-hero__inner { max-width: 760px; margin: 0 auto; }
.tqbc-page-eyebrow { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .05em; margin-bottom: .75rem; }
.tqbc-page-title { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 500; color: #f2f0e8; }

/* ─── Archive / Blog ─────────────────────────────── */
.tqbc-archive-header { padding: 2.5rem 0 2rem; }
.tqbc-archive-title { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 500; color: #f2f0e8; margin-bottom: .5rem; }
.tqbc-archive-desc { font-size: 15px; color: var(--ink-muted); }

/* ─── Footer ─────────────────────────────────────── */
#colophon {
  background: var(--bg-header); border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.footer-brand { font-family: var(--mono); font-size: 12px; color: var(--teal); }
.footer-copy { font-size: 12px; color: var(--ink-dim); }
.footer-nav ul { display: flex; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.footer-nav a { font-size: 12px; color: var(--ink-dim); text-decoration: none; }
.footer-nav a:hover { color: var(--ink-muted); }

/* ─── Pagination ─────────────────────────────────── */
.tqbc-pagination { display: flex; gap: .5rem; justify-content: center; padding: 2rem 0; }
.tqbc-pagination .page-numbers {
  font-family: var(--mono); font-size: 12px;
  padding: .4rem .875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--ink-muted);
  text-decoration: none; transition: all .15s;
}
.tqbc-pagination .page-numbers:hover, .tqbc-pagination .page-numbers.current {
  border-color: var(--teal); color: var(--teal); background: rgba(63,184,175,.08);
}

/* ─── Widgets ────────────────────────────────────── */
.widget { margin-bottom: 2rem; }
.widget-title { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .05em; margin-bottom: 1rem; }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.widget ul li:last-child { border-bottom: none; }

/* ─── Comments ───────────────────────────────────── */
.comments-area { max-width: 760px; margin: 0 auto; padding: 2rem; border-top: 1px solid var(--border); }
.comment-list { list-style: none; padding: 0; }
.comment { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.comment-author { font-family: var(--mono); font-size: 13px; color: var(--amber); margin-bottom: .25rem; }
.comment-metadata { font-size: 12px; color: var(--ink-dim); margin-bottom: .75rem; }
.comment-content p { font-size: 14px; }
.comment-form label { font-family: var(--mono); font-size: 12px; color: var(--teal); display: block; margin-bottom: .35rem; letter-spacing: .04em; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .625rem .875rem;
  color: var(--ink); font-size: 14px; margin-bottom: 1rem;
  transition: border-color .15s;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--teal); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input[type="submit"] { cursor: pointer; font-family: var(--mono); font-size: 13px; background: var(--amber); color: #1c1304; border: none; padding: .6rem 1.375rem; border-radius: var(--radius-sm); }
.comment-form input[type="submit"]:hover { background: #e89a26; }

/* ─── 404 ────────────────────────────────────────── */
.tqbc-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; }
.tqbc-404__code { font-family: var(--mono); font-size: clamp(4rem, 15vw, 8rem); font-weight: 500; color: var(--border); line-height: 1; margin-bottom: 1rem; }
.tqbc-404__title { font-size: 1.25rem; color: var(--ink); margin-bottom: .75rem; }
.tqbc-404__desc { color: var(--ink-muted); margin-bottom: 2rem; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  #masthead { padding: 0 1rem; }
  .tqbc-container, .tqbc-container--narrow { padding: 0 1rem; }
  .tqbc-hero { padding: 2.5rem 1rem 2rem; }
  .tqbc-post-hero, .tqbc-page-hero { padding: 2rem 1rem; }
  .tqbc-entry-content { padding: 2rem 1rem; }
  .tqbc-grid { grid-template-columns: 1fr; }
  #colophon { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  #primary-navigation ul { gap: 1rem; }
  #primary-navigation a { font-size: 12px; }
}

/* ─── WordPress Alignment Helpers ────────────────── */
.alignleft  { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { margin: 1rem auto; text-align: center; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--ink-dim); font-style: italic; margin-top: .375rem; }
.screen-reader-text { position: absolute; left: -9999px; }

/* ─── Gutenberg Block Overrides ──────────────────── */
.wp-block-separator { border-color: var(--border); }
.wp-block-quote { border-left-color: var(--amber); background: rgba(242,169,59,.05); }
.wp-block-code { background: #0a0d12; border: 1px solid var(--border); border-radius: var(--radius-sm); color: #a8c0e8; }
.wp-block-pullquote { border-top: 3px solid var(--teal); border-bottom: 3px solid var(--teal); }
.wp-block-table td, .wp-block-table th { border-color: var(--border); }
