:root {
  --bg: #0b0b0b;
  --panel: #111214;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --border: #2a2f36;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.app {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.shell {
  width: 100%;
  max-width: 860px;
}

.header {
  display: flex;
  align-items: center;      /* centers text vertically with avatar */
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 16px;
  padding: 24px 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.header-text {
  flex: 1;
  text-align: center;       /* center text horizontally inside block */
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 66px;
  border: 4px solid #1f2328;
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  object-fit: cover;
}

.nav-btn {
  color: #404069;
  text-decoration: underline;
  padding: 4px 12px;
  font-size: 16px;
}

.nav-btn:hover { 
  background: #202025;           
  border-color: var(--border);
  border-radius: 8px;
  color: var(--text);
  transform: scale(1.1) translateY(1px);
}

.title {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 800;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 22px;        
}

.card {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-rows: auto 1fr;
  gap: 12px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  padding: 24px 28px;
  margin-bottom: 20px;
  min-height: 160px; 
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateX(-12px);
  box-shadow: 0 10px 28px rgba(0.4,0.5,0.6,.35);
  outline: 2px solid var(--border)
}

.card > img {
  width: 130px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0;
  grid-column: 1;
  grid-row: 1;
}

.card-date {
  grid-column: 1;
  grid-row: 2;
  font-weight: 600;
  color: #707088;
  margin-top: 6px;
}

.card-main {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 3;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  gap: 8px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}

.card-summary {
  color: var(--muted);
  margin: 0;
  font-size: 16px;
}

.card-tags {
  grid-row: 3;
  margin-top: auto;          /* push to bottom inside .card-main */
  margin-bottom: 0;
  align-self: end;      /* stick to the right edge */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end; /* right-align each wrapped row */
  max-width: 100%;
}


.card-tags span {
  padding: 2px 8px;
  border-radius: 9999px;        
  border: 1px solid var(--border);
  font-weight: 600;
  color: #707088;
  line-height: 1.8;
}

.main {
  display: grid;
  gap: 16px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}
.markdown-body p {
  margin: 0.6em 0;
  line-height: 1.5;
}
.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
}
.markdown-body pre {
  background: #1e1e1e;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
}

.overlayButtons { display:flex; gap:8px; justify-content:flex-end; padding:8px; border-bottom:1px solid #2a2f36; }
.overlayBtn  { background:#1a1c21; 
  color:#e5e7eb; 
  border:1px solid #2c3138; 
  border-radius:8px; 
  padding:6px 10px; 
  line-height:1; 
  text-decoration:none; 
  cursor:pointer; 
  font-size: 16px;
  font-family: inherit;
  font-weight: 550;
}
.overlayBtn:hover { background:#202030; transform: scale(1.15) translateY(1px); }

.markdown-body blockquote:has(.katex-display) {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
}

/* Tighter spacing + smaller legend inside the card */
.markdown-body blockquote:has(.katex-display) .katex-display { margin: 6px 0; }
.markdown-body blockquote:has(.katex-display) .katex-display + .katex-display { font-size: .95em; }
.markdown-body p:has(img) { text-align: center; }

