/* Better Site blog. Shared editorial styles layered over the main site CSS. */
.blog-main {
  min-height: 70vh;
}

.blog-hero {
  padding: clamp(64px, 9vw, 112px) 0 clamp(42px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.055) 0 1px, transparent 1px) calc(50% - 590px) 0 / 100% 100% no-repeat,
    linear-gradient(180deg, #f8fbf9 0%, #f2f7f4 100%);
}

.blog-hero-inner {
  max-width: 880px;
}

.blog-hero .eyebrow,
.article-category,
.blog-card-category {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 6.6vw, 6.35rem);
  line-height: 0.9;
  letter-spacing: -0.062em;
}

.blog-hero p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
}

.blog-index-section {
  padding: clamp(48px, 7vw, 88px) 0 clamp(76px, 9vw, 116px);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 34px);
}

.blog-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 42, 58, 0.075);
}

.blog-card-image-link {
  display: block;
  overflow: hidden;
  background: var(--bg-soft);
}

.blog-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
  transition: transform 280ms ease;
}

.blog-card:focus-within img,
.blog-card:hover img {
  transform: scale(1.018);
}

.blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(22px, 3vw, 32px);
}

.blog-card-category,
.article-category {
  color: var(--teal);
}

.blog-card h2,
.related-card h3 {
  margin: 12px 0 14px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.blog-card h2 a:hover,
.blog-card h2 a:focus-visible,
.related-card h3 a:hover,
.related-card h3 a:focus-visible {
  color: var(--blue-dark);
}

.blog-card-excerpt {
  margin-bottom: 22px;
  color: var(--muted-strong);
}

.blog-card-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.blog-card-meta {
  margin-top: auto;
}

.blog-card-meta span[aria-hidden="true"],
.article-meta span[aria-hidden="true"] {
  color: var(--line-strong);
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 15px;
  color: var(--blue-dark);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.34);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.article-header {
  padding: clamp(38px, 6vw, 70px) 0 clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbf9 0%, var(--studio-paper) 100%);
}

.article-head-inner {
  max-width: 970px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 clamp(28px, 4vw, 44px);
  color: var(--muted);
  font-size: 0.84rem;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue-dark);
  font-weight: 800;
}

.breadcrumbs span:last-child {
  overflow: hidden;
  max-width: min(520px, 68vw);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-header h1 {
  max-width: 940px;
  margin: 14px 0 22px;
  font-size: clamp(2.75rem, 6.2vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.062em;
}

.article-meta {
  color: var(--muted-strong);
  font-weight: 680;
}

.article-shell {
  padding: clamp(34px, 5vw, 58px) 0 clamp(82px, 10vw, 126px);
}

.article-hero-image {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto clamp(38px, 6vw, 68px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-soft);
  box-shadow: var(--shadow-soft);
}

.article-hero-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
}

.article-layout {
  width: min(calc(100% - 40px), 780px);
  margin-inline: auto;
}

.article-lead {
  margin-bottom: clamp(32px, 5vw, 48px);
  padding-bottom: clamp(28px, 4vw, 42px);
  border-bottom: 1px solid var(--studio-rule);
}

.article-lead p {
  color: var(--ink);
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.72;
}

.article-lead p:first-child {
  font-weight: 720;
}

.article-content {
  color: var(--muted-strong);
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.78;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 110px;
}

.article-content h2 {
  margin: clamp(54px, 8vw, 78px) 0 20px;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.048em;
}

.article-content h3 {
  margin: 38px 0 14px;
  font-size: clamp(1.3rem, 2.4vw, 1.72rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.article-content p,
.article-content li {
  color: var(--muted-strong);
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content .table-scroll,
.article-content .checklist {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  display: grid;
  gap: 9px;
  padding-left: 1.35rem;
}

.article-content li::marker {
  color: var(--teal);
  font-weight: 900;
}

.article-content a:not(.btn),
.article-lead a {
  color: var(--blue-dark);
  font-weight: 780;
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.38);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.article-content a:not(.btn):hover,
.article-content a:not(.btn):focus-visible,
.article-lead a:hover,
.article-lead a:focus-visible {
  text-decoration-color: currentColor;
}

.toc {
  margin: 0 0 clamp(42px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.toc summary {
  min-height: 50px;
  padding: 14px 18px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.toc nav {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.toc ol {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 1.25rem;
}

.toc a {
  display: inline-block;
  padding-block: 3px;
  color: var(--blue-dark);
  font-size: 0.92rem;
  font-weight: 760;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.article-content table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

.article-content th,
.article-content td {
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  color: var(--ink);
  background: var(--bg-soft);
  font-weight: 900;
}

.checklist {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.checklist-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 15px;
  color: var(--muted-strong);
}

.checklist-row + .checklist-row {
  border-top: 1px solid var(--line);
}

.checklist-box {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  border: 2px solid var(--teal);
  border-radius: 3px;
  background: var(--bg-soft);
}

.article-cta {
  margin: clamp(48px, 7vw, 72px) 0;
  padding: clamp(25px, 5vw, 38px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  background: linear-gradient(150deg, #edf7f3, #fff 70%);
}

.article-cta .eyebrow {
  margin-bottom: 9px;
}

.article-cta h2 {
  margin: 0 0 13px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.04;
}

.article-cta p {
  max-width: 640px;
  margin-bottom: 20px;
}

.article-cta-final {
  margin-bottom: 0;
  border-left-color: var(--gold);
  background: var(--studio-dark);
}

.article-cta-final h2,
.article-cta-final p,
.article-cta-final .eyebrow {
  color: #fff;
}

.related-guides {
  margin-top: clamp(58px, 8vw, 88px);
  padding-top: clamp(38px, 6vw, 56px);
  border-top: 1px solid var(--studio-rule);
}

.related-guides > h2 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.045em;
}

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

.related-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.related-card h3 {
  margin: 10px 0 12px;
  font-size: 1.12rem;
  line-height: 1.18;
}

.related-card .blog-card-link {
  margin-top: auto;
}

.author-note {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.author-initial {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.author-note strong,
.author-note span {
  display: block;
}

.author-note span {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 1080px) {
  .primary-nav .blog-nav-link {
    display: block;
  }
}

@media (max-width: 760px) {
  .blog-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .blog-hero h1,
  .article-header h1 {
    overflow-wrap: anywhere;
  }

  .article-hero-image,
  .article-layout {
    width: min(calc(100% - 28px), 780px);
  }

  .article-content table {
    min-width: 590px;
  }

  .related-card {
    min-height: 184px;
  }
}

@media (max-width: 370px) {
  .blog-card-body,
  .related-card {
    padding: 18px;
  }

  .article-content table {
    min-width: 540px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card img {
    transition: none;
  }
}
