/* The Cyber Omelette - Clean, minimal blog style */

:root {
  --bg: #fafafa;
  --text: #222;
  --text-muted: #666;
  --accent: #e85d04;
  --accent-hover: #d14800;
  --border: #e0e0e0;
  --code-bg: #f4f4f4;
  --sidebar-bg: #f0f0f0;
  --max-width: 1100px;
  --content-width: 720px;
  --sidebar-width: 240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #e8e8e8;
    --text-muted: #999;
    --accent: #ff7b29;
    --accent-hover: #ff9147;
    --border: #333;
    --code-bg: #252525;
    --sidebar-bg: #222;
  }
}

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

html {
  font-size: 17px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Site Header */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

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

.logo-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

.logo-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.1rem;
}

/* Layout */
.layout {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
}

.sidebar::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

.sidebar:hover {
  scrollbar-width: thin; /* Firefox */
}

.sidebar:hover::-webkit-scrollbar {
  width: 6px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sidebar:hover::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--sidebar-bg);
  color: var(--accent);
}

.sidebar-categories h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.sidebar-category {
  margin-bottom: 1.25rem;
}

.sidebar-category h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.sidebar-category ul {
  list-style: none;
  font-size: 0.85rem;
}

.sidebar-category li {
  margin-bottom: 0.25rem;
}

.sidebar-category a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.sidebar-category .more {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

/* Main content */
main {
  flex: 1;
  min-width: 0;
  max-width: var(--content-width);
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-preview {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
  border-bottom: none;
}

.post-preview h2 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.post-preview h2 a {
  color: var(--text);
  text-decoration: none;
}

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

.post-preview time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-excerpt {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: var(--code-bg);
  border-radius: 3px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tag:hover {
  background: var(--accent);
  color: white;
}

/* Post content */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-header time {
  color: var(--text-muted);
}

.post-content {
  line-height: 1.7;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

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

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

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

.post-content ul,
.post-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

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

.post-content iframe {
  max-width: 100%;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

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

/* Post footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Site footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* About page */
.about-page h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

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

  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    margin-bottom: 1.5rem;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 1.5rem;
    margin-bottom: 0;
    padding-bottom: 1rem;
  }

  .sidebar-nav a {
    padding: 0;
    font-size: 0.95rem;
  }

  .sidebar-categories {
    display: none;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 0 1rem;
  }

  .logo-icon {
    font-size: 2rem;
  }

  .logo-title {
    font-size: 1.4rem;
  }

  .post-header h1 {
    font-size: 1.6rem;
  }
}
