/* =========================
   BLOG POST PAGE
   ========================= */

.blog-post-page {
  width: 100%;
  min-height: calc(100vh - var(--header-height, 72px));
  padding: 72px 24px 96px;
  background:
    radial-gradient(circle at 18% 8%, rgba(247, 37, 168, 0.12), transparent 30rem),
    radial-gradient(circle at 82% 18%, rgba(255, 138, 42, 0.08), transparent 28rem),
    linear-gradient(
      180deg,
      var(--color-background) 0%,
      var(--color-background-soft) 48%,
      var(--color-background) 100%
    );
  color: var(--color-text);
}

.blog-post-page *,
.blog-post-page *::before,
.blog-post-page *::after {
  box-sizing: border-box;
}

.blog-post {
  width: min(100%, 1120px);
  margin-inline: auto;
}

/* =========================
   HERO
   ========================= */

.blog-post-hero {
  margin-bottom: 42px;
  text-align: center;
}

.blog-post-breadcrumb {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.blog-post-breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 160ms ease;
}

.blog-post-breadcrumb a:hover {
  color: var(--color-secondary);
}

.blog-post-breadcrumb span:last-child {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-post-heading {
  width: min(100%, 860px);
  margin-inline: auto;
}

.blog-post-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--color-primary);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.blog-post-heading h1 {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.blog-post-abstract {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--color-text-muted);
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.75;
}

.blog-post-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 26px;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.blog-post-meta span {
  display: inline-flex;
  align-items: center;
}

.blog-post-meta span:not(:first-child)::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 14px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(247, 37, 168, 0.12);
}

/* =========================
   COVER
   ========================= */

.blog-post-cover {
  width: 100%;
  margin: 0 0 54px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.blog-post-cover img {
  display: block;
  width: 100%;
  height: clamp(280px, 46vw, 520px);
  object-fit: cover;
  filter: saturate(0.96) contrast(1.02);
}

/* =========================
   LAYOUT
   ========================= */

.blog-post-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* =========================
   SIDEBAR
   ========================= */

.blog-post-sidebar {
  position: sticky;
  top: calc(var(--header-height, 72px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.blog-post-sidebar-card,
.blog-post-cta-card {
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--color-surface) 90%, transparent),
      color-mix(in srgb, var(--color-surface) 68%, transparent)
    );
  box-shadow: var(--shadow-soft);
}

.blog-post-sidebar-card {
  padding: 22px;
}

.blog-post-sidebar-label {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.blog-post-sidebar-item {
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
}

.blog-post-sidebar-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text);
  font-size: 0.84rem;
}

.blog-post-sidebar-item span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-post-tags span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(247, 37, 168, 0.18);
  background: rgba(247, 37, 168, 0.08);
  color: var(--color-primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.blog-post-cta-card {
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(247, 37, 168, 0.15), transparent 44%),
    radial-gradient(circle at bottom right, rgba(255, 138, 42, 0.10), transparent 44%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--color-surface) 88%, transparent),
      color-mix(in srgb, var(--color-surface) 64%, transparent)
    );
}

.blog-post-cta-card span {
  display: block;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.blog-post-cta-card p {
  margin: 10px 0 18px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.blog-post-cta-card a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 850;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.blog-post-cta-card a:hover {
  transform: translateY(-2px);
  background: var(--color-secondary);
  box-shadow: 0 16px 34px rgba(255, 138, 42, 0.18);
}

/* =========================
   CONTENT
   ========================= */

.blog-post-content {
  min-width: 0;
  padding: 44px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--color-surface) 92%, transparent),
      color-mix(in srgb, var(--color-surface) 74%, transparent)
    );
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  font-size: 1.02rem;
  line-height: 1.85;
}

.blog-post-content > *:first-child {
  margin-top: 0;
}

.blog-post-content > *:last-child {
  margin-bottom: 0;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.blog-post-content h2 {
  margin: 48px 0 18px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.blog-post-content h3 {
  margin: 36px 0 14px;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
}

.blog-post-content h4 {
  margin: 28px 0 12px;
  font-size: 1.16rem;
}

.blog-post-content p {
  margin: 0 0 22px;
  color: var(--color-text-muted);
}

.blog-post-content strong {
  color: var(--color-text);
  font-weight: 850;
}

.blog-post-content a {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 37, 168, 0.28);
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.blog-post-content a:hover {
  color: var(--color-secondary);
  border-color: rgba(255, 138, 42, 0.45);
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 0 0 26px;
  padding-left: 1.35rem;
  color: var(--color-text-muted);
}

.blog-post-content li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.blog-post-content li::marker {
  color: var(--color-primary);
  font-weight: 900;
}

.blog-post-content blockquote {
  margin: 34px 0;
  padding: 24px 26px;
  border-left: 4px solid var(--color-primary);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(247, 37, 168, 0.09),
      rgba(255, 138, 42, 0.06)
    );
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.75;
}

.blog-post-content blockquote p {
  color: var(--color-text);
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.blog-post-content figure {
  margin: 34px 0;
}

.blog-post-content figcaption {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-size: 0.84rem;
  text-align: center;
}

.blog-post-content code {
  padding: 3px 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-tertiary) 12%, transparent);
  color: var(--color-primary);
  font-size: 0.92em;
}

.blog-post-content pre {
  overflow-x: auto;
  margin: 30px 0;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--color-tertiary);
  color: #ffffff;
  font-size: 0.92rem;
  line-height: 1.65;
}

.blog-post-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.blog-post-content table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  font-size: 0.92rem;
}

.blog-post-content th,
.blog-post-content td {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.blog-post-content th {
  background: rgba(247, 37, 168, 0.08);
  color: var(--color-text);
  font-weight: 850;
}

.blog-post-content td {
  color: var(--color-text-muted);
}

/* =========================
   FOOTER
   ========================= */

.blog-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 42px;
  padding-top: 30px;
  border-top: 1px solid var(--color-border);
}

.blog-post-back-link,
.blog-post-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 850;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.blog-post-back-link {
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
}

.blog-post-back-link::before {
  content: "←";
  margin-right: 9px;
  color: var(--color-primary);
}

.blog-post-back-link:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 37, 168, 0.28);
  color: var(--color-primary);
}

.blog-post-contact-link {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(247, 37, 168, 0.16);
}

.blog-post-contact-link:hover {
  transform: translateY(-2px);
  background: var(--color-secondary);
  box-shadow: 0 18px 38px rgba(255, 138, 42, 0.18);
}

/* =========================
   DARK THEME TUNING
   ========================= */

html[data-theme="dark"] .blog-post-sidebar-card,
html[data-theme="dark"] .blog-post-content {
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--color-surface) 92%, transparent),
      color-mix(in srgb, var(--color-surface) 72%, transparent)
    );
}

html[data-theme="dark"] .blog-post-cta-card {
  background:
    radial-gradient(circle at top left, rgba(247, 37, 168, 0.16), transparent 44%),
    radial-gradient(circle at bottom right, rgba(255, 138, 42, 0.10), transparent 44%),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--color-surface) 92%, transparent),
      color-mix(in srgb, var(--color-surface) 70%, transparent)
    );
}

html[data-theme="dark"] .blog-post-content pre {
  background: #111116;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 980px) {
  .blog-post-layout {
    grid-template-columns: 1fr;
  }

  .blog-post-sidebar {
    position: static;
    order: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-post-content {
    order: 1;
  }
}

@media (max-width: 760px) {
  .blog-post-page {
    padding: 54px 16px 76px;
  }

  .blog-post-hero {
    margin-bottom: 32px;
  }

  .blog-post-breadcrumb {
    justify-content: flex-start;
    overflow: hidden;
  }

  .blog-post-breadcrumb span:last-child {
    max-width: 220px;
  }

  .blog-post-heading {
    text-align: left;
  }

  .blog-post-heading h1 {
    font-size: clamp(2.15rem, 10vw, 3.35rem);
  }

  .blog-post-abstract {
    font-size: 1rem;
  }

  .blog-post-meta {
    justify-content: flex-start;
    gap: 10px 16px;
  }

  .blog-post-meta span:not(:first-child)::before {
    display: none;
  }

  .blog-post-cover {
    margin-bottom: 34px;
    border-radius: 20px;
  }

  .blog-post-cover img {
    height: 260px;
  }

  .blog-post-content {
    padding: 30px 22px;
    border-radius: 20px;
    font-size: 1rem;
  }

  .blog-post-sidebar {
    grid-template-columns: 1fr;
  }

  .blog-post-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-post-back-link,
  .blog-post-contact-link {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .blog-post-page {
    padding: 44px 12px 64px;
  }

  .blog-post-cover img {
    height: 220px;
  }

  .blog-post-content {
    padding: 26px 18px;
  }

  .blog-post-content h2 {
    margin-top: 38px;
  }

  .blog-post-sidebar-card,
  .blog-post-cta-card {
    border-radius: 18px;
  }
}