/*
 * Learning Curve - main.css
 * Option B: sidebar-free, centered column.
 * Palette: warm stone background · violet accent · dark code blocks.
 */


/* -------------------------
   Design tokens
   ------------------------- */

:root {
  --bg:           #fafaf9;   /* stone-50 - barely off-white, warm */
  --surface:      #f4f4f5;   /* inline code bg */
  --border:       #e4e4e7;   /* zinc-200 */
  --border-soft:  #f0f0f2;   /* post list divider, very subtle */
  --text:         #18181b;   /* zinc-900 */
  --text-muted:   #71717a;   /* zinc-500 */
  --text-subtle:  #a1a1aa;   /* zinc-400 */
  --accent:       #7c3aed;   /* violet-600 */
  --accent-soft:  #ede9fe;   /* violet-100 */
  --accent-dark:  #5b21b6;   /* violet-800, for hover states */
  --code-dark:    #1e1e2e;   /* Catppuccin mocha */
  --code-text:    #cdd6f4;
}


/* -------------------------
   Reset & Base
   ------------------------- */

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; padding: 0; }

@media (max-width: 640px) {
  html { font-size: 16px; }
}


/* -------------------------
   Container
   ------------------------- */

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* -------------------------
   Navigation
   ------------------------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1.25rem;
  margin-bottom: 3.5rem;
  border-bottom: 2px solid var(--border);
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.15s ease;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a {
  margin-left: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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


/* -------------------------
   Typography
   ------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin: 2.25rem 0 0.6rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4, h5, h6 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1.25rem; }

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

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

strong { color: var(--text); font-weight: 600; }

hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 2.5rem 0;
}

abbr[title] {
  cursor: help;
  border-bottom: 1px dotted var(--text-subtle);
  text-decoration: none;
}


/* -------------------------
   Lists
   ------------------------- */

ul, ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

li { margin-bottom: 0.3rem; }


/* -------------------------
   Blockquote
   ------------------------- */

blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  color: #3b0764;
  font-style: italic;
}

blockquote p:last-child { margin-bottom: 0; }


/* -------------------------
   Code
   ------------------------- */

code {
  font-family: "JetBrains Mono", "Fira Code", Menlo, Monaco,
               "Courier New", monospace;
  font-size: 0.83em;
  background: var(--surface);
  color: #be185d;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--code-dark);
  color: var(--code-text);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.83rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 100%;
  border-radius: 0;
}

.highlight {
  background: var(--code-dark);
  border-radius: 8px;
  margin: 0 0 1.5rem;
  overflow-x: auto;
}

.highlight pre { margin: 0; background: transparent; border-radius: 0; }


/* -------------------------
   Images & Tables
   ------------------------- */

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

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

th { background: var(--accent-soft); font-weight: 600; color: #3b0764; }
tbody tr:nth-child(even) td { background: #fafafb; }


/* -------------------------
   Home tagline
   ------------------------- */

.site-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin: -1.75rem 0 2.5rem;   /* pulls up close under the nav border */
  letter-spacing: 0.01em;
}


/* -------------------------
   Post List (Home)
   ------------------------- */

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

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.85rem 0.6rem;
  margin: 0 -0.6rem;           /* bleed into padding for hover bg */
  border-bottom: 1px solid var(--border-soft);
  border-radius: 6px;
  transition: background 0.15s ease;
  position: relative;
}

.post-list li:first-child { border-top: 1px solid var(--border-soft); }

.post-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.post-list li:hover {
  background: var(--accent-soft);
}

.post-list li:hover::before {
  opacity: 1;
}

.post-date {
  font-size: 0.78rem;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 85px;
}

.post-link {
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.post-link:hover {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 480px) {
  .post-list li { flex-direction: column; gap: 0.15rem; }
}


/* -------------------------
   Post Page
   ------------------------- */

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-meta time { color: var(--text-muted); }

.reading-time {
  display: inline-flex;
  align-items: center;
}

.reading-time::before {
  content: '·';
  margin-right: 0.5rem;
  color: var(--border);
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.1em 0.55em;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

/* Section headings inside posts */
.post-content h2 {
  margin-top: 2.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  margin-top: 2rem;
  color: var(--accent-dark);
}


/* -------------------------
   Static Pages
   ------------------------- */

.page-title {
  font-size: 1.75rem;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

/* About page contact links */
.page p:last-of-type { color: var(--text-muted); }


/* -------------------------
   Pagination
   ------------------------- */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination a {
  color: var(--accent);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  background: var(--accent-soft);
  transition: background 0.15s, color 0.15s;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.pagination-disabled {
  color: var(--border);
}


/* -------------------------
   Footer
   ------------------------- */

.site-footer {
  margin-top: 5rem;
  padding: 2rem 0 3rem;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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