/* ==========================================================================
   AI Boost — Blog (gallery + single post)
   Uses the site tokens from app.css (--grad, --ink, --stroke, --card-shadow).
   ========================================================================== */

.blog-gallery,
.blog-single,
.post-related {
  --blog-radius: 1.75rem;
  --blog-soft: #f6f5fd;
}

.blog-gallery section,
.blog-single section {
  padding: 0;
}

/* Shared: gradient wash, chip, dot */
.blog-hero-wash {
  position: absolute;
  inset: -12rem 0 auto;
  height: 34rem;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(38rem 18rem at 82% 40%, rgba(123, 47, 240, 0.12), transparent 70%),
    radial-gradient(30rem 16rem at 18% 30%, rgba(22, 184, 160, 0.12), transparent 70%),
    radial-gradient(26rem 14rem at 50% 70%, rgba(236, 47, 214, 0.08), transparent 70%);
}

.blog-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3125rem 0.875rem;
  border-radius: 62.4375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--purple);
  background: rgba(123, 47, 240, 0.08);
  text-decoration: none;
  transition: background 0.2s;
}

a.blog-chip:hover {
  background: rgba(123, 47, 240, 0.16);
}

.blog-dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: var(--ink-40);
}

/* --------------------------------------------------------------------------
   Gallery hero
   -------------------------------------------------------------------------- */
.blog-gallery .blog-hero {
  position: relative;
  isolation: isolate;
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.blog-hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background-image: linear-gradient(270deg, var(--teal), var(--blue) 35%, var(--purple) 70%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.1em;
}

.blog-hero-intro {
  max-width: 40rem;
  margin: 1.25rem auto 0;
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--ink-62);
}

.blog-filter {
  margin-top: 2.5rem;
}

.blog-filter ul {
  list-style: none;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem;
  border-radius: 62.4375rem;
  background: #fff;
  border: 0.0625rem solid var(--stroke);
  box-shadow:
    0 1.125rem 2.5rem -1.125rem rgba(10, 15, 50, 0.22),
    0 0.375rem 1rem -0.5rem rgba(123, 47, 240, 0.14);
}

@media (max-width: 47rem) {
  .blog-filter ul {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

.blog-filter a {
  display: block;
  padding: 0.5625rem 1.25rem;
  border-radius: 62.4375rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
}

.blog-filter a:hover {
  background: var(--blog-soft);
}

.blog-filter a[aria-current='page'] {
  background: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.blog-list {
  padding: 1.5rem 0 7rem !important;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem 2rem;
}

@media (max-width: 61.25rem) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--blog-radius);
  border: 0.0625rem solid var(--stroke);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition:
    transform 0.35s,
    box-shadow 0.35s;
}

.blog-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 2.5rem 4.5rem -2.5rem rgba(80, 40, 200, 0.35);
}

.blog-card::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 0.1875rem;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s;
}

.blog-card:hover::after {
  transform: scaleX(1);
}

.blog-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--blog-soft);
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.blog-card-img--empty {
  display: block;
  background: linear-gradient(135deg, rgba(22, 184, 160, 0.25), rgba(31, 59, 224, 0.25), rgba(236, 47, 214, 0.25));
}

.blog-card:hover .blog-card-img {
  transform: scale(1.05);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem 1.75rem 1.75rem;
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--ink-40);
}

.blog-card-meta .blog-chip {
  margin-inline-end: 0.25rem;
}

.blog-card-title {
  margin-top: 1rem;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0a0f3c;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

/* Whole card clickable */
.blog-card-title a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.blog-card-title a:focus-visible {
  outline: none;
}

.blog-card:focus-within {
  outline: 0.125rem solid var(--purple);
  outline-offset: 0.25rem;
}

.blog-card-excerpt {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-62);
}

.blog-card-more {
  margin-top: auto;
  padding-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0a0f3c;
}

.blog-card-more i {
  font-style: normal;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-more span {
  -webkit-text-fill-color: transparent;
}

.blog-card:hover .blog-card-more i {
  transform: translateX(-0.375rem);
}

/* Featured (first post) */
.blog-card--featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  margin-bottom: 3rem;
  border-radius: 2.125rem;
}

@media (max-width: 61.25rem) {
  .blog-card--featured {
    grid-template-columns: 1fr;
  }
}

.blog-card--featured .blog-card-media {
  aspect-ratio: auto;
  min-height: 26rem;
}

@media (max-width: 61.25rem) {
  .blog-card--featured .blog-card-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
}

.blog-card--featured .blog-card-body {
  justify-content: center;
  padding: 3rem 3.25rem;
}

@media (max-width: 61.25rem) {
  .blog-card--featured .blog-card-body {
    padding: 1.75rem 1.75rem 2rem;
  }
}

.blog-card--featured .blog-card-title {
  font-size: clamp(1.625rem, 2.6vw, 2.25rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.blog-card--featured .blog-card-excerpt {
  font-size: 1.0625rem;
}

.blog-card--featured .blog-card-more {
  margin-top: 1.75rem;
  padding-top: 0;
}

/* Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 4rem;
}

.blog-pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 62.4375rem;
  border: 0.0625rem solid var(--stroke);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s;
}

.blog-pagination a.page-numbers:hover {
  background: var(--blog-soft);
}

.blog-pagination .page-numbers.current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.blog-empty {
  text-align: center;
  font-size: 1.125rem;
  color: var(--ink-62);
  padding: 4rem 0;
}

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */
.blog-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 0.25rem;
  z-index: 100;
  pointer-events: none;
}

.blog-progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: right;
}

.post-hero {
  position: relative;
  isolation: isolate;
  padding: 2.5rem 0 2.75rem;
  text-align: center;
}

@media (max-width: 47rem) {
  .post-hero {
    padding: 1.5rem 0 2rem;
  }
}

.post-crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
  color: var(--ink-40);
}

.post-crumbs a {
  color: var(--ink-62);
  text-decoration: none;
}

.post-crumbs a:hover {
  color: var(--purple);
}

.post-title {
  max-width: 52rem;
  margin: 1.25rem auto 0;
  font-size: clamp(2.125rem, 4.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0a0f3c;
}

.post-lead {
  max-width: 42rem;
  margin: 1.25rem auto 0;
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--ink-62);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--ink-62);
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  color: var(--ink);
}

.post-author-logo {
  display: block;
  width: 5.5rem;
  height: 2rem;
  flex-shrink: 0;
  object-fit: contain;
}

.post-cover {
  margin: 0;
  border-radius: 2.125rem;
  overflow: hidden;
  box-shadow: 0 2.125rem 4.375rem -2.375rem rgba(10, 15, 50, 0.3);
  aspect-ratio: 2 / 1;
}

@media (max-width: 47rem) {
  .post-author {
    flex-basis: 100%;
    justify-content: center;
  }

  .post-author + .blog-dot {
    display: none;
  }

  .post-cover {
    border-radius: 1.25rem;
    aspect-ratio: 16 / 10;
  }
}

.post-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-layout {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 46rem);
  justify-content: center;
  gap: 4.5rem;
  padding: 4rem 0 6rem;
}

@media (max-width: 61.25rem) {
  .post-layout {
    grid-template-columns: minmax(0, 46rem);
    gap: 2rem;
    padding: 2.5rem 0 4.5rem;
  }
}

/* Aside: TOC + share (right column in RTL) */
.post-aside {
  position: sticky;
  top: 6rem;
  align-self: start;
  display: grid;
  gap: 1.5rem;
}

@media (max-width: 61.25rem) {
  .post-aside {
    position: static;
    order: -1;
  }
}

.post-toc {
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--blog-soft);
  border: 0.0625rem solid var(--stroke);
}

@media (max-width: 61.25rem) {
  .post-toc {
    padding: 1.25rem;
  }
}

.post-toc-title,
.post-share-title {
  font-weight: 800;
  font-size: 0.9375rem;
  color: #0a0f3c;
  margin-bottom: 0.875rem;
}

.post-toc ol {
  list-style: none;
  display: grid;
  gap: 0.125rem;
}

.post-toc a {
  position: relative;
  display: block;
  padding: 0.4375rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-62);
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.post-toc .toc-l3 a {
  padding-inline-start: 1.75rem;
  font-size: 0.875rem;
}

.post-toc a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
}

.post-toc a[aria-current] {
  color: var(--ink);
  font-weight: 700;
  background: #fff;
}

.post-toc a[aria-current]::before {
  content: '';
  position: absolute;
  inset-block: 0.5rem;
  inset-inline-start: 0;
  width: 0.1875rem;
  border-radius: 1rem;
  background: var(--grad);
}

.post-share {
}

@media (max-width: 61.25rem) {
  .post-share {
    display: none;
  }
}

.post-share-links {
  display: flex;
  gap: 0.5rem;
}

.post-share-links a,
.post-share-links button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 0.0625rem solid var(--stroke);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.post-share-links a:hover,
.post-share-links button:hover {
  transform: translateY(-0.125rem);
  color: var(--purple);
  box-shadow: 0 0.75rem 1.5rem -0.75rem rgba(123, 47, 240, 0.45);
}

.post-share-links button.is-done {
  color: var(--teal);
}

.post-share-links svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

/* Article typography — blog spacing standard: 30px after headings,
   lists and media; stronger separation above section headings. */
.post-body {
  font-size: 1.1875rem;
  line-height: 1.8;
  color: rgba(6, 8, 28, 0.82);
}

@media (max-width: 47rem) {
  .post-body {
    font-size: 1.0625rem;
  }
}

.post-body > * + * {
  margin-top: 1.25rem;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  color: #0a0f3c;
  line-height: 1.3;
  scroll-margin-top: 6rem;
}

.post-body h2 {
  font-size: clamp(1.625rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-size: 1.4375rem;
  font-weight: 800;
}

.post-body h4 {
  font-size: 1.1875rem;
  font-weight: 700;
}

.post-body > * + h2 {
  margin-top: 3.5rem;
}

.post-body > * + h3,
.post-body > * + h4 {
  margin-top: 2.75rem;
}

.post-body h2 + *,
.post-body h3 + * {
  margin-top: 1.875rem;
}

.post-body ul,
.post-body ol {
  padding-inline-start: 1.5rem;
  display: grid;
  gap: 0.625rem;
}

.post-body ul li::marker {
  color: var(--purple);
}

.post-body ol li::marker {
  color: var(--purple);
  font-weight: 800;
}

.post-body ul + *,
.post-body ol + *,
.post-body figure + *,
.post-body img + *,
.post-body iframe + *,
.post-body .wp-caption + *,
.post-body .gallery + *,
.post-body .wp-video + *,
.post-body blockquote + * {
  margin-top: 1.875rem;
}

.post-body * + ul,
.post-body * + ol,
.post-body * + figure,
.post-body * + .wp-caption,
.post-body * + .gallery,
.post-body * + iframe {
  margin-top: 1.875rem;
}

.post-body strong {
  color: var(--ink);
  font-weight: 700;
}

.post-body a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.2em;
}

.post-body a:hover {
  color: var(--purple);
}

.post-body img {
  height: auto;
  border-radius: 0.625rem;
}

.post-body figure,
.post-body .wp-caption {
  max-width: 100%;
}

.post-body figcaption,
.post-body .wp-caption-text {
  margin-top: 0.625rem;
  font-size: 0.875rem;
  color: var(--ink-40);
  text-align: center;
}

.post-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 0.625rem;
}

.post-body blockquote {
  position: relative;
  margin-inline: 0;
  padding: 1.75rem 2rem;
  padding-inline-start: 2.25rem;
  border-radius: 1.25rem;
  background: var(--blog-soft);
  font-size: 1.3125rem;
  line-height: 1.6;
  font-weight: 600;
  color: #0a0f3c;
}

.post-body blockquote::before {
  content: '';
  position: absolute;
  inset-block: 1.25rem;
  inset-inline-start: 0;
  width: 0.25rem;
  border-radius: 1rem;
  background: var(--grad);
}

.post-body blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-style: normal;
  color: var(--ink-40);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.post-body th,
.post-body td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--stroke);
  text-align: start;
}

.post-body th {
  background: var(--blog-soft);
  font-weight: 700;
}

.post-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}

.post-tags a {
  display: block;
  padding: 0.375rem 0.875rem;
  border-radius: 62.4375rem;
  border: 0.0625rem solid var(--stroke);
  font-size: 0.875rem;
  color: var(--ink-62);
  text-decoration: none;
}

.post-tags a:hover {
  color: var(--purple);
  border-color: rgba(123, 47, 240, 0.3);
}

/* CTA box at end of article */
.post-cta {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding: 2.25rem 2.5rem;
  border-radius: 1.75rem;
  background: #0a0f3c;
  color: #fff;
  overflow: hidden;
}

@media (max-width: 47rem) {
  .post-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 2rem 1.5rem;
  }
}

.post-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(22rem 12rem at 100% 0%, rgba(123, 47, 240, 0.55), transparent 70%),
    radial-gradient(20rem 12rem at 0% 100%, rgba(22, 184, 160, 0.45), transparent 70%);
}

.post-cta-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
}

.post-cta-text p + p {
  margin-top: 0.375rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.0625rem;
}

.post-cta .btn-grad-outline {
  flex-shrink: 0;
  padding: 0.875rem 2rem;
  text-decoration: none;
}

.post-cta .btn-grad-outline .in {
  justify-content: center;
}

.post-cta .btn-grad-outline i {
  font-style: normal;
}

/* Related posts */
.post-related {
  padding: 5.5rem 0 7rem;
  background: linear-gradient(180deg, var(--blog-soft), #fff);
}

@media (max-width: 47rem) {
  .post-related {
    padding: 3.5rem 0 4.5rem;
  }
}

.post-related-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.post-related-head h2 {
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  font-weight: 800;
  color: #0a0f3c;
  letter-spacing: -0.01em;
}

.post-related-head a {
  font-weight: 700;
  color: #0a0f3c;
  text-decoration: none;
  white-space: nowrap;
}
