/* ============================================
   BOT. — Blog on Tech
   Dark muted grape theme, IBM Plex Mono/Serif
   ============================================ */

:root {
  --bg:           #1a1520;
  --bg-sidebar:   #141019;
  --bg-post:      #1e1826;
  --border:       #2e2638;
  --text:         #d4cedd;
  --text-muted:   #7a6e85;
  --text-dim:     #4a4255;
  --accent-yellow:#f0c040;
  --accent-red:   #d94f3d;
  --accent-blue:  #4a8fd4;
  --accent-hover: #c9a8e8;
  --font-mono:    'IBM Plex Mono', monospace;
  --font-serif:   'IBM Plex Serif', Georgia, serif;
  --sidebar-w:    260px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.7;
  min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */

.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================
   BOT. LOGOTYPE
   ============================================ */

.site-title {
  display: block;
  text-decoration: none;
  line-height: 1;
  margin-bottom: -0.5rem;
  /* Allow letters to overflow and overlap */
  position: relative;
}

.bot-letter,
.bot-dot {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 4.5rem;
  display: inline-block;
  position: relative;
  letter-spacing: -0.05em;
}

/* B — yellow, tilted slightly left, nudged down */
.bot-b {
  color: var(--accent-yellow);
  transform: rotate(-3deg) translateY(4px) translateX(2px);
  z-index: 3;
}

/* O — red, tilted right, overlapping B slightly */
.bot-o {
  color: var(--accent-red);
  transform: rotate(2.5deg) translateY(-2px) translateX(-6px);
  z-index: 2;
}

/* T — blue, tilted left, overlapping O */
.bot-t {
  color: var(--accent-blue);
  transform: rotate(-1.5deg) translateY(5px) translateX(-10px);
  z-index: 1;
}

/* . — yellow, tight after T */
.bot-dot {
  color: var(--accent-yellow);
  font-size: 4.5rem;
  transform: rotate(3deg) translateY(-4px) translateX(-14px);
  z-index: 4;
}

.site-desc {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* ============================================
   SIDEBAR SECTIONS
   ============================================ */

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* ============================================
   SEARCH
   ============================================ */

.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--accent-blue);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.search-result-item {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.search-result-item a {
  color: var(--accent-hover);
  text-decoration: none;
}

.search-result-item a:hover {
  color: var(--text);
}

/* ============================================
   CATEGORY LIST
   ============================================ */

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.category-list a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.category-list a:hover {
  color: var(--accent-hover);
}

/* ============================================
   ARCHIVE TREE
   ============================================ */

.archive-tree {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.archive-year > summary,
.archive-month > summary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 0.1rem 0;
  transition: color 0.15s;
}

.archive-year > summary::-webkit-details-marker,
.archive-month > summary::-webkit-details-marker {
  display: none;
}

.archive-year > summary::before {
  content: '▸ ';
  font-size: 0.6rem;
  color: var(--text-dim);
}

.archive-year[open] > summary::before {
  content: '▾ ';
}

.archive-month > summary::before {
  content: '  ▸ ';
  font-size: 0.6rem;
  color: var(--text-dim);
}

.archive-month[open] > summary::before {
  content: '  ▾ ';
}

.archive-year > summary:hover,
.archive-month > summary:hover {
  color: var(--accent-hover);
}

.archive-months {
  list-style: none;
  padding-left: 0.5rem;
  margin-top: 0.2rem;
}

.archive-posts {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.archive-posts a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-posts a:hover {
  color: var(--accent-hover);
}

/* ============================================
   RSS LINK
   ============================================ */

.rss-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.rss-link:hover {
  color: var(--accent-yellow);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 3.5rem;
  max-width: 780px;
}

/* ============================================
   POSTS
   ============================================ */

.post-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-full {
  padding-bottom: 3.5rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.post-full:last-of-type {
  border-bottom: none;
}

.post-header {
  margin-bottom: 1.25rem;
}

.post-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.post-title a:hover {
  color: var(--accent-hover);
}

.post-single .post-title {
  font-size: 1.6rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-cats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-cat {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.7rem;
  border: 1px solid #2a3d55;
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

.post-cat:hover {
  background: #1e3050;
  color: var(--text);
}

/* ============================================
   POST BODY TYPOGRAPHY
   ============================================ */

.post-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.post-body p {
  margin-bottom: 1.25rem;
}

.post-body h2 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.05em;
}

.post-body h3 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
  letter-spacing: 0.05em;
}

.post-body a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.post-body a:hover {
  color: var(--text);
  text-decoration-color: var(--accent-hover);
}

.post-body blockquote {
  border-left: 3px solid var(--accent-blue);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #231d2b;
  padding: 0.15em 0.35em;
  border-radius: 2px;
  color: var(--accent-yellow);
}

.post-body pre {
  background: #141019;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
}

.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-body li {
  margin-bottom: 0.3rem;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin: 1.5rem 0;
}

/* ============================================
   POST FOOTER
   ============================================ */

.post-footer {
  margin-top: 1.5rem;
}

.permalink-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.permalink-link:hover {
  color: var(--accent-hover);
}

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

.pagination {
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
}

.page-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.page-link:hover {
  color: var(--accent-hover);
}

/* ============================================
   CATEGORY PAGE
   ============================================ */

.category-page-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}

.category-page-title span {
  color: var(--accent-blue);
}

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

@media (max-width: 800px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
  }

  .bot-letter,
  .bot-dot {
    font-size: 3.5rem;
  }

  .main-content {
    padding: 2rem 1.5rem;
  }
}
