/* public/css/blog-single.css */
/* 專為 blog single 頁面設計的 CSS */

/* 整體容器 */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

/* 文章主體 */
.post-single {
  flex: 1 1 70%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 2rem;
}

/* 文章頭部 */
.post-header {
  margin-bottom: 2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
}

.post-category {
  background: #f0f0f0;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.post-date,
.post-views {
  color: #888;
}

.post-title {
  font-size: 2.5rem;
  margin: 0 0 1rem;
  line-height: 1.2;
  color: #222;
}

.post-featured-image {
  margin-bottom: 2rem;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

/* 文章內容 */
.post-content-body {
  line-height: 1.8;
  color: #444;
  font-size: 1.1rem;
}

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

.post-content-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
}

.post-content-body h2,
.post-content-body h3 {
  margin: 2rem 0 1rem;
  color: #333;
}

.post-content-body ul,
.post-content-body ol {
  margin: 1rem 0 1.5rem 2rem;
}

.post-content-body blockquote {
  border-left: 4px solid #ddd;
  padding-left: 1rem;
  color: #666;
  font-style: italic;
  margin: 1.5rem 0;
}

/* 文章標籤 */
.post-tags {
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.post-tags span {
  font-weight: 500;
}

.post-tags .tag {
  background: #f5f5f5;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-decoration: none;
  color: #555;
}

.post-tags .tag:hover {
  background: #e0e0e0;
}

/* 上一篇/下一篇導航 */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.prev-post,
.next-post {
  flex: 1;
  text-decoration: none;
  color: #333;
  padding: 1rem;
  border-radius: 4px;
  transition: background 0.3s;
}

.prev-post:hover,
.next-post:hover {
  background: #f9f9f9;
}

.prev-post span,
.next-post span {
  display: block;
  font-size: 0.875rem;
  color: #888;
}

.prev-post strong,
.next-post strong {
  display: block;
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* 相關文章 */
.related-posts {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #eee;
}

.related-posts h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #222;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.related-post-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s;
}

.related-post-card:hover {
  transform: translateY(-5px);
}

.related-post-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.related-post-content {
  padding: 1rem;
}

.related-post-content h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.related-post-content h3 a {
  color: #333;
  text-decoration: none;
}

.related-post-content h3 a:hover {
  color: #007bff;
}

.related-post-excerpt {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.related-post-date {
  font-size: 0.75rem;
  color: #888;
}

/* 側邊欄 */
.blog-sidebar {
  flex: 1 1 25%;
  min-width: 250px;
}

.sidebar-widget {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #222;
}

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

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

.category-list a {
  display: flex;
  justify-content: space-between;
  color: #555;
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.3s;
}

.category-list a:hover {
  color: #007bff;
}

.category-list .active {
  color: #007bff;
  font-weight: bold;
}

.count {
  color: #888;
  font-size: 0.875rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #f0f0f0;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-block {
  display: block;
  width: 100%;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .blog-container {
    flex-direction: column;
  }

  .post-single,
  .blog-sidebar {
    flex: 1 1 100%;
  }

  .post-title {
    font-size: 2rem;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}
