/* ===== LAYOUT ===== */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  min-width: 280px;
  border-right: 2px solid var(--accent);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.3em;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.sidebar-desc {
  font-size: 0.85em;
  opacity: 0.6;
  margin-top: 0.5rem;
}

.sidebar-nav h2 {
  font-size: 0.9em;
  margin-bottom: 0.5rem;
  opacity: 0.5;
  text-transform: lowercase;
  letter-spacing: 0.1em;
}

.sidebar-year {
  margin-bottom: 1.5rem;
}

.year-label {
  font-size: 0.8em;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0.25rem 0 0 0;
  padding: 0;
}

.sidebar-nav li {
  margin: 0;
  padding: 0;
}

.sidebar-nav li a {
  display: block;
  padding: 2px 0;
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.85em;
  opacity: 0.75;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  color: var(--accent);
  opacity: 1;
}

.post-date {
  color: var(--accent);
  opacity: 0.5;
  font-size: 0.85em;
  margin-right: 0.5ch;
}

/* ===== MAIN CONTENT ===== */
.content {
  flex: 1;
  min-width: 0;
  padding: 2rem 3rem;
  max-width: 720px;
}

/* ===== TOP NAV ===== */
.topnav {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--foreground) 15%, transparent);
}

.topnav a {
  text-decoration: none;
  margin-right: 2ch;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.topnav a:hover,
.topnav a.active {
  opacity: 1;
}

/* ===== LANDING ===== */
.landing h1 {
  font-size: 1.4em;
}

.landing-blurb {
  opacity: 0.7;
  font-style: italic;
}

/* ===== POST LIST ===== */
.post-list h2 {
  margin-top: 2rem;
}

.year-heading {
  font-size: 1em;
  color: var(--accent);
  opacity: 0.6;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-item {
  padding: 0.4rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1.5ch;
}

.post-item a {
  text-decoration: none;
  font-weight: 500;
}

.post-meta {
  font-size: 0.8em;
  opacity: 0.5;
}

.tag {
  margin-left: 0.5ch;
  color: var(--accent);
}

.upvote-count {
  margin-left: 1ch;
  color: var(--accent);
}

/* ===== SINGLE POST ===== */
.post header {
  margin-bottom: 2rem;
}

.post header h1 {
  margin-bottom: 0.5rem;
}

.post-body {
  line-height: 1.7;
}

.lastmod {
  opacity: 0.5;
}

/* ===== UPVOTE WIDGET ===== */
.post-actions {
  margin-top: 2rem;
}

.upvote-widget {
  display: flex;
  align-items: center;
  gap: 1ch;
  margin-bottom: 2rem;
}

.upvote-btn {
  font-size: 1.2em;
  padding: 4px 12px;
  min-width: auto;
}

.upvote-btn.upvoted {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  cursor: default;
}

.upvote-number {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1em;
}

.upvote-label {
  opacity: 0.5;
  font-size: 0.85em;
}

/* ===== COMMENT FORM ===== */
.comment-section {
  margin-top: 1rem;
}

.comment-section h3 {
  font-size: 1em;
  margin-bottom: 1rem;
}

.comment-form textarea,
.comment-form input {
  width: 100%;
  margin-bottom: 0.75rem;
}

.comment-form button {
  margin-top: 0.25rem;
}

.comment-status {
  font-size: 0.85em;
  margin-top: 0.5rem;
  color: var(--accent);
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 4rem;
  padding-bottom: 2rem;
}

.site-footer p {
  font-size: 0.8em;
  opacity: 0.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 2px solid var(--accent);
    padding: 1.5rem;
  }

  .sidebar-nav {
    max-height: 40vh;
    overflow-y: auto;
  }

  .content {
    padding: 1.5rem;
    max-width: 100%;
  }
}
