/* =========================================
   Nova Blog — Stylesheet
   Dark, elegant, night-sky aesthetic
   ========================================= */

/* --- Custom Properties --- */
:root {
  --bg:           #08080f;
  --surface:      #10101a;
  --border:       #1e1e2e;
  --text:         #e8e6f0;
  --text-muted:   #8884a0;
  --accent:       #a78bfa;
  --accent-hover: #c4b5fd;
  --code-bg:      #13131f;

  --font-ui:      'Inter', system-ui, sans-serif;
  --font-body:    'Lora', Georgia, serif;

  --max-width:    680px;
  --gap:          1.5rem;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

/* --- Site Wrapper --- */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header --- */
.site-header {
  padding-top: 2.5rem;
  margin-bottom: 3rem;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.site-name {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.site-name:hover {
  color: var(--accent-hover);
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.site-nav a:hover {
  color: var(--text);
}

.header-rule {
  border: none;
  border-top: 1px solid var(--border);
}

/* --- Main --- */
.site-main {
  flex: 1;
}

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.site-footer a:hover {
  color: var(--accent);
}

/* --- Homepage --- */
.home-tagline {
  margin-bottom: 3rem;
}

.home-tagline p {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-body);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-title-link {
  display: inline-block;
}

.post-item-title {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s ease;
  line-height: 1.35;
}

.post-title-link:hover .post-item-title {
  color: var(--accent);
}

.post-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

.post-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0.1rem;
}

.no-posts {
  color: var(--text-muted);
  font-style: italic;
}

/* --- Single Post --- */
.post-full {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-full-title {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

.post-full-date {
  display: block;
}

/* --- Post Body (prose) --- */
.post-body {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

.post-body p {
  margin-bottom: 1.4em;
}

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

.post-body h2 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 2em 0 0.6em;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75em 0 0.5em;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}

.post-body a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.25rem;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* --- Code --- */
.post-body code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.9rem;
}

/* highlight.js overrides — keep within the dark theme */
.hljs {
  background: var(--code-bg);
  color: var(--text);
}

/* --- Post Footer --- */
.post-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.back-link:hover {
  color: var(--accent);
}

/* --- About Page --- */
.about-page h1 {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.about-body {
  font-size: 1.05rem;
}

/* --- Responsive --- */
@media (max-width: 520px) {
  .post-full-title {
    font-size: 1.6rem;
  }

  .post-body {
    font-size: 1rem;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }
}
