/**
 * Additional Articles Toggle System
 * Expandable articles that appear above main content
 */

/* Smooth scroll behavior for all anchor links */
html {
  scroll-behavior: smooth;
}

/* Container for additional articles */
.additional-articles {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Hidden by default */
.additional-articles.hidden {
  display: none;
}

/* Footer toggle button styling - appears ONLY in footer menu, not fixed/floating */
.articles-toggle-btn-footer {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  width: auto;
  display: inline;
  transition: color 0.2s ease;
  position: static !important; /* Not fixed or absolute */
}

.articles-toggle-btn-footer:hover {
  color: #e11229 !important;
}

.articles-toggle-btn-footer .badge-count {
  color: #a0aec0;
  font-size: 0.9em;
  margin-left: 4px;
}

.articles-toggle-btn-footer.active .btn-text::after {
  content: ' ▲';
  margin-left: 4px;
  font-size: 0.8em;
}

.articles-toggle-btn-footer:not(.active) .btn-text::after {
  content: ' ▼';
  margin-left: 4px;
  font-size: 0.8em;
}

/* Hide any other toggle buttons (only footer button should show) */
.articles-toggle-btn,
button.articles-toggle-btn {
  display: none !important;
}

/* Individual article card */
.article-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }

.article-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Article header with image */
.article-header {
  position: relative;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.article-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-header-img {
  transform: scale(1.05);
}

.article-header-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  padding: 30px;
  color: white;
}

.article-category {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: white;
}

/* Article metadata */
.article-meta {
  padding: 20px 30px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

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

.article-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

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

.article-author-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 14px;
}

.article-date {
  font-size: 12px;
  color: #a0aec0;
}

.article-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #718096;
}

.article-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Article content */
.article-content {
  padding: 30px;
  color: #4a5568;
  line-height: 1.8;
  font-size: 16px;
}

.article-content h2 {
  color: #2d3748;
  font-size: 24px;
  font-weight: 700;
  margin: 30px 0 15px 0;
  line-height: 1.3;
}

.article-content h3 {
  color: #2d3748;
  font-size: 20px;
  font-weight: 600;
  margin: 25px 0 12px 0;
}

.article-content p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.article-content strong {
  color: #2d3748;
  font-weight: 600;
}

.article-content ul, .article-content ol {
  margin: 20px 0;
  padding-left: 30px;
}

.article-content li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.article-content blockquote {
  border-left: 4px solid #667eea;
  padding-left: 20px;
  margin: 25px 0;
  font-style: italic;
  color: #4a5568;
  background: #f7fafc;
  padding: 20px;
  border-radius: 4px;
}

/* Stock ticker chips */
.stock-ticker {
  display: inline-block;
  background: #edf2f7;
  color: #2d3748;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  margin: 2px 4px;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

.stock-ticker.positive {
  background: #c6f6d5;
  color: #22543d;
}

.stock-ticker.negative {
  background: #fed7d7;
  color: #742a2a;
}

/* Stock references section */
.stock-references {
  background: #f7fafc;
  border-left: 4px solid #667eea;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
}

.stock-references p {
  margin: 0 !important;
  line-height: 2;
}

/* Read more link */
.article-read-more {
  padding: 20px 30px;
  border-top: 1px solid #e2e8f0;
}

.article-read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
}

.article-read-more-link:hover {
  color: #764ba2;
  gap: 12px;
}

.article-read-more-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Divider between articles and main content */
.articles-divider {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.articles-divider-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.articles-divider-text {
  font-size: 14px;
  font-weight: 600;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive design */
@media (max-width: 768px) {
  .article-header {
    height: 200px;
  }
  
  .article-title {
    font-size: 22px;
  }
  
  .article-content {
    padding: 20px;
    font-size: 15px;
  }
  
  .article-content h2 {
    font-size: 20px;
  }
  
  .articles-toggle-btn {
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    font-size: 14px;
  }
  
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Loading animation for images */
.article-header-img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.article-header-img[src] {
  animation: none;
  background: none;
}

/* Article excerpt for collapsed view */
.article-excerpt {
  color: #718096;
  font-size: 15px;
  line-height: 1.6;
  margin-top: 10px;
}

/* Premium badge */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f6ad55, #ed8936);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 10px;
}

