/* =========================================================
   ZHEX Blog Archive Layout — Custom Dark Theme
   ========================================================= */

/* ---------- Base ---------- */
.blogzhex-archive {
  background: #212121;
  color: #eaeaea;
  min-height: 100vh;
}

.blogzhex-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.blogzhex-row {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.blogzhex-main {
  flex: 1;
  padding-right: 20px;
}

.blogzhex-sidebar {
  flex: 0 0 300px;
  padding-left: 20px;
}

/* ---------- Premium Hero Section ---------- */
.premium-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
  padding: 40px 20px 45px;
  text-align: center;
  border-bottom: 1px solid #2a2a2a;
  position: relative;
  overflow: hidden;
}

.premium-hero .blogzhex-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(63,70,198,0.15), transparent 70%);
  pointer-events: none;
}

.premium-hero .container {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.blogzhex-title {
  font-size: clamp(32px, 3.5vw, 44px);
  margin-bottom: 16px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.blogzhex-breadcrumb {
  margin-bottom: 18px;
  font-size: 0.9rem;
  opacity: .9;
}

.blogzhex-breadcrumb a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color .2s ease;
}

.blogzhex-breadcrumb a:hover {
  color: #3f46c6;
}

.blogzhex-intro {
  font-size: 1.15rem;
  color: #d0d0d0;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
  animation: fadeInUp .5s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Posts Grid ---------- */
.blogzhex-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.blogzhex-post-card {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blogzhex-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.blogzhex-card-image {
  position: relative;
  overflow: hidden;
}

.blogzhex-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.blogzhex-post-card:hover .blogzhex-card-thumb {
  transform: scale(1.05);
}

.blogzhex-card-content {
  padding: 20px;
}

.blogzhex-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
}

.blogzhex-card-title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blogzhex-card-title a:hover {
  color: #3f46c6;
}

.blogzhex-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #eaeaea;
  margin-bottom: 16px;
}

.blogzhex-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.blogzhex-card-date {
  color: #a8a8a8;
}

.blogzhex-card-category a {
  color: #3f46c6;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.blogzhex-card-category a:hover {
  color: #4a52d1;
}

.blogzhex-card-actions {
  margin-top: 16px;
}

/* ---------- Sidebar ---------- */
.blogzhex-sidebar-sticky {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.blogzhex-sidebar-sticky::-webkit-scrollbar {
  display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* ---------- Unified Sidebar Group ---------- */
.blogzhex-sidebar-group {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blogzhex-sidebar-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

/* Unified sidebar box styling */
.blogzhex-sidebar-group .blogzhex-sidebar-box {
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  transition: none;
  padding: 0;
}

/* Add divider only between boxes */
.blogzhex-sidebar-group .blogzhex-sidebar-box + .blogzhex-sidebar-box {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 16px;
}

/* Individual box hover removed - now handled by group */

.blogzhex-box-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  padding: 12px 16px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 44px; /* Ensure consistent height for better alignment */
}

.blogzhex-box-title:hover {
  background-color: rgba(255,255,255,0.05);
}

.blogzhex-box-title-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  flex-shrink: 0;
}

.blogzhex-box-title-text {
  flex: 1;
}

.blogzhex-box-title-arrow {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.blogzhex-box-title-arrow.expanded {
  transform: rotate(90deg);
}

.blogzhex-sidebar-box-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  max-height: 1000px;
  opacity: 1;
  padding: 0 16px 16px;
}

.blogzhex-sidebar-box-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 16px 0; /* Remove bottom padding when collapsed */
}

/* ---------- Categories List ---------- */
.blogzhex-categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blogzhex-categories-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}

.blogzhex-list-bullet {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 1px; /* Slight adjustment for visual alignment */
}

.blogzhex-link {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  color: #eaeaea;
  transition: all 0.2s ease;
  line-height: 1.4;
  position: relative;
}

.blogzhex-link:hover {
  color: #fff;
  transform: translateX(4px);
}

.blogzhex-link:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3f46c6;
  border-radius: 0 2px 2px 0;
}

.blogzhex-category-count {
  font-size: 0.8rem;
  color: #a8a8a8;
  margin-left: auto;
  flex-shrink: 0;
}

/* ---------- Quick Links ---------- */
.blogzhex-quick-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blogzhex-quick-links li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}

/* Ensure Quick Links use the same styling as Categories */
.blogzhex-quick-links .blogzhex-link {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  color: #eaeaea;
  transition: all 0.2s ease;
  line-height: 1.4;
  position: relative;
}

.blogzhex-quick-links .blogzhex-link:hover {
  color: #fff;
  transform: translateX(4px);
}

.blogzhex-quick-links .blogzhex-link:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3f46c6;
  border-radius: 0 2px 2px 0;
}

.blogzhex-categories-list .blogzhex-link {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  color: #eaeaea;
  transition: all 0.2s ease;
  line-height: 1.4;
  position: relative;
}

.blogzhex-categories-list .blogzhex-link:hover {
  color: #fff;
  transform: translateX(4px);
}

.blogzhex-categories-list .blogzhex-link:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #3f46c6;
  border-radius: 0 2px 2px 0;
}

/* ---------- Newsletter Form ---------- */
.blogzhex-newsletter-form {
  margin-top: 16px;
}

.blogzhex-form-group {
  margin-bottom: 12px;
}

.blogzhex-newsletter-input {
  width: 100%;
  padding: 10px 12px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #eaeaea;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.blogzhex-newsletter-input:focus {
  outline: none;
  border-color: #3f46c6;
}

.blogzhex-newsletter-input::placeholder {
  color: #a8a8a8;
}

.blogzhex-newsletter-btn {
  width: 100%;
  justify-content: center;
}

.blogzhex-newsletter-message {
  margin-top: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.blogzhex-newsletter-message.success {
  color: #4ade80;
}

.blogzhex-newsletter-message.error {
  color: #f87171;
}

/* ---------- Buttons ---------- */
.blogzhex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: #3f46c6;
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(160, 148, 255, 0.35);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  border-radius: 6px;
  font-size: 0.9rem;
}

.blogzhex-btn:hover {
  background: #4a52d1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

/* ---------- Pagination ---------- */
.blogzhex-pagination {
  margin-top: 40px;
  text-align: center;
}

.blogzhex-pagination-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 35px;
}

.blogzhex-pagination-nav a,
.blogzhex-pagination-nav span {
  padding: 8px 12px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #eaeaea;
  text-decoration: none;
  transition: all 0.2s ease;
}

.blogzhex-pagination-nav a:hover {
  background: #3f46c6;
  color: #fff;
}

.blogzhex-pagination-nav .current {
  background: #3f46c6;
  color: #fff;
}

/* ---------- No Posts ---------- */
.blogzhex-no-posts {
  text-align: center;
  padding: 60px 20px;
  background: #141414;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
}

.blogzhex-no-posts h2 {
  color: #fff;
  margin-bottom: 12px;
}

.blogzhex-no-posts p {
  color: #a8a8a8;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .blogzhex-container {
    padding: 0 15px;
  }
  
  .blogzhex-row {
    flex-direction: column;
    gap: 0;
  }
  
  .blogzhex-main {
    padding-right: 0;
  }
  
  .blogzhex-sidebar {
    flex: none;
    padding-left: 0;
    margin-top: 30px;
  }
  
  .blogzhex-sidebar-sticky {
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
  }
  
  .blogzhex-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .blogzhex-hero-title {
    font-size: 28px;
  }
  
  .blogzhex-card-content {
    padding: 16px;
  }
  
  .blogzhex-sidebar-group {
    padding: 12px 16px;
  }
}
