/* Bubbles — Minimal CSS, mobile-first, light + dark mode */

:root {
  --bg: #faf8f5;
  --text: #2d2a26;
  --text-muted: #8a857e;
  --accent: #5e8a6e;
  --accent-hover: #4a7259;
  --link: #2d2a26;
  --border: #e8e4df;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b19;
    --text: #e0ddd8;
    --text-muted: #7a766f;
    --accent: #7db88e;
    --accent-hover: #9ad0a8;
    --link: #e0ddd8;
    --border: #33312e;
  }
}

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
header {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-logo {
  width: 22px;
  height: 22px;
}

nav {
  display: flex;
  gap: 16px;
}

nav a {
  color: var(--text-muted);
  font-size: 14px;
}

nav a.active {
  color: var(--text);
  font-weight: 600;
}

/* Entry list */
.entries {
  list-style: none;
  padding: 0;
}

.entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.entry-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Vote arrows — button (logged in) and link (logged out) */
button.vote-arrow {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px 2px 0;
  user-select: none;
}

button.vote-arrow:hover:not([disabled]) {
  color: var(--accent);
}

button.vote-arrow.voted {
  color: var(--accent);
  cursor: default;
}

a.vote-arrow {
  color: var(--text-muted);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding-top: 2px;
  user-select: none;
  text-decoration: none;
}

a.vote-arrow:hover {
  color: var(--accent);
  text-decoration: none;
}

.entry-content {
  flex: 1;
  min-width: 0;
}

.entry-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.entry-title {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
}

.entry-title:visited {
  color: var(--text-muted);
}

.entry-domain {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.entry-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.entry-meta a {
  color: var(--text-muted);
}

.entry-meta a:hover {
  color: var(--text);
}

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  list-style: none;
}

/* Pagination */
.pagination {
  padding: 16px 0;
  text-align: center;
}

.pagination a {
  color: var(--accent);
  font-size: 14px;
}

/* Detail page */
.detail-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.detail-title a {
  color: var(--text);
}

.detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-meta a {
  color: var(--text-muted);
}

.detail-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  border-left: 3px solid var(--border);
  padding-left: 12px;
}

/* Comments */
.comments {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comments h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.comments-placeholder {
  font-size: 13px;
  color: var(--text-muted);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-name {
  font-size: 13px;
  font-weight: 600;
}

.comment-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-time {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-body {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 30px;
}

.comment-body p {
  margin: 0 0 8px;
}

.comment-body p:last-child {
  margin-bottom: 0;
}

.comment-body a {
  color: var(--accent);
}

/* Nested replies */
.comment-replies {
  margin-top: 8px;
  padding-left: 30px;
}

.comment-replies > summary {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.comment-replies > summary::before {
  content: "▸ ";
}

.comment-replies[open] > summary::before {
  content: "▾ ";
}

.comment-replies > summary:hover {
  color: var(--text);
}

.comment-replies > .comment-list {
  border-left: 2px solid var(--border);
  padding-left: 12px;
  margin-top: 4px;
}

.comments-cta {
  margin-top: 12px;
  font-size: 13px;
}

.comments-cta a {
  color: var(--accent);
}

.comments-empty {
  font-size: 13px;
  color: var(--text-muted);
}

.comments-empty a {
  color: var(--accent);
}

/* Static pages */
.static-page h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.static-page h2 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.static-page p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 12px;
}

.static-page ul {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
  padding-left: 20px;
}

.static-page li {
  margin-bottom: 4px;
}

.static-page h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 6px;
}

.static-page a {
  color: var(--accent);
}

.static-page a:hover {
  color: var(--accent-hover);
}

.static-page code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  background: var(--border);
  padding: 1px 4px;
  border-radius: 3px;
}

.static-page pre {
  font-size: 13px;
  line-height: 1.6;
  background: var(--border);
  padding: 12px 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.static-page pre code {
  background: none;
  padding: 0;
}

/* Footer */
footer {
  padding: 24px 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

footer a {
  color: var(--text-muted);
}

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

/* Signed-in user in footer */
.footer-user {
  margin-bottom: 6px;
}

.inline-form {
  display: inline;
}

.link-button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  padding: 0;
}

.link-button:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Login form */
.login-form {
  max-width: 400px;
  margin-top: 16px;
}

.login-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-input-row {
  display: flex;
  gap: 8px;
}

.login-form input[type="text"] {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

.login-form input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.login-form button {
  font-family: var(--sans);
  font-size: 14px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.login-form button:hover {
  background: var(--accent-hover);
}

.login-help {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Flash messages */
.flash-message {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

.flash-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

@media (prefers-color-scheme: dark) {
  .flash-error {
    background: #2d1b1b;
    color: #fca5a5;
    border-color: #5c2626;
  }
}
