/* 
   CloudLaundry - Blog Styles 
   This file contains all styles for the blog list and detail pages.
   It uses variables from landingpage/base.html or landing.css.
*/

:root {
  --blog-primary: #2d6b41;
  --blog-primary-dark: #2d6b41;
  --blog-primary-light: #e6f4ea;
  --blog-bg: #f8fafc;
  --blog-card: #ffffff;
  --blog-border: #f1f5f9;
  --blog-text: #0f172a;
  --blog-text-light: #64748b;
  --blog-radius: 1.25rem;
  --blog-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  --blog-shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.1);
}

/* Blog Hero */
.blog-hero, .post-hero {
  padding: 8rem 5% 4rem;
  text-align: center;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  position: relative;
  overflow: hidden;
}

.blog-hero h1, .post-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
  line-height: 1.1;
  color: var(--blog-text);
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.blog-hero h1 span, .post-hero h1 span {
  color: var(--blog-primary);
}

.blog-hero p {
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--blog-text-light);
  line-height: 1.6;
}

/* Layout */
.blog-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 4rem 5%;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 4rem;
}

.blog-section-header {
  grid-column: 1 / -1;
  margin-bottom: 0rem;
}

.search-no-results {
  color: var(--blog-text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-left: 4px solid var(--blog-primary);
  border-radius: 8px;
}

@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
  }
}

/* Blog List Cards */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
}

.blog-card {
  background: var(--blog-card);
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  display: flex;
  border: 1px solid var(--blog-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 250px;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--blog-shadow-lg);
  border-color: var(--blog-primary-light);
}

.blog-card .image-container {
  width: 320px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.blog-card .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.blog-card:hover .image-container img {
  transform: scale(1.08);
}

.blog-card-content {
  padding: 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.blog-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--blog-text-light);
  margin-bottom: 0.75rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.blog-meta i {
  color: var(--blog-primary);
  font-size: 0.9rem;
}

/* Detail Page Meta */
.post-meta {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.7);
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1rem 2rem;
  background: white;
  display: inline-flex;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.post-meta i {
  color: var(--blog-primary);
  font-size: 1rem;
}

.blog-card h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.blog-card h3 a {
  text-decoration: none;
  color: var(--blog-text);
  transition: color 0.3s ease;
}

.blog-card h3 a:hover {
  color: var(--blog-primary);
}

.blog-card p {
  color: var(--blog-text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--blog-primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: gap 0.3s ease;
}

.read-more:hover {
  gap: 0.8rem;
}

@media (max-width: 768px) {
  .blog-card {
    flex-direction: column;
    min-height: auto;
  }
  .blog-card .image-container {
    width: 100%;
    height: 220px;
  }
  .blog-card-content {
    padding: 1.8rem;
  }
}

/* Post Detail */
.post-content {
  background: var(--blog-card);
  padding: 3.5rem;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow);
  border: 1px solid var(--blog-border);
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.post-content p {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--blog-text);
  margin-bottom: 1.8rem;
}

.post-content h2 {
  font-size: 2.2rem;
  margin: 3.5rem 0 1.5rem;
  color: var(--blog-primary);
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.post-content h3 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1.2rem;
  color: var(--blog-primary-dark);
}

.post-content img, .post-content iframe, .post-content video {
  max-width: 100%;
  height: auto;
  border-radius: 1.25rem;
  margin: 2.5rem 0;
  box-shadow: var(--blog-shadow);
}
.post-content pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: keep-all;
}
.post-content table {
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

.post-content blockquote {
  border-left: 5px solid var(--blog-primary);
  padding: 1.5rem 2rem;
  background: var(--blog-primary-light);
  border-radius: 0.5rem;
  margin: 3rem 0;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--blog-primary-dark);
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.sidebar-widget {
  background: var(--blog-card);
  padding: 2rem;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow);
  border: 1px solid var(--blog-border);
  margin-bottom: 0.5rem; /* fallback bottom margin */
}

.sidebar-widget h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--blog-text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-widget h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--blog-primary);
  border-radius: 2px;
}

/* Search Form */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form input {
  flex: 1;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--blog-border);
  border-radius: 50px;
  background: #f8fafc;
  outline: none;
  transition: all 0.3s ease;
}

.search-form input:focus {
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 3px rgba(56, 135, 82, 0.1);
  background: white;
}

.search-form button {
  background: var(--blog-primary);
  color: white;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-form button:hover {
  background: var(--blog-primary-dark);
  transform: scale(1.1);
}

/* Categories List */
.categories-list {
  list-style: none;
}

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

.categories-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--blog-text-light);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.categories-list a:hover {
  background: var(--blog-primary-light);
  color: var(--blog-primary-dark);
  padding-left: 1rem;
}

.categories-list span {
  background: white;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  box-shadow: var(--blog-shadow);
}

/* Recent Posts */
.recent-posts {
  list-style: none;
}

.recent-posts li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.recent-posts img {
  width: 64px;
  height: 64px;
  border-radius: 0.75rem;
  object-fit: cover;
}

.recent-posts a {
  text-decoration: none;
  color: var(--blog-text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  display: block;
  margin-bottom: 0.25rem;
}

.recent-posts a:hover {
  color: var(--blog-primary);
}

.recent-posts small {
  color: var(--blog-text-light);
  font-size: 0.8rem;
}

@media (max-width: 1024px) {
  .post-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .post-content {
    padding: 1.25rem;
  }
}

/* Breadcrumbs */
.breadcrumb-nav {
  padding: 1.5rem 5%;
  background: white;
  border-bottom: 1px solid var(--blog-border);
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--blog-text-light);
  max-width: 1300px;
  margin: 0 auto;
}

.breadcrumb-item a {
  color: var(--blog-primary);
  text-decoration: none;
}

.breadcrumb-item::after {
  content: '/';
  margin-left: 0.75rem;
}

.breadcrumb-item:last-child::after {
  content: none;
}

/* Pagination */
.pagination {
  margin-top: 4rem;
  margin-bottom: 6rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--blog-border);
  text-decoration: none;
  color: var(--blog-text);
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: var(--blog-primary);
  color: white;
  border-color: var(--blog-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pagination .current {
  background: var(--blog-primary);
  color: white;
  border-color: var(--blog-primary);
  box-shadow: 0 4px 12px rgba(45, 107, 65, 0.25);
  cursor: default;
}

.pagination .disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: var(--blog-text-light);
  border-color: #e2e8f0;
}

/* Author Box */
.author-box {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem;
  background: var(--blog-primary-light);
  border-radius: var(--blog-radius);
  margin: 4rem 0;
  border: 1px solid var(--blog-border);
}

.author-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--blog-shadow);
}

.author-box h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--blog-text);
}

.author-box p {
  font-size: 0.95rem;
  color: var(--blog-text-light);
  margin: 0;
  line-height: 1.6;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 3rem 0 4rem;
}

.share-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  color: var(--blog-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: var(--blog-shadow);
  text-decoration: none;
  border: 1px solid var(--blog-border);
}

.share-btn:hover {
  background: var(--blog-primary);
  color: white;
  transform: translateY(-5px);
  border-color: var(--blog-primary);
}

/* Related Posts (Detail Page) */
.related-posts {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--blog-border);
}

.related-posts h3 {
  text-align: center;
  margin-bottom: 2.5rem;
}

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

.related-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  border: 1px solid var(--blog-border);
  transition: all 0.3s ease;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--blog-shadow-lg);
}

.related-right {
  padding: 1.5rem;
}

.related-right h4 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.related-right h4 a {
  text-decoration: none;
  color: var(--blog-text);
  transition: color 0.3s ease;
}

.related-card:hover h4 a {
  color: var(--blog-primary);
}

.related-post-meta {
  font-size: 0.8rem;
  color: var(--blog-text-light);
}

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.post-tags .tag {
  padding: 0.4rem 1rem;
  background: var(--blog-primary-light);
  color: var(--blog-primary-dark);
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.post-tags .tag:hover {
  background: var(--blog-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--blog-shadow);
}

@media (max-width: 768px) {
  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 2rem;
  }
}
