/* =========================================================
   NextShop.bg — Blog styles
   Listing + single post
   ========================================================= */

/* ============ SHARED: blog page header ============ */
.blog-hero {
  position: relative; padding: 80px 32px 40px; text-align: center; overflow: hidden;
  isolation: isolate;
}
.blog-hero .blob { opacity: .35; }
.blog-hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.blog-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: var(--violet-pale);
  border: 1px solid color-mix(in srgb, var(--violet-light) 30%, transparent);
  border-radius: 100px; padding: 6px 16px; font-size: 12px; font-weight: 600;
  color: var(--violet-mid); margin-bottom: 22px;
}
.blog-eyebrow i { font-size: 14px; }
.blog-hero h1 {
  font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.035em;
  line-height: 1.05; margin-bottom: 16px; font-family: var(--font-display);
}
.blog-hero p { font-size: 17px; color: var(--muted); max-width: 520px; margin: 0 auto; line-height: 1.65; }

/* Search */
.blog-search { max-width: 460px; margin: 30px auto 0; position: relative; }
.blog-search i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 18px; pointer-events: none;
}
.blog-search input {
  width: 100%; padding: 14px 16px 14px 46px; border-radius: 12px;
  border: 1.5px solid var(--border2); background: var(--white); color: var(--ink);
  font-size: 15px; font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.blog-search input:focus { outline: none; border-color: var(--violet-light); box-shadow: 0 0 0 4px var(--violet-faint); }

/* ============ Category filter ============ */
.blog-cats {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 0 32px; margin: 0 auto 40px; max-width: var(--container);
}
.blog-cat {
  padding: 8px 18px; border-radius: 100px; border: 1.5px solid var(--border2);
  background: var(--white); color: var(--muted); font-size: 13.5px; font-weight: 600;
  font-family: inherit; transition: all .2s; cursor: pointer;
}
.blog-cat:hover { border-color: var(--violet-light); color: var(--violet-mid); }
.blog-cat.active {
  background: linear-gradient(135deg, var(--violet-mid), var(--violet-light));
  border-color: transparent; color: #fff; box-shadow: var(--shadow-violet);
}

/* ============ Featured post ============ */
.blog-featured {
  max-width: var(--container); margin: 0 auto 48px; padding: 0 32px;
}
.blog-featured-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r4);
  overflow: hidden; box-shadow: var(--shadow-md);
  transition: transform .3s, box-shadow .3s; text-decoration: none; color: inherit;
}
.blog-featured-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.blog-featured-cover {
  min-height: 320px; position: relative; display: grid; place-items: center;
  overflow: hidden;
}
.blog-featured-cover i { font-size: 90px; color: rgba(255,255,255,.85); transition: transform .5s; }
.blog-featured-card:hover .blog-featured-cover i { transform: scale(1.1) rotate(-4deg); }
.blog-featured-cover .blog-card-cat { position: absolute; top: 20px; left: 20px; }
.blog-featured-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.blog-featured-body .feat-label { font-size: 12px; font-weight: 700; color: var(--violet-mid); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 14px; }
.blog-featured-body h2 { font-size: clamp(24px, 2.8vw, 32px); margin-bottom: 14px; line-height: 1.15; }
.blog-featured-body p { font-size: 15.5px; color: var(--muted); line-height: 1.7; margin-bottom: 22px; }
.blog-featured-body .read-more {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--violet-mid);
  font-size: 14px; transition: gap .2s;
}
.blog-featured-body .read-more i { transition: transform .2s; }
.blog-featured-card:hover .read-more i { transform: translateX(4px); }

/* ============ Blog grid ============ */
.blog-grid {
  max-width: var(--container); margin: 0 auto; padding: 0 32px 80px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.blog-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r3);
  overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s, opacity .4s;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--violet-light); }
.blog-card.hide { display: none; }
.blog-card-link { text-decoration: none; color: inherit; display: block; }
.blog-card-cover {
  height: 180px; position: relative; display: grid; place-items: center; overflow: hidden;
}
.blog-card-cover i { font-size: 50px; color: rgba(255,255,255,.85); transition: transform .5s; }
.blog-card:hover .blog-card-cover i { transform: scale(1.12); }
.blog-card-cat {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  color: var(--ink); font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 100px;
  letter-spacing: .3px;
}
.blog-card-body { padding: 22px; }
.blog-card-title { font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; letter-spacing: -.01em; transition: color .2s; }
.blog-card:hover .blog-card-title { color: var(--violet-mid); }
.blog-card-excerpt { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.blog-card-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--faint); padding-top: 14px; border-top: 1px solid var(--border); }
.blog-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.blog-card-meta i { font-size: 14px; }
.blog-card-author { display: flex; align-items: center; gap: 8px; }
.blog-card-author .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }

/* cover gradients per category */
.cover-ecommerce { background: linear-gradient(135deg, #6d28d9, #a78bfa, #f0abfc); }
.cover-marketing { background: linear-gradient(135deg, #db2777, #f472b6, #fb923c); }
.cover-ai        { background: linear-gradient(135deg, #059669, #10b981, #6ee7b7); }
.cover-guides    { background: linear-gradient(135deg, #d97706, #fbbf24, #fde68a); }
.cover-stories   { background: linear-gradient(135deg, #2563eb, #60a5fa, #93c5fd); }

.av1 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.av2 { background: linear-gradient(135deg, #059669, #34d399); }
.av3 { background: linear-gradient(135deg, #d97706, #fbbf24); }
.av4 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.av5 { background: linear-gradient(135deg, #db2777, #f472b6); }

/* No results */
.blog-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); display: none; }
.blog-empty.show { display: block; }
.blog-empty i { font-size: 48px; color: var(--border2); margin-bottom: 16px; }

/* Newsletter CTA on blog */
.blog-news {
  max-width: var(--container); margin: 0 auto 96px; padding: 0 32px;
}
.blog-news-card {
  background: linear-gradient(135deg, var(--ink2), var(--ink3));
  border-radius: var(--r4); padding: 56px 40px; text-align: center;
  position: relative; overflow: hidden; isolation: isolate;
}
.blog-news-card .blob { opacity: .4; }
.blog-news-card h3 { color: #fff; font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; position: relative; }
.blog-news-card p { color: rgba(255,255,255,.7); margin-bottom: 28px; position: relative; }
.blog-news-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; position: relative; }
.blog-news-form input {
  flex: 1; padding: 14px 16px; border-radius: 11px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; font-size: 14px; font-family: inherit;
}
.blog-news-form input::placeholder { color: rgba(255,255,255,.5); }
.blog-news-form input:focus { outline: none; border-color: var(--violet-light); }
.blog-news-form button {
  padding: 14px 22px; border-radius: 11px; border: none;
  background: linear-gradient(135deg, var(--violet-mid), var(--violet-light));
  color: #fff; font-weight: 700; font-size: 14px; font-family: inherit; white-space: nowrap;
  box-shadow: var(--shadow-violet); cursor: pointer; transition: transform .2s;
}
.blog-news-form button:hover { transform: translateY(-2px); }

/* =========================================================
   SINGLE POST
   ========================================================= */
.reading-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--violet-mid), var(--pink));
  z-index: 999; box-shadow: 0 0 12px rgba(124,58,237,.6);
}

.post-breadcrumb {
  max-width: 820px; margin: 0 auto; padding: 28px 32px 0;
  font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 8px;
}
.post-breadcrumb a { color: var(--muted); transition: color .15s; }
.post-breadcrumb a:hover { color: var(--violet-mid); }
.post-breadcrumb i { font-size: 12px; }

/* Article header */
.post-header { max-width: 820px; margin: 0 auto; padding: 24px 32px 0; text-align: center; }
.post-cat-tag {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--violet-mid);
  letter-spacing: 1px; text-transform: uppercase; background: var(--violet-pale);
  padding: 5px 14px; border-radius: 100px; margin-bottom: 22px;
}
.post-header h1 {
  font-size: clamp(30px, 4.5vw, 48px); font-weight: 800; letter-spacing: -.03em;
  line-height: 1.1; margin-bottom: 22px; font-family: var(--font-display);
}
.post-meta {
  display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted); margin-bottom: 8px;
}
.post-meta .post-author { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.post-meta .post-author .av { width: 38px; height: 38px; font-size: 13px; }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta i { font-size: 16px; color: var(--faint); }

/* Cover */
.post-cover {
  max-width: 1000px; margin: 36px auto 0; padding: 0 32px;
}
.post-cover-img {
  width: 100%; aspect-ratio: 16/7; border-radius: var(--r4);
  display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.post-cover-img i { font-size: 90px; color: rgba(255,255,255,.85); }

/* Layout: TOC sidebar + content */
.post-layout {
  max-width: 1000px; margin: 48px auto 0; padding: 0 32px;
  display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start;
}
.post-toc {
  position: sticky; top: calc(var(--nav-h) + 32px);
  font-size: 13.5px; max-height: calc(100vh - var(--nav-h) - 64px); overflow: auto;
}
.post-toc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--faint); margin-bottom: 14px; }
.post-toc ul { list-style: none; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--border); }
.post-toc li { position: relative; }
.post-toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -2px;
  color: var(--muted); border-left: 2px solid transparent; transition: all .2s; line-height: 1.4;
}
.post-toc a:hover { color: var(--violet-mid); }
.post-toc a.active { color: var(--violet-mid); border-left-color: var(--violet-mid); font-weight: 600; }

/* Share sidebar */
.post-share-side {
  position: sticky; top: calc(var(--nav-h) + 32px);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.post-share-side .share-label { writing-mode: vertical-rl; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.share-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--white); color: var(--muted); display: grid; place-items: center;
  font-size: 18px; transition: all .2s; cursor: pointer;
}
.share-btn:hover { background: var(--violet-mid); color: #fff; border-color: var(--violet-mid); transform: translateY(-3px); }

/* Article content (prose) */
.post-content { font-size: 17px; line-height: 1.8; color: var(--ink2); max-width: none; }
.post-content > * + * { margin-top: 1.4em; }
.post-content h2 {
  font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  margin-top: 2.2em; margin-bottom: .6em; line-height: 1.2; scroll-margin-top: 100px;
}
.post-content h2:first-child { margin-top: 0; }
.post-content h3 { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 1.8em; margin-bottom: .5em; scroll-margin-top: 100px; }
.post-content p { color: var(--muted); }
.post-content strong { color: var(--ink); font-weight: 700; }
.post-content a { color: var(--violet-mid); text-decoration: underline; text-decoration-color: var(--violet-faint); text-underline-offset: 3px; }
.post-content a:hover { text-decoration-color: var(--violet-mid); }
.post-content ul, .post-content ol { padding-left: 1.4em; color: var(--muted); }
.post-content li { margin-top: .5em; }
.post-content li::marker { color: var(--violet-mid); }

/* Blockquote */
.post-content blockquote {
  border-left: 4px solid var(--violet-mid); background: var(--violet-pale);
  padding: 20px 26px; border-radius: 0 12px 12px 0; font-size: 18px; font-style: italic;
  color: var(--ink); position: relative;
}
.post-content blockquote p { color: var(--ink); }
.post-content blockquote cite { display: block; font-size: 14px; font-style: normal; color: var(--muted); margin-top: 8px; }

/* Callout */
.post-callout {
  display: flex; gap: 14px; padding: 18px 22px; border-radius: 12px;
  background: var(--emerald-faint); border: 1px solid color-mix(in srgb, var(--emerald) 25%, transparent);
  font-size: 15px; color: var(--ink);
}
.post-callout.info { background: var(--violet-pale); border-color: color-mix(in srgb, var(--violet-light) 30%, transparent); }
.post-callout.warn { background: var(--amber-faint); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.post-callout i { font-size: 22px; flex-shrink: 0; }
.post-callout.info i { color: var(--violet-mid); }
.post-callout.warn i { color: var(--amber); }
.post-callout i:first-child { color: var(--emerald); }

/* Code */
.post-content pre {
  background: var(--ink2); color: #e5e7eb; padding: 20px 24px; border-radius: 12px;
  overflow-x: auto; font-size: 14px; line-height: 1.6; font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}
.post-content code { background: var(--soft); padding: 2px 7px; border-radius: 5px; font-size: .88em; font-family: 'SF Mono', Consolas, monospace; color: var(--violet-mid); }
.post-content pre code { background: none; padding: 0; color: inherit; }

/* Figure */
.post-figure { margin: 2em 0; }
.post-figure-img {
  aspect-ratio: 16/8; border-radius: 14px; display: grid; place-items: center;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.post-figure-img i { font-size: 56px; color: rgba(255,255,255,.85); }
.post-figure figcaption { text-align: center; font-size: 13.5px; color: var(--faint); margin-top: 10px; font-style: italic; }

/* Tags */
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.post-tag { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 100px; background: var(--soft); color: var(--muted); border: 1px solid var(--border); transition: all .2s; text-decoration: none; }
.post-tag:hover { background: var(--violet-pale); color: var(--violet-mid); border-color: var(--violet-light); }

/* Author bio */
.post-author-bio {
  display: flex; gap: 20px; align-items: flex-start; margin-top: 40px; padding: 28px;
  background: var(--off); border: 1px solid var(--border); border-radius: var(--r3);
}
.post-author-bio .av { width: 64px; height: 64px; font-size: 22px; flex-shrink: 0; }
.post-author-bio h4 { font-size: 17px; font-weight: 700; color: var(--ink); }
.post-author-bio .role { font-size: 13px; color: var(--violet-mid); font-weight: 600; margin-bottom: 8px; }
.post-author-bio p { font-size: 14.5px; color: var(--muted); line-height: 1.65; }

/* Share inline (mobile) */
.post-share-inline {
  display: flex; align-items: center; gap: 10px; margin-top: 32px;
  padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.post-share-inline span { font-size: 14px; font-weight: 600; color: var(--muted); margin-right: 6px; }

/* Related posts */
.post-related { max-width: 1000px; margin: 80px auto 0; padding: 0 32px; }
.post-related-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.post-related-head h2 { font-size: 28px; }
.post-related-head a { font-size: 14px; font-weight: 600; color: var(--violet-mid); display: inline-flex; align-items: center; gap: 6px; }
.post-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Responsive */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .post-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .blog-featured-card { grid-template-columns: 1fr; }
  .blog-featured-cover { min-height: 220px; }
  .blog-featured-body { padding: 28px; }
  .post-layout { grid-template-columns: 1fr; gap: 0; }
  .post-toc { display: none; }
  .post-share-side {
    position: fixed; right: 14px; bottom: 80px; top: auto; flex-direction: row;
    background: var(--white); border: 1px solid var(--border); padding: 8px; border-radius: 14px;
    box-shadow: var(--shadow-lg); z-index: 150;
  }
  .post-share-side .share-label { display: none; }
}
@media (max-width: 560px) {
  .blog-hero { padding: 56px 20px 30px; }
  .blog-cats { padding: 0 20px; }
  .blog-featured, .blog-grid, .blog-news { padding: 0 20px; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-news-form { flex-direction: column; }
  .post-header, .post-cover, .post-layout, .post-related { padding: 0 20px; }
  .post-content { font-size: 16px; }
  .post-content h2 { font-size: 24px; }
  .post-related-grid { grid-template-columns: 1fr; }
  .post-author-bio { flex-direction: column; }
}
