/* Base styles */
:root {
  --primary-color: #2c3e50;
  --accent-color: #1890a0;
  --text-color: #333;
  --light-text: #666;
  --lightest-text: #999;
  --background-color: #fff;
  --light-background: #f8f9fa;
  --border-color: #eaeaea;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-width: 800px;
  --spacing-unit: 1.5rem;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 2.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
  margin-top: 0;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.3rem;
}

h5 {
  font-size: 1.1rem;
  margin-bottom: 1em;
  color: var(--accent-color);
}

p {
  margin-bottom: 1.5em;
}

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

a:hover {
  color: #1a6ecc;
  /* text-decoration: underline; */
}

/* Site header */
.site-header {
  width: 100%;
  background-color: var(--background-color);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
  position: relative; /* This ensures the header is in the normal document flow */
  top: auto; /* Reset any top positioning */
}

.site-header-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.site-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

.site-title a {
  color: var(--primary-color);
  text-decoration: none;
}

/* Navigation */
.navbar {
  margin: 0.5rem 0;
}

.navbar ul {
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
}

.navbar ul li {
  margin: 0;
}

.navbar ul li a {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  display: inline-block;
}

.navbar ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.navbar ul li a:hover::after {
  width: 100%;
}

.navbar ul li a.active {
  color: var(--accent-color);
  font-weight: 600;
}

.navbar ul li a.active::after {
  width: 100%;
}

/* Blog styles */
.blog-header {
  margin-bottom: 2rem;
  clear: both;
}

.blog-description {
  font-size: 1.1rem;
  color: var(--light-text);
}

.blog-categories {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.blog-category-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  border-radius: 4px;
  background-color: var(--light-background);
  color: var(--text-color);
  font-weight: 500;
}

.blog-category-link.active {
  background-color: var(--accent-color);
  color: white;
}

.blog-entry-list {
  padding-left: 0 !important;
  list-style-type: none;
  margin-top: 2rem;
}

.blog-line-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.blog-line-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-color);
}

.blog-line-item:last-child {
  border-bottom: none;
}

.blog-line-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.blog-line-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.blog-line-tags {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.blog-line-tag {
  margin-right: 0;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.blog-line-date {
  font-size: 0.85rem;
  color: var(--lightest-text);
  white-space: nowrap;
}

.blog-entry {
  /* margin-bottom: 1rem; */
  /* padding-bottom: 1rem; */
  border-bottom: 1px solid var(--border-color);
}

.blog-entry:last-child {
  border-bottom: none;
}

.blog-entry-title {
  font-size: 1.3rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.blog-entry-date {
  font-size: 0.9rem;
  color: var(--lightest-text);
  display: block;
  margin-bottom: 0.5rem;
}

.blog-entry-meta {
  margin-bottom: 1rem;
}

.blog-tag, .post-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin-right: 0.5rem;
  border-radius: 3px;
  background-color: var(--light-background);
  color: var(--light-text);
  font-size: 0.8rem;
}

.blog-entry-excerpt {
  margin-bottom: 1rem;
}

.blog-content {
  clear: both;
}

.no-posts {
  margin: 2rem 0;
  color: var(--light-text);
  font-style: italic;
}

/* Post styles */
.post {
  margin-bottom: 3rem;
  clear: both;
}

.post-header {
  width: 100%;
  background-color: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  margin-right: 1rem;
  position: relative; 
  top: auto; 
}

.post-title {
  margin-bottom: 0.5rem;
}

.post-meta {
  color: var(--light-text);
  margin-bottom: 1rem;
}

.post-date {
  display: inline-block;
  margin-right: 1rem;
}

.post-tags {
  margin-top: 0.5rem;
}

.post-content {
  margin-bottom: 3rem;
}

.post-status {
  margin: 0.6rem 0 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-status-warning {
  color: #6b4f00;
  background-color: #fff8db;
  border-color: #d8b862;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.post-content img {
  margin: 1.5rem 0;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--light-text);
}

.post-content pre {
  background-color: var(--light-background);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.post-content code {
  background-color: var(--light-background);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.post-footer {
  width: 100%;
  margin-top: 2rem;
  position: relative; /* This ensures the header is in the normal document flow */
}

.prev-post, .next-post {
  max-width: 45%;
}

.prev-post.empty, .next-post.empty {
  flex: 1;
}

.back-to-blog {
  text-align: center;
  margin-top: 2rem;
}

.back-to-blog a {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background-color: var(--light-background);
  border-radius: 4px;
  font-weight: 500;
}

/* Site content */
.site-content {
  flex: 1;
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1rem 1rem;
}

/* Site footer */
.site-footer {
  width: 100%;
  background-color: var(--background-color);
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--light-text);
  font-size: 0.9rem;
  /* box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05); */
  position: relative; /* This ensures the header is in the normal document flow */
  bottom: auto; 
}

.footer-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.footer-info {
  margin-bottom: 1rem;
}

.footer-info p {
  margin-bottom: 0;
}

.footer-social {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-social a {
  color: var(--light-text);
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

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

/* Code highlighting */
pre, code {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

pre {
  padding: 1rem;
  overflow: auto;
  background-color: var(--light-background);
  border-radius: 4px;
  margin: 1.5rem 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

code {
  padding: 0.2rem 0.4rem;
  background-color: var(--light-background);
  border-radius: 3px;
}

pre code {
  padding: 0;
  background-color: transparent;
}

/* Ensure lists don't overflow */
ul, ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .wrapper {
    padding: 0;
  }
  
  .site-header-content, 
  .site-content,
  .footer-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .navbar ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .skills-section {
    grid-template-columns: 1fr;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .prev-post, .next-post {
    max-width: 100%;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-social {
    justify-content: center;
  }

  .blog-line-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.6rem 0;
  }

  .blog-line-date {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0;
  }
  
  .site-content {
    padding-top: 0;
  }
  
  .site-footer {
    padding: 1rem 0;
  }
}

/* About section */
.about-section {
  margin-bottom: 2rem;
  clear: both;
}

.about-pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.about-pillar {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbfc 0%, #ffffff 100%);
}

.about-pillar h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--primary-color);
}

.about-tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.about-tag-list li {
  margin: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid #d9e8ea;
  border-radius: 999px;
  background-color: #f2f8f9;
  font-size: 0.92rem;
  color: #2f4d53;
  line-height: 1.2;
}

.about-tag-list li a {
  color: #2f4d53;
  font-weight: 600;
}

.about-tag-list li a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: var(--light-background);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.social-links a:hover {
  background-color: var(--border-color);
  text-decoration: none;
}

/* Figure and image styles */
figure {
  margin: 2rem 0;
}

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

.figure-caption {
  text-align: center;
  padding: 0.8rem 0;
  color: var(--light-text);
  font-size: 0.9rem;
}

/* Home page */
.home-intro {
  font-size: 1.2rem;
  margin: 2rem 0;
  clear: both;
}

/* Home page sections */
.home-section {
  margin-bottom: 3rem;
  clear: both;
}

.home-section h3 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.view-all {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 500;
}

.read-more {
  display: inline-block;
  font-weight: 500;
}

/* Skills section */
.skills-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.skill-category {
  background-color: var(--light-background);
  padding: 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.skill-category h4 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
}

.skill-category p {
  margin-bottom: 0;
}

/* Projects page styles */
.projects-header {
  margin-bottom: 2rem;
  clear: both;
}

.projects-description {
  font-size: 1.1rem;
  color: var(--light-text);
  margin-bottom: 2rem;
}

.projects-secondary-nav {
  margin: 0 0 1.5rem;
}

.projects-secondary-link {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--light-background);
  color: var(--primary-color);
  font-weight: 500;
}

.projects-secondary-link:hover {
  background-color: var(--border-color);
  color: var(--primary-color);
}

.projects-categories {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.project-category-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  background-color: var(--light-background);
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
}

.project-category-link.active {
  background-color: var(--accent-color);
  color: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 300px;
  margin-bottom: 1rem;
  padding: 1.5rem;
  box-sizing: border-box;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
}

.project-image-placeholder {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light-background);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.project-image-placeholder i {
  font-size: 3.5rem;
  color: var(--accent-color);
}

.project-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card h3 {
  margin: 0.5rem 0;
  font-size: 1.3rem;
}

.project-tags {
  margin-top: auto;
}

.project-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
  border-radius: 3px;
  background-color: var(--light-background);
  color: var(--light-text);
  font-size: 0.8rem;
}

.project-status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project-status.status-in-progress{
  background-color: #fff4ce;
  color: #8a6d00;
}

.project-status.status-completed {
  background-color: #dcf5e3;
  color: #1e7a34;
}

.project-status.status-maintained {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.project-story-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 2.5rem;
}

.project-story {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  background-color: var(--background-color);
}

.project-story h3 {
  margin-top: 0;
}

.project-story p {
  margin-bottom: 0.9rem;
}

.project-story p:last-child {
  margin-bottom: 0;
}

/* Career timeline */
.career-intro {
  color: var(--light-text);
  font-size: 1.05rem;
  margin-bottom: 1.3rem;
}

.career-timeline {
  position: relative;
  list-style: none;
  padding: 0 0 0 1.55rem;
  margin: 0 0 2.4rem;
}

.career-timeline::before {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-color), #87ccd5);
}

.career-item {
  position: relative;
  margin-bottom: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--light-background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.career-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 1.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-color);
  border: 2px solid var(--background-color);
}

.career-item > :last-child {
  margin-bottom: 0;
}

.career-item:last-child {
  margin-bottom: 0;
}

.career-period {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-color);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.career-role {
  margin: 0;
  font-size: 1.2rem;
}

.career-org {
  margin: 0.2rem 0 0;
  color: var(--light-text);
}

.career-highlights {
  margin: 0.1rem 0 0;
  padding-left: 1.2rem;
}

.career-org + .career-highlights {
  margin-top: 0.6rem;
}

.career-highlights li {
  margin-bottom: 0.45rem;
}

.career-highlights li:last-child {
  margin-bottom: 0;
}

figure {
  margin: 1.5rem auto 2.5rem;
  max-width: 80%;
}

@media (max-width: 768px) {
  .career-timeline {
    padding-left: 1.15rem;
  }
}

@media (max-width: 480px) {
  .career-item {
    padding: 0.9rem;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .project-card {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-card {
    height: 270px;
  }
  
  .project-category-link {
    margin-bottom: 0.5rem;
  }
}