body {
  overflow-x: hidden;
}

.page-container {
  max-width: 1600px;
  width: 94vw;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.content-wrapper {
  display: flex;
  gap: clamp(1.5rem, 3vw, 3rem);
  width: 100%;
  align-items: flex-start;
}

.homepage-main {
  flex: 1 1 0;
  min-width: 0;
  padding-top: 2rem;
}

.homepage-sidebar {
  flex: 0 0 24rem;
  min-width: 0;
  font-size: 0.85rem;
  border-left: 1px solid #e0e0e0;
  padding-left: 1rem;
  box-sizing: border-box;
}

.post-homepage-divider {
  margin: 2rem auto;
  width: 80%;
  height: 15px;
  background: linear-gradient(to right, transparent, #ccc, transparent);
  border: none;
}

.post-homepage-preview {
  margin-bottom: 2rem;
}

.post-homepage-date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 0.2rem;
}

.post-homepage-title {
  margin: 0.2rem 0 0.8rem;
  font-size: 1.25rem;
  font-weight: bold;
}

.post-homepage-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.post-homepage-image {
  flex: 0 0 360px;
}

.post-homepage-image img {
  display: block;
  width: 360px;
  height: 220px;
  border-radius: 6px;
  object-fit: contain;
}

.post .post-content .post-homepage-image img {
  width: 360px;
  max-width: 360px;
  height: 220px;
}

.post-homepage-excerpt {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: #333;
}

.post-homepage-link {
  text-decoration: none;
  color: inherit;
}

.blog-archive {
  font-size: 0.95rem;
  margin-top: 2rem;
  overflow-wrap: anywhere;
}

.archive-tree {
  margin-left: 0;
  padding-left: 1rem;
}

.archive-tree ul {
  list-style: none;
  margin-left: 0;
  padding-left: 1rem;
}

.archive-tree li {
  margin: 0.25rem 0;
}

.archive-tree summary {
  cursor: pointer;
  font-weight: 500;
  color: #3366cc;
  white-space: normal;
}

.archive-tree a {
  text-decoration: none;
  color: #222;
  overflow-wrap: anywhere;
}

/* Theme container overrides */
.container, .wrapper {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.site-header .wrapper,
.site-footer .wrapper {
  max-width: 1600px !important;
  width: min(94vw, 1600px) !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

.site-header {
  padding-top: 2rem;
}

.site-title {
  margin-left: 0;
}

.site-nav {
  margin-right: 0;
}

.site-footer {
  padding-bottom: 2rem;
}

.footer-heading {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.footer-col-wrapper {
  display: flex;
  flex-wrap: wrap;
  font-weight: bold;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

.footer-col {
  flex: 1;
  min-width: 200px;
  margin-right: 2rem;
}

.footer-col:last-child {
  margin-right: 0;
}

.footer-col-3 {
  flex: 2.5;
  min-width: 250px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.page-number,
.pagination a {
  padding: 0.4em 0.8em;
  border-radius: 4px;
  text-decoration: none;
  color: #3366cc;
  font-weight: bold;
}

.page-number.current {
  background: #3366cc;
  color: #fff;
}

.pagination a:hover {
  background: #e0e0e0;
}

.search-container {
  margin-bottom: 2rem;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background-color: #fff;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #3366cc;
  box-shadow: 0 0 0 3px rgba(51, 102, 204, 0.1);
}

.search-input::placeholder {
  color: #999;
}

/* Category styles */
.post-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.category-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: #fff;
}

/* Keep post pages readable without crushing medium desktop widths. */
.post .post-content,
.post .post-title,
.post .post-meta,
.post .post-categories {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.post .post-content img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1200px) {
  .page-container {
    width: 94vw;
  }

  .content-wrapper {
    gap: 2rem;
  }

  .homepage-sidebar {
    flex-basis: 20rem;
  }
}

@media (max-width: 1050px) {
  .page-container {
    max-width: 100vw;
    width: 100vw;
    padding: 0 5vw;
  }
  .content-wrapper {
    flex-direction: column;
  }
  .homepage-main {
    flex: 1 1 100%;
  }
  .homepage-sidebar {
    flex: 1 1 100%;
    border-left: none;
    padding-left: 0;
    margin-top: 2rem;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  /* Post page mobile styles */
  .post .post-content,
  .post .post-title,
  .post .post-meta,
  .post .post-categories {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Category badges mobile */
  .post-categories {
    gap: 0.3rem;
  }

  .category-badge {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .post-homepage-content {
    flex-direction: column;
  }

  .post-homepage-image,
  .post-homepage-image img,
  .post .post-content .post-homepage-image img {
    width: 100%;
    max-width: 100%;
  }
}
