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

/* Base */
body {
  font-family: monospace;
  font-size: 16px;
  line-height: 1.4;
  background: white;
  color: black;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Layout */
.w {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem;
  width: 100%;
}

/* Typography */
h1 {
  margin-bottom: 2rem;
  font-size: 1.8rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

h2 {
  font-size: 1.5rem;
  word-wrap: break-word;
}

/* Navigation */
.site-nav {
  margin-top: 1rem;
}

.nav-section {
  margin-left: 1.5rem;
}

.section-title {
  margin: 0.4rem 0;
  font-weight: bold;
}

.nav-items {
  margin-left: 1.5rem;
}

.nav-item-with-links {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

/* Links */
a {
  color: blue;
  text-decoration: none;
  word-wrap: break-word;
}

a:hover {
  text-decoration: underline;
}

/* Post list */
.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.2rem 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Post styles */
.post-date {
  font-style: italic;
  font-size: 0.9rem;
  color: #666;
}

.post-content {
  margin: 1.5rem 0;
  line-height: 1.6;
}

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

.post-content pre {
  overflow-x: auto;
  padding: 1rem;
  background: #f5f5f5;
}

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

/* Mobile Adjustments */
@media (max-width: 480px) {
  .w {
    padding: 3rem 1.5rem;
  }

  .post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin: 0.5rem 0;
  }

  .nav-item-with-links {
    margin: 0.5rem 0;
  }

  .post-content {
    font-size: 15px;
    line-height: 1.5;
  }

  .post-content pre {
    margin: 1rem -0.75rem;
    padding: 0.75rem;
  }

  .post-content pre code {
    font-size: 14px;
  }

  ul {
    margin-left: 1rem;
  }
}

/* Editor */
.editor {
  margin: 2rem 0;
}

.full-width {
  width: 100%;
  margin: 1rem 0;
  padding: 0.5rem;
  font-family: monospace;
}

textarea {
  height: 400px;
  resize: vertical;
}

button {
  font-family: monospace;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* Typing animation */
.cursor {
  color: blue;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.text {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  animation: type 2s steps(12);
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Admin controls */
.admin-controls {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.edit-btn,
.delete-btn {
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  opacity: 0.7;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  border-radius: 3px;
}

.edit-btn:hover,
.delete-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.edit-btn {
  color: blue;
}

.delete-btn {
  color: #ff4444;
}

/* List spacing */
ul > li {
  margin: 0.4rem 0;
}

/* Nested list spacing */
ul > li > ul > li {
  margin: 0.2rem 0;
}

/* Draft styles */
.draft {
  opacity: 0.7;
}

.draft-label {
  font-size: 0.8rem;
  color: #666;
  background: #eee;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

.draft-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
}

.editor-controls {
  display: flex;
  align-items: center;
  margin-top: 1rem;
}
