/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: #1d3557;
  background-color: #f7fafc;
  font-weight: 400;
}

/* Container and layout */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  padding: 3rem 0 2rem;
  margin-bottom: 0.1rem;
}

header h1 {
  font-size: 3.4rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

header h1 a {
  color: #1d3557;
  text-decoration: none;
}

header h1 a:hover {
  color: #1d3557;
  text-decoration: none;
}

/* Navigation */
nav {
  display: flex;
  gap: 2rem;
  font-size: 1.2rem;
}

nav a {
  color: #457b9d;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #1d3557;
}

@media (max-width: 768px) {
  nav {
    gap: 1.5rem;
    flex-wrap: wrap;
  }
}

/* Main content */
.main {
  flex: 1;
  margin-bottom: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0rem;
  color: #1d3557;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

p {
  margin-bottom: 1rem;
  color: #1d3557;
  line-height: 1.7;
}

/* Links */
a {
  color: #e63946;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul {
  list-style: none;
}

li {
  margin-bottom: 1rem;
}

/* Blog intro - remove heavy styling */
.blog-intro {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.blog-intro p {
  color: #457b9d;
  font-size: 1rem;
  margin-bottom: 0;
}

/* Home page layout - single column for cleaner look */
.home-content {
  display: block;
}

.right {
  text-align: right;
}

/* Post index */
#post-index {
  margin-bottom: 1rem;
}

#post-index ul li {
  padding: 1.0rem 0;
  border-bottom: 1px solid #e2e8f0;
  transition: none;
}

#post-index ul li:hover {
  transform: none;
  box-shadow: none;
}

#post-index ul li:last-child {
  border-bottom: none;
}

.post-title {
  font-weight: 600;
  font-size: 1.3rem;
}

.post-title a {
  color: #e63946;
}

.post-title a:hover {
  color: #e63946;
}

.post-date {
  font-size: 0.9rem;
  font-weight: 400;
}

.see-all-posts {
  padding-top: 1rem;
}

.see-all-posts a {
  color: #457b9d;
  font-weight: 500;
}

/* Sidebar - integrate into main content */
#tags {
  margin-top: 1rem;
  /* padding-top: 2rem; */
  /* border-top: 1px solid #e2e8f0; */
}

#tags h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #1d3557;
  font-weight: 600;
}

#tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

#tags ul li {
  margin-bottom: 0;
}

#tags ul li a {
  background: #edf2f7;
  color: #1d3557;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

#tags ul li a:hover {
  background: #e2e8f0;
  color: #457b9d;
  text-decoration: none;
}

/* Individual Post */
#post {
  margin-bottom: 1rem;
}

#post h2 {
  font-size: 2rem;
  margin-bottom: 0.2rem;
  margin-top: 0;
  line-height: 1.2;
  color: #1d3557;
  font-weight: 600;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  /* color: #457b9d;
  font-size: 0.9rem; */
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tags a {
  background: #edf2f7;
  color: #1d3557;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tags a:hover {
  background: #e2e8f0;
  color: #457b9d;
  text-decoration: none;
}

.tag-title-tags {
  background: #edf2f7;
  color: #1d3557;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  /* font-size: 0.8rem; */
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-content {
  line-height: 1.7;
  font-size: 1rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 3rem;
  margin-bottom: 0rem;
}

.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
  margin-top: 0;
}

.post-content pre {
  background: #f7fafc;
  border-radius: 4px;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.9rem;
  border: 1px solid #e2e8f0;
}

.post-content code {
  background: #f7fafc;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  font-size: 0.85rem;
}

.post-content blockquote {
  border-left: 4px solid #e63946;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #457b9d;
}

/* Posts list page */
.post {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.post:last-child {
  border-bottom: none;
}

.post:hover {
  transform: none;
  box-shadow: none;
}

.post_body {
  color: #1d3557;
  line-height: 1.7;
}

.truncated_post_body {
  color: #1d3557;
  line-height: 1.7;
  margin-top: 0.7rem;
}

.read-more {
  margin-top: 0.5rem;
}

.read-more a {
  color: #457b9d;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Archive page */
.archive-year {
  margin-bottom: 4rem;
}

.archive-year h2 {
  font-size: 1.5rem;
  color: #1d3557;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.archive-month {
  margin-bottom: 2rem;
}

.archive-month h3 {
  color: #1d3557;
  margin-top: 0;
  margin-bottom: 1rem;
  margin-left: 1em;
  font-size: 1.1rem;
  font-weight: 500;
}

.archive-posts {
  list-style: none;
}

.archive-posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-left: 2em;
}

.archive-posts li:last-child {
  border-bottom: none;
}

.archive-posts li:hover {
  background: none;
}

.archive-post-title {
  font-weight: 500;
  margin-bottom: 0;
  flex: 1;
}

.archive-post-title a {
  color: #1d3557;
}

.archive-post-title a:hover {
  color: #e63946;
}

.archive-post-date {
  color: #457b9d;
  font-size: 0.9rem;
  margin-left: 1rem;
  white-space: nowrap;
}

/* Tag page */
.tag-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.tag-title {
  font-size: 1.5rem;
  color: #1d3557;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.tag-count {
  color: #457b9d;
  font-size: 0.9rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4rem 0;
  padding: 2rem 0;
  border-top: 1px solid #e2e8f0;
}

.pagination a,
.pagination span {
  text-decoration: none;
  color: #457b9d;
  font-size: 0.9rem;
}

.pagination a:hover {
  color: #e63946;
  text-decoration: underline;
}

.pagination .current {
  color: #1d3557;
  font-weight: 500;
}

.pagination .disabled {
  color: #cbd5e0;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #457b9d;
  font-size: 0.8rem;
  line-height: 1.5;
}

footer div {
  margin-bottom: 0.5rem;
}

footer div:last-child {
  margin-bottom: 0;
}

footer a {
  color: #457b9d;
}

footer a:hover {
  color: #e63946;
}

.render-time {
  opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  header {
    padding: 2rem 0 1.5rem;
  }
  
  header h1 {
    font-size: 1.7rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  #post h2 {
    font-size: 1.8rem;
  }
  
  .pagination {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }
  
  .container {
    padding: 0 15px;
  }
  
  header {
    padding: 1.5rem 0 1rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  nav {
    gap: 1rem;
    font-size: 0.85rem;
  }
  
  h2 {
    font-size: 1.4rem;
  }
  
  #post h2 {
    font-size: 1.6rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .container {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  
  header nav,
  footer,
  .pagination,
  .see-all-posts {
    display: none;
  }
  
  header {
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
  }
  
  header h1 {
    font-size: 24pt;
  }
  
  #post,
  .post,
  #post-index,
  .blog-intro {
    box-shadow: none;
    border: 1px solid #000;
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .post-tags a {
    background: none;
    color: black;
    border: 1px solid black;
  }
}

ul.links li {
  margin-left: 1em;
}

.rss {
  color: #F99000;
}
