/* css/style.css */

/* 1. Set modern defaults & define color variables */
:root {
    --color-primary: #3355cc;
    --color-text: #333;
    --color-background: #f8f9fa;
    --color-light-gray: #e9ecef;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-serif: "Georgia", "Times New Roman", serif;
  }
  
  * {
    box-sizing: border-box;
  }
  
  /* 2. Style the main body and layout */
  body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    margin: 0;
    padding: 0;
  }
  
  .container {
    max-width: 800px;
    margin: 2rem auto; /* 2rem top/bottom, auto left/right centers it */
    padding: 0 1rem;   /* Padding for mobile screens */
  }
  
  /* 3. Style typography */
  h1, h2, h3 {
    font-family: var(--font-serif);
    color: var(--color-primary);
    line-height: 1.2;
  }
  
  a {
    color: var(--color-primary);
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  code {
    background-color: var(--color-light-gray);
    padding: 0.2em 0.4em;
    border-radius: 3px;
  }

/* --- Main Layout --- */
  .main-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: Single column */
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
  }
  
  /* .sidebar {
    /* Sidebar specific styles will go here *
    border-right: 1px solid var(--color-light-gray);
    padding-right: 1.5rem;
  } */

  .sidebar-left {
    /* Styles for the left sidebar (navigation) */
    border-left: 1px solid var(--color-light-gray);
    padding-left: 1.5rem;
  }
  
  .sidebar-right {
    /* Styles for the right sidebar (author profile) */
    border-right: 1px solid var(--color-light-gray);
    padding-right: 1.5rem;
  }
  
  .content-container {
    /* This just holds the main content */
    min-width: 0;
  }
  
/* Tablet view: 2 columns */
@media (min-width: 768px) {
  .main-wrapper {
    grid-template-columns: 280px 1fr; /* Nav + Main Content */
  }
  .sidebar-right {
    /* On tablets, move the author profile below the main content */
    grid-column: 2 / 3;
    margin-top: 2rem;
  }
}

/* Desktop view: 3 columns */
@media (min-width: 1024px) {
  .main-wrapper {
    /* Left(280px) - Center(Flexible) - Right(280px) */
    grid-template-columns: 280px 1fr 280px;
  }
  .sidebar-right {
    /* On desktops, place it back in the third column */
    grid-column: 3 / 4;
    grid-row: 1 / 2; /* Ensure it aligns to the top */
    margin-top: 0;
  }
}


  /* Author Profile */
.author-profile {
  text-align: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
}
.author-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}
.author-name {
  margin: 0;
  font-size: 1.25rem;
}
.author-description {
  font-size: 0.9rem;
  color: #666;
}
.author-contact {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.author-contact a svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
  transition: stroke 0.2s ease;
}
.author-contact a:hover svg {
  stroke: var(--color-primary);
}

/* Folder Navigation */
.folder-nav h3 {
  margin-top: 0;
}
.folder-list, .post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.folder-toggle {
  background: none;
  border: none;
  padding: 0.5rem 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
}
.folder-toggle::after {
  content: '▶';
  font-size: 0.7em;
  transition: transform 0.2s ease;
}
.folder-toggle.open::after {
  transform: rotate(90deg);
}
.post-count {
  color: #888;
  font-size: 0.9em;
}
.post-list {
  display: none; /* Hidden by default */
  padding-left: 1rem;
}
.post-list.open {
  display: block; /* Shown when open */
}
.post-list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-radius: 4px;
}
.post-list a.active {
  font-weight: bold;
  color: var(--color-primary);
}

/* --- New Home Button Style --- */
.home-button {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: var(--font-serif);
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-light-gray);
}

/* Fix for horizontal overflow in code blocks */
pre {
  overflow-x: auto;
}

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

.content-container {
  word-wrap: break-word;
  overflow-wrap: break-word;
}