/* blog.css */
/* Consolidated blog styles for dashboard and article pages */

/* --- Content Container --- */
.content-container {
  padding: 2rem;
  transition: margin-left 0.3s ease, padding 0.3s ease;
}


/* --- General Typography --- */
h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  word-wrap: break-word;
}

/* --- Image Handling (Quill Content) --- */
img,
.post-content img,
.post-excerpt img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

/* Prevent overflow in content containers */
.post-content,
.post-excerpt {
  overflow-x: hidden;
  word-wrap: break-word;
  word-break: break-word;
}

/* Handle embedded media (iframes, videos) */
.post-content iframe,
.post-excerpt iframe,
.post-content video,
.post-excerpt video {
  max-width: 100%;
  height: auto;
}

/* --- Blog Dashboard Styles --- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.post-item {
  background-color: var(--light-blue);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.post-item:hover {
  box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.15);
}

.post-item h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.post-item h2 a {
  color: var(--dark-green);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-item h2 a:hover {
  color: var(--steel-blue);
  text-decoration: underline;
}

.post-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--dark-gray);
  line-height: 1.4;
}

.post-meta a {
  color: var(--steel-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-meta a:hover {
  text-decoration: underline;
  color: var(--cadet-blue);
}

.post-item hr {
  margin-top: 1rem;
  border: none;
  border-top: 1px solid var(--border-color);
}

/* --- Blog Article Styles --- */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--background-color);
  padding: 2rem;
  border-radius: 0.5rem;
}

.blog-post h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.blog-post .post-meta {
  font-size: 0.875rem;
  color: var(--dark-gray);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
}

/* Handle Quill-generated HTML */
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-content h2 {
  font-size: 1.75rem;
  color: var(--dark-green);
}

.post-content h3 {
  font-size: 1.5rem;
  color: var(--steel-blue);
}

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

.post-content ul,
.post-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
  line-height: 1.8;
}

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

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem;
  border-left: 4px solid var(--steel-blue);
  background-color: var(--light-gray);
  font-style: italic;
  color: var(--text-color);
}

.post-content a {
  color: var(--steel-blue);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.post-content a:hover {
  color: var(--cadet-blue);
}

.post-content code {
  background-color: var(--light-gray);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.post-content pre {
  background-color: var(--light-gray);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  .content-container {
    padding: 1.5rem;
  }

  .blog-post {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .post-item h2 {
    font-size: 1.5rem;
  }

  .blog-post h1 {
    font-size: 2rem;
  }

  .blog-post .post-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    margin-left: 0;
  }

  body.sidebar--open {
    margin-left: 0;
  }

  .content-container {
    padding: 1rem;
    margin-left: 0;
  }

  h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .posts-list {
    gap: 1.5rem;
  }

  .post-item {
    padding: 1rem;
  }

  .post-item h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .blog-post {
    padding: 1rem;
    margin: 0;
    border-radius: 0;
  }

  .blog-post h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .blog-post .post-meta {
    margin-bottom: 1.5rem;
  }

  .post-content {
    font-size: 1rem;
    line-height: 1.6;
  }

  .post-content h2 {
    font-size: 1.35rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  .post-content h3 {
    font-size: 1.15rem;
  }

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

  img,
  .post-content img,
  .post-excerpt img {
    margin: 0.75rem 0;
    border-radius: 4px;
  }

  .post-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem;
    border-left: 3px solid var(--steel-blue);
  }
}

@media (max-width: 480px) {
  .content-container {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
  }

  .posts-list {
    gap: 1rem;
  }

  .post-item {
    padding: 0.75rem;
    border-radius: 4px;
  }

  .post-item h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .post-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .post-meta {
    font-size: 0.8rem;
  }

  .blog-post {
    padding: 0.75rem;
  }

  .blog-post h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .blog-post .post-meta {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .post-content {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .post-content h2 {
    font-size: 1.25rem;
    margin-top: 0.75rem;
  }

  .post-content h3 {
    font-size: 1.05rem;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 1.25rem;
  }

  img,
  .post-content img,
  .post-excerpt img {
    margin: 0.5rem 0;
  }

  .post-item hr {
    margin-top: 0.75rem;
  }
}
