/*
 * Blog post redesign (/blog/<post>/), loaded after style_index_min.css. Every rule is scoped to main.sd-post.
 * Large cover with the post picture, a comfortable reading column, a sticky side column (table of contents
 * and About card), the shared persona cards block and the recent posts as cards at the end.
 */

/* ------------------------------------------------------------------ Tokens */

.sd-post {
  --sd-text: #1B2333;
  --sd-body: #344055;
  --sd-muted: #5F6A7D;
  --sd-line: #E3E8EF;
  --sd-ground: #F2F4F7;
  --sd-card: #FFFFFF;
  --sd-navy: #111827;
  --sd-green: #50D878;
  --sd-green-text: #157A43;
  --sd-reading: 44rem;
  --sd-radius: 1rem;
  --sd-shadow: 0 1px 2px rgba(27, 35, 51, 0.06), 0 12px 28px -16px rgba(27, 35, 51, 0.35);
  display: flow-root;
  background: var(--sd-ground);
  color: var(--sd-text);
}

/* style_index_min.css gives every section a 100px bottom margin; spacing here is set per block */
.sd-post section {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ Cover */

.sd-post-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 30rem;
  padding: 6rem 0 3rem;
  background: var(--sd-navy) var(--sd-post-picture) center / cover no-repeat;
}

/* Dark fade so the white title always reads over the picture */
.sd-post-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.35) 0%, rgba(17, 24, 39, 0.6) 45%, rgba(17, 24, 39, 0.95) 100%);
}

.sd-post-cover-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.sd-post-category {
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  background: var(--sd-green);
  color: var(--sd-navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sd-post-title {
  max-width: 52rem;
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
  color: #FFFFFF;
  text-wrap: balance;
}

.sd-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 1.25rem;
  margin: 0;
  font-size: 0.9375rem;
  color: #C9D2E0;
}

.sd-post-meta a {
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
}

.sd-post-meta a:hover,
.sd-post-meta a:focus-visible {
  color: var(--sd-green);
}

.sd-post-reading i {
  margin-right: 0.25rem;
  color: var(--sd-green);
}

/* Share: round icon buttons and the copy-link pill */
.sd-post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.sd-post-share-label {
  margin-right: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C9D2E0;
}

.sd-post-share a,
.sd-post-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.sd-post-share a:hover,
.sd-post-share a:focus-visible,
.sd-post-share-link:hover,
.sd-post-share-link:focus-visible {
  border-color: var(--sd-green);
  background: var(--sd-green);
  color: var(--sd-navy);
  transform: translateY(-2px);
}

/* ------------------------------------------------------------------ Reading column and side column */

.sd-post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--sd-reading)) minmax(0, 20rem);
  justify-content: center;
  gap: 3.5rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.sd-post-article {
  min-width: 0;
  padding: 2.5rem 3rem;
  border: 1px solid var(--sd-line);
  border-radius: 1.25rem;
  background: var(--sd-card);
  box-shadow: var(--sd-shadow);
}

/* Post text: larger type and generous line height */
.sd-post-article .blog-post-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--sd-body);
}

.sd-post-article .blog-post-text p {
  margin-bottom: 1.25rem;
}

.sd-post-article .blog-post-text a {
  color: var(--sd-green-text);
  font-weight: 600;
}

.sd-post-article .blog-post-text img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.sd-post-section {
  margin-top: 2.5rem;
  scroll-margin-top: 6rem;
}

.sd-post-section-title {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 4px solid var(--sd-green);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--sd-text);
  scroll-margin-top: 6rem;
}

/* Bold lines used as sub-headings inside the text (marked by blog_post.js) */
.sd-post-article .sd-post-subhead {
  display: inline-block;
  margin-top: 0.75rem;
  padding-left: 0.875rem;
  border-left: 4px solid var(--sd-green);
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--sd-text);
  scroll-margin-top: 6rem;
}

.sd-post-section-img {
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 0.875rem;
  box-shadow: var(--sd-shadow);
}

/* Side column: stays in view while reading */
.sd-post-side {
  min-width: 0;
}

.sd-post-side-sticky {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sd-post-side-title {
  margin: 0 0 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sd-green-text);
}

.sd-post-toc,
.sd-post-about {
  padding: 1.375rem;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: var(--sd-card);
  box-shadow: var(--sd-shadow);
}

/* Table of contents: the section being read is marked in green */
.sd-post-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sd-toc;
}

.sd-post-toc-list li {
  counter-increment: sd-toc;
}

.sd-post-toc-list a {
  display: flex;
  gap: 0.625rem;
  padding: 0.4375rem 0.625rem;
  border-left: 2px solid var(--sd-line);
  color: var(--sd-muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.sd-post-toc-list a::before {
  content: counter(sd-toc, decimal-leading-zero);
  font-weight: 700;
  color: #9AA5B5;
}

.sd-post-toc-list a:hover,
.sd-post-toc-list a:focus-visible {
  color: var(--sd-text);
}

.sd-post-toc-list a.is-current {
  border-left-color: var(--sd-green);
  background: rgba(80, 216, 120, 0.1);
  color: var(--sd-text);
  font-weight: 600;
}

.sd-post-toc-list a.is-current::before {
  color: var(--sd-green-text);
}

/* About card on the dark navy, as the other dark panels */
.sd-post-about {
  border-color: var(--sd-navy);
  background: var(--sd-navy);
  background-image: radial-gradient(ellipse 80% 120% at 100% 0%, rgba(80, 216, 120, 0.18) 0%, transparent 70%);
}

.sd-post-about .sd-post-side-title {
  color: var(--sd-green);
}

.sd-post-about p {
  margin: 0 0 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #C9D2E0;
}

.sd-post-about-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  --sd-btn-font-size: 1rem;
  --sd-btn-secondary-color: #FFFFFF;
}

.sd-post-about-actions .btn {
  width: 100%;
}

/* Book a Demo outlined in white on the dark card */
.sd-post-about-actions .google-analytics-calendly:is(:hover, :focus-visible, :active) {
  color: var(--sd-navy) !important;
}

/* ------------------------------------------------------------------ More posts */

.sd-post-more {
  padding: 0 0 1rem;
}

.sd-post-more-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--sd-text);
}

.sd-post-more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.sd-post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--sd-radius);
  background: var(--sd-card);
  color: var(--sd-text);
  text-decoration: none;
  box-shadow: var(--sd-shadow);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}

.sd-post-card:hover,
.sd-post-card:focus-visible {
  color: var(--sd-text);
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(27, 35, 51, 0.06), 0 28px 48px -20px rgba(27, 35, 51, 0.5);
}

.sd-post-card-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  background-color: #E8ECF1;
  background-position: center;
  background-size: cover;
}

.sd-post-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.125rem 1.25rem;
}

.sd-post-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  transition: color .2s ease;
}

.sd-post-card:hover .sd-post-card-title {
  color: var(--sd-green-text);
}

.sd-post-card small {
  font-size: 0.75rem;
  color: var(--sd-muted);
}

/* ------------------------------------------------------------------ Communities (shared include) */

.sd-post-community section > .container {
  max-width: 1200px;
  margin-top: 3.5rem !important;
  margin-bottom: 4.5rem !important;
}

.sd-post-community .lp-bg-gray-100 {
  background: #FFFFFF !important;
  border: 1px solid var(--sd-line);
  border-radius: 1.25rem !important;
  box-shadow: var(--sd-shadow);
}

.sd-post-community a.google-analytics-whatsapp.btn {
  color: #FFFFFF;
  background: #25D366;
  border-color: #25D366;
  font-weight: 700;
}

.sd-post-community a.google-analytics-whatsapp.btn:hover,
.sd-post-community a.google-analytics-whatsapp.btn:focus-visible {
  color: #FFFFFF;
  background: #1EBE5A;
  border-color: #1EBE5A;
}

.sd-post-community a.google-analytics-whatsapp.btn > div {
  background: rgba(255, 255, 255, 0.22) !important;
}

/* ------------------------------------------------------------------ Small screens */

@media (max-width: 1099.98px) {
  .sd-post-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--sd-reading);
    gap: 1.5rem;
  }

  /* Table of contents above the post, the rest of the side column after it */
  .sd-post-side {
    display: contents;
  }

  .sd-post-side-sticky {
    display: contents;
  }

  .sd-post-toc { order: -1; }
  .sd-post-about { order: 1; }
}

@media (max-width: 767.98px) {
  .sd-post-cover {
    min-height: 24rem;
    padding: 4rem 0 2rem;
  }

  .sd-post-article {
    padding: 1.5rem 1.25rem;
  }

  .sd-post-article .blog-post-text {
    font-size: 1.0625rem;
    line-height: 1.75;
  }

  .sd-post-section-title {
    font-size: 1.25rem;
  }

  .sd-post-more-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-post-share a,
  .sd-post-share-link,
  .sd-post-card {
    transition: none;
  }

  .sd-post-share a:hover,
  .sd-post-share-link:hover,
  .sd-post-card:hover {
    transform: none;
  }
}
