/* ══════════════════════════════════════════════════════
   INSIGHTS / BLOG  —  Zohar I.T. Solutions
   Premium, world-class editorial layout
   ══════════════════════════════════════════════════════ */

/* ── List view: hero filter bar ─────────────────────── */
.insights-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 40px;
}
.insights-filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
  letter-spacing: 0.02em;
}
.insights-filter-btn:hover { color: var(--white); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.07); }
.insights-filter-btn.active { background: var(--gradient); color: #fff; border-color: transparent; }
.insights-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0 18px 0 0;
  overflow: hidden;
}
.insights-search input {
  background: none;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--white);
  font-family: var(--font-main);
  width: 220px;
}
.insights-search input::placeholder { color: var(--text-muted); }
.insights-search i { color: var(--text-muted); font-size: 0.85rem; }

/* ── Featured post (first card, full-width hero) ───── */
.insights-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 48px;
  transition: var(--transition);
}
.insights-featured:hover { border-color: rgba(0,87,255,0.35); box-shadow: 0 12px 40px rgba(0,0,0,0.35); transform: translateY(-3px); }
.insights-feat-img {
  background: linear-gradient(135deg, var(--dark-2) 0%, #0d1b35 100%);
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.insights-feat-img img { width: 100%; height: 100%; object-fit: cover; }
.insights-feat-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.insights-feat-img-placeholder i { font-size: 3rem; color: var(--primary); opacity: 0.4; }
.insights-feat-img-placeholder span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.insights-feat-body {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.insights-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
  background: rgba(0,87,255,0.1);
  border: 1px solid rgba(0,87,255,0.2);
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
  width: fit-content;
}
.insights-feat-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 14px;
}
.insights-feat-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.insights-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.insights-meta span { display: flex; align-items: center; gap: 6px; }
.insights-meta i { color: var(--primary); }
.insights-read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 11px 26px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--transition);
  width: fit-content;
}
.insights-read-link:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,87,255,0.35); }

/* ── Grid of blog cards ─────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 60px;
}
.insight-card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.insight-card:hover { border-color: rgba(0,87,255,0.35); box-shadow: 0 8px 32px rgba(0,0,0,0.3); transform: translateY(-4px); }
.insight-card-thumb {
  height: 190px;
  background: linear-gradient(135deg, var(--dark-2) 0%, #0d1b35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.insight-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.insight-card-thumb-placeholder { color: var(--primary); opacity: 0.3; font-size: 2.5rem; }
.insight-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.insight-card-cat {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 10px;
}
.insight-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.insight-card-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
}
.insight-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 14px;
  margin-top: auto;
}
.insight-card-footer span { display: flex; align-items: center; gap: 5px; }
.insight-card-footer i { color: var(--primary); }
.insight-card-arrow {
  width: 28px; height: 28px;
  background: rgba(0,87,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--primary-light);
  transition: var(--transition);
}
.insight-card:hover .insight-card-arrow { background: var(--gradient); color: #fff; }

/* ── No results ──────────────────────────────────────── */
.insights-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.insights-empty i { font-size: 3rem; opacity: 0.25; display: block; margin-bottom: 16px; }

/* ── Load-more ───────────────────────────────────────── */
.insights-load-more {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}
.btn-load-more {
  padding: 13px 36px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-main);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-load-more:hover { color: var(--white); border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.07); }
.btn-load-more:disabled { opacity: 0.4; cursor: default; }

/* ══════════════════════════════════════════════════════
   SINGLE POST VIEW
   ══════════════════════════════════════════════════════ */
#post-view { display: none; }
#list-view { display: block; }

.post-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-main);
  padding: 0;
  margin-bottom: 36px;
  transition: var(--transition);
}
.post-back-btn:hover { color: var(--white); }
.post-back-btn i { font-size: 0.8rem; }

.post-hero {
  max-width: 860px;
  margin: 0 auto 48px;
}
.post-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
  background: rgba(0,87,255,0.1);
  border: 1px solid rgba(0,87,255,0.2);
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
}
.post-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1.18;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.post-subtitle {
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 28px;
}
.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.post-author-avatar {
  width: 44px; height: 44px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.post-author-info strong { display: block; font-size: 0.88rem; color: var(--white); font-weight: 700; }
.post-author-info small { font-size: 0.75rem; color: var(--text-muted); }
.post-meta-divider { width: 1px; height: 36px; background: var(--border); }
.post-meta-item { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text-muted); }
.post-meta-item i { color: var(--primary); }
.post-meta-item strong { color: var(--white); }

.post-featured-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 48px;
  border: 1px solid var(--border);
}

/* ── Article body ────────────────────────────────────── */
.post-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.82;
  color: var(--text-muted);
}
.post-body h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--white);
  margin: 44px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: -0.01em;
}
.post-body h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--white);
  margin: 32px 0 12px;
}
.post-body p { margin-bottom: 22px; }
.post-body strong { color: var(--white); font-weight: 700; }
.post-body em { font-style: italic; }
.post-body a { color: var(--primary-light); }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(0,87,255,0.06);
  border-radius: 0 12px 12px 0;
  padding: 18px 24px;
  margin: 28px 0;
  font-size: 1.05rem;
  color: var(--white);
  font-style: italic;
}

/* Article images injected by JS */
.post-body .article-img-wrap {
  margin: 32px 0;
}
.post-body .article-img-wrap.pos-left { float: left; margin-right: 28px; margin-bottom: 16px; clear: left; }
.post-body .article-img-wrap.pos-right { float: right; margin-left: 28px; margin-bottom: 16px; clear: right; }
.post-body .article-img-wrap.pos-center { float: none; clear: both; text-align: center; }
.post-body .article-img-wrap img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.post-body .article-img-wrap.pos-center img { margin: 0 auto; }
.post-body .article-img-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
  text-align: center;
}

/* ── Tags strip ──────────────────────────────────────── */
.post-tags {
  max-width: 760px;
  margin: 48px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 50px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Related posts ───────────────────────────────────── */
.related-posts {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.related-posts-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 28px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Share strip ─────────────────────────────────────── */
.post-share {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 20px 24px;
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.post-share-label { font-size: 0.85rem; font-weight: 700; color: var(--white); }
.post-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  transition: var(--transition);
  text-decoration: none;
}
.share-twitter { background: rgba(29,161,242,0.1); color: #1da1f2; border: 1px solid rgba(29,161,242,0.2); }
.share-twitter:hover { background: rgba(29,161,242,0.18); }
.share-linkedin { background: rgba(10,102,194,0.1); color: #0a66c2; border: 1px solid rgba(10,102,194,0.2); }
.share-linkedin:hover { background: rgba(10,102,194,0.18); }
.share-copy { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border); }
.share-copy:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.share-copy.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }

/* ── CTA banner at end of article ───────────────────── */
.post-cta {
  max-width: 760px;
  margin: 48px auto;
  background: linear-gradient(135deg, rgba(0,87,255,0.12) 0%, rgba(0,212,255,0.06) 100%);
  border: 1px solid rgba(0,87,255,0.2);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  text-align: center;
}
.post-cta h3 { font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: 10px; }
.post-cta p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 22px; }
.post-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--transition);
}
.post-cta a:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(0,87,255,0.35); }

/* ── Sidebar / sticky TOC (future extension point) ──── */
.post-layout { display: block; }

/* ══════════════════════════════════════════════════════
   LOADING SKELETON
   ══════════════════════════════════════════════════════ */
.insights-skeleton { animation: sk-pulse 1.6s ease-in-out infinite; }
@keyframes sk-pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.sk-block { background: rgba(255,255,255,0.06); border-radius: 6px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .insights-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .insights-featured { grid-template-columns: 1fr; }
  .insights-feat-img { min-height: 220px; }
  /* Show the full photo on mobile instead of cropping the sides — the
     gradient background already on these wrappers fills any letterbox gap */
  .insights-feat-img img,
  .insight-card-thumb img { object-fit: contain !important; }
  .post-featured-img { object-fit: contain !important; background: linear-gradient(135deg, var(--dark-2) 0%, #0d1b35 100%); }
  .insights-feat-body { padding: 28px 24px; }
  .insights-feat-title { font-size: 1.25rem; }
  .insights-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 1.65rem; }
  .post-subtitle { font-size: 0.95rem; }
  .post-body h2 { font-size: 1.25rem; }
  .post-meta-bar { gap: 14px; }
  .post-meta-divider { display: none; }
  .insights-search { display: none; }
  .post-body .article-img-wrap.pos-left,
  .post-body .article-img-wrap.pos-right {
    float: none; margin-left: 0; margin-right: 0; clear: both;
    text-align: center;
  }
  .post-body .article-img-wrap img { width: 100% !important; }
  .post-cta { padding: 24px 20px; }
  .post-cta h3 { font-size: 1.1rem; }
}

/* Green theme overrides */
[data-theme="green"] .insights-cat-pill,
[data-theme="green"] .post-hero-cat {
  color: var(--primary-light);
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.2);
}
[data-theme="green"] .insights-filter-btn.active { background: var(--gradient); }
[data-theme="green"] .insights-read-link { background: var(--gradient); }
[data-theme="green"] .post-body blockquote { border-left-color: var(--primary); background: rgba(22,163,74,0.06); }
[data-theme="green"] .post-cta { background: linear-gradient(135deg, rgba(22,163,74,0.1) 0%, rgba(52,211,153,0.05) 100%); border-color: rgba(22,163,74,0.2); }
