/**
 * Blog 2026 — Page-Specific Styles
 * Loaded only on: /blog and /en/blog
 */

/* === HERO === */
.hero {
  padding: 8rem 0 4rem;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.125rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.hero .disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

/* === FEATURED POST === */
.featured {
  padding: 4rem 0;
  background: var(--bg-subtle);
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.featured-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.featured-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, #E5E7EB 0%, #F3F4F6 100%);
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.featured-content {
  padding: 2rem 2rem 2rem 0;
}

.featured-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.featured-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.featured-content p {
  color: var(--secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* === BLOG GRID === */
.blog-section {
  padding: 4rem 0 6rem;
  background: var(--bg-white);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.blog-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, #E5E7EB 0%, #F3F4F6 100%);
}

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

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

.blog-card-category {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.substack-badge {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.substack-badge svg {
  width: 16px;
  height: 16px;
  color: #666;
  transition: color 0.3s ease;
}

.blog-card:hover .substack-badge svg {
  color: #FF6719;
}

.blog-card-content {
  padding: 1.25rem 1.5rem;
}

.blog-card-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.blog-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card p {
  font-size: 0.9rem;
  color: var(--secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary);
  transition: all 0.3s ease;
}

.blog-card:hover .blog-card-cta {
  color: var(--primary);
  transform: translateX(3px);
}

/* === LOADING & EMPTY STATES === */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
}

.loading-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.loading-bubble {
  width: 12px;
  height: 12px;
  background: var(--purple);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-bubble:nth-child(1) { animation-delay: -0.32s; }
.loading-bubble:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* === LOAD MORE BUTTON === */
.load-more-container {
  text-align: center;
  margin-top: 3rem;
  grid-column: 1 / -1;
}

.btn-load-more {
  background: white;
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 0.875rem 2rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-load-more:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
}

.btn-load-more.hidden {
  display: none;
}

/* === REFERENCES SECTION === */
.references-section {
  padding: 5rem 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
}

.references-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.references-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.references-header p {
  color: var(--secondary);
}

.references-categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.reference-category {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.reference-category:hover {
  border-color: #d1d1d1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.category-header:hover {
  background: #f5f5f5;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.category-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-count {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

.category-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  background: none;
  border: none;
  cursor: pointer;
}

.reference-category.collapsed .category-toggle {
  transform: rotate(-180deg);
}

.category-content {
  padding: 1.5rem;
}

.reference-category.collapsed .category-content {
  display: none;
}

.references-inner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.reference-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.reference-card:hover {
  border-color: var(--purple);
  box-shadow: 0 4px 12px rgba(147, 172, 240, 0.15);
}

.reference-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reference-content {
  flex: 1;
}

.reference-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.reference-title a {
  color: inherit;
  text-decoration: none;
}

.reference-title a:hover {
  color: var(--purple);
}

.reference-author {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.reference-summary {
  font-size: 0.875rem;
  color: var(--secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reference-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.hashtag {
  font-size: 0.75rem;
  color: var(--purple);
  background: rgba(147, 172, 240, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.reference-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.reference-link-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}

.reference-link-indicator:hover {
  color: var(--purple);
  transform: translateX(3px);
}

.references-loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 7rem 0 3rem;
  }

  /* Featured post: stack vertically */
  .featured {
    padding: 3rem 0;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-image {
    order: -1;
  }

  .featured-content {
    padding: 1.5rem;
  }

  .featured-content h2 {
    font-size: 1.35rem;
  }

  .featured-content p {
    font-size: 0.9rem;
  }

  /* Blog section: tighter padding */
  .blog-section {
    padding: 3rem 0 4rem;
  }

  .section-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  /* Blog cards → horizontal scroll carousel */
  .blog-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
  }

  .blog-grid::-webkit-scrollbar {
    display: none;
  }

  .blog-card {
    flex: 0 0 80%;
    scroll-snap-align: start;
  }

  .blog-card-content {
    padding: 1rem 1.25rem;
  }

  .blog-card h3 {
    font-size: 1rem;
  }

  .blog-card p {
    font-size: 0.85rem;
  }

  /* References: compact */
  .references-section {
    padding: 3.5rem 0;
  }

  .references-header {
    margin-bottom: 2rem;
  }

  .references-header h2 {
    font-size: 1.4rem;
  }

  .category-content {
    padding: 1rem;
  }

  .references-inner-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .reference-card {
    padding: 1rem;
  }

  .reference-title {
    font-size: 0.95rem;
  }

  .reference-summary {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .category-header {
    padding: 1rem 1.25rem;
  }

  .category-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .blog-card {
    flex: 0 0 85%;
  }

  .featured-content h2 {
    font-size: 1.2rem;
  }

  .blog-card-content {
    padding: 0.875rem 1rem;
  }

  .blog-card h3 {
    font-size: 0.95rem;
  }

  .reference-card {
    padding: 0.875rem;
  }

  .references-header h2 {
    font-size: 1.25rem;
  }
}
