/* Blog service styles — matches fcc.cc ecosystem dark theme */

:root {
  --bg: #111113;
  --bg-card: #1a1a1f;
  --bg-hover: #222228;
  --text: #e4e4e7;
  --text-muted: #8b8b94;
  --accent: #7c9bff;
  --accent-hover: #9db5ff;
  --border: #2a2a30;
  --danger: #f87171;
  --success: #4ade80;
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.topbar {
  padding: 0.5rem 0;
}

.topbar-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--tiny { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.btn--danger { color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: rgba(248,113,113,0.1); }

.glass-btn {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
}

/* Badge */
.badge { font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.badge--draft { background: rgba(255,200,50,0.15); color: #ffc832; }

/* Muted text */
.muted { color: var(--text-muted); }

/* Feed header */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feed-header h1 { font-size: 1.4rem; font-weight: 700; }
.feed-actions { display: flex; gap: 0.5rem; }

/* Post card (list items) — news-style grid layout */
.post-list { display: flex; flex-direction: column; gap: 0.75rem; }

.post-card {
  display: grid;
  grid-template-columns: minmax(90px, 110px) 1fr;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  transition: border-color 0.15s;
  align-items: start;
}

.post-card:hover { border-color: var(--text-muted); }

.post-card__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
}

.post-card__dropcap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-family: "Georgia", "Times New Roman", "Palatino Linotype", serif;
  font-size: 3.2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--accent, #7c9bff);
  line-height: 1;
  user-select: none;
  text-shadow: 0 2px 8px rgba(124,155,255,0.15);
}

.post-card__body { min-width: 0; }

.post-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.3rem;
  text-decoration: none;
}
.post-card__title:hover { color: var(--accent); }

.post-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.post-card__edit { font-size: 0.75rem; }

.post-card__excerpt {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Blog header */
.blog-header { margin-bottom: 1.5rem; }
.blog-header h1 { font-size: 1.6rem; font-weight: 700; }
.blog-bio { color: var(--text-muted); margin-top: 0.3rem; }
.blog-owner-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }

/* Post full view */
.post-full { margin-bottom: 2rem; }
.post-full__header { margin-bottom: 1.5rem; }
.post-full__header h1 { font-size: 1.8rem; font-weight: 700; line-height: 1.3; }

.post-full__meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.post-full__edit { font-size: 0.8rem; }

/* Prose (rendered Markdown) */
.prose {
  font-size: 0.95rem;
  line-height: 1.75;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }

.prose p { margin-bottom: 1em; }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.prose code {
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

.prose pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1em;
}

.prose pre code { background: none; padding: 0; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(255,255,255,0.02);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1em;
}

.prose blockquote img {
  max-width: 200px;
  border-radius: 4px;
  margin: 0.5em 0;
  float: left;
  margin-right: 1rem;
}

.prose blockquote a { font-style: normal; font-weight: 600; }

.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1em; }
.prose li { margin-bottom: 0.25em; }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1em 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th { font-weight: 600; background: rgba(255,255,255,0.03); }

/* Comments */
.comments-section {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.comments-section h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.comment-form { margin-bottom: 1.5rem; }
.comment-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.comment-form textarea:focus { outline: none; border-color: var(--accent); }

.comments-list { display: flex; flex-direction: column; gap: 0.75rem; }

.comment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.comment__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.comment__date { color: var(--text-muted); }
.comment__body { font-size: 0.9rem; }

/* Setup page */
.setup-page { max-width: 500px; }
.setup-page h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.setup-current { margin-bottom: 1.5rem; }
.setup-current p { margin-bottom: 0.3rem; }

.setup-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}

.setup-form label:first-child { margin-top: 0; }

.handle-input-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.handle-prefix {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.handle-input-row input {
  flex: 1;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.handle-status { font-size: 0.8rem; margin-top: 0.3rem; min-height: 1.2em; }
.handle-status--ok { color: var(--success); }
.handle-status--taken { color: var(--danger); }

.setup-form input[type="text"],
.setup-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}

.setup-form input:focus,
.setup-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.setup-form .btn { margin-top: 1rem; }

/* Editor page */
.editor-page h1 { font-size: 1.4rem; margin-bottom: 1rem; }

.editor-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}

.editor-form label:first-child { margin-top: 0; }

.editor-form input[type="text"],
.editor-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}

.editor-form textarea {
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

.editor-form input:focus,
.editor-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.editor-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.status-toggle label { display: flex; align-items: center; gap: 0.3rem; margin: 0; }

.editor-buttons { display: flex; gap: 0.5rem; }

.preview-toggle {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-toggle summary {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.preview-pane {
  padding: 1rem;
  border-top: 1px solid var(--border);
  min-height: 100px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state .btn { margin-top: 1rem; }

/* Fineprint */
.fineprint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2rem 1rem;
  margin-top: 3rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  z-index: 9999;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
  .feed-header { flex-direction: column; align-items: flex-start; }
  .editor-controls { flex-direction: column; align-items: flex-start; }
  .post-full__header h1 { font-size: 1.4rem; }
  .post-card { grid-template-columns: 64px 1fr; gap: 8px; }
  .post-card__dropcap { font-size: 2rem; }
}
