/**
 * Blog Styles
 * Public blog listing and article pages
 */

/* ===========================================
   Page Title Section
   =========================================== */
.page-title-section {
  padding: 140px 0 80px;
  text-align: center;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  position: relative;
  overflow: hidden;
}

.page-title-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-title-content {
  position: relative;
  z-index: 1;
}

.page-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-500);
  margin-bottom: 16px;
}

.page-title-section h1 {
  font-family: var(--heading-font);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================================
   Blog Listing Section
   =========================================== */
.blog-listing {
  padding: 60px 0 80px;
  background: var(--white);
}

/* Filters */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

.filter-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-600);
  background: var(--stone-100);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:hover {
  background: var(--green-100);
  color: var(--green-800);
}

.filter-btn.active {
  background: var(--green-800);
  color: var(--white);
}

/* Loading State */
.blog-loading {
  text-align: center;
  padding: 60px 20px;
}

.blog-loading .loading-spinner {
  font-size: 32px;
  color: var(--green-800);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.blog-loading p {
  color: var(--stone-500);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Empty State */
.blog-empty {
  text-align: center;
  padding: 80px 20px;
}

.blog-empty i {
  font-size: 64px;
  color: var(--stone-300);
  margin-bottom: 24px;
}

.blog-empty h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--stone-700);
  margin-bottom: 12px;
}

.blog-empty p {
  color: var(--stone-500);
}

/* ===========================================
   Article Cards
   =========================================== */
.blog-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-card-image {
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: var(--stone-100);
}

.blog-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.blog-card-image .placeholder-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: var(--stone-300);
}

.blog-card-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blog-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-800);
  background: var(--green-100);
  padding: 4px 10px;
  border-radius: 4px;
}

.blog-card-title {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--stone-900);
  margin-bottom: 12px;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card-title a:hover {
  color: var(--green-800);
}

.blog-card-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--stone-600);
  margin-bottom: 20px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--stone-100);
}

.blog-card-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--stone-200);
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-800);
}

.blog-card-date {
  font-size: 13px;
  color: var(--stone-500);
}

.blog-card-reading-time {
  margin-left: auto;
  font-size: 13px;
  color: var(--stone-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===========================================
   Pagination
   =========================================== */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-600);
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--stone-100);
  border-color: var(--stone-300);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--green-800);
  border-color: var(--green-800);
  color: var(--white);
}

/* ===========================================
   CTA Section
   =========================================== */
.blog-cta {
  padding: 80px 0;
  text-align: center;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
}

.blog-cta h2 {
  font-family: var(--heading-font);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.blog-cta p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ===========================================
   Article Detail Page
   =========================================== */
.article-header {
  padding: 140px 0 40px;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
}

.article-header .breadcrumbs {
  font-size: 14px;
  margin-bottom: 24px;
}

.article-header .breadcrumbs a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-header .breadcrumbs a:hover {
  color: var(--white);
}

.article-header .breadcrumbs span {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 8px;
}

.article-header .breadcrumbs .current {
  color: var(--white);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.article-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-500);
  background: rgba(116, 198, 157, 0.15);
  padding: 6px 12px;
  border-radius: 4px;
}

.article-header h1 {
  font-family: var(--heading-font);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 24px;
  max-width: 800px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.article-meta .author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-meta .author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.article-meta .author-details {
  display: flex;
  flex-direction: column;
}

.article-meta .author-name {
  font-weight: 500;
  color: var(--white);
}

.article-meta .article-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.article-meta .reading-time {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Featured Image */
.article-featured-image {
  margin-top: -40px;
  padding: 0 0 40px;
  position: relative;
  z-index: 1;
}

.article-featured-image img {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Article Content */
.article-content {
  padding: 40px 0 80px;
}

.article-content .prose {
  max-width: 720px;
}

/* Prose Styles */
.prose {
  font-size: 17px;
  line-height: 1.8;
  color: var(--stone-700);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--heading-font);
  color: var(--stone-900);
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.prose h1:first-child,
.prose h2:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 28px;
  font-weight: 600;
}

.prose h3 {
  font-size: 22px;
  font-weight: 600;
}

.prose h4 {
  font-size: 18px;
  font-weight: 600;
}

.prose p {
  margin-bottom: 1.5em;
}

.prose a {
  color: var(--green-800);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--green-900);
}

.prose strong {
  font-weight: 600;
  color: var(--stone-800);
}

.prose ul,
.prose ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 4px solid var(--green-800);
  padding: 16px 24px;
  margin: 2em 0;
  background: var(--green-50);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--stone-700);
}

.prose code {
  font-family: "Roboto Mono", monospace;
  font-size: 0.9em;
  background: var(--stone-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--stone-800);
}

.prose pre {
  background: var(--stone-900);
  color: var(--green-500);
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 14px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
}

.prose th,
.prose td {
  padding: 12px 16px;
  border: 1px solid var(--stone-200);
  text-align: left;
}

.prose th {
  background: var(--stone-100);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--stone-200);
  margin: 3em 0;
}

/* Author Bio */
.author-bio-box {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--stone-50);
  border-radius: 12px;
  margin-top: 48px;
}

.author-bio-box .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-bio-box .author-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--stone-900);
  margin-bottom: 4px;
}

.author-bio-box .author-content p {
  font-size: 15px;
  color: var(--stone-600);
  line-height: 1.6;
  margin: 0;
}

/* Related Articles */
.related-articles {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--stone-200);
}

.related-articles h3 {
  font-family: var(--heading-font);
  font-size: 24px;
  font-weight: 600;
  color: var(--stone-900);
  margin-bottom: 24px;
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
}

/* Table of Contents */
.toc-widget {
  background: var(--stone-50);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.toc-widget h4 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-600);
  margin-bottom: 16px;
}

.toc-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-widget li {
  margin-bottom: 8px;
}

.toc-widget a {
  font-size: 14px;
  color: var(--stone-600);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  padding: 4px 0;
}

.toc-widget a:hover,
.toc-widget a.active {
  color: var(--green-800);
}

.toc-widget .toc-h3 {
  padding-left: 16px;
}

/* CTA Widget */
.cta-widget {
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-900) 100%);
  border-radius: 12px;
  padding: 24px;
  color: var(--white);
}

.cta-widget h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.cta-widget p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.cta-widget .btn-get-started {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-900);
  background: var(--white);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.cta-widget .btn-get-started:hover {
  background: var(--green-100);
  transform: translateY(-2px);
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 991px) {
  .article-sidebar {
    position: static;
    margin-top: 48px;
  }
}

@media (max-width: 768px) {
  .page-title-section {
    padding: 120px 0 60px;
  }

  .blog-filters {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 32px;
    flex-wrap: nowrap;
  }

  .filter-btn {
    white-space: nowrap;
  }

  .blog-card-content {
    padding: 20px;
  }

  .blog-card-meta {
    flex-wrap: wrap;
  }

  .blog-card-reading-time {
    margin-left: 0;
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--stone-100);
  }

  .article-header {
    padding: 120px 0 30px;
  }

  .article-meta {
    gap: 16px;
  }

  .author-bio-box {
    flex-direction: column;
    text-align: center;
  }

  .author-bio-box .avatar {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .blog-card-title {
    font-size: 18px;
  }

  .blog-pagination {
    gap: 4px;
  }

  .pagination-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}
