/* Modern, Clean, and Minimalist Blog Theme */

:root {
  /* Color Palette - Light Mode */
  --bg-body: #faf9f6; /* Off-white / Eggshell */
  --bg-card: #ffffff;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --accent: #0984e3; /* Vibrant Blue */
  --accent-hover: #00cec9;
  --border-light: #dfe6e9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.05);
  
  /* Typography - Standardized */
  --font-sans: 'Space Grotesk', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-mono: 'SFMono-Regular', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Color Palette - Dark Mode */
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #74b9ff;
    --accent-hover: #81ecec;
    --border-light: #333333;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.2);
  }
}

/* Import Fonts with full weight range */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 1.125rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* Ensure all interactive/text elements inherit the standardized font */
input, button, textarea, select {
  font-family: inherit;
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Layout */
header, main, footer {
  max-width: 800px; /* Narrower for better reading experience */
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  padding-top: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid transparent; /* Placeholder for potential sticky header border */
}

header h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

header h1 a:hover {
  text-decoration: none;
  color: var(--text-main); /* Keep site title neutral on hover */
}

header p {
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-sans);
}

/* Navigation */
nav {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  font-family: var(--font-sans);
}

nav a {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px 0;
  position: relative;
}

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

/* Active link styling could be added here if we had active classes */

/* Main Content */
main {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 0; /* Let content dictate padding or remove card look for cleaner text */
  margin-bottom: 40px;
  /* Option: Remove visible card background for a cleaner "text-only" look, 
     or keep it subtle. Let's make it subtle. */
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden; /* For nested items */
  font-family: var(--font-sans);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* The main article card shouldn't look like a dashboard card */
article.card {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
}
article.card:hover {
  transform: none;
  box-shadow: none;
}

/* Typography inside Articles */
article h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-main);
}

article h2, article h3, article h4 {
  font-family: var(--font-serif);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.3;
}

article h2 { font-size: 1.75rem; }
article h3 { font-size: 1.5rem; }
article h4 { font-size: 1.25rem; }

article p {
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
}

article ul, article ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  font-family: var(--font-sans);
}

article li {
  margin-bottom: 0.5rem;
}

article blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(9, 132, 227, 0.05); /* Tint of accent */
  border-radius: 0 8px 8px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-main);
}

article blockquote p {
  margin-bottom: 0;
  font-family: var(--font-serif); /* Keep blockquotes in serif for editorial feel */
}

article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
}

article code {
  background-color: rgba(0,0,0,0.05);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

article pre {
  background-color: #2d3436;
  color: #f5f6fa;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

article pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
  font-family: var(--font-mono);
}

.meta {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-family: var(--font-sans);
}

/* Helper Classes for WordPress Blocks */
.wp-block-table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
}

.wp-block-table td, .wp-block-table th {
  border: 1px solid var(--border-light);
  padding: 0.75rem;
}

/* Homepage specific: List of posts */
.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 0;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.post-list-item {
  padding: 0.5rem 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-light);
}

.post-list-item:last-child {
  border-bottom: none;
  padding-bottom: 1.5rem;
}

.post-list-item a {
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  flex: 1;
  margin-right: 1rem;
}

.post-list-item a:hover {
  color: var(--accent);
}

.post-list-item .meta {
  margin-bottom: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-light);
  padding-top: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  header h1 { font-size: 2rem; }
  article h1 { font-size: 2rem; }
  header, main, footer { padding: 0 16px; }
  
  .card > p {
    flex-direction: column;
    gap: 0.25rem;
  }
}