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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  color: #373737;
  min-height: 100vh;
  position: relative;
}

/* --- Background --- */
.mosaic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #525938;
  background-image: url("/img/block.png");
  background-size: 256px 256px;
  background-repeat: repeat;
}

/* --- Page Layout --- */
.page-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.content-column {
  width: 100%;
  max-width: 1280px;
  background: rgba(198, 198, 198, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 3px solid #8C8C8C;
  border-radius: 8px;
  padding: 2.5rem 2.5rem 1.5rem;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* --- Site Header --- */
.site-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid #62733F;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.site-title a {
  color: #525938;
  text-decoration: none;
  transition: color 0.2s;
}

.site-title a:hover {
  color: #7C8C58;
}

/* --- Navigation --- */
.site-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav li {
  display: inline;
}

.site-nav a {
  display: inline-block;
  padding: 0.4rem 1rem;
  color: #555555;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: #62733F;
  border-color: #62733F;
  background: rgba(98, 115, 63, 0.1);
}

/* --- Timeline (Home, section & term pages) --- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #595959;
  font-style: italic;
}

.timeline-entry {
  padding: 1.75rem 0;
  border-top: 1px solid #7C8C58;
}

.timeline-entry:first-child {
  padding-top: 0;
  border-top: none;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.timeline-entry-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #525938;
  line-height: 1.3;
  margin: 0;
  margin-right: 0.4rem;
}

.timeline-entry-date {
  font-size: 0.82rem;
  color: #595959;
  font-weight: 600;
}

.timeline-entry-permalink {
  color: #8C8C8C;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.25rem;
  transition: color 0.2s;
}

.timeline-entry-permalink:hover {
  color: #62733F;
  text-decoration: underline;
}

.timeline-entry-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

.timeline-entry-tags a {
  color: #62733F;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.2s;
}

.timeline-entry-tags a:hover {
  color: #525938;
  text-decoration: underline;
}

/* Inline post body reuses .post-content typography rules */

/* --- Single timeline entry page (permalink view) --- */
.timeline-back {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #7C8C58;
}

.timeline-back a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #62733F;
  text-decoration: none;
  transition: color 0.2s;
}

.timeline-back a:hover {
  color: #525938;
  text-decoration: underline;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #373737;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  color: #525938;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
}

.post-content h2 { font-size: 1.4rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content a {
  color: #525938;
  text-decoration: underline;
}

.post-content a:hover {
  color: #62733F;
}

.post-content pre {
  background: #2d2d2d;
  color: #e0e0e0;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.post-content code {
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.88em;
}

.post-content p > code,
.post-content li > code {
  background: #7C8C58;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #ffffff;
}

.post-content blockquote {
  border-left: 4px solid #62733F;
  padding: 0.5rem 1rem;
  margin: 0 0 1rem;
  background: rgba(98, 115, 63, 0.12);
  border-radius: 0 4px 4px 0;
}

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #555555;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.3rem;
}

/* --- Section Title (list pages) --- */
.section-title {
  font-size: 1.6rem;
  color: #525938;
  margin-bottom: 0.5rem;
}

.section-content {
  margin-bottom: 1.5rem;
  color: #555555;
}

/* --- Tag Cloud (Taxonomy Pages) --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.25rem 0;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  background: #efede8;
  border: 1px solid #8C8C8C;
  border-radius: 5px;
  color: #525938;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tag-pill:hover {
  border-color: #62733F;
  box-shadow: 0 2px 8px rgba(98, 115, 63, 0.2);
}

.tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  background: #62733F;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 3px;
  line-height: 1;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #7C8C58;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  background: #efede8;
  border: 1px solid #8C8C8C;
  border-radius: 4px;
  color: #525938;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.pagination-link:hover:not(.disabled):not(.pagination-current) {
  border-color: #62733F;
  box-shadow: 0 2px 8px rgba(98, 115, 63, 0.2);
}

.pagination-current {
  background: #62733F;
  color: #ffffff;
  border-color: #62733F;
  cursor: default;
}

.pagination .disabled {
  color: #8C8C8C;
  cursor: default;
  opacity: 0.6;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 3px solid #62733F;
  font-size: 0.85rem;
  color: #595959;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .content-column {
    padding: 1.5rem 1.25rem 1rem;
  }

  .site-title {
    font-size: 1.6rem;
  }

  .site-nav a {
    padding: 0.3rem 0.7rem;
    font-size: 0.88rem;
  }

  .timeline-entry {
    padding: 1.25rem 0;
  }

  .timeline-entry-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timeline-entry-tags {
    margin-left: 0;
  }

  .timeline-back {
    margin-top: 1rem;
    padding-top: 1rem;
  }
}
