:root {
  --bg: #f0ebe4;
  --text: #000000;
  --text-muted: #555;
  --border: #d4cfc6;
}

[data-theme="dark"] {
  --bg: #000000;
  --text: #e0e0e0;
  --text-muted: #999;
  --border: #333;
}

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

html, body {
  background: var(--bg);
}

body {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 24px;
  min-height: 100vh;
}

/* Navigation toggle */
header {
  margin-bottom: 60px;
  display: flex;
  justify-content: center;
}

nav.toggle {
  display: inline-flex;
  position: relative;
  background: #000000;
  border-radius: 20px;
  padding: 4px;
  gap: 0;
}

[data-theme="dark"] nav.toggle {
  background: #222;
}

.toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #000000;
  border-radius: 16px;
  transition: transform 0.3s ease;
  z-index: 0;
}

[data-theme="dark"] .toggle-slider {
  background: #00ffff;
}

nav.toggle a {
  font-size: 0.95rem;
  text-decoration: none;
  color: #888;
  padding: 8px 20px;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

nav.toggle a:hover {
  color: #aaa;
}

nav.toggle[data-active="people"] a:first-of-type,
nav.toggle[data-active="rambels"] a:last-of-type {
  color: #00ffff;
}

[data-theme="dark"] nav.toggle[data-active="people"] a:first-of-type,
[data-theme="dark"] nav.toggle[data-active="rambels"] a:last-of-type {
  color: #000000;
}

/* Slider position */
nav.toggle[data-active="rambels"] .toggle-slider {
  transform: translateX(100%);
}

/* Typography */
h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
}

h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p {
  margin-bottom: 1.3em;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 20px;
}

.post-list a {
  text-decoration: none;
  display: block;
}

.post-list a:hover {
  text-decoration: underline;
}

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

.post-list time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 12px;
}

/* Single post */
.post-header {
  text-align: center;
  margin-bottom: 50px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-header h1 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: normal;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  margin: 0 0 12px 0;
  width: 100%;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
  width: 100%;
}

.post-content {
  margin-top: 40px;
  text-align: justify;
  text-justify: inter-word;
}

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content pre {
  background: var(--border);
  padding: 16px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.post-content code {
  font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--border);
  padding: 2px 5px;
}

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

.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 20px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

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

.post-content li {
  margin-bottom: 0.4em;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1000;
}

.theme-toggle:hover {
  opacity: 0.7;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun,
:root:not([data-theme]) .icon-sun {
  display: none;
}

/* Hold to view images */
.hold-to-view {
  cursor: pointer;
  max-width: 200px;
  opacity: 0.8;
  transition: opacity 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.hold-to-view:hover {
  opacity: 1;
}

.image-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.image-overlay.active {
  display: flex;
}

.image-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* Hold to show links */
.hold-to-show {
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid #00ffff;
  padding-bottom: 1px;
  user-select: none;
  -webkit-user-select: none;
}

.hold-to-show:hover {
  opacity: 0.8;
}

.link-overlay {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 640px;
  width: 90%;
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.link-overlay.active {
  display: flex;
}

.link-overlay img {
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Post image */
.post-image {
  max-width: 100%;
  margin: 20px 0;
}

/* Mobile */
@media (max-width: 480px) {
  body {
    padding: 40px 20px;
  }

  nav {
    gap: 32px;
  }
}
