/**
 * Gorgeous News Archive Styles
 * Webeloper-inspired with DDFV branding
 */

/* ==========================================
   FILTER CHIPS SECTION
========================================== */
.filter-chips-container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 159, 227, 0.1);
  padding: 16px 0;
  margin-bottom: 40px;
}

.filter-chips-container .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Style the filter chips */
.fe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.fe-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #009fe3, #0069b4);
  color: white;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.fe-chip:hover {
  background: linear-gradient(135deg, #0069b4, #26348b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 159, 227, 0.3);
}

.fe-chip .remove-filter {
  margin-left: 4px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.8;
}

.fe-chip .remove-filter:hover {
  opacity: 1;
}

/* ==========================================
   MAIN ARCHIVE LAYOUT
========================================== */
.archive-main {
  padding: 0 0 60px 0;
}

.archive-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  /* Ensure proper stacking context for sticky */
  position: relative;
  z-index: 1;
}

/* ==========================================
   STICKY SIDEBAR
========================================== */
.archive-sidebar {
  position: relative;
  align-self: flex-start; /* Important for sticky to work in grid */
}

.sidebar-sticky {
  position: -webkit-sticky !important; /* Safari support */
  position: sticky !important;
  top: 20px !important; /* Stick closer to top for better UX */
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 32px 24px;
  border: 1px solid rgba(0, 159, 227, 0.1);
  max-height: calc(100vh - 40px); /* Prevent sidebar from being too tall */
  overflow-y: auto; /* Allow scrolling if content is too long */
  z-index: 10; /* Ensure it stays above other content */
  transition: box-shadow 0.3s ease; /* Smooth shadow transition */
  will-change: transform; /* Optimize for animations */
}

/* Enhanced shadow when scrolling */
.sidebar-sticky.is-stuck {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.filter-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #009fe3;
}

.filter-widget {
  margin-bottom: 32px;
}

.archive-stats {
  border-top: 1px solid rgba(0, 159, 227, 0.1);
  padding-top: 24px;
}

.stats-item {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 12px;
  border: 1px solid rgba(0, 159, 227, 0.1);
}

.stats-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #009fe3;
  line-height: 1;
}

.stats-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ==========================================
   FEATURED ARTICLE SECTION
========================================== */
.featured-article {
  margin-bottom: 60px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 159, 227, 0.1);
  transition: all 0.4s ease;
  position: relative;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.featured-image {
  position: relative;
  overflow: hidden;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  aspect-ratio: 3/2;
}

.featured-card:hover .featured-img {
  transform: scale(1.05);
}

.featured-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.featured-date {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.featured-category {
  background: linear-gradient(135deg, #009fe3, #0069b4);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.featured-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px 0;
}

.featured-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.featured-title a:hover {
  color: #009fe3;
}

.featured-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 32px;
  flex-grow: 1;
}

.featured-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #009fe3, #0069b4);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.read-more-btn:hover {
  background: linear-gradient(135deg, #0069b4, #26348b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 159, 227, 0.3);
}

.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  background: rgba(0, 159, 227, 0.1);
  color: #009fe3;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(0, 159, 227, 0.2);
}

/* ==========================================
   ARTICLES GRID
========================================== */
.articles-grid {
  margin-top: 40px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 60px;
}

.article-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 159, 227, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .card-img {
  transform: scale(1.05);
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  margin-bottom: 12px;
}

.card-date {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.card-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.card-title a:hover {
  color: #009fe3;
}

.card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: auto;
}

.card-read-more {
  color: #009fe3;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.card-read-more:hover {
  color: #0069b4;
  transform: translateX(4px);
}

.card-tags {
  display: flex;
  gap: 6px;
}

.card-tag {
  background: rgba(0, 159, 227, 0.1);
  color: #009fe3;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================
   LOAD MORE BUTTON
========================================== */
.load-more-container {
  text-align: center;
  margin-top: 60px;
}

.load-more-btn {
  background: linear-gradient(135deg, #009fe3, #0069b4);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.load-more-btn:hover {
  background: linear-gradient(135deg, #0069b4, #26348b);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 159, 227, 0.3);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  display: none;
}

.load-more-btn.loading .btn-text {
  display: none;
}

.load-more-btn.loading .btn-loader {
  display: inline;
}

/* ==========================================
   NO POSTS STATE
========================================== */
.no-posts {
  text-align: center;
  padding: 80px 40px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-posts-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-posts h3 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.no-posts p {
  color: #64748b;
  font-size: 16px;
  margin: 0;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */
@media (max-width: 1024px) {
  .archive-layout {
    grid-template-columns: 240px 1fr;
    gap: 32px;
  }
  
  .sidebar-sticky {
    padding: 24px 20px;
  }
  
  .featured-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .archive-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .archive-sidebar {
    order: 2;
  }
  
  .archive-content {
    order: 1;
  }
  
  .sidebar-sticky {
    position: static;
    top: auto;
  }
  
  .featured-card {
    grid-template-columns: 1fr;
  }
  
  .featured-content {
    padding: 24px;
  }
  
  .featured-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .grid-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .filter-chips-container {
    padding: 12px 0;
  }
  
  .filter-chips-container .container {
    padding: 0 16px;
  }
  
  .fe-chips {
    gap: 8px;
  }
  
  .fe-chip {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .archive-main {
    padding: 0 0 40px 0;
  }
  
  .featured-article {
    margin-bottom: 40px;
  }
  
  .featured-content {
    padding: 20px;
  }
  
  .card-content {
    padding: 20px;
  }
  
  .load-more-container {
    margin-top: 40px;
  }
}

/* ==========================================
   LOADING ANIMATIONS
========================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card {
  animation: fadeInUp 0.6s ease forwards;
}

.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; }

/* ==========================================
   FILTER WIDGET STYLING
========================================== */
.filter-widget .fe-widget {
  border: none;
  box-shadow: none;
  background: transparent;
}

.filter-widget .fe-widget-title {
  display: none;
}

.filter-widget .fe-filter-group {
  margin-bottom: 24px;
}

.filter-widget .fe-filter-group h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-widget .fe-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 159, 227, 0.1);
}

.filter-widget .fe-filter-item:last-child {
  border-bottom: none;
}

.filter-widget .fe-filter-item input[type="checkbox"] {
  accent-color: #009fe3;
}

.filter-widget .fe-filter-item label {
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  flex-grow: 1;
}

.filter-widget .fe-filter-item:hover label {
  color: #009fe3;
}
