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

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: #faf8f5;
  color: #2c2c2c;
  line-height: 1.7;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #3b3024;
  color: #e8dfd3;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

nav a { color: #e8dfd3; text-decoration: none; }
nav a:hover { color: #fff; }
.nav-brand { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.5px; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-user { opacity: 0.7; font-size: 0.85rem; }

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #3b3024;
  font-weight: normal;
}

h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: #5a4a3a;
  font-weight: normal;
  border-bottom: 1px solid #d4cabb;
  padding-bottom: 0.3rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: #6b5b4b;
  font-weight: normal;
}

/* Volume list */
.volume-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.volume-list li a {
  display: block;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e0d8cc;
  border-radius: 4px;
  color: #3b3024;
  text-decoration: none;
  transition: background 0.15s;
}

.volume-list li a:hover { background: #f0ebe3; }

/* Entry list */
.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.entry-list li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #4a6741;
  text-decoration: none;
}

.entry-list li a:hover {
  background: #f0ebe3;
  border-radius: 3px;
}

/* Entry view */
.entry-header { margin-bottom: 1.5rem; }

.back-link {
  color: #8a7a6a;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.back-link:hover { color: #3b3024; }

.journal-entry p {
  margin-bottom: 0.3rem;
  text-indent: 0;
}

.journal-entry hr {
  border: none;
  border-top: 1px solid #d4cabb;
  margin: 2rem 0;
}

.journal-entry h2 {
  border-bottom: none;
  color: #3b3024;
  margin-top: 1.5rem;
}

.journal-entry h3 {
  color: #5a4a3a;
}

.journal-entry pre,
.journal-entry code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  background: #f5f0e8;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.journal-entry pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Search */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.search-form input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-family: Georgia, serif;
  border: 1px solid #d4cabb;
  border-radius: 4px;
  background: #fff;
}

.search-form button {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  background: #3b3024;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-form button:hover { background: #5a4a3a; }

.search-result {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0d8cc;
}

.search-result h3 a { color: #4a6741; text-decoration: none; }
.search-result h3 a:hover { text-decoration: underline; }

.snippet {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.snippet mark {
  background: #f7e5a0;
  padding: 0 2px;
  border-radius: 2px;
}

.no-results { color: #8a7a6a; font-style: italic; }
.result-count { color: #8a7a6a; margin-bottom: 1rem; font-size: 0.9rem; }

/* Login page */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f0ebe3;
}

.login-box {
  text-align: center;
  background: #fff;
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-box h1 {
  color: #3b3024;
  margin-bottom: 0.5rem;
}

.login-box p {
  color: #8a7a6a;
  margin-bottom: 2rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  transition: box-shadow 0.15s;
}

.google-btn:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Responsive */
@media (max-width: 600px) {
  nav { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .nav-right { gap: 1rem; font-size: 0.85rem; }
  main { padding: 0 1rem; }
  h1 { font-size: 1.4rem; }
}
