/* =========================================================
   ZHEX Single Post Layout — Prod Ready CSS v2.1
   Updated: Copy anchor fixes + Featured grid layout + List indentation
   ========================================================= */

/* ---------- Base ---------- */
:root {
  --zhex-bg: #111111;
  --zhex-box: #141414;
  --zhex-text: #eaeaea;
  --zhex-muted: #a8a8a8;
  --zhex-accent: #3f46c6;
  --zhex-accent-hover: #4a52d1;
  --zhex-border: #2a2a2a;
  --zhex-radius: 12px;
  --zhex-gap: 16px;
  --zhex-header-h: 90px;
}

#blogzhex-single,
body.single-post,
.single-post .page-wrapper {
  background: var(--zhex-bg) !important;
  color: var(--zhex-text);
  min-height: 100vh;
}

#blogzhex-single .container {
  max-width: 1240px;
  padding: 0 var(--zhex-gap);
}

#blogzhex-single .large-9 { padding-right: var(--zhex-gap) !important; }
#blogzhex-single .large-3 { padding-left: var(--zhex-gap) !important; }

/* Hide Flatsome default title bar */
.page-title,
.page-title-bg,
.page-title-inner,
.title-bg,
.title-overlay {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ---------- Hero ---------- */
.blogzhex-hero {
  margin: 16px 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--zhex-radius);
  border: 1px solid var(--zhex-border);
  background: #111;
}
.blogzhex-hero__img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #111;
}

/* ---------- Headings & Breadcrumb ---------- */
.blogzhex-head { margin: 18px 0 10px; text-align: left; }
.blogzhex-title {
  font-size: clamp(26px, 3.2vw, 40px);
  margin: 0;
  color: #fff;
  font-weight: 800;
  text-align: left;
}
.blogzhex-breadcrumb {
  margin: 12px 0 16px;
  opacity: .95;
  text-align: left;
}
.blogzhex-breadcrumb a {
  color: var(--zhex-muted);
  text-decoration: none;
  transition: color .2s ease;
}
.blogzhex-breadcrumb a:hover { color: var(--zhex-accent); }

/* ---------- Post Meta (Author and Date) ---------- */
.blogzhex-post-meta {
  margin: 16px 0 20px;
  text-align: left;
  font-size: 0.9rem;
  color: #999;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blogzhex-post-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blogzhex-post-author a {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blogzhex-post-author a:hover {
  color: var(--zhex-accent);
}

.blogzhex-author-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: #696ed2;
}

.blogzhex-post-separator {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.blogzhex-post-date {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

/* ---------- Social Share Buttons ---------- */
.blogzhex-social-share {
  margin: 16px 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 100%;
}

.blogzhex-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: all 0.2s ease;
  height: 44px; /* Fixed height for consistency */
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  line-height: normal; /* Prevent line-height issues */
}

.blogzhex-social-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.blogzhex-social-btn:active {
  transform: scale(0.98);
}

/* Social Platform Colors - Default State */
.blogzhex-social-btn--twitter {
  background: #000000;
  color: #fff;
}

.blogzhex-social-btn--facebook {
  background: #1877F2;
  color: #fff;
}

.blogzhex-social-btn--reddit {
  background: #FF4500;
  color: #fff;
}

/* Hover State - Keep white text/icons for consistency */
.blogzhex-social-btn--twitter:hover {
  background: #ffffff;
  color: #000000;
}

.blogzhex-social-btn--facebook:hover {
  background: #ffffff;
  color: #1877F2;
}

.blogzhex-social-btn--reddit:hover {
  background: #ffffff;
  color: #FF4500;
}

.blogzhex-social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

/* Fix X button icon alignment */
.blogzhex-social-btn--twitter .blogzhex-social-icon {
  transform: translateY(1px); /* Slight adjustment for visual centering */
}

.blogzhex-social-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Responsive: Stack vertically on mobile */
@media (max-width: 600px) {
  .blogzhex-social-share {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .blogzhex-social-btn {
    height: 44px; /* Same fixed height on mobile */
    font-size: 15px;
    gap: 8px; /* Ensure consistent gap on mobile */
    padding: 8px 12px; /* Same padding on mobile */
  }
  
  .blogzhex-social-icon {
    width: 20px;
    height: 20px; /* Keep same size on mobile for consistency */
  }
  
  .blogzhex-social-text {
    font-size: 15px;
    line-height: normal; /* Consistent line-height */
  }
  
  /* Post Meta - Mobile */
  .blogzhex-post-meta {
    margin: 12px 0 16px;
    font-size: 0.85rem;
    line-height: 1.5;
    gap: 6px;
  }
  
  .blogzhex-post-author {
    gap: 4px;
  }
  
  .blogzhex-author-icon {
    width: 16px;
    height: 16px;
  }
}

/* ---------- Content ---------- */
.blogzhex-article { line-height: 1.75; font-size: 1.05rem; }
.blogzhex-content { margin: 20px 0; }
.blogzhex-content p { margin: 0 0 14px; }

/* Auto-indent for all list items */
.blogzhex-single li {
  padding-left: 20px !important;
  margin-left: 0 !important;
}

.blogzhex-content img,
.blogzhex-content figure img {
  display: block;
  margin: 20px auto;
  padding: 0 !important;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.blogzhex-content h2 {
  margin: 24px 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.blogzhex-content h3 {
  margin: 20px 0 12px;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--zhex-text);
}

/* ---------- Sidebar ---------- */
.blogzhex-sidebar { padding-left: var(--zhex-gap); }
.blogzhex-sidebar.sticky {
  position: sticky;
  top: calc(var(--zhex-header-h) + 20px);
  max-height: calc(100vh - var(--zhex-header-h) - 40px);
  overflow-y: auto;
  z-index: 5;
  /* 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: var(--zhex-box);
  border: 1px solid var(--zhex-border);
  border-radius: var(--zhex-radius);
  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-box {
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}


/* Add divider only between boxes */
.blogzhex-sidebar-group .blogzhex-box + .blogzhex-box {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 16px;
}
.blogzhex-box__title {
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .4px;
  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-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-box__content.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 16px 0; /* Remove bottom padding when collapsed */
}

/* ---------- TOC ---------- */
.blogzhex-toc__list,
.blogzhex-list { list-style: none; margin: 0; padding: 0; }

.blogzhex-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--zhex-text);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.blogzhex-link:hover {
  background: rgba(63,70,198,.1);
  color: var(--zhex-accent);
  transform: translateX(4px);
}
.blogzhex-toc__list a.is-active {
  background: var(--zhex-accent);
  color: #fff !important;
  font-weight: 700;
  border-left: 3px solid #fff;
  padding: 8px 12px !important;
  border-radius: 6px;
  line-height: 1.5;
}


/* ---------- List Bullets ---------- */
.blogzhex-toc__list li,
.blogzhex-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-toc__list a,
.blogzhex-list a {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--zhex-text);
  transition: all 0.2s ease;
  line-height: 1.4;
  position: relative;
}

.blogzhex-toc__list a:hover,
.blogzhex-list a:hover {
  color: #fff;
  transform: translateX(4px);
}

.blogzhex-toc__list a:hover::before,
.blogzhex-list a:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--zhex-accent);
  border-radius: 0 2px 2px 0;
}

/* ---------- 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-categories-list .blogzhex-link {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--zhex-text);
  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: var(--zhex-accent);
  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: var(--zhex-text);
  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: var(--zhex-accent);
  border-radius: 0 2px 2px 0;
}

/* ---------- Buttons ---------- */
.blogzhex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: var(--zhex-accent);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(160,148,255,.35);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: all .2s ease;
}
.blogzhex-btn:hover {
  background: var(--zhex-accent-hover);
  transform: translateY(-1px);
}

/* ---------- Featured Cards ---------- */
.blogzhex-featured { 
  margin: 28px 0 20px; 
  position: relative;
}

/* Divider before Featured Posts */
.blogzhex-featured::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--zhex-border), transparent);
}

/* Alternative: More visible divider */
.blogzhex-featured-divider {
  margin: 32px 0 24px;
  text-align: center;
  position: relative;
}

.blogzhex-featured-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--zhex-border);
}

.blogzhex-featured-divider::after {
  content: '✦';
  position: relative;
  background: var(--zhex-bg);
  color: var(--zhex-muted);
  padding: 0 16px;
  font-size: 0.9rem;
}
.blogzhex-section-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

/* Featured Posts Grid Layout */
.blogzhex-featured .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}
.blogzhex-featured .col {
  flex: 0 0 100%;
  padding: 0 8px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .blogzhex-featured .col {
    flex: 0 0 33.333%;
  }
}

.blogzhex-card {
  background: var(--zhex-box);
  border: 1px solid var(--zhex-border);
  border-radius: var(--zhex-radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  display: block;
  height: 100%;
}
.blogzhex-card:hover { transform: translateY(-2px); }
.blogzhex-card__thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.blogzhex-card__body { padding: 12px; }
.blogzhex-card__title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.blogzhex-card__date {
  font-size: .85rem;
  color: var(--zhex-muted);
}

/* ---------- Copy Anchor Button ---------- */
.blogzhex-copy-anchor {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--zhex-box);
  border: 1px solid var(--zhex-border);
  color: var(--zhex-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.blogzhex-content h2 {
  position: relative;
  padding-right: 50px;
}

.blogzhex-content h2:hover .blogzhex-copy-anchor {
  opacity: 1;
}

.blogzhex-copy-anchor:hover {
  background: var(--zhex-accent);
  color: #fff;
  border-color: var(--zhex-accent);
  transform: translateY(-50%) scale(1.05);
}

.blogzhex-copy-anchor:focus {
  outline: 2px solid var(--zhex-accent);
  outline-offset: 2px;
}

/* ---------- Toast Notification ---------- */
.blogzhex-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #414141;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  z-index: 9999;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .blogzhex-sidebar.sticky { 
    position: static; 
    top: auto; 
    max-height: none;
    overflow-y: visible;
  }
  #blogzhex-single .container { padding: 0 14px; }
  .blogzhex-hero__img { max-height: 240px; }
  .blogzhex-title { font-size: 24px; }
  
  /* Hide copy anchor on mobile to save space */
  .blogzhex-copy-anchor {
    display: none;
  }
  .blogzhex-content h2 {
    padding-right: 0;
  }
  
  .blogzhex-sidebar-group {
    padding: 12px 16px;
  }
  
  .blogzhex-sidebar-group .blogzhex-box {
    padding: 12px 14px;
  }
}

/* Removed inconsistent margin - now handled by unified sidebar group */