/* Business Builder article template.
   Independent copy of the CRM-Lab article page styles.
   Do not import this file from CRM-Lab pages. */

:root {
  --accent: #a54e3d;
  --accent-hover: #8a4032;
  --ink: #402c25;
  --muted: #6e5a52;
  --bg: #faf5ef;
  --surface: #fefdf9;
  --surface-2: #f3e5dc;
  --line: #e6d4c8;
  --white: #fefdf9;
  --shadow: 0 18px 50px rgba(64, 44, 37, 0.08);
  --radius: 22px;
  --header-h: 84px;
  --header-logo-h: 48px;
  --header-gap: 20px;
  --header-nav-gap: 6px 18px;
  --header-nav-size: 15px;
  --header-nav-pad: 10px 4px;
  --container: 1180px;
  --font: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: clip;
}

h1,
h2,
h3 {
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -40px;
  z-index: 80;
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transform: translateY(0);
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--white);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(250, 245, 239, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(64, 44, 37, 0.06);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--header-gap);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  line-height: 1;
  margin-left: max(0px, calc((100% - 1076px) / 2));
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  display: block;
  width: 32px;
  height: 28px;
  flex: 0 0 auto;
}

.logo-wordmark {
  display: inline-flex;
  align-items: center;
  height: var(--header-logo-h);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--header-nav-gap);
  flex-wrap: nowrap;
}

.site-nav a:not(.btn) {
  font-weight: 700;
  font-size: var(--header-nav-size);
  line-height: 1.6;
  color: var(--ink);
  text-decoration: none;
  padding: var(--header-nav-pad);
  white-space: nowrap;
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  padding: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: var(--ink);
  transition: 0.2s ease;
}

body.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-cta-mobile {
  display: none;
}

.section-head {
  max-width: 760px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.site-footer {
  background: var(--ink);
  color: #f3e5dc;
  padding: 48px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(254, 253, 249, 0.16);
  margin-bottom: 20px;
}

.site-footer a.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 0;
  color: var(--white);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-decoration: none;
}

.footer-logo .logo-mark {
  width: 28px;
  height: 24px;
}

.footer-brand p {
  margin: 14px 0 0;
  max-width: 28ch;
  font-size: 14px;
  line-height: 1.55;
}

.site-footer h4 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a {
  display: block;
  margin-bottom: 8px;
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.footer-logo {
  margin-bottom: 0;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--ink);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
}

.article-hero {
  padding: 28px 0 0;
  width: min(1076px, 100%);
  margin-inline: auto;
}

.article-hero .breadcrumbs {
  margin-bottom: 0;
}

.article-lead {
  margin: 0 0 22px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink);
}

.article-audience {
  margin: -12px 0 28px;
  max-width: 40rem;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.article-audience b {
  color: var(--ink);
  font-weight: 700;
}

.bb-article-figure {
  margin: 8px 0 28px;
}

.bb-article-figure img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: var(--bg);
}

.bb-article-figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.bb-figure-data {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.article-content > h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.article-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0 0 36px;
}

.article-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.article-fact svg {
  flex-shrink: 0;
  color: var(--accent);
}

.article-fact b {
  color: var(--ink);
  font-weight: 700;
}

.article-main {
  padding: 24px 0 72px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 760px);
  gap: 48px 56px;
  align-items: start;
  width: min(1076px, 100%);
  margin-inline: auto;
}

.article-side-column {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: calc(16px * 1.7);
  min-width: 0;
}

.article-tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.article-tagline a {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.article-tagline a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: calc(100svh - var(--header-h) - 72px);
  overflow: hidden;
}

.article-toc {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.article-toc::-webkit-scrollbar {
  width: 4px;
}

.article-toc::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}

.article-offers {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.article-next {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(165, 78, 61, 0.22);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-align: left;
}

.article-next-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.article-next-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.article-next-action {
  width: 100%;
  margin-top: 4px;
}

.article-content {
  min-width: 0;
}

.article-toc-label,
.article-toc-mobile summary {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-toc ul,
.article-toc-mobile ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc a,
.article-toc-mobile a {
  display: block;
  padding: 7px 0 7px 12px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.article-toc a:hover,
.article-toc-mobile a:hover,
.article-toc a.is-active,
.article-toc-mobile a.is-active {
  color: var(--accent);
}

.article-toc a.is-active,
.article-toc-mobile a.is-active {
  border-left-color: var(--accent);
}

.article-toc-mobile {
  display: none;
  margin: 8px 0 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.article-toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}

.article-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.article-toc-mobile summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 200ms ease;
}

.article-toc-mobile[open] summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
}

.article-toc-mobile nav {
  padding: 0 16px 14px;
}

.article-body {
  min-width: 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
}

.article-body h2 {
  margin: 48px 0 16px;
  font-size: clamp(26px, 2.8vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.2;
  scroll-margin-top: calc(var(--header-h) + 20px);
  color: var(--ink);
}

.article-body h3 {
  margin: 28px 0 12px;
  font-size: clamp(22px, 2.2vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 20px);
  color: var(--ink);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body p:last-child,
.article-body ul:last-child,
.article-body ol:last-child {
  margin-bottom: 0;
}

.article-body strong {
  font-weight: 700;
}

.article-body a {
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--accent);
}

.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.article-body ul li {
  position: relative;
  padding: 6px 0 6px 20px;
}

.article-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.article-body ol {
  counter-reset: article-ol;
}

.article-body ol li {
  counter-increment: article-ol;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 8px;
  padding: 8px 0;
}

.article-body ol li > * {
  min-width: 0;
}

.article-body ol li::before {
  content: counter(article-ol);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding-top: 3px;
}

.article-formula {
  margin: 8px 0 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.article-definition {
  margin: 8px 0 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.article-table-wrap {
  margin: 8px 0 28px;
  overflow-x: auto;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.article-table th,
.article-table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
}

.related-section {
  padding: 72px 0 80px;
  background: var(--surface-2);
}

.related-section .section-head {
  margin-bottom: 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.related-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  border: 1px solid rgba(64, 44, 37, 0.06);
  box-shadow: 0 10px 30px rgba(64, 44, 37, 0.04);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(64, 44, 37, 0.08);
}

.related-card:hover h3 {
  color: var(--accent);
}

.related-card h2,
.related-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}

.related-card h3 a {
  color: inherit;
  text-decoration: none;
}

.related-card h3 a:hover {
  color: var(--accent);
}

.related-card .related-level {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.related-card .related-how {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.related-card .related-desc {
  margin-top: 10px;
}

.bb-article-figure .bb-figure-open {
  display: inline-block;
  margin-top: 8px;
}

.related-card .text-link {
  margin-top: auto;
  padding-top: 18px;
  font-size: 15px;
}

.related-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}

.text-link:hover {
  color: var(--accent-hover);
}

.related-all {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.related-all .text-link {
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  .related-card:hover,
  .btn:hover {
    transform: none;
  }
}

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

  .nav-toggle {
    display: block;
  }

  .header-cta {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    width: 100%;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(64, 44, 37, 0.12);
    padding: 8px 20px 20px;
    flex-direction: column;
    align-items: stretch;
    z-index: 55;
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .site-nav a:not(.btn) {
    padding: 12px 4px;
    white-space: normal;
  }

  .nav-cta-mobile {
    display: flex;
    width: 100%;
    margin-top: 12px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article-side-column {
    display: contents;
  }

  .article-tagline {
    order: 1;
  }

  .article-content {
    order: 2;
  }

  .article-sidebar {
    order: 3;
    position: static;
    top: auto;
    z-index: auto;
    max-height: none;
    overflow: visible;
  }

  .article-toc {
    display: none;
  }

  .article-toc-mobile {
    display: block;
  }

  .related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-body {
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container), calc(100% - 28px));
  }

  .btn {
    width: 100%;
  }

  :root {
    --header-logo-h: 40px;
  }

  .logo-wordmark {
    font-size: 15px;
  }

  .logo-mark {
    width: 28px;
    height: 24px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-formula {
    padding: 16px 18px;
    font-size: 18px;
  }

  .related-all .text-link {
    width: auto;
  }
}
