/* ============================================================
   CURIOSITY IN CODE — blog.css
   Shared: nav, footer, base reset
   Blog-specific: hero, post cards, post body, code blocks
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --navy:       #003147;
  --blue:       #03a9f4;
  --blue-dim:   #0288c7;
  --white:      #ffffff;
  --off-white:  #f7f8fa;
  --border:     #e4e8ed;
  --text:       #1a2332;
  --muted:      #6b7a8d;
  --tag-bg:     #e8f4fd;
  --tag-text:   #0277a8;
  --code-bg:    #0d1117;
  --code-text:  #e6edf3;
  --nav-height: 60px;

  --font-sans: 'Poppins', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  height: var(--nav-height);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-logo .logo-bracket {
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 400;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
}

.nav-link {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: var(--blue);
  background: rgba(3, 169, 244, 0.12);
}

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

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.8rem;
  margin-top: auto;
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Blog — layout shell ---------- */
.blog-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

/* ---------- Blog — hero ---------- */
.blog-hero {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 2px solid var(--border);
}

.blog-hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 12px;
}

.blog-hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
}

/* ---------- Blog — post cards ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(3, 169, 244, 0.1);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.post-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.post-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}

.post-card-title a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s;
}

.post-card-title a:hover {
  color: var(--blue);
}

.post-card-summary {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
  font-weight: 300;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.read-more:hover {
  color: var(--blue-dim);
}

.read-more .fa {
  margin-left: 4px;
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.read-more:hover .fa {
  transform: translateX(3px);
}

/* ---------- Blog — empty state ---------- */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--muted);
}

.empty-icon {
  font-size: 3rem;
  color: var(--border);
  display: block;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--navy);
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 300;
}

.empty-state code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------- Blog — single post ---------- */
.post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 36px;
  transition: color 0.15s;
}

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

.post-full {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 48px;
}

.post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.post-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 16px;
}

.post-lead {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.65;
}

/* ---------- Post body typography ---------- */
.post-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
  font-weight: 600;
  color: var(--navy);
  margin: 2em 0 0.75em;
  line-height: 1.3;
}

.post-body h2 { font-size: 1.4rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body h4 { font-size: 1rem; }

.post-body p {
  margin-bottom: 1.3em;
  color: var(--text);
}

.post-body a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.post-body a:hover {
  color: var(--blue-dim);
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.3em 1.5em;
}

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

.post-body blockquote {
  border-left: 3px solid var(--blue);
  margin: 1.5em 0;
  padding: 8px 24px;
  background: var(--tag-bg);
  color: var(--muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

/* Inline code */
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Fenced code blocks */
.post-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 1.5em 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  border: 1px solid #2a3440;
}

.post-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  white-space: pre;
  font-size: inherit;
}

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

.post-body th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
}

.post-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.post-body tr:nth-child(even) td {
  background: var(--off-white);
}

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

/* ---------- Post footer nav ---------- */
.post-footer-nav {
  margin-top: 32px;
}

/* ---------- Resume wrapper — prevent resume body styles
   from colliding with blog body styles ---------- */
.resume-wrapper {
  padding: 0 0 40px;
  /* The resume .container handles its own centering */
}

/* Bump the resume body override — resume.css sets body to flexbox,
   we override here since the <body> already has column flex from blog.css */
.resume-wrapper .container {
  margin: 32px auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .blog-hero-title  { font-size: 1.5rem; }
  .post-card        { padding: 20px; }
  .post-full        { padding: 24px 20px; }
  .post-title       { font-size: 1.5rem; }
  .nav-logo         { font-size: 0.9rem; }
}
