/* mladen.me - Minimalist Redesign
   Clean, monospace aesthetic */

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

/* ==================== Theme Variables ==================== */
:root {
  --color-bg: #fff;
  --color-text: #000;
  --color-text-secondary: #333;
  --color-text-muted: #666;
  --color-text-faint: #999;
  --color-border: #eee;
  --color-border-subtle: #ddd;
  --color-surface: #f5f5f5;
  --color-footer-bg: #fafafa;
  --color-selection: rgba(0, 0, 0, 0.1);
  --color-cursor-dot: rgba(128, 128, 128, 0.3);
}

[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-text: #e5e5e5;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #888;
  --color-text-faint: #888;
  --color-border: #333;
  --color-border-subtle: #333;
  --color-surface: #252525;
  --color-footer-bg: #1f1f1f;
  --color-selection: rgba(255, 255, 255, 0.15);
  --color-cursor-dot: rgba(180, 180, 180, 0.35);
}

/* ==================== Base ==================== */
body {
  font-family: 'Roboto Mono', monospace;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

::selection {
  background-color: var(--color-selection);
}

/* ==================== Layout ==================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ==================== Header & Navigation ==================== */
header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.site-title {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

nav {
  display: flex;
  gap: 2rem;
}

.theme-toggle {
  margin-left: auto;
}

nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover,
nav a.active {
  color: var(--color-text);
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.5px;
  width: fit-content;
  max-width: 100%;
}

h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -2px;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  color: var(--color-text);
}

h3 { font-size: 1.15rem; }
h4, h5, h6 { font-size: 1rem; }

p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  width: fit-content;
  max-width: 100%;
}

a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: border-color 0.2s ease;
}

a:hover {
  border-color: var(--color-text);
}

strong {
  font-weight: 500;
}

/* ==================== Post Header ==================== */
.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.post-title {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -2px;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.post-meta span:not(:last-child)::after {
  content: " / ";
  margin: 0 0.25rem;
}

.post-tags {
  display: inline;
}

.post-tags a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-bottom: none;
}

.post-tags a:hover {
  color: var(--color-text);
}

/* ==================== Table of Contents ==================== */
.toc {
  background: var(--color-surface);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--color-border-subtle);
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.toc li {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.toc li:last-child {
  margin-bottom: 0;
}

.toc a {
  color: var(--color-text-secondary);
  border-bottom: none;
}

.toc a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* ==================== Post Content ==================== */
.post-content {
  margin-bottom: 4rem;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h2 {
  scroll-margin-top: 2rem;
}

/* Lists */
.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

.post-content li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
  width: fit-content;
  max-width: 100%;
}

/* Code */
code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.875em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
}

pre {
  background: var(--color-surface);
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--color-border-subtle);
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* Blockquotes */
blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border-subtle);
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote p {
  color: var(--color-text-muted);
}

/* Images */
.post-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 500;
  color: var(--color-text);
}

td {
  color: var(--color-text-secondary);
}

/* ==================== Post List ==================== */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-list-item {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-surface);
}

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

.post-list-item a {
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 400;
  border-bottom: none;
  transition: color 0.2s ease;
}

.post-list-item a:hover {
  color: var(--color-text-muted);
}

.post-list-date {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-faint);
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

/* Year grouping */
.year-group {
  margin-bottom: 3rem;
}

.year-heading {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-faint);
  margin-bottom: 1.5rem;
  text-transform: lowercase;
  letter-spacing: 1px;
}

/* ==================== About Page ==================== */
.about-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: var(--color-text-secondary);
}

.about-links {
  list-style: none;
}

.about-links li {
  margin-bottom: 0.75rem;
}

.about-links a {
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
}

.about-links a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* ==================== Footer ==================== */
footer {
  margin-top: 2rem;
  padding: 2rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-footer-bg);
}

footer p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ==================== Wiki-link (unlinked) ==================== */
.wikilink-unlinked {
  color: var(--color-text-muted);
  background: var(--color-surface);
  padding: 0.1em 0.3em;
}

/* ==================== Cursor Dot ==================== */
.cursor-dot {
  position: fixed;
  width: 24px;
  height: 24px;
  background-color: var(--color-cursor-dot);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body:hover .cursor-dot {
  opacity: 1;
}

/* Hide cursor dot on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot {
    display: none;
  }
}

/* ==================== Theme Toggle ==================== */
.theme-toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-text);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }

  header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .site-title {
    font-size: 1.25rem;
  }

  nav {
    gap: 1rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  h1,
  .post-title {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  p,
  .post-content li {
    font-size: 1rem;
  }

  .post-list-item a {
    font-size: 1rem;
  }

  .toc {
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
  }

  .toc li {
    font-size: 0.9rem;
  }

  pre {
    padding: 1rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }
}
