/* Cobalt — a modern blue theme for Micro.blog */

:root {
  color-scheme: dark;

  --blue-400: #60a5fa;
  --blue-500: #3b82f6;

  --bg: #0b1220;
  --bg-elevated: #111a2c;
  --text: #e6ecf5;
  --text-muted: #93a1bd;
  --border: #1f2b42;
  --accent: var(--blue-400);
  --accent-hover: var(--blue-500);
  --accent-tint: rgba(59, 130, 246, 0.14);
  --title-accent: #e8b06b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Header */

#site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

#site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}
.site-brand:hover { text-decoration: none; }

.site-brand .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--accent-tint);
  color: var(--accent);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-nav a.active:hover {
  background: none;
  color: var(--accent);
}

/* Main content */

#main {
  padding: 40px 0 60px;
}

.list-header { margin-bottom: 28px; }
.list-header h1 {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.list-intro { color: var(--text-muted); }

/* Archive */

.archive-categories {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.archive-categories label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.archive-categories select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 36px 8px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2393a1bd' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.archive-categories select:hover,
.archive-categories select:focus {
  border-color: var(--accent);
  outline: none;
}

.archive-list {
  display: flex;
  flex-direction: column;
}

.archive-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
  font-size: 0.94rem;
}
.archive-item:last-child { border-bottom: none; }

.archive-date {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.archive-date:hover { color: var(--accent); }

.archive-title {
  font-weight: 600;
  color: var(--text);
}

.archive-summary {
  color: var(--text-muted);
  flex: 1 1 260px;
  min-width: 0;
}

/* Post list */

#post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { padding-top: 0; }
.post-item:last-child { border-bottom: none; }

.post-title {
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.post-title a { color: var(--title-accent); }
.post-title a:hover { color: var(--accent); text-decoration: none; }

.post-content { color: var(--text); }
.post-content p:first-child { margin-top: 0; }

.post-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.88rem;
}

.post-date {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-date:hover { color: var(--accent); }

.read-more {
  font-weight: 600;
}

/* Single post / page */

.single-header { margin-bottom: 24px; }
.single-header h1 {
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--title-accent);
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.single-content { font-size: 1.05rem; }

/* Replies (injected by micro.blog/conversation.js) */

.post-conversation {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.microblog_conversation {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.microblog_post {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.microblog_post:last-child { border-bottom: none; padding-bottom: 0; }

.microblog_user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* conversation.js sets width/height attrs and an inline max-width on this
   img itself, so !important is needed to make replies a consistent size */
.microblog_avatar {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.microblog_fullname {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.microblog_text {
  color: var(--text);
}
.microblog_text p { margin: 0; }
.microblog_text a { color: var(--accent); text-decoration: none; }
.microblog_text a:hover { text-decoration: underline; }

.microblog_time {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}
.microblog_time a { color: inherit; }
.microblog_time a:hover { color: var(--accent); }

/* Typography inside content */

.post-content a,
.single-content a { text-decoration: underline; text-decoration-color: var(--accent-tint); text-underline-offset: 2px; }

.post-content h1, .post-content h2, .post-content h3, .post-content h4,
.single-content h1, .single-content h2, .single-content h3, .single-content h4 {
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.post-content img,
.single-content img { border-radius: 10px; }

.post-content hr,
.single-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Lists */

.post-content ul, .post-content ol,
.single-content ul, .single-content ol {
  margin: 16px 0;
  padding-left: 1.4em;
}
.post-content li, .single-content li { margin: 6px 0; }
.post-content li > ul, .post-content li > ol,
.single-content li > ul, .single-content li > ol { margin: 6px 0; }

.post-content dt, .single-content dt { font-weight: 600; }
.post-content dd, .single-content dd { margin: 0 0 10px 20px; color: var(--text-muted); }

/* Blockquotes */

.post-content blockquote,
.single-content blockquote {
  margin: 20px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}
.post-content blockquote > :first-child,
.single-content blockquote > :first-child { margin-top: 0; }
.post-content blockquote > :last-child,
.single-content blockquote > :last-child { margin-bottom: 0; }

/* Inline code and code blocks */

.post-content code,
.single-content code {
  background: var(--accent-tint);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.post-content pre,
.single-content pre {
  background: var(--accent-tint);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.5;
}
.post-content pre code,
.single-content pre code {
  background: none;
  padding: 0;
  font-size: 0.88em;
}

/* Tables */

.post-content table,
.single-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95em;
}
.post-content th, .post-content td,
.single-content th, .single-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.post-content th,
.single-content th {
  background: var(--bg-elevated);
  font-weight: 600;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 600;
}
.pagination-count { color: var(--text-muted); font-weight: 400; }

/* 404 */

.not-found {
  text-align: center;
  padding: 60px 0;
}
.not-found h1 { font-size: 2rem; }

/* Footer */

#site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  text-align: center;
}

.footer-title {
  font-weight: 700;
  color: var(--text);
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0;
  padding: 0;
  font-size: 0.9rem;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}
.footer-copy a { color: var(--text-muted); text-decoration: underline; }

.footer-credit {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}
.footer-credit a { color: var(--text-muted); text-decoration: underline; }
.footer-credit a:hover { color: var(--accent); }

/* Responsive */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  #site-header .wrap { justify-content: flex-start; }
  .site-nav { width: 100%; }
  .single-header h1 { font-size: 1.5rem; }
}
