/* Blog page - retro window style */

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Add scroll padding to account for fixed headers */
html {
  scroll-padding-top: 2rem;
}

.blog-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 5vw, 4rem);
}

.blog-layout {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.blog-window {
  width: 100%;
  max-width: 100%;
}

.sidebar-container {
  position: sticky;
  top: 2rem;
}

/* Main blog window */
.blog-window {
  background: #f5f5f5;
  border: 3px solid #000;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

[data-theme="dark"] .blog-window {
  background: #2a2a2a;
  border-color: #e0e0e0;
  box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.15);
}

.blog-window-header {
  padding: 0.75rem 1.5rem;
  background: #fff176;
  border-bottom: 3px solid #000;
}

[data-theme="dark"] .blog-window-header {
  background: #1e3a5f;
  border-bottom-color: #e0e0e0;
}

.blog-window-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  font-family: monospace;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .blog-window-title {
  color: #fff;
}

.blog-window-content {
  padding: 2rem;
  background: #ffffff;
}

[data-theme="dark"] .blog-window-content {
  background: #2a2a2a;
}

/* Sidebar container */
.sidebar-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar windows */
.sidebar-window {
  background: #f5f5f5;
  border: 3px solid #000;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

[data-theme="dark"] .sidebar-window {
  background: #2a2a2a;
  border-color: #e0e0e0;
  box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.15);
}

.sidebar-window-header {
  padding: 0.75rem 1.5rem;
  border-bottom: 3px solid #000;
}

[data-theme="dark"] .sidebar-window-header {
  border-bottom-color: #e0e0e0;
}

/* RSS window - orange header, no content, clickable */
.rss-window {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.1s ease;
}

.rss-window .sidebar-window-header {
  background: #ffb74d;
  border-bottom: none;
  transition: all 0.1s ease;
}

[data-theme="dark"] .rss-window .sidebar-window-header {
  background: #5a3a1a;
}

.rss-window:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .rss-window:hover {
  box-shadow: 8px 8px 0px rgba(255, 255, 255, 0.15);
}

.rss-window:hover .sidebar-window-header {
  background: #000;
}

[data-theme="dark"] .rss-window:hover .sidebar-window-header {
  background: #fff;
}

.rss-window:hover .sidebar-window-title {
  color: #ffb74d;
}

[data-theme="dark"] .rss-window:hover .sidebar-window-title {
  color: #5a3a1a;
}

.rss-window:active {
  transform: translate(0, 0);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

/* Posts window - yellow header (same as main blog) */
.posts-window .sidebar-window-header {
  background: #fff176;
}

[data-theme="dark"] .posts-window .sidebar-window-header {
  background: #1e3a5f;
}

.sidebar-window-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #000;
  font-family: monospace;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .sidebar-window-title {
  color: #fff;
}

.sidebar-window-content {
  padding: 1.5rem;
  background: #ffffff;
}

[data-theme="dark"] .sidebar-window-content {
  background: #2a2a2a;
}

/* Post meta with date, tags, and share buttons */
.post-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  background: #f5f5f5;
  border: 2px solid #000;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .tag-badge {
  background: #1a1a1a;
  border-color: #e0e0e0;
  color: #fff;
  box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.1);
}

.tag-badge:hover {
  background: #8B5CF6;
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .tag-badge:hover {
  background: #4A2C7B;
  border-color: #e0e0e0;
  box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.15);
}

.tag-badge.active {
  background: #8B5CF6;
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .tag-badge.active {
  background: #4A2C7B;
  border-color: #e0e0e0;
  color: #fff;
  box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.15);
}

.tag-count {
  opacity: 0.7;
  font-size: 0.8em;
}

/* Share buttons */
.share-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f5f5f5;
  border: 2px solid #000;
  border-radius: 4px;
  color: #000;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .share-button {
  background: #1a1a1a;
  border-color: #e0e0e0;
  color: #fff;
  box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.1);
}

.share-button:hover {
  background: #fff176;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .share-button:hover {
  background: #1e3a5f;
  box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.15);
}

.share-button:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.post-date {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}

/* Post hero image */
.post-hero-wrapper {
  margin-bottom: 2rem;
  border: 3px solid #000;
  overflow: hidden;
}

[data-theme="dark"] .post-hero-wrapper {
  border-color: #e0e0e0;
}

.post-hero {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

/* Post intro */
.post-intro {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--ink);
}

/* Table of Contents */
.table-of-contents {
  background: #f5f5f5;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .table-of-contents {
  background: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.1);
}

.toc-header h2 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--ink);
  font-family: monospace;
  letter-spacing: 0.02em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin: 0.5rem 0;
}

.toc-item a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  display: inline-block;
  padding: 0.25rem 0;
  transition: all 0.1s ease;
}

.toc-item a:hover {
  color: #4A90E2;
  transform: translateX(4px);
}

[data-theme="dark"] .toc-item a:hover {
  color: #1e3a5f;
}

.toc-h3 {
  margin-left: 1.5rem;
}

.toc-h3 a {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.85;
}

/* Post body */
.post-body {
  color: var(--ink);
  margin-bottom: 3rem;
}

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 2rem 0 1rem 0;
  color: var(--ink);
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--ink);
}

.post-body p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0.75rem 0;
  color: var(--ink);
}

.post-body ul,
.post-body ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.post-body li {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0.35rem 0;
}

.post-body strong {
  font-weight: 900;
}

.post-body a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.post-body a:hover {
  background: #fff176;
}

[data-theme="dark"] .post-body a:hover {
  background: #1e3a5f;
}

.post-body code {
  background: #f5f5f5;
  padding: 0.2rem 0.4rem;
  font-family: monospace;
  font-size: 1em;
}

[data-theme="dark"] .post-body code {
  background: #1a1a1a;
}

.post-body pre {
  background: #f5f5f5;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 1rem;
}

[data-theme="dark"] .post-body pre {
  background: #1a1a1a;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 1rem;
}

/* Post navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  border: none !important;
}

.blog-post hr {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border: 2px solid #000;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #000;
  text-decoration: none;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nav-link {
  background: #1a1a1a;
  border-color: #e0e0e0;
  color: #fff;
  box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
  background: #fff176;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .nav-link:hover {
  background: #1e3a5f;
  box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.15);
}

.nav-link:active {
  transform: translate(0, 0);
  box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.nav-disabled {
  visibility: hidden;
}

.nav-arrow {
  font-size: 1.2rem;
}

/* Comments section */
.comments-section {
  margin-top: 3rem;
  border: none !important;
}

.comments-section *,
.comments-section iframe,
.utterances {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
}

/* Sidebar content */
.rss-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff176;
  border: 2px solid #000;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #000;
  text-decoration: none;
  transition: all 0.1s ease;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
  width: 100%;
}

[data-theme="dark"] .rss-link {
  background: #1e3a5f;
  border-color: #e0e0e0;
  color: #fff;
  box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.1);
}

.rss-link:hover {
  background: #000;
  color: #fff176;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .rss-link:hover {
  background: #fff;
  color: #1e3a5f;
  box-shadow: 3px 3px 0px rgba(255, 255, 255, 0.15);
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-list li {
  margin-bottom: 0.75rem;
}

.sidebar-list a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
  display: block;
  padding: 0.5rem 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-container {
    position: static;
  }
}

@media (max-width: 768px) {
  .blog-container {
    padding: 2rem 1rem;
  }

  .blog-window-content,
  .sidebar-window-content {
    padding: 1.5rem;
  }

  .blog-window-title {
    font-size: 1.2rem;
  }

  .post-intro {
    font-size: 1.1rem;
  }

  .post-body h2 {
    font-size: 1.3rem;
  }

  .post-body h3 {
    font-size: 1.1rem;
  }

  .post-body p,
  .post-body li {
    font-size: 1rem;
  }

  .share-buttons {
    flex-wrap: wrap;
  }
}
