/* ===== AGENTYX Blog Styles ===== */

/* --- Blog Hero --- */
.blog-hero {
  background: var(--graphite);
  color: #fff;
  padding: clamp(100px, 12vw, 160px) 0 clamp(48px, 6vw, 80px);
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(183,137,60,0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: hero-drift 20s linear infinite;
  pointer-events: none;
}
.blog-hero-content { position: relative; z-index: 1; max-width: 640px; }
.blog-hero-label {
  color: var(--brass);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.blog-hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: #d1d5db;
  line-height: 1.6;
}

/* --- Category Filters --- */
.blog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.blog-filter {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--light);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.blog-filter:hover {
  border-color: var(--brass);
  color: var(--brass);
}
.blog-filter.active {
  background: linear-gradient(135deg, var(--brass-dark), var(--brass), var(--brass-light));
  background-size: 200% 200%;
  animation: shimmer 4s ease infinite;
  border-color: transparent;
  color: #fff;
}

/* --- Blog Grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}
.blog-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* --- Article Card --- */
.blog-card {
  background: #fff;
  border: 1px solid var(--light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.08);
}
.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--lighter);
}
.blog-card-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--graphite), var(--graphite-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--brass);
  opacity: 0.5;
}
.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brass);
  margin-bottom: 10px;
}
.blog-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.blog-card-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--lighter);
  font-size: 13px;
  color: var(--text-muted);
}
.blog-card-author {
  font-weight: 600;
  color: var(--text);
}
.blog-card-dot {
  margin: 0 6px;
  opacity: 0.4;
}

/* --- Loading & Empty States --- */
.blog-loading,
.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  color: var(--text-muted);
}
.blog-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--light);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.blog-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 16px;
}
.blog-load-more {
  text-align: center;
  margin-top: 48px;
}
.blog-load-btn {
  min-width: 180px;
}

/* --- Reading Progress Bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brass-dark), var(--brass), var(--brass-light));
  z-index: 200;
  transition: width 0.1s linear;
}

/* --- Article Page --- */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brass);
  margin-bottom: 24px;
  transition: gap 0.2s;
}
.article-back:hover { gap: 10px; }

.article-header {
  padding: clamp(100px, 12vw, 140px) 0 clamp(32px, 4vw, 48px);
}
.article-header .container {
  max-width: 800px;
}
.article-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--brass);
  padding: 4px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.article-title {
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.article-meta-dot {
  opacity: 0.4;
}

/* --- Article Cover Image --- */
.article-cover-wrap {
  margin-bottom: 48px;
}
.article-cover-wrap .container {
  max-width: 960px;
}
.article-cover {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* --- Article Body (Prose) --- */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}
.article-body h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  margin: 36px 0 12px;
}
.article-body p {
  margin-bottom: 20px;
}
.article-body a {
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover {
  color: var(--brass-dark);
}
.article-body strong {
  font-weight: 700;
}
.article-body ul, .article-body ol {
  margin: 16px 0 20px 24px;
}
.article-body li {
  margin-bottom: 8px;
  padding-left: 8px;
}
.article-body ul li::marker {
  color: var(--brass);
}
.article-body ol li::marker {
  color: var(--brass);
  font-weight: 700;
}
.article-body blockquote {
  border-left: 4px solid var(--brass);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--lighter);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}
.article-body blockquote p { margin-bottom: 0; }
.article-body pre {
  background: var(--graphite);
  color: #e5e7eb;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}
.article-body code {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}
.article-body p code {
  background: var(--lighter);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
}
.article-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 24px 0;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--light);
  margin: 40px 0;
}

/* --- Article Tags --- */
.article-tags {
  max-width: 720px;
  margin: 40px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.article-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid var(--light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}
.article-tag:hover {
  border-color: var(--brass);
  color: var(--brass);
}

/* --- Share Buttons --- */
.article-share {
  max-width: 720px;
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--light);
}
.article-share-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 16px;
}
.article-share-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.article-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.article-share-btn:hover {
  border-color: var(--brass);
  color: var(--brass);
}
.article-share-btn.copied {
  border-color: #16a34a;
  color: #16a34a;
}

/* --- Related Articles --- */
.article-related {
  margin-top: 64px;
  background: var(--lighter);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid-sm {
    grid-template-columns: 1fr;
  }
  .article-header {
    padding-top: 100px;
  }
  .blog-hero {
    padding-top: 100px;
  }
  .article-share-buttons {
    flex-direction: column;
  }
  .article-share-btn {
    justify-content: center;
  }
}

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