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

body {
  background-color: #1e1e1e; /* VS Code dark background */
  font-family: Consolas, 'Courier New', monospace; /* Monospaced font stack */
  font-size: 14px;
  color: #d4d4d4; /* Soft off-white text */
  line-height: 1.6; /* Increased line height for readability */
}

a {
  color: #569cd6; /* VS Code link blue */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Wrapper for main content and sidebar */
#wrapper {
  max-width: 100%; /* Expand to full width */
  margin: 20px; /* Keep some margin from the edges */
  padding: 0;
  display: flex;
  gap: 20px; /* Space between main and sidebar */
}

/* Header / Top Nav */
header {
  background-color: #252526; /* VS Code sidebar/panel background */
  color: #d4d4d4;
  padding: 15px 0;
  border-bottom: 1px solid #333841; /* VS Code-like border */
  margin-bottom: 20px; /* Space below header */
}

header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 24px;
  font-weight: bold;
}

header h1 a {
  color: #d4d4d4; /* White for site title */
  text-decoration: none;
}

header nav a {
  color: #d4d4d4;
  margin-left: 25px;
  text-decoration: none;
  font-weight: normal;
  padding: 5px 0;
  transition: color 0.2s ease;
}

header nav a:hover {
  color: #569cd6; /* Link hover color */
  text-decoration: none;
}

/* Main Content Area */
main {
  flex: 1; /* Takes up remaining space */
  min-width: 0; /* Allow content to shrink */
}

/* Sidebar Panels */
.sidebar {
  width: 280px; /* Wider sidebar */
  flex-shrink: 0; /* Don't shrink sidebar */
}

.sidebar .panel {
  background-color: #252526; /* VS Code sidebar/panel background */
  border: 1px solid #333841; /* VS Code-like border */
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

.sidebar .panel h3 {
  background-color: #333841; /* Darker header for panels */
  color: #4ec9b0; /* Section header color */
  font-size: 16px;
  padding: 10px 15px;
  border-bottom: 1px solid #333841;
}

.sidebar .panel ul {
  list-style: none;
  padding: 10px 15px;
}

.sidebar .panel ul li {
  padding: 5px 0;
}

.sidebar .panel ul li a {
  color: #d4d4d4; /* White for sidebar links */
  text-decoration: none;
  display: block;
}

.sidebar .panel ul li a:hover {
  color: #569cd6; /* Link hover color */
  background-color: #333841; /* Subtle background on hover */
  text-decoration: none;
}

/* News Section / Forum Table (general content boxes) */
.news-section,
.forum-table-container, /* New container for forum table */
.post-content,
.editor-container,
.ai-news-item,
.post-list-item,
.home-section,
.search-form,
.author-info,
.toc {
  background-color: #252526; /* VS Code panel background */
  border: 1px solid #333841; /* VS Code-like border */
  margin-bottom: 20px;
  padding: 15px 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.news-section h2,
.home-section h2 {
  color: #4ec9b0; /* Section header color */
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333841; /* Horizontal line */
}

.news-item {
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #333841; /* Horizontal line between news items */
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-item h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.news-item h3 a {
  color: #dcdcaa; /* Post title color */
  text-decoration: none;
}

.news-item h3 a:hover {
  text-decoration: underline;
}

.news-item .news-meta {
  font-size: 12px;
  color: #888; /* Muted meta info */
  margin-top: 5px;
}

.news-item .news-meta a {
  color: #888;
  text-decoration: none;
}

.news-item .news-meta a:hover {
  text-decoration: underline;
}

.news-item-summary {
  margin-top: 10px;
  color: #d4d4d4;
}

.sector-title {
  color: #e06c75; /* A prominent color, like a reddish-pink from VS Code theme */
  font-weight: bold;
  font-size: 22px; /* Slightly larger for prominence */
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333841;
}

/* Forum Table (thread lists) */
.forum-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0; /* Container handles margin */
}

.forum-table thead {
  background-color: #333841; /* Darker header for table */
  color: #d4d4d4;
}

.forum-table thead th {
  padding: 10px 15px;
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid #333841;
}

.forum-table tbody tr {
  background-color: #252526; /* Default row background */
  border-bottom: 1px solid #333841; /* Horizontal line between rows */
}

.forum-table tbody tr:nth-child(odd) {
  background-color: #2d2d2d; /* Slightly different shade for odd rows */
}

.forum-table tbody tr:hover {
  background-color: #3a3a3a; /* Lighter gray on hover */
}

.forum-table td {
  padding: 10px 15px;
  color: #d4d4d4;
}

.thread-title {
  color: #dcdcaa; /* Post title color */
  font-weight: bold;
}

.thread-title:hover {
  text-decoration: underline;
}

/* Post-specific styles */
.post-content h1 {
  color: #dcdcaa; /* Post title color */
  font-size: 28px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333841;
}

.post-content .meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
  border-bottom: 1px solid #333841;
  padding-bottom: 10px;
}

.post-content p {
  margin-bottom: 1em;
  line-height: 1.8;
}

.post-content pre {
  background-color: #1a1a1a; /* Darker background for code blocks */
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid #333841;
}

.post-content code {
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  background-color: #333841; /* Subtle background for inline code */
  padding: 2px 4px;
  border-radius: 3px;
  color: #d4d4d4;
}

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

/* Editor page specific styles */
.editor-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background-color: #252526;
  border: 1px solid #333841;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.editor-container h1 {
  text-align: center;
  color: #d4d4d4;
  margin-bottom: 20px;
  border-bottom: 1px solid #333841;
  padding-bottom: 10px;
}

.editor-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #d4d4d4;
}

.editor-form input[type="text"],
.editor-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #333841;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border-radius: 4px;
  font-size: 16px;
}

.editor-form textarea {
  min-height: 200px;
  resize: vertical;
}

.editor-form button {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: #569cd6; /* VS Code blue for buttons */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.editor-form button:hover {
  background-color: #4080c0;
}

.editor-form .message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
}

.editor-form .message.success {
  background-color: #28a745; /* Green for success */
  color: white;
  border-color: #28a745;
}

.editor-form .message.error {
  background-color: #dc3545; /* Red for error */
  color: white;
  border-color: #dc3545;
}

/* AI News specific styles */
.ai-news-list {
  list-style: none;
  padding: 0;
}

.ai-news-item {
  background-color: #252526;
  border: 1px solid #333841;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 0; /* Remove border-radius for retro look */
}

.ai-news-item h3 {
  margin-top: 0;
  color: #dcdcaa; /* Post title color */
}

.ai-news-item p {
  margin-bottom: 10px;
}

.ai-news-item .source-link {
  display: inline-block;
  margin-top: 10px;
  color: #569cd6;
  text-decoration: none;
}

.ai-news-item .source-link:hover {
  text-decoration: underline;
}

.ai-news-item .date {
  font-size: 0.9em;
  color: #888;
}

/* Posts list */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list-item {
  background-color: #252526;
  border: 1px solid #333841;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 0;
}

.post-list-item h3 {
  margin-top: 0;
  color: #dcdcaa; /* Post title color */
}

.post-list-item .meta {
  font-size: 0.9em;
  color: #888;
}

.post-list-item .meta a {
  color: #569cd6;
  text-decoration: none;
}

.post-list-item .meta a:hover {
  text-decoration: underline;
}

/* General content styling */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  color: #4ec9b0; /* Section header color */
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  border-bottom: 1px solid #333841;
  padding-bottom: 5px;
}

.content p {
  margin-bottom: 1em;
}

.content ul,
.content ol {
  margin-left: 25px;
  margin-bottom: 1em;
}

.content li {
  margin-bottom: 0.5em;
}

.content a {
  color: #569cd6;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border: 1px solid #333841; /* Border for images */
}

.content blockquote {
  border-left: 4px solid #569cd6; /* Blue border for blockquote */
  padding-left: 15px;
  margin: 1.5em 0;
  color: #d4d4d4;
  background-color: #2d2d2d; /* Slightly lighter background for blockquote */
  padding: 10px 15px;
}

.content pre {
  background-color: #1a1a1a;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid #333841;
}

.content code {
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  background-color: #333841;
  padding: 2px 4px;
  border-radius: 3px;
  color: #d4d4d4;
}

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

/* Table of Contents (if used) */
.toc {
  border: 1px solid #333841;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #252526;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.2em;
  color: #4ec9b0;
  border-bottom: 1px solid #333841;
  padding-bottom: 5px;
}

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

.toc ul li a {
  color: #d4d4d4;
  text-decoration: none;
}

.toc ul li a:hover {
  text-decoration: underline;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination a {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 5px;
  border: 1px solid #333841;
  color: #569cd6;
  text-decoration: none;
  border-radius: 4px;
  background-color: #252526;
}

.pagination a.active,
.pagination a:hover {
  background-color: #569cd6;
  color: white;
  border-color: #569cd6;
}

/* Search form styles */
.search-form {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #252526;
  border: 1px solid #333841;
}

.search-form input[type="text"] {
  width: calc(100% - 80px);
  padding: 8px;
  border: 1px solid #333841;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border-radius: 4px;
  margin-right: 5px;
}

.search-form button {
  padding: 8px 15px;
  background-color: #569cd6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-form button:hover {
  background-color: #4080c0;
}

/* Tag list styles */
.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list-item a {
  display: inline-block;
  background-color: #333841;
  padding: 5px 10px;
  border-radius: 15px;
  color: #d4d4d4;
  text-decoration: none;
  font-size: 0.9em;
}

.tag-list-item a:hover {
  background-color: #404040;
}

/* Author info styles */
.author-info {
  margin-top: 20px;
  padding: 15px;
  border-top: 1px solid #333841;
  background-color: #252526;
}

.author-info h4 {
  margin-top: 0;
  color: #4ec9b0;
}

.author-info p {
  font-size: 0.9em;
  color: #888;
}

/* Specific for posts/first-post.md and posts/fun-post.md */
.post-header {
  text-align: center;
  margin-bottom: 30px;
}

.post-header h1 {
  font-size: 2.5em;
  color: #dcdcaa;
  margin-bottom: 10px;
}

.post-header .meta {
  font-size: 0.9em;
  color: #888;
}

.post-content {
  line-height: 1.8;
  font-size: 1.1em;
}

.post-content h2 {
  font-size: 1.8em;
  color: #4ec9b0;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  border-bottom: 1px solid #333841;
  padding-bottom: 5px;
}

.post-content h3 {
  font-size: 1.4em;
  color: #4ec9b0;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  border-bottom: 1px solid #333841;
  padding-bottom: 5px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em auto;
  border: 1px solid #333841;
}

.post-content blockquote {
  background-color: #2d2d2d;
  border-left: 5px solid #569cd6;
  padding: 15px 20px;
  margin: 1.5em 0;
  font-style: italic;
  color: #d4d4d4;
}

.post-content pre {
  background-color: #1a1a1a;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid #333841;
}

.post-content code {
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  background-color: #333841;
  padding: 2px 4px;
  border-radius: 3px;
  color: #d4d4d4;
}

.post-content ul,
.post-content ol {
  margin-left: 25px;
  margin-bottom: 1.5em;
}

.post-content li {
  margin-bottom: 0.8em;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.post-content th,
.post-content td {
  border: 1px solid #333841;
  padding: 8px;
  text-align: left;
  color: #d4d4d4;
}

.post-content th {
  background-color: #333841;
  color: #d4d4d4;
}

.post-content hr {
  border: 0;
  height: 1px;
  background-color: #333841;
  margin: 2em 0;
}

/* Specific for ahens-news.njk */
.ahens-news-list {
  list-style: none;
  padding: 0;
}

.ahens-news-item {
  background-color: #252526;
  border: 1px solid #333841;
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 0;
}

.ahens-news-item h3 {
  margin-top: 0;
  color: #dcdcaa;
}

.ahens-news-item p {
  margin-bottom: 10px;
}

.ahens-news-item .meta {
  font-size: 0.9em;
  color: #888;
}

.ahens-news-item .meta a {
  color: #569cd6;
  text-decoration: none;
}

.ahens-news-item .meta a:hover {
  text-decoration: underline;
}

/* Specific for index.njk */
.home-section {
  background-color: #252526;
  border: 1px solid #333841;
  margin-bottom: 20px;
  padding: 15px;
}

.home-section h2 {
  color: #4ec9b0;
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333841;
}

.home-section ul {
  list-style: none;
  padding: 0;
}

.home-section ul li {
  margin-bottom: 10px;
}

.home-section ul li a {
  color: #d4d4d4;
  text-decoration: none;
}

.home-section ul li a:hover {
  text-decoration: underline;
}

/* Specific for editor.html */
.editor-page-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background-color: #252526;
  border: 1px solid #333841;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.editor-page-container h1 {
  text-align: center;
  color: #d4d4d4;
  margin-bottom: 20px;
  border-bottom: 1px solid #333841;
  padding-bottom: 10px;
}

.editor-page-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #d4d4d4;
}

.editor-page-form input[type="text"],
.editor-page-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #333841;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border-radius: 4px;
  font-size: 16px;
}

.editor-page-form textarea {
  min-height: 200px;
  resize: vertical;
}

.editor-page-form button {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: #569cd6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.editor-page-form button:hover {
  background-color: #4080c0;
}

.editor-page-form .message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
}

.editor-page-form .message.success {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

.editor-page-form .message.error {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}
/* Notice / Info Boxes */
.notice {
  max-width: 1200px;
  margin: 10px auto;
  background-color: #2d2d2d; /* Darker background for notice */
  border: 1px solid #333841;
  padding: 10px 15px;
  font-size: 13px;
  color: #d4d4d4;
}

/* Footer */
footer {
  background-color: #252526;
  border-top: 1px solid #333841;
  text-align: center;
  padding: 15px 0;
  margin-top: 30px;
  font-size: 12px;
  color: #888;
}

/* Responsive */
@media (max-width: 768px) {
  #wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 20px;
  }

  header .container {
    flex-direction: column;
    align-items: flex-start;
  }

  header nav {
    margin-top: 10px;
  }
}
