/* ==========================================================================
   blog.css: blog index + article pages, in the stur.css design language.
   Loaded after stur.css.
   ========================================================================== */

/* ---------- Dark page header (sits under the glass nav) ---------- */
.blog-hero,
.article-band {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(144.58deg, #02030c 7.74%, #030828 37.32%, #06166e 60.14%, #02061e 92.27%);
  isolation: isolate;
}
.blog-hero::before,
.article-band::before {
  content: '';
  position: absolute;
  z-index: -1;
  right: -200px;
  top: -220px;
  width: 760px;
  height: 520px;
  filter: blur(40px);
  background: radial-gradient(closest-side, rgba(40, 90, 255, 0.5), rgba(40, 90, 255, 0));
}
.blog-hero::after,
.article-band::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -220px;
  bottom: -320px;
  width: 760px;
  height: 520px;
  filter: blur(30px);
  background: radial-gradient(closest-side, rgba(0, 170, 255, 0.4), rgba(0, 170, 255, 0));
}

.blog-hero-inner {
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 190px var(--gutter) 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.blog-hero .pill { border-color: rgba(255, 255, 255, 0.2); color: var(--white); background: rgba(255, 255, 255, 0.04); }
.blog-hero h1 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 64px;
  line-height: 70px;
  letter-spacing: -1.28px;
  max-width: 720px;
}
.blog-hero-sub { max-width: 480px; color: rgba(255, 255, 255, 0.8); }

.blog-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.blog-cat {
  height: 40px;
  padding: 0 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  transition: background-color .2s ease;
}
.blog-cat:hover { background: rgba(255, 255, 255, 0.12); }
.blog-cat.active { background: var(--grad-brand); border-color: transparent; }

/* ---------- Index body ---------- */
.blog-main { background: var(--surface); padding: 80px var(--gutter) var(--section-y); }
.blog-container { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; gap: 70px; }

.blog-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 27.6px;
  padding: 0 12px;
  border-radius: 100px;
  border: 1px solid var(--line-soft);
  background: var(--white);
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  line-height: 15.6px;
  white-space: nowrap;
}
.blog-tag--product::before,
.blog-tag--guides::before,
.blog-tag--vendor::before,
.blog-tag--updates::before { content: ''; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; }
.blog-tag--product::before { background: #4424d7; }
.blog-tag--guides::before { background: #0a6eff; }
.blog-tag--vendor::before { background: #16a34a; }
.blog-tag--updates::before { background: #f59e0b; }

/* Featured story */
.blog-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-card);
  background: var(--white);
  transition: transform .25s ease, box-shadow .25s ease;
}
.blog-featured:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(10, 110, 255, 0.12); }
.featured-img-wrap { border-radius: 32px; overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 2; }
.featured-img { width: 100%; height: 100%; object-fit: cover; }
.featured-body { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 32px 36px; }
.featured-label { color: var(--muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.featured-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 34px;
  line-height: 40px;
  letter-spacing: -0.68px;
}
.featured-excerpt { color: rgba(0, 0, 0, 0.6); }
.featured-read, .card-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--blue);
}
.featured-read { margin-top: 6px; }

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; line-height: 20px; }
.author-av {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: var(--white); font-weight: 600; font-size: 12px;
}
.author-name { color: var(--ink); font-weight: 500; }

/* Grid */
.blog-section-head { margin-bottom: 28px; scroll-margin-top: 110px; }
.blog-section-head h2,
.related-head h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.64px;
}
.blog-grid, .related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.blog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 32px;
  background: var(--white);
  transition: transform .25s ease, box-shadow .25s ease;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(10, 110, 255, 0.12); }
.card-img-wrap { border-radius: 26px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--surface-2); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.blog-card:hover .card-img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 18px; flex: 1; }
.card-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: -0.2px;
}
.card-excerpt {
  color: rgba(0, 0, 0, 0.6);
  font-size: 15px;
  line-height: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-read { margin-top: auto; }

/* Pager */
.blog-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 40px; }
.blog-pager[hidden] { display: none; }
.blog-page-btn {
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: 100px;
  background: var(--white); border: 1px solid var(--line-soft);
  font-weight: 600; font-size: 14px;
}
.blog-page-btn.is-active { background: var(--grad-brand); color: var(--white); border-color: transparent; }
.blog-page-btn:disabled { opacity: .4; cursor: default; }

/* ---------- Article ---------- */
.article-header {
  max-width: 860px;
  margin: 0 auto;
  padding: 170px var(--gutter) 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.article-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, 0.7); }
.article-breadcrumb a { color: var(--white); }
.article-breadcrumb a:hover { text-decoration: underline; }
.article-header .blog-tag { align-self: center; }
.article-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 52px;
  line-height: 58px;
  letter-spacing: -1.04px;
}
.article-sub { max-width: 640px; color: rgba(255, 255, 255, 0.8); font-size: 18px; line-height: 28px; }
.article-header .post-meta { justify-content: center; color: rgba(255, 255, 255, 0.7); }
.article-header .author-name { color: var(--white); }

.article-cover {
  position: relative;
  z-index: 1;
  display: block;
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--container);
  aspect-ratio: 12 / 5;
  height: auto;
  margin: -110px auto 0;
  border-radius: var(--radius-card);
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: 0 30px 60px rgba(2, 6, 30, 0.25);
}

.article-prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 70px var(--gutter) 0;
  font-size: 18px;
  line-height: 30px;
  color: #1a1c24;
}
.article-prose > * + * { margin-top: 22px; }
.article-prose h2, .article-prose h3, .article-prose h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--black);
}
.article-prose h2 { font-size: 30px; line-height: 36px; letter-spacing: -0.6px; margin-top: 48px; }
.article-prose h3 { font-size: 23px; line-height: 30px; letter-spacing: -0.3px; margin-top: 36px; }
.article-prose h4 { font-size: 19px; line-height: 26px; margin-top: 28px; }
.article-prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-prose ul, .article-prose ol { padding-left: 24px; }
.article-prose ul { list-style: disc; }
.article-prose ol { list-style: decimal; }
.article-prose li + li { margin-top: 8px; }
.article-prose li::marker { color: var(--blue); }
.article-prose blockquote {
  margin: 32px 0;
  padding: 22px 26px;
  border-radius: 20px;
  background: var(--surface);
  border-left: 4px solid #4424d7;
  font-size: 19px;
}
.article-prose img, .article-img { width: 100%; border-radius: 24px; }
.article-prose figure { margin: 32px 0; }
.article-prose hr { border: 0; height: 1px; background: var(--line-soft); margin: 40px 0; }
.article-prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.article-prose th, .article-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }

.article-footer {
  max-width: 720px;
  margin: 56px auto 0;
  padding: 28px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid var(--line-soft);
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article-share { display: flex; align-items: center; gap: 8px; }
.share-label { color: var(--muted); font-size: 14px; margin-right: 4px; }
.share-btn {
  width: 38px; height: 38px; border-radius: 100px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-soft); background: var(--white); color: var(--ink);
  transition: background-color .2s ease, color .2s ease;
}
.share-btn:hover { background: var(--black); color: var(--white); }

.related-posts { margin-top: var(--section-y); background: var(--surface); padding: var(--section-y) var(--gutter); }
.related-inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.related-head a { font-weight: 600; font-size: 15px; color: var(--blue); }
article + .site-footer { margin-top: var(--section-y); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .blog-featured { grid-template-columns: 1fr; }
  .blog-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .blog-hero-inner { padding: 140px var(--gutter) 60px; }
  .blog-hero h1 { font-size: 44px; line-height: 50px; letter-spacing: -0.88px; }
  .blog-main { padding-top: 50px; }
  .featured-body { padding: 20px 16px 22px; }
  .featured-title { font-size: 26px; line-height: 32px; }
  .article-header { padding: 130px var(--gutter) 110px; }
  .article-title { font-size: 36px; line-height: 42px; letter-spacing: -0.72px; }
  .article-sub { font-size: 16px; line-height: 24px; }
  .article-cover { margin-top: -70px; border-radius: 24px; aspect-ratio: 16 / 9; }
  .article-prose { padding-top: 44px; font-size: 17px; line-height: 28px; }
  .article-prose h2 { font-size: 25px; line-height: 31px; }
}
@media (max-width: 620px) {
  .blog-grid, .related-grid { grid-template-columns: 1fr; }
  .blog-page-btn { min-width: 36px; height: 36px; padding: 0 8px; font-size: 13px; }
  .related-head { flex-direction: column; }
}
