/* Woozle Blog Styles — extends existing Dracula/Tailwind theme */

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
}

.blog-header { margin-bottom: 2rem; }
.blog-header h1 { margin-top: 0.5rem; }

/* Post Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Post Card */
.blog-card {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  min-width: 0;
}
.blog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139,233,253,0.3);
}
.blog-card-image { display: block; aspect-ratio: 16/9; overflow: hidden; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 1.25rem; box-sizing: border-box; overflow-wrap: break-word; word-break: break-word; }
.blog-card-meta {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  font-size: 0.75rem; margin-bottom: 0.5rem;
}
.blog-card-category {
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  text-decoration: none;
}
.blog-card-date, .blog-card-reading { color: rgba(255,255,255,0.5); }
.blog-card-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.3; }
.blog-card-title a { color: #f8f8f2; text-decoration: none; }
.blog-card-title a:hover { color: #8be9fd; }
.blog-card-excerpt { font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.6; overflow-wrap: break-word; word-break: break-word; }
.blog-card-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.blog-tag {
  display: inline-block; font-size: 0.75rem; color: #bd93f9;
  text-decoration: none; padding: 0.15rem 0.5rem;
  border: 1px solid rgba(189,147,249,0.2); border-radius: 2rem;
}
.blog-tag:hover { border-color: #bd93f9; color: #ff79c6; }

/* Single Post */
.blog-post-header { margin-bottom: 2rem; }
.blog-post-meta {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-bottom: 0.75rem;
}
.blog-post-title { font-size: 2.25rem; font-weight: 700; line-height: 1.2; color: #f1fa8c; }
.blog-post-author { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin-top: 0.75rem; }
.blog-post-featured { margin: 1.5rem 0; border-radius: 1rem; overflow: hidden; }
.blog-post-featured img { width: 100%; height: auto; }

/* Prose (markdown content) */
.prose { font-size: 1.05rem; line-height: 1.8; color: rgba(255,255,255,0.85); }
.prose h2 { font-size: 1.5rem; font-weight: 600; color: #f1fa8c; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.25rem; font-weight: 600; color: #8be9fd; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; }
.prose a { color: #8be9fd; text-decoration: underline; }
.prose a:hover { color: #ff79c6; }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  border-left: 3px solid #bd93f9; padding: 0.75rem 1rem; margin: 1.5rem 0;
  background: rgba(189,147,249,0.08); border-radius: 0 0.5rem 0.5rem 0;
  color: rgba(255,255,255,0.7);
}
.prose code {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.9em;
  background: rgba(255,255,255,0.08); padding: 0.15rem 0.4rem; border-radius: 0.25rem;
}
.prose pre {
  background: #1a1528; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem; padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0;
}
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; border-radius: 0.75rem; margin: 1rem 0; }
.prose hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 2rem 0; }

/* Comments */
.blog-comments-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); }
.blog-comments-section h3 { font-size: 1.25rem; color: #f1fa8c; margin-bottom: 1.5rem; }
.comments-list { margin-bottom: 2rem; }
.comment-item { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #bd93f9, #ff79c6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: #1a1528;
}
.comment-body { flex: 1; }
.comment-header { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.25rem; font-size: 0.9rem; }
.comment-body p { font-size: 0.9rem; color: rgba(255,255,255,0.75); line-height: 1.6; }
.comment-form-wrapper { margin-top: 2rem; }
.comment-form-wrapper h4 { color: #8be9fd; margin-bottom: 1rem; }
.comment-form { display: flex; flex-direction: column; gap: 0.75rem; }
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comment-form label { font-size: 0.8rem; color: rgba(255,255,255,0.5); display: block; margin-bottom: 0.25rem; }
.comment-form input, .comment-form textarea {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem; padding: 0.6rem 0.75rem; color: #f8f8f2;
  font-family: inherit; font-size: 0.9rem;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: #8be9fd; }
.comment-form .btn { align-self: flex-start; }

/* Related Posts */
.related-posts { margin-top: 2.5rem; }
.related-posts h3 { font-size: 1.1rem; color: #f1fa8c; margin-bottom: 1rem; }
.related-posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.related-post-card {
  display: block; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem; padding: 1rem; text-decoration: none; transition: border-color 0.15s;
}
.related-post-card:hover { border-color: rgba(139,233,253,0.3); }
.related-post-card h4 { font-size: 0.9rem; color: #f8f8f2; margin-bottom: 0.25rem; line-height: 1.3; }

/* Blog Sidebar */
.blog-sidebar { position: sticky; top: 2rem; }
.blog-sidebar-section {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem; padding: 1.25rem; margin-bottom: 1rem;
  overflow: hidden; box-sizing: border-box;
}
.blog-sidebar-section h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; color: #8be9fd; margin-bottom: 0.75rem; }
.blog-sidebar-list { list-style: none; }
.blog-sidebar-list li { margin-bottom: 0.4rem; }
.blog-sidebar-list a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.blog-sidebar-list a:hover { color: #8be9fd; }
.blog-sidebar-list small { color: rgba(255,255,255,0.4); }
.blog-tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.blog-search-form { display: flex; gap: 0.5rem; width: 100%; min-width: 0; }
.blog-search-input {
  flex: 1; min-width: 0; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem; padding: 0.5rem 0.75rem; color: #f8f8f2;
  font-family: inherit; font-size: 0.85rem;
  box-sizing: border-box;
}
.blog-search-input:focus { outline: none; border-color: #8be9fd; }

/* Blog button styles (reuse admin) */
.blog-layout .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.8rem;
  font-weight: 500; text-decoration: none; border: none; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.blog-layout .btn-primary { background: linear-gradient(135deg, #bd93f9, #ff79c6); color: #1a1528; }
.blog-layout .btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.7); }
.blog-layout .btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.blog-layout .btn-full { width: 100%; }
.blog-layout .text-muted { color: rgba(255,255,255,0.5); font-size: 0.85rem; }

/* Pagination */
.blog-layout .pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 2rem 0; }
.blog-layout .pagination-link { color: #8be9fd; text-decoration: none; font-size: 0.9rem; }
.blog-layout .pagination-info { color: rgba(255,255,255,0.5); font-size: 0.85rem; }

/* Flash messages */
.blog-layout .flash { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; }
.blog-layout .flash-success { background: rgba(80,250,123,0.1); border: 1px solid rgba(80,250,123,0.3); color: #50fa7b; }
.blog-layout .flash-error { background: rgba(255,85,85,0.1); border: 1px solid rgba(255,85,85,0.3); color: #ff5555; }

/* Responsive */
@media (max-width: 768px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-posts-grid { grid-template-columns: 1fr; }
  .comment-form-row { grid-template-columns: 1fr; }
  .blog-post-title { font-size: 1.75rem; }
}
