/*
 * Hive LiteMag — Mono Style
 * Dark terminal / monospace aesthetic.
 * Loaded instead of the default styles when style = mono.
 */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #c8c8c8;
  background: #0d0d0d;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: #4da6ff; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #ffffff; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #f0f0f0; /* overridden in light mode below */
  line-height: 1.2;
}
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 { color: #111111; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 32px;
}

/* ============================================================
   HEADER
   ============================================================ */
#masthead {
  background: #0d0d0d;
  border-bottom: 1px solid #2a2a2a;
  /* padding-top set by customizer */
}

.site-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* padding-bottom set by customizer */
}

.mono-prompt {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: #2266cc;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.site-title {
  font-family: 'JetBrains Mono', monospace;
  /* font-size set by customizer */
  font-weight: 700;
  color: #4da6ff;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 40px rgba(77,166,255,0.2);
}
.site-title a { color: #4da6ff; }
.site-title a:hover { color: #fff; }

.mono-cursor {
  display: inline;
  color: #4da6ff;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.site-tagline {
  font-family: 'JetBrains Mono', monospace;
  /* font-size set by customizer */
  color: #444;
  letter-spacing: 0.12em;
  margin-top: 10px;
}
.mono-comment { color: #2266cc; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-navigation {
  border-top: 1px solid #2a2a2a;
}
.main-navigation { display: flex; justify-content: center; }
.main-navigation ul { display: flex; }
.main-navigation ul li { position: relative; }
.main-navigation ul li a {
  display: block;
  padding: 12px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #555;
  transition: color 0.15s ease, background 0.15s ease;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  color: #4da6ff;
  background: rgba(0,255,136,0.04);
}

.main-navigation ul ul {
  position: absolute; top: 100%; left: 0;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  min-width: 180px; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s; z-index: 100;
}
.main-navigation ul li:hover > ul { opacity: 1; pointer-events: auto; transform: none; }
.main-navigation ul ul li a { padding: 10px 16px; font-size: 0.72rem; }

.menu-toggle {
  display: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #4da6ff;
  padding: 12px 0;
}

/* ============================================================
   POST GRID
   ============================================================ */
#primary { padding-block: 40px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #2a2a2a;
  border: 1px solid #2a2a2a;
}

.post-card {
  background: #0d0d0d;
  padding: 20px;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  border-bottom: none;
}
.post-card:hover { background: #141414; }

/* Terminal titlebar */
.post-card-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #2a2a2a;
}
.post-card-bar span {
  display: block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.post-card-bar .dot-red    { background: #ff5f56; }
.post-card-bar .dot-yellow { background: #ffbd2e; }
.post-card-bar .dot-green  { background: #27c93f; }

.post-card .entry-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f0f0f0;
  margin-bottom: 12px;
  line-height: 1.3;
}
.post-card .entry-title a { color: #f0f0f0; }
.post-card .entry-title a:hover { color: #4da6ff; }

.post-card .post-thumbnail {
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
}
.post-card .post-thumbnail::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 2px,
    rgba(0,0,0,0.2) 2px, rgba(0,0,0,0.2) 4px
  );
  pointer-events: none; z-index: 1;
}
.post-card .post-thumbnail img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  filter: saturate(0.7) brightness(0.85);
  transition: filter 0.4s, transform 0.4s;
}
.post-card:hover .post-thumbnail img {
  filter: saturate(1) brightness(1);
  transform: scale(1.03);
}

.post-card .entry-excerpt {
  font-size: 0.75rem;
  color: #555;
  line-height: 1.65;
  margin-bottom: 12px;
  flex: 1;
}

.post-card .entry-meta {
  font-size: 0.65rem;
  color: #444;
  display: flex;
  align-items: center;
  border-top: 1px solid #1e1e1e;
  padding-top: 10px;
  margin-top: auto;
}
.post-card .entry-meta .meta-date { margin-right: 4px; }
.post-card .entry-meta .meta-date::before { content: 'date: '; color: #2266cc; }
.post-card .entry-meta .meta-sep { margin-inline: 4px; color: #333; }
.post-card .entry-meta .meta-cat { color: #7cc4ff; }
.post-card .entry-meta .meta-cat:hover { color: #fff; }
.post-card .entry-meta .meta-rule { flex: 1; height: 1px; background: #1e1e1e; margin-left: 10px; }

/* ============================================================
   SINGLE POST + SIDEBAR
   ============================================================ */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding-block: 32px;
  align-items: start;
}

.single .entry-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2a2a;
}
.single .entry-meta-top {
  font-size: 0.65rem; color: #555; margin-bottom: 10px;
}
.single .entry-meta-top .meta-cat { color: #7cc4ff; }
.single .entry-meta-top .meta-cat:hover { color: #fff; }

.single .entry-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.2;
}


.single .post-thumbnail { margin-bottom: 28px; position: relative; }
.single .post-thumbnail::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 3px,
    rgba(0,0,0,0.1) 3px, rgba(0,0,0,0.1) 4px
  );
  pointer-events: none;
}
.single .post-thumbnail img { width: 100%; }

.single .entry-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #c8c8c8;
}
.single .entry-content p { margin-bottom: 1.4em; }
.single .entry-content h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem; color: #f0f0f0;
  margin-block: 1.8em 0.5em;
}

.single .entry-content h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem; color: #f0f0f0;
  margin-block: 1.4em 0.4em;
}

.single .entry-content a { color: #7cc4ff; }
.single .entry-content a:hover { color: #fff; }
.single .entry-content strong { color: inherit; font-weight: 700; }
.single .entry-content ul, .single .entry-content ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.single .entry-content ul { list-style: disc; }

.single .entry-content ol { list-style: decimal; }
.single .entry-content li { margin-bottom: 0.4em; }
.single .entry-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83em;
  background: #1a1a1a; color: #4da6ff;
  border: 1px solid #2a2a2a; padding: 2px 6px;
}
.single .entry-content pre {
  background: #141414; border: 1px solid #2a2a2a;
  border-left: 3px solid #2266cc;
  padding: 18px; overflow-x: auto;
  font-size: 0.8rem; line-height: 1.6;
  margin-block: 1.4em;
}
.single .entry-content blockquote {
  border-left: 3px solid #2266cc;
  padding-left: 20px; margin-block: 1.6em;
  color: #666; font-style: italic;
}
.single .entry-content img { max-width: 100%; margin-block: 1em; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#secondary.widget-area {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 20px;
  position: sticky;
  top: 20px;
}

/* Sidebar widget top padding fix */
#secondary.widget-area .widget:first-child {
  padding-top: 0;
}

.widget-area .widget { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid #1e1e1e; }
.widget-area .widget:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.widget-area .widget-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; font-weight: 700;
  color: #4da6ff; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 10px; border-bottom: 1px solid #2a2a2a;
  margin-bottom: 14px;
}
.widget-area .widget-title::before { content: '> '; color: #2266cc; }

.widget_recent_entries ul li { padding-block: 7px; border-bottom: 1px solid #1e1e1e; font-size: 0.75rem; }
.widget_recent_entries ul li:last-child { border-bottom: none; }
.widget_recent_entries ul li a { color: #c8c8c8; }
.widget_recent_entries ul li a:hover { color: #4da6ff; }
.widget_recent_entries .post-date { display: block; font-size: 0.62rem; color: #444; margin-top: 2px; }
.widget_recent_entries .post-date::before { content: 'date: '; color: #2266cc; }

.widget_categories ul li { padding-block: 6px; border-bottom: 1px solid #1e1e1e; font-size: 0.75rem; }
.widget_categories ul li:last-child { border-bottom: none; }
.widget_categories ul li a { color: #555; }
.widget_categories ul li a:hover { color: #4da6ff; }

.widget_text p, .widget_custom_html p { font-size: 0.78rem; line-height: 1.6; color: #555; }
.widget_media_image img { width: 100%; }

/* Search widget */
.search-form { display: flex; border-bottom: 1px solid #2266cc; }
.search-form input[type="search"] {
  flex: 1; border: none; outline: none;
  background: transparent; color: #c8c8c8;
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; padding: 6px 0;
}
.search-form button {
  font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
  color: #4da6ff; padding: 6px 0 6px 10px;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area { margin-top: 48px; padding-top: 28px; border-top: 1px solid #2a2a2a; }
.comments-title, .comment-reply-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem; color: #f0f0f0;
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
}
.comments-title::before { content: 'i'; display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;background:#1a1a1a;border:1px solid #2a2a2a;color:#4da6ff;font-size:0.75rem;flex-shrink:0; }
.comment-reply-title::before { content:'+'; display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;background:#1a1a1a;border:1px solid #2a2a2a;color:#4da6ff;font-size:0.9rem;flex-shrink:0; }
.comment-form label { display:block;font-size:0.62rem;color:#555;letter-spacing:0.1em;text-transform:uppercase;margin-bottom:5px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea { width:100%;background:#1a1a1a;border:1px solid #2a2a2a;color:#c8c8c8;font-family:'JetBrains Mono',monospace;font-size:0.8rem;padding:10px 12px;outline:none;border-radius:0;transition:border-color 0.15s; }
.comment-form input:focus,.comment-form textarea:focus { border-color:#2266cc; }
.comment-form textarea { min-height:160px;resize:vertical; }
.comment-form .form-submit .submit { display:inline-block;background:transparent;border:1px solid #2266cc;color:#4da6ff;font-family:'JetBrains Mono',monospace;font-size:0.72rem;font-weight:700;letter-spacing:0.1em;text-transform:uppercase;padding:10px 24px;cursor:pointer;float:right;transition:all 0.15s; }
.comment-form .form-submit .submit:hover { background:#4da6ff;color:#0d0d0d; }
.logged-in-as,.comment-notes { font-size:0.75rem;color:#555;margin-bottom:16px; }
.comment-list .comment-body { padding-block:20px;border-bottom:1px solid #1e1e1e; }
.comment-list .comment-author { font-weight:700;font-size:0.82rem;color:#f0f0f0;margin-bottom:3px; }
.comment-list .comment-metadata { font-size:0.62rem;color:#444;margin-bottom:10px; }
.comment-list .comment-content p { font-size:0.85rem;line-height:1.65; }
.no-comments { font-family:'JetBrains Mono',monospace;font-size:1rem;display:flex;align-items:center;gap:14px; }
.no-comments::before { content:'i';display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;background:#1a1a1a;border:1px solid #2a2a2a;color:#4da6ff;font-size:0.75rem;flex-shrink:0; }

/* ============================================================
   DARK/LIGHT TOGGLE
   ============================================================ */
.theme-toggle-wrap {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  display: flex; align-items: center; gap: 8px;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 2px; padding: 6px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.theme-toggle-label { font-family:'JetBrains Mono',monospace;font-size:0.6rem;letter-spacing:0.08em;color:#555;text-transform:uppercase; }
.theme-toggle { width:40px;height:22px;background:#2a2a2a;border-radius:11px;border:1px solid #2266cc;position:relative;cursor:pointer;transition:background 0.2s; }
.theme-toggle::after { content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#2266cc;transition:transform 0.2s; }

/* ============================================================
   FOOTER
   ============================================================ */
#colophon {
  border-top: 1px solid #2a2a2a;
  padding-block: 32px 20px;
  background: #141414;
  margin-top: 40px;
}
.footer-widgets { display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin-bottom:28px;padding-bottom:28px;border-bottom:1px solid #2a2a2a; }
.site-info { display:flex;justify-content:space-between;align-items:center;font-family:'JetBrains Mono',monospace;font-size:0.65rem;color:#444; }
.footer-brand { font-family:'JetBrains Mono',monospace;font-size:0.9rem;font-weight:700;color:#4da6ff; }
.footer-menu { display:flex;gap:16px; }
.footer-menu li a { font-size:0.65rem;color:#444;font-family:'JetBrains Mono',monospace; }
.footer-menu li a:hover { color:#4da6ff; }

/* ============================================================
   PAGINATION
   ============================================================ */
.posts-navigation,.post-navigation,.pagination { margin-top:40px;padding-top:24px;border-top:1px solid #2a2a2a;font-family:'JetBrains Mono',monospace;font-size:0.75rem; }
.nav-links { display:flex;justify-content:flex-start;align-items:center;gap:4px;flex-wrap:wrap; }
.nav-links a { color:#4da6ff; }
.nav-links a:hover { color:#fff; }
.nav-links .page-numbers { display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 6px;border:1px solid #2a2a2a;color:#555;transition:all 0.15s; }
.nav-links .page-numbers.dots { border:none;color:#444; }
.nav-links .page-numbers:hover,.nav-links .page-numbers.current { background:#4da6ff;color:#0d0d0d;border-color:#4da6ff; }
.nav-links .prev,.nav-links .next { padding:0 10px; }

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive-header { padding-block:40px 28px;border-bottom:1px solid #2a2a2a;margin-bottom:32px; }
.archive-kicker { display:block;font-family:'JetBrains Mono',monospace;font-size:0.65rem;color:#2266cc;letter-spacing:0.15em;text-transform:uppercase;margin-bottom:8px; }
.archive-kicker::before { content:'$ cat '; }
.archive-title { font-family:'JetBrains Mono',monospace;font-size:clamp(1.3rem,3vw,2rem);color:#f0f0f0; }

/* ============================================================
   LIGHT MODE OVERRIDE (data-theme=light on top of mono)
   ============================================================ */
[data-theme="light"] body { background:#f5f5f0;color:#2a2a2a; }
[data-theme="light"] #masthead,[data-theme="light"] #colophon { background:#f5f5f0;border-color:#ccc; }
[data-theme="light"] .site-title { color:#1a5ccc;text-shadow:none; }
[data-theme="light"] .site-title a { color:#1a5ccc; }
[data-theme="light"] .site-title a:hover { color:#000; }
[data-theme="light"] .mono-prompt { color:#0d3d8a; }
[data-theme="light"] .mono-cursor { color:#1a5ccc; }
[data-theme="light"] .mono-comment { color:#0d3d8a; }
[data-theme="light"] .site-tagline { color:#888; }
[data-theme="light"] a { color:#1a5ccc; }
[data-theme="light"] a:hover { color:#000; }
[data-theme="light"] #site-navigation { border-top-color:#ccc; }
[data-theme="light"] .main-navigation ul li a { color:#555; }
[data-theme="light"] .main-navigation ul li a:hover { color:#1a5ccc;background:rgba(26,92,204,.05); }
[data-theme="light"] .post-grid { background:#ccc;border-color:#ccc; }
[data-theme="light"] .post-card { background:#f5f5f0; }
[data-theme="light"] .post-card:hover { background:#eee; }
[data-theme="light"] .post-card-bar .dot-red { background:#ff5f56; }
[data-theme="light"] .post-card .entry-title { color:#111; }
[data-theme="light"] .post-card .entry-title a { color:#111; }
[data-theme="light"] .post-card .entry-title a:hover { color:#1a5ccc; }
[data-theme="light"] .post-card .post-thumbnail img { filter:saturate(.9) brightness(.98); }
[data-theme="light"] .post-card .post-thumbnail::after { background:repeating-linear-gradient(to bottom,transparent 0,transparent 2px,rgba(0,0,0,.04) 2px,rgba(0,0,0,.04) 4px); }
[data-theme="light"] .post-card .entry-excerpt { color:#666; }
[data-theme="light"] .post-card .entry-meta { color:#888;border-top-color:#ddd; }
[data-theme="light"] .post-card .entry-meta .meta-date::before { color:#0d3d8a; }
[data-theme="light"] .post-card .entry-meta .meta-cat { color:#004499; }
[data-theme="light"] .post-card .entry-meta .meta-rule { background:#ddd; }
[data-theme="light"] .post-card-bar { border-bottom-color:#ddd; }
[data-theme="light"] .single .entry-header { border-bottom-color:#ccc; }
[data-theme="light"] .single .entry-title { color:#111; }
[data-theme="light"] .single .entry-title::before { color:#0d3d8a; }
[data-theme="light"] .single .entry-content { color:#333; }
[data-theme="light"] .single .entry-content h2 { color:#111; }
[data-theme="light"] .single .entry-content h2::before { color:#0d3d8a; }
[data-theme="light"] .single .entry-content h3 { color:#111; }
[data-theme="light"] .single .entry-content h3::before { color:#0d3d8a; }
[data-theme="light"] .single .entry-content h4,
[data-theme="light"] .single .entry-content h5,
[data-theme="light"] .single .entry-content h6 { color:#111; }
[data-theme="light"] .single .entry-content strong,
[data-theme="light"] .single .entry-content b { color:#0a0a0a; }
[data-theme="light"] .single .entry-content ol li,
[data-theme="light"] .single .entry-content ul li { color:#333; }
[data-theme="light"] h1,[data-theme="light"] h2,[data-theme="light"] h3,
[data-theme="light"] h4,[data-theme="light"] h5,[data-theme="light"] h6 { color:#111; }
[data-theme="light"] .single .entry-content a { color:#004499; }
[data-theme="light"] .single .entry-content code { background:#e5e5e0;color:#1a5ccc;border-color:#ccc; }
[data-theme="light"] .single .entry-content pre { background:#e5e5e0;border-color:#ccc;border-left-color:#0d3d8a; }
[data-theme="light"] .single .entry-content ul li::before { color:#0d3d8a; }
[data-theme="light"] .single .entry-content blockquote { border-left-color:#0d3d8a;color:#666; }
[data-theme="light"] .single .post-thumbnail::after { background:repeating-linear-gradient(to bottom,transparent 0,transparent 3px,rgba(0,0,0,.04) 3px,rgba(0,0,0,.04) 4px); }
[data-theme="light"] #secondary.widget-area { background:#eee;border-color:#ccc; }
[data-theme="light"] .widget-area .widget { border-bottom-color:#ddd; }
[data-theme="light"] .widget-area .widget-title { color:#1a5ccc;border-bottom-color:#ccc; }
[data-theme="light"] .widget-area .widget-title::before { color:#0d3d8a; }
[data-theme="light"] .widget_recent_entries ul li { border-bottom-color:#ddd; }
[data-theme="light"] .widget_recent_entries ul li a { color:#333; }
[data-theme="light"] .widget_recent_entries ul li a:hover { color:#1a5ccc; }
[data-theme="light"] .widget_recent_entries .post-date { color:#888; }
[data-theme="light"] .widget_recent_entries .post-date::before { color:#0d3d8a; }
[data-theme="light"] .widget_categories ul li { border-bottom-color:#ddd; }
[data-theme="light"] .widget_categories ul li a { color:#555; }
[data-theme="light"] .widget_categories ul li a:hover { color:#1a5ccc; }
[data-theme="light"] .search-form { border-bottom-color:#0d3d8a; }
[data-theme="light"] .search-form input { color:#333; }
[data-theme="light"] .search-form button { color:#1a5ccc; }
[data-theme="light"] .comments-area { border-top-color:#ccc; }
[data-theme="light"] .comments-title::before,[data-theme="light"] .comment-reply-title::before { background:#e5e5e0;border-color:#ccc;color:#1a5ccc; }
[data-theme="light"] .comment-form label { color:#666; }
[data-theme="light"] .comment-form input,[data-theme="light"] .comment-form textarea { background:#fff;border-color:#ccc;color:#333; }
[data-theme="light"] .comment-form input:focus,[data-theme="light"] .comment-form textarea:focus { border-color:#0d3d8a; }
[data-theme="light"] .comment-form .form-submit .submit { border-color:#0d3d8a;color:#1a5ccc; }
[data-theme="light"] .comment-form .form-submit .submit:hover { background:#1a5ccc;color:#fff; }
[data-theme="light"] #colophon { background:#eee;border-top-color:#ccc; }
[data-theme="light"] .footer-brand { color:#1a5ccc; }
[data-theme="light"] .footer-menu li a { color:#666; }
[data-theme="light"] .footer-menu li a:hover { color:#1a5ccc; }
[data-theme="light"] .site-info { color:#888; }
[data-theme="light"] .theme-toggle-wrap { background:#eee;border-color:#ccc; }
[data-theme="light"] .theme-toggle { border-color:#0d3d8a;background:#ddd; }
[data-theme="light"] .theme-toggle::after { background:#0d3d8a; }
[data-theme="light"] .theme-toggle-label { color:#666; }
[data-theme="light"] .nav-links a { color:#1a5ccc; }
[data-theme="light"] .nav-links .page-numbers:hover,[data-theme="light"] .nav-links .page-numbers.current { background:#1a5ccc;color:#fff;border-color:#1a5ccc; }
[data-theme="light"] .posts-navigation,[data-theme="light"] .post-navigation { border-top-color:#ccc; }
[data-theme="light"] .archive-kicker { color:#0d3d8a; }
[data-theme="light"] .archive-title { color:#111; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet — 2 column grid */
@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .single-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-block: 24px;
  }
  #secondary.widget-area {
    position: static;
    border-top: 1px solid #2a2a2a;
    margin-top: 8px;
  }
  [data-theme="light"] #secondary.widget-area {
    border-top-color: #ccc;
  }
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Mobile menu */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    padding: 12px 0;
  }
  .main-navigation {
    justify-content: flex-start;
  }
  .main-navigation ul {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid #2a2a2a;
  }
  [data-theme="light"] .main-navigation ul {
    border-top-color: #ccc;
  }
  .main-navigation ul.toggled {
    display: flex;
  }
  .main-navigation ul li a {
    padding: 12px 0;
    border-bottom: 1px solid #1e1e1e;
    width: 100%;
  }
  [data-theme="light"] .main-navigation ul li a {
    border-bottom-color: #ddd;
  }
  .main-navigation ul ul {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    border: none;
    padding-left: 16px;
  }
}

/* Mobile — single column */
@media (max-width: 600px) {
  .container {
    padding-inline: 16px;
  }

  /* Stack grid to 1 column */
  .post-grid {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  /* Header */
  #masthead {
    padding-top: 24px !important;
  }
  .site-branding {
    padding-bottom: 16px !important;
  }
  .site-title {
    font-size: clamp(1.4rem, 9vw, 2.2rem) !important;
    word-break: break-word;
  }
  .site-tagline {
    font-size: 0.6rem !important;
    letter-spacing: 0.1em;
    padding-inline: 8px;
    text-align: center;
  }
  .mono-prompt {
    font-size: 0.6rem;
  }

  /* Cards */
  .post-card {
    padding: 16px;
  }
  .post-card .entry-title {
    font-size: 0.88rem;
  }
  .post-card .post-thumbnail img {
    aspect-ratio: 16/9;
  }

  /* Single post */
  .single .entry-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }
  .single .entry-content {
    font-size: 0.85rem;
  }
  .single .entry-content pre {
    font-size: 0.72rem;
    padding: 12px;
    overflow-x: auto;
  }
  .single .entry-content code {
    font-size: 0.78em;
  }

  /* Sidebar stacks below content */
  #secondary.widget-area {
    padding: 16px;
  }

  /* Footer */
  .footer-widgets {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .site-info {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .footer-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  /* Pagination */
  .nav-links {
    gap: 3px;
  }
  .nav-links .page-numbers {
    min-width: 30px;
    height: 30px;
    font-size: 0.7rem;
  }

  /* Toggle button */
  .theme-toggle-wrap {
    bottom: 12px;
    right: 12px;
    padding: 5px 10px;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .site-title {
    font-size: 1.3rem !important;
  }
  .post-card {
    padding: 12px;
  }
}

/* ============================================================
   TEXT OVERFLOW & BLEED FIXES — Mono Theme
   ============================================================ */
.entry-content,
.entry-excerpt,
.post-card,
.single .entry-content,
.widget-area {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.entry-content a,
.entry-content code {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.entry-content img,
.post-card img,
.post-thumbnail img {
  max-width: 100%;
  height: auto;
}

.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content video {
  max-width: 100%;
}

/* ============================================================
   TABLE STYLES — Mono Theme (terminal aesthetic)
   ============================================================ */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.6em;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
  border: 1px solid #2a2a2a;
}

.entry-content table thead {
  background: #1a1a1a;
  border-bottom: 2px solid #4da6ff;
}

.entry-content table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4da6ff;
  white-space: nowrap;
}

.entry-content table td {
  padding: 9px 14px;
  border-bottom: 1px solid #1e1e1e;
  vertical-align: top;
  color: #c8c8c8;
}

.entry-content table tbody tr:nth-child(even) {
  background: #141414;
}

.entry-content table tbody tr:hover {
  background: #1e1e1e;
}

/* Light mode table overrides */
[data-theme="light"] .entry-content table {
  border-color: #ccc;
}
[data-theme="light"] .entry-content table thead {
  background: #e8e8e8;
  border-bottom-color: #1a5ccc;
}
[data-theme="light"] .entry-content table th {
  color: #1a5ccc;
}
[data-theme="light"] .entry-content table td {
  color: #333;
  border-bottom-color: #ddd;
}
[data-theme="light"] .entry-content table tbody tr:nth-child(even) {
  background: #f0f0ec;
}
[data-theme="light"] .entry-content table tbody tr:hover {
  background: #e8e8e4;
}

/* Scrollable table wrapper for narrow screens */
@media (max-width: 600px) {
  .entry-content table {
    font-size: 0.72rem;
  }
  .entry-content table th,
  .entry-content table td {
    padding: 7px 10px;
  }
}

/* ============================================================
   BROKEN IMAGE GRACEFUL FALLBACK — Mono
   ============================================================ */
.post-thumbnail img[src=""],
.post-thumbnail img:not([src]) {
  display: none;
}
.post-card .post-thumbnail:empty { display: none; }
.post-grid img, .single-layout img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   404 PAGE — Mono Theme
   ============================================================ */
.error-404-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding-block: 48px;
  align-items: start;
}

.error-prompt {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #2266cc;
  margin-bottom: 8px;
}

.error-num {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  color: #4da6ff;
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px rgba(77,166,255,0.2);
}

.error-msg {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #2266cc;
  margin-top: 4px;
}

.error-404-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: #f0f0f0;
  margin-bottom: 14px;
  margin-top: 16px;
}
[data-theme="light"] .error-404-title { color: #111; }
[data-theme="light"] .error-num { color: #1a5ccc; text-shadow: none; }
[data-theme="light"] .error-prompt,
[data-theme="light"] .error-msg { color: #0d3d8a; }

.error-404-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.7;
}
[data-theme="light"] .error-404-desc { color: #555; }

.error-home-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #4da6ff;
  border-bottom: 1px solid #2266cc;
  padding-bottom: 1px;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.error-home-link:hover { color: #fff; }
[data-theme="light"] .error-home-link { color: #1a5ccc; }
[data-theme="light"] .error-home-link:hover { color: #000; }

.error-search-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #444;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
[data-theme="light"] .error-search-label { color: #666; }

.error-recent-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4da6ff;
  padding-bottom: 10px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 14px;
}
[data-theme="light"] .error-recent-title { color: #1a5ccc; border-bottom-color: #ccc; }

.error-recent-list { list-style: none; }
.error-recent-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-block: 10px;
  border-bottom: 1px solid #1e1e1e;
}
.error-recent-item:last-child { border-bottom: none; }
[data-theme="light"] .error-recent-item { border-bottom-color: #ddd; }
.error-recent-thumb { flex-shrink: 0; }
.error-recent-thumb img { width: 64px; height: 48px; object-fit: cover; filter: saturate(0.6); }
.error-recent-text { display: flex; flex-direction: column; gap: 3px; }
.error-recent-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #c8c8c8;
  line-height: 1.4;
}
.error-recent-link:hover { color: #4da6ff; }
[data-theme="light"] .error-recent-link { color: #333; }
[data-theme="light"] .error-recent-link:hover { color: #1a5ccc; }
.error-recent-date { font-size: 0.62rem; color: #444; }
[data-theme="light"] .error-recent-date { color: #888; }

.error-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.error-cat-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 4px 10px;
  border: 1px solid #2a2a2a;
  color: #555;
  transition: all 0.15s;
}
.error-cat-link span { color: #444; margin-left: 3px; }
.error-cat-link:hover { border-color: #4da6ff; color: #4da6ff; }
[data-theme="light"] .error-cat-link { border-color: #ccc; color: #666; }
[data-theme="light"] .error-cat-link:hover { border-color: #1a5ccc; color: #1a5ccc; }

@media (max-width: 768px) {
  .error-404-wrap { grid-template-columns: 1fr; gap: 32px; padding-block: 32px; }
}

/* ============================================================
   MOBILE NAV BAR + CTA BUTTON — Mono Theme
   ============================================================ */
.mobile-nav-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mobile-cta-btn {
  display: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  color: #4da6ff;
  border: 1px solid #2266cc;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.mobile-cta-btn:hover {
  background: #4da6ff;
  color: #0d0d0d;
  border-color: #4da6ff;
}

[data-theme="light"] .mobile-cta-btn {
  color: #1a5ccc;
  border-color: #1a5ccc;
}
[data-theme="light"] .mobile-cta-btn:hover {
  background: #1a5ccc;
  color: #fff;
}

@media (max-width: 768px) {
  .mobile-nav-bar {
    display: flex;
  }
  .mobile-cta-btn {
    display: inline-block;
  }
}

/* Mono hamburger icon */
.menu-toggle-icon span { background: #4da6ff; }
[data-theme="light"] .menu-toggle-icon span { background: #1a5ccc; }
.menu-toggle-spacer { width: 24px; display: none; }
@media (max-width: 768px) {
  .menu-toggle-spacer { display: block; }
  .mobile-cta-btn { display: inline-block; }
  .mobile-nav-bar { display: flex; }
}
