/*
 * Custom overrides for Tim Roller's site
 * Complete dark theme override of Poole + Hyde
 * Gradient headings, project cards, terminal demo
 */

/* ==========================================================
   FULL DARK THEME — override every light color from poole.css
   ========================================================== */

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
  background-color: #0d1117;
  color: #c9d1d9;
}

/* Links — everywhere */
a { color: #58a6ff; }
a:hover, a:focus { color: #79c0ff; }
a strong { color: inherit; }

/* Headings — gradient effect */
h1, h2, h3, h4, h5, h6 {
  color: #e6edf3;
  font-weight: 600;
  text-rendering: optimizeLegibility;
}

/* Post and page titles get the gradient */
.post-title,
.post-title a,
.page-title,
.hero h1 {
  background: linear-gradient(135deg, #4a9eff, #9b6dff, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.post-title a:hover {
  background: linear-gradient(135deg, #6db3ff, #b48aff, #d48ef5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #30363d;
  /* h2 stays solid color for readability */
  color: #e6edf3;
  background: none;
  -webkit-text-fill-color: #e6edf3;
}

h3 {
  font-size: 1.2rem;
  color: #58a6ff;
  background: none;
  -webkit-text-fill-color: #58a6ff;
}

/* Body text */
p { color: #c9d1d9; margin-top: 0; margin-bottom: 1rem; }
strong { color: #e6edf3; }
li { color: #c9d1d9; }

/* Misc elements */
hr { border: none; border-top: 1px solid #30363d; margin: 2rem 0; }
abbr { color: #8b949e; }
abbr[title] { border-bottom-color: #30363d; }

/* Code — dark bg */
code {
  background: #1c2333;
  color: #e6edf3;
  padding: 0.2em 0.4em;
  font-size: 85%;
  border-radius: 4px;
}
pre {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
  color: #e6edf3;
}
pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
}
.highlight { background: transparent; }
.highlight pre { background: #161b22; border: 1px solid #30363d; border-radius: 8px; }

/* Blockquotes */
blockquote {
  border-left: 0.25rem solid #58a6ff;
  color: #8b949e;
  padding: 0.5rem 1rem;
}

/* Tables — dark */
table { border: 1px solid #30363d; border-collapse: collapse; }
td, th { padding: 0.5rem 0.75rem; border: 1px solid #30363d; }
th { background: #161b22; color: #58a6ff; font-weight: 600; font-size: 0.85rem; }
td { background: #0d1117; color: #c9d1d9; }
tbody tr:nth-child(odd) td,
tbody tr:nth-child(odd) th { background-color: #161b22; }
tbody tr:hover td { background: #1c2333; }

/* Messages */
.message { background-color: #161b22; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px; }

/* Masthead */
.masthead-title, .masthead-title a { color: #e6edf3; }
.masthead-title small { color: #8b949e; }

/* Posts and pages */
.post { margin-bottom: 3em; border-bottom: 1px solid #21262d; padding-bottom: 2rem; }
.post img, .page img {
  border-radius: 8px;
  border: 1px solid #30363d;
  margin: 0.5rem 0 1.5rem;
}
.post-date { color: #8b949e; font-size: 0.85rem; display: block; margin-top: -0.5rem; margin-bottom: 1rem; }

/* Related posts */
.related-posts li a { color: #58a6ff; }
.related-posts li a:hover { color: #79c0ff; }

/* ==========================================================
   SIDEBAR — dark gradient
   ========================================================== */

.sidebar {
  background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
  border-right: 1px solid #30363d;
  color: rgba(255,255,255,0.5);
  padding-top: 1.5rem;
}
/* Override Hyde's bottom-pinned sticky positioning */
@media (min-width: 48em) {
  .sidebar-sticky {
    position: absolute;
    top: 1rem;
    bottom: auto;
    left: 1rem;
    right: 1rem;
  }
}
.sidebar a { color: #58a6ff; }

/* Logo in sidebar */
.sidebar-logo {
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
}
.sidebar-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  clip-path: circle(42% at center);
  transition: transform 0.3s;
}
.sidebar-logo-img:hover {
  transform: scale(1.05);
}

.sidebar-about h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4a9eff, #9b6dff, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0;
}
.sidebar-about .lead {
  color: #8b949e;
  font-size: 0.82rem;
  line-height: 1.5;
}

.sidebar-nav-item {
  color: #8b949e;
  font-size: 0.9rem;
  padding: 0.15rem 0;
  transition: color 0.15s;
}
.sidebar-nav-item:hover,
.sidebar-nav-item:focus,
.sidebar-nav-item.active { color: #58a6ff; text-decoration: none; }

.sidebar p { color: #484f58; font-size: 0.75rem; }

/* Sidebar icon links */
.sidebar-icons {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid #30363d;
}
.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  max-width: 22px;
  color: #8b949e;
  transition: color 0.2s, transform 0.2s;
}
.sidebar-icon:hover {
  color: #58a6ff;
  transform: scale(1.15);
  text-decoration: none;
}
.sidebar-icon svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  display: block;
}

/* Override all theme-base colors */
.theme-base-0d .sidebar { background: linear-gradient(180deg, #161b22 0%, #0d1117 100%); border-right: 1px solid #30363d; }
.theme-base-0d .content a,
.theme-base-0d .related-posts li a:hover { color: #58a6ff; }

/* Content area */
.content { max-width: 48rem; }
@media (min-width: 48em) { .content { max-width: 48rem; margin-left: 20rem; } }
@media (min-width: 64em) { .content { margin-left: 22rem; max-width: 52rem; } }

/* ==========================================================
   HERO
   ========================================================== */

.hero {
  padding: 2rem 0 3rem;
  border-bottom: 1px solid #30363d;
  margin-bottom: 2rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 0.25rem; }
.hero .tagline { color: #8b949e; font-size: 1.1rem; margin-bottom: 1.5rem; -webkit-text-fill-color: #8b949e; background: none; }
.hero .summary { color: #c9d1d9; font-size: 1rem; line-height: 1.7; max-width: 40rem; }

/* ==========================================================
   PROJECT CARDS
   ========================================================== */

.project-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: border-color 0.2s;
}
.project-card:hover { border-color: #58a6ff; }
.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #4a9eff, #9b6dff, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.project-card p { color: #8b949e; font-size: 0.95rem; margin-bottom: 0.75rem; }
.project-card li { color: #c9d1d9; font-size: 0.9rem; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}
.tag-rag { background: rgba(63,185,80,0.15); color: #3fb950; }
.tag-agent { background: rgba(88,166,255,0.15); color: #58a6ff; }
.tag-mcp { background: rgba(188,140,255,0.15); color: #bc8cff; }
.tag-sdk { background: rgba(57,210,192,0.15); color: #39d2c0; }
.tag-python { background: rgba(210,153,34,0.15); color: #d29922; }

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.project-link { color: #58a6ff; font-weight: 600; font-size: 0.85rem; }

/* Architecture diagrams (legacy, kept for compatibility) */
.arch-diagram {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8b949e;
}

/* Flow diagrams — clean HTML boxes, no ASCII alignment issues */
.flow-diagram {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.flow-arrow {
  color: #484f58;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.25rem 0;
}
.flow-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.flow-box {
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  text-align: center;
  color: #c9d1d9;
  -webkit-text-fill-color: #c9d1d9;
  background: none;
}
.flow-box small {
  display: block;
  color: #8b949e;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}
.flow-box.flow-primary {
  background: #161b22;
  border-color: #58a6ff;
  color: #e6edf3;
  -webkit-text-fill-color: #e6edf3;
  font-weight: 600;
}
.flow-box.flow-tool {
  background: #161b22;
  border-color: #30363d;
  flex: 1;
  min-width: 100px;
}
.flow-box.flow-output {
  background: rgba(63,185,80,0.08);
  border-color: #3fb950;
  color: #3fb950;
  -webkit-text-fill-color: #3fb950;
  flex: 1;
  min-width: 120px;
}
.flow-box.flow-input {
  background: #161b22;
  border-color: #bc8cff;
  color: #bc8cff;
  -webkit-text-fill-color: #bc8cff;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
}

/* ==========================================================
   TERMINAL DEMO
   ========================================================== */

.terminal {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
}
.terminal-bar {
  background: #161b22;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #30363d;
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #f85149; }
.terminal-dot.yellow { background: #d29922; }
.terminal-dot.green { background: #3fb950; }
.terminal-title { color: #8b949e; font-size: 0.75rem; margin-left: 0.5rem; font-family: 'SF Mono', monospace; }
.terminal-body {
  padding: 1rem 1.25rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #e6edf3;
  max-height: 400px;
  overflow-y: auto;
}
.terminal-body .prompt { color: #3fb950; }
.terminal-body .cmd { color: #e6edf3; }
.terminal-body .output { color: #8b949e; }
.terminal-body .highlight { color: #58a6ff; }
.terminal-body .metric { color: #d29922; }

/* ==========================================================
   TIMELINE
   ========================================================== */

.timeline { position: relative; padding-left: 2rem; margin: 1.5rem 0; }
.timeline::before { content: ''; position: absolute; left: 0.45rem; top: 0; bottom: 0; width: 2px; background: #30363d; }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.7rem; top: 0.5rem; width: 10px; height: 10px; border-radius: 50%; background: #58a6ff; border: 2px solid #0d1117; }
.timeline-year { font-size: 0.75rem; color: #58a6ff; font-weight: 700; }
.timeline-role { font-weight: 600; color: #e6edf3; }
.timeline-company { color: #8b949e; font-size: 0.9rem; }

/* ==========================================================
   WRITING CARDS
   ========================================================== */

.writing-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1rem 0;
  transition: border-color 0.2s;
}
.writing-card:hover { border-color: #58a6ff; }
.writing-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  background: none;
  -webkit-text-fill-color: #e6edf3;
}
.writing-card h3 a {
  color: #e6edf3 !important;
  -webkit-text-fill-color: #e6edf3 !important;
  background: none !important;
}
.writing-card h3 a:hover {
  color: #58a6ff !important;
  -webkit-text-fill-color: #58a6ff !important;
}
.writing-card p { color: #8b949e; font-size: 0.9rem; margin-bottom: 0.5rem; }
.writing-card .read-time { color: #484f58; font-size: 0.8rem; }

/* ==========================================================
   PAGINATION
   ========================================================== */

.pagination-item { color: #8b949e; border: 1px solid #30363d; background: #161b22; }
a.pagination-item:hover { background: #1c2333; border-color: #58a6ff; color: #58a6ff; }
