/* ── Market Info Blog — style.css ── */
:root {
  --bg:         #07070d;
  --bg2:        #0f0f18;
  --bg3:        #161622;
  --border:     rgba(255,255,255,0.07);
  --border-h:   rgba(255,255,255,0.14);
  --text:       #e8e8f0;
  --muted:      #8888a0;
  --hint:       #50505e;
  --accent:     #00c896;
  --accent-dim: rgba(0,200,150,0.10);
  --accent-bdr: rgba(0,200,150,0.20);
  --red:        #ff6b6b;
  --red-dim:    rgba(255,107,107,0.10);
  --red-bdr:    rgba(255,107,107,0.22);
  --blue:       #6b8eff;
  --blue-dim:   rgba(107,142,255,0.10);
  --yellow:     #ffd600;
  --radius:     12px;
  --radius-sm:  8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ─── HEADER ─── */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,7,13,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  width: 96px;
}
.back-link:hover { color: var(--text); }

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

.logo-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.lb {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
}
.lb:nth-child(1) { height: 5px; }
.lb:nth-child(2) { height: 9px; }
.lb:nth-child(3) { height: 14px; }
.lb:nth-child(4) { height: 11px; }
.lb:nth-child(5) { height: 7px; }

.logo-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text);
}
.logo-text em { font-style: normal; color: var(--accent); }

.blog-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  padding: 2px 8px;
  border-radius: 20px;
}

.admin-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--hint);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.admin-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ─── HERO ─── */
.blog-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 24px 36px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.tag-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2.2s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.hero-title {
  font-size: clamp(30px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 500px;
}

/* ─── FILTER BAR ─── */
.filter-bar {
  position: sticky;
  top: 52px;
  z-index: 90;
  background: rgba(7,7,13,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.filter-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  height: 44px;
  align-items: center;
}
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-btn:hover  { color: var(--text); background: var(--bg3); }
.filter-btn.active { color: var(--accent); background: var(--accent-dim); }

/* ─── POSTS FEED ─── */
.posts-feed {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 0;
  justify-content: center;
}

.loader {
  width: 16px; height: 16px;
  border: 2px solid var(--bg3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── POST CARD ─── */
.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
  animation: fadeUp 0.45s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-card:hover { border-color: var(--border-h); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  flex-wrap: wrap;
}

.post-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  padding: 2px 9px;
  border-radius: 20px;
}

.post-mood {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid;
}
.post-mood.bullish { color: var(--accent); border-color: var(--accent-bdr); background: var(--accent-dim); }
.post-mood.bearish { color: var(--red);    border-color: var(--red-bdr);    background: var(--red-dim); }
.post-mood.neutral { color: var(--muted);  border-color: var(--border);     background: transparent; }

.post-date {
  font-size: 11px;
  color: var(--hint);
  margin-left: auto;
  white-space: nowrap;
}

.post-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.22;
  color: var(--text);
  margin-bottom: 10px;
}

/* ─── POST BODY (Markdown rendered) ─── */
.post-body {
  font-size: 15px;
  line-height: 1.72;
  color: #b4b4cc;
}
.post-body p          { margin-bottom: 12px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h2         { font-size: 18px; font-weight: 700; color: var(--text); margin: 20px 0 7px; }
.post-body h3         { font-size: 16px; font-weight: 600; color: var(--text); margin: 16px 0 5px; }
.post-body strong     { color: var(--text); font-weight: 600; }
.post-body em         { color: #c8c8e0; font-style: italic; }
.post-body code       {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 14px 0;
  color: var(--muted);
  font-style: italic;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 0 0;
  display: inline-block;
}
.read-more-btn:hover { text-decoration: underline; }

/* ─── POST ACTIONS ─── */
.post-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}
.action-btn:hover { border-color: var(--border-h); color: var(--text); background: var(--bg3); }

.action-btn.vote-up.active,
.action-btn.vote-up:hover  { border-color: var(--accent-bdr); color: var(--accent); background: var(--accent-dim); }

.action-btn.vote-down.active,
.action-btn.vote-down:hover { border-color: var(--red-bdr); color: var(--red); background: var(--red-dim); }

.action-btn.comment-btn:hover { border-color: rgba(107,142,255,0.25); color: var(--blue); background: var(--blue-dim); }

.action-count { font-size: 12px; }

.action-spacer { flex: 1; }

/* Admin buttons inside post */
.admin-bar {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.draft-pill {
  font-size: 10px;
  color: var(--yellow);
  border: 1px solid rgba(255,214,0,0.2);
  background: rgba(255,214,0,0.06);
  padding: 2px 8px;
  border-radius: 20px;
}

.btn-admin {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.14s;
}
.btn-admin:hover           { border-color: var(--border-h); color: var(--text); }
.btn-admin.edit:hover      { border-color: var(--accent-bdr); color: var(--accent); }
.btn-admin.delete:hover    { border-color: var(--red-bdr); color: var(--red); }
.btn-admin.publish:hover   { border-color: var(--accent-bdr); color: var(--accent); }
.btn-admin.unpublish:hover { border-color: var(--red-bdr); color: var(--red); }

/* ─── EMPTY STATE ─── */
.empty-state {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.empty-icon  { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-sub   { font-size: 14px; color: var(--muted); }

/* ─── FAB ─── */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(0,200,150,0.38);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,200,150,0.55); }

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
.editor-modal   { max-width: 680px; }
.comments-modal { max-width: 560px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
}
.modal-close:hover { color: var(--text); background: var(--bg3); }

.modal-body   { padding: 20px; flex: 1; overflow-y: auto; }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── FORM ELEMENTS ─── */
.editor-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}
.editor-input:focus { border-color: var(--accent); }
.editor-input::placeholder { color: var(--hint); }

.editor-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.editor-select {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.editor-select:focus { border-color: var(--accent); }
.editor-select option { background: var(--bg3); }

.editor-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.65;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  min-height: 320px;
  transition: border-color 0.15s;
}
.editor-textarea.small { min-height: 80px; resize: none; }
.editor-textarea:focus { border-color: var(--accent); }
.editor-textarea::placeholder { color: var(--hint); }

.editor-meta {
  font-size: 11px;
  color: var(--hint);
  margin-top: 6px;
  text-align: right;
}
.editor-hint { color: var(--hint); }

/* ─── BUTTONS ─── */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover    { opacity: 0.86; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-h); }

/* ─── COMMENTS ─── */
.comments-list { margin-bottom: 22px; }

.comments-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.comment-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }

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

.comment-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.comment-author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment-time   { font-size: 11px; color: var(--hint); margin-left: auto; }
.comment-text   { font-size: 14px; color: #b4b4cc; line-height: 1.62; }

.comment-form { padding-top: 18px; border-top: 1px solid var(--border); }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text);
  z-index: 500;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
}
.toast.success { border-color: var(--accent-bdr); color: var(--accent); }
.toast.error   { border-color: var(--red-bdr);    color: var(--red); }

/* ─── IMAGE UPLOAD TOOLBAR ─── */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.toolbar-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.toolbar-btn:hover:not(:disabled) { border-color: var(--accent-bdr); color: var(--accent); background: var(--accent-dim); }
.toolbar-btn:disabled { opacity: 0.6; cursor: wait; }
.toolbar-hint { font-size: 11px; color: var(--hint); }

/* ─── POST IMAGES ─── */
.post-img {
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-img img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.post-img img:hover { opacity: 0.92; }
.post-img figcaption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 12px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 95%;
  max-height: 95%;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ─── UTILITY ─── */
.hidden { display: none !important; }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .blog-header { padding: 0 16px; }
  .blog-hero   { padding: 36px 16px 24px; }
  .posts-feed  { padding: 18px 16px 100px; }
  .post-card   { padding: 16px; }
  .post-title  { font-size: 18px; }
  .post-date   { display: none; }
  .fab         { bottom: 18px; right: 18px; width: 46px; height: 46px; font-size: 22px; }
  .editor-row  { flex-direction: column; }
  .modal-body  { padding: 14px; }
  .modal-footer{ padding: 12px 14px; }
}
