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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fafafa;
}

header nav {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header nav a {
  color: #555;
  text-decoration: none;
}

header nav a:hover {
  color: #1a1a1a;
}

.site-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #1a1a1a !important;
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
  border-top: 1px solid #e0e0e0;
  color: #888;
  font-size: 0.85rem;
}

/* Index page */
h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.intro {
  color: #555;
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 1.5rem;
}

.post-list a {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a6bb8;
  text-decoration: none;
}

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

.post-list time {
  display: block;
  font-size: 0.85rem;
  color: #888;
}

.post-list p {
  color: #555;
  margin-top: 0.25rem;
}

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

.post-header h1 {
  font-size: 2rem;
  line-height: 1.3;
}

.post-header time {
  color: #888;
  font-size: 0.9rem;
}

.post-body h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

.post-body h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

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

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

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

.post-body code {
  background: #f0f0f0;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-body pre {
  background: #f0f0f0;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

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

.post-body blockquote {
  border-left: 3px solid #ddd;
  padding-left: 1rem;
  color: #555;
  margin-bottom: 1rem;
}

.back-link {
  margin-top: 3rem;
}

.back-link a {
  color: #1a6bb8;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

/* Glossary terms */
.glossary-term {
  border-bottom: 1px dotted #1a6bb8;
  cursor: pointer;
  position: relative;
}

/* Glossary tooltip */
.glossary-tooltip {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 0.75rem 1rem;
  max-width: 320px;
  min-width: 200px;
  font-size: 0.9rem;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.glossary-tooltip.visible {
  opacity: 1;
}

.glossary-tooltip .arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid #ddd;
  transform: rotate(45deg);
}

.glossary-tooltip.above .arrow {
  bottom: -6px;
  left: 20px;
  border-top: none;
  border-left: none;
}

.glossary-tooltip.below .arrow {
  top: -6px;
  left: 20px;
  border-bottom: none;
  border-right: none;
}

.glossary-tooltip .term-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.glossary-tooltip .term-short {
  color: #333;
}

.glossary-tooltip .term-long {
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}
