/*
Theme Name: StartupAdvisory Blog
Theme URI: https://startupsadvisory.ai/
Author: StartupAdvisory.ai
Description: Production blog theme aligned with StartupAdvisory.ai brand shell — insights listing, single posts with auto TOC, and Yoast SEO compatibility.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: startupadvisoryblog
*/

/* --- Design tokens (from startupsadvisory.ai computed styles) --- */
:root {
  --sa-bg: #ffffff;
  --sa-surface: #ffffff;
  --sa-off: #f9f9fd;
  --sa-lavender: #f2f2fb;
  --sa-lavender-mid: #eaeaf8;
  --sa-ink: #14142a;
  --sa-black: #1a1a2e;
  --sa-text: #2d2d44;
  --sa-body: #3d3d58;
  --sa-muted: #7b7b96;
  --sa-midnight: #454da1;
  --sa-midnight-deep: #2f3680;
  --sa-midnight-d: #363d88;
  --sa-teal: #21bfcf;
  --sa-teal-border: #7dd8e8;
  --sa-green: #16a34a;
  --sa-border: rgba(69, 77, 161, 0.1);
  --sa-border-m: rgba(69, 77, 161, 0.18);
  --sa-shadow-sm: 0 2px 12px rgba(69, 77, 161, 0.08);
  --sa-shadow-md: 0 8px 32px rgba(69, 77, 161, 0.12);
  --sa-radius: 10px;
  --sa-radius-lg: 16px;
  --sa-container: min(1200px, calc(100% - 40px));
  --sa-font: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --sa-header-offset: 96px;
  --sa-sticky-top: calc(var(--sa-header-offset) + 16px);
  --sa-sticky-bottom-gap: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.sa-blog {
  margin: 0;
  font-family: var(--sa-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--sa-text);
  background: var(--sa-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--sa-midnight);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--sa-midnight-deep);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  clip: auto;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: var(--sa-ink);
  color: #fff;
  z-index: 100000;
  left: 8px;
  top: 8px;
}

.sa-container {
  width: var(--sa-container);
  margin-inline: auto;
}

.sa-blog-main {
  padding-top: calc(var(--sa-header-offset) + 12px);
}

.sa-blog-main.sa-blog-index,
.sa-blog-main.sa-single {
  padding-top: 0;
}

/* StartupAdvisory header shell (match live nav pill + CTA) */
body.sa-blog nav#nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(96%, 1200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 8px 32px rgba(69, 77, 161, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  align-items: center;
  gap: 8px;
}

body.sa-blog nav#nav.scrolled {
  top: 12px;
  background: rgba(255, 255, 255, 0.92);
}

body.sa-blog nav#nav .logo1 {
  width: 180px;
  height: auto;
  max-height: 28px;
}

body.sa-blog nav#nav .nav-links > li > a {
  font-size: 14px;
  font-weight: 500;
  color: var(--sa-text);
  text-decoration: none;
}

body.sa-blog nav#nav a.nav-cta,
body.sa-blog nav#nav .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  background: linear-gradient(135deg, #454da1 0%, #21bfcf 100%);
  box-shadow: 0 4px 16px rgba(33, 191, 207, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.sa-blog nav#nav a.nav-cta:hover,
body.sa-blog nav#nav .nav-cta:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(33, 191, 207, 0.35);
}

@media (max-width: 900px) {
  body.sa-blog nav#nav .logo1 {
    width: 140px;
  }
}

/* Blog hero — full-width band from top of page (behind fixed header) */
.blog-hero {
  background: linear-gradient(180deg, var(--sa-lavender) 0%, var(--sa-bg) 100%);
  border-bottom: 1px solid var(--sa-border);
  padding: calc(24px + var(--sa-header-offset) + 12px) 0 40px;
  margin: 0;
}

.sa-blog-index .blog-hero .sa-breadcrumbs,
.single-hero .sa-breadcrumbs {
  margin: 0 0 0;
}

.single-hero {
  background: linear-gradient(180deg, var(--sa-lavender) 0%, var(--sa-bg) 100%);
  border-bottom: 1px solid var(--sa-border);
  padding: calc(24px + var(--sa-header-offset) + 8px) 0 18px;
}

.blog-hero__eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sa-midnight);
}

.blog-hero__title {
  margin: 0 0 12px;
  max-width: 18ch;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--sa-black);
}

.blog-hero__lead {
  margin: 0;
  max-width: 62ch;
  color: var(--sa-body);
  font-size: 1.05rem;
}

/* Blog grid & cards */
.blog-archive {
  padding: 40px 0 72px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: var(--sa-radius-lg);
  box-shadow: var(--sa-shadow-sm);
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
  box-shadow: var(--sa-shadow-md);
  transform: translateY(-2px);
}

.blog-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sa-lavender);
  flex-shrink: 0;
}

.blog-card__media .blog-card__image,
.blog-card__media img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

.blog-card__image,
.single-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 24px;
  gap: 10px;
}

.blog-card__category {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sa-midnight);
  color: #fff !important;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.blog-card__category:hover {
  background: var(--sa-midnight-deep);
  color: #fff !important;
}

.blog-card__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sa-black);
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-card__title a:hover {
  color: var(--sa-midnight);
}

.blog-card__date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--sa-muted);
}

.blog-card__date-icon {
  color: var(--sa-midnight);
  flex-shrink: 0;
}

.blog-card__excerpt {
  margin: 0;
  color: var(--sa-body);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__cta {
  margin-top: auto;
  font-weight: 600;
  color: var(--sa-black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  align-self: flex-start;
}

.blog-card__cta:hover {
  color: var(--sa-midnight);
}

.blog-pagination {
  margin-top: 48px;
}

.blog-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  min-width: 40px;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--sa-border);
  text-decoration: none;
  color: var(--sa-text);
}

.blog-pagination .current {
  background: var(--sa-midnight);
  border-color: var(--sa-midnight);
  color: #fff;
}

.blog-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--sa-lavender);
  border-radius: var(--sa-radius-lg);
  color: var(--sa-body);
  font-size: 1.1rem;
}

/* Single post */
.single-wrap {
  padding: 24px 0 56px;
}

/* Override SA global `nav { position: fixed }` — breadcrumbs must stay in document flow */
.sa-breadcrumbs {
  position: static;
  display: block;
  width: auto;
  max-width: none;
  margin: 0 0 16px;
  padding: 0;
  transform: none;
  left: auto;
  top: auto;
  z-index: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sa-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--sa-muted);
}

.sa-breadcrumbs__item + .sa-breadcrumbs__item::before {
  content: "/";
  margin-right: 8px;
  color: var(--sa-border-m);
}

.sa-breadcrumbs__item a {
  color: var(--sa-midnight);
  text-decoration: none;
  font-weight: 500;
}

.sa-breadcrumbs__item a:hover {
  text-decoration: underline;
}

.sa-breadcrumbs__item--current span {
  color: var(--sa-body);
  font-weight: 500;
}

/* Single post — WD-style two column */
.single-layout {
  display: grid;
  gap: 36px 48px;
  align-items: start;
}

.single-layout--with-sidebar {
  grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
  align-items: stretch;
}

.sa-single .single-layout--with-sidebar > .single-sidebar {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  position: relative;
}

.sa-single .single-layout--with-sidebar > .single-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.single-layout--full {
  grid-template-columns: 1fr;
}

.single-layout--full .single-main {
  max-width: 860px;
  margin-inline: auto;
}

.single-sidebar {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.single-sidebar__sticky {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 1025px) {
  .sa-single .single-sidebar__sticky {
    max-height: calc(100vh - var(--sa-sticky-top) - var(--sa-sticky-bottom-gap));
    overflow: hidden;
  }

  .sa-single .single-sidebar__sticky.is-pinned-fixed {
    position: fixed;
    z-index: 5;
  }

  .sa-single .single-sidebar__sticky.is-pinned-end {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 5;
  }

  .sa-single .single-sidebar__sticky .single-summary--sidebar {
    flex: 0 0 auto;
  }

  .sa-single .single-sidebar__sticky .single-toc {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .sa-single .single-sidebar__sticky .single-toc__panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .sa-single .single-sidebar__sticky .single-toc__nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sa-single .single-sidebar .single-toc__list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(69, 77, 161, 0.35) transparent;
    padding-right: 4px;
  }

  .sa-single .single-sidebar .single-toc__list::-webkit-scrollbar {
    width: 6px;
  }

  .sa-single .single-sidebar .single-toc__list::-webkit-scrollbar-thumb {
    background: rgba(69, 77, 161, 0.28);
    border-radius: 999px;
  }

  .sa-single .single-sidebar .single-toc__list::-webkit-scrollbar-thumb:hover {
    background: rgba(69, 77, 161, 0.45);
  }
}

.single-sidebar__sticky > * {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  min-width: 0;
}

.single-sidebar__sticky .single-summary--sidebar {
  flex-shrink: 0;
}

.single-sidebar__sticky .single-toc {
  flex-shrink: 0;
}

.single-main {
  min-width: 0;
}

.single-main__date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--sa-muted);
}

.single-main__reading {
  color: var(--sa-muted);
  font-weight: 500;
}

.single-main__reading::before {
  content: "·";
  margin-right: 8px;
}

.single-main__category {
  margin-bottom: 12px;
}

.single-main__title {
  margin: 0 0 20px;
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--sa-black);
}

.single-main__media {
  margin-bottom: 28px;
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
  border: 1px solid var(--sa-border);
  box-shadow: var(--sa-shadow-sm);
}

.single-main__image {
  width: 100%;
  height: auto;
  display: block;
}

.single-sidebar__sticky .single-summary--sidebar,
.single-sidebar__sticky .single-toc {
  background: var(--sa-bg);
  border: 1px solid var(--sa-border);
  border-left: 4px solid var(--sa-teal-border);
  border-radius: var(--sa-radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--sa-shadow-sm);
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.single-summary__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sa-black);
}

.single-summary--sidebar p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--sa-body);
}

.single-toc {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.single-sidebar__sticky .single-toc__panel {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.single-toc__panel {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--sa-bg);
  border: 1px solid var(--sa-border);
  border-left: 4px solid var(--sa-teal-border);
  border-radius: var(--sa-radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--sa-shadow-sm);
}

.single-toc__heading {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sa-border);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sa-black);
  line-height: 1.3;
}

.single-toc__nav {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: static;
  transform: none;
  left: auto;
  top: auto;
  z-index: auto;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.single-toc__toggle {
  display: none;
}

.single-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

body.sa-single .single-sidebar .single-toc__list {
  display: block !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none;
  overflow-y: visible;
}

.single-toc__item {
  margin: 0 0 10px;
}

.single-toc__item--level-3 {
  padding-left: 12px;
  font-size: 0.92rem;
}

.single-toc__item--level-4 {
  padding-left: 22px;
  font-size: 0.88rem;
}

.single-toc__item a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: var(--sa-body);
  line-height: 1.45;
}

.single-toc__item a:hover .single-toc__text,
.single-toc__item a:hover .single-toc__num {
  color: var(--sa-midnight);
}

.single-toc__num {
  color: var(--sa-midnight);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 1.75rem;
}

.single-toc__text {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.single-article.entry-content {
  max-width: 820px;
  font-size: 1.05rem;
  color: var(--sa-body);
}

.single-article.entry-content > *:first-child {
  margin-top: 0;
}

.single-article.entry-content h2 {
  margin: 2.2em 0 0.75em;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--sa-black);
  line-height: 1.25;
}

.single-article.entry-content h3 {
  margin: 1.6em 0 0.6em;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sa-black);
}

.single-article.entry-content p,
.single-article.entry-content ul,
.single-article.entry-content ol {
  margin: 0 0 1.1em;
}

.single-article.entry-content a {
  color: var(--sa-midnight);
  font-weight: 500;
}

.single-article.entry-content blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--sa-midnight);
  background: var(--sa-off);
  color: var(--sa-text);
}

.single-article.entry-content img,
.single-article.entry-content figure {
  max-width: 100%;
}

.single-article.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.single-article.entry-content th,
.single-article.entry-content td {
  border: 1px solid var(--sa-border);
  padding: 10px 12px;
  text-align: left;
}

.single-article.entry-content pre,
.single-article.entry-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.single-article.entry-content pre {
  overflow-x: auto;
  padding: 16px;
  background: var(--sa-ink);
  color: #f5f5f5;
  border-radius: var(--sa-radius);
}

/* Self-hosted video, MediaElement (wp-video), & YouTube Shorts — natural size, centered */
.single-article.entry-content figure.wp-block-video,
.single-article.entry-content .sa-youtube-short-embed,
.single-article.entry-content .wp-block-embed.wp-embed-aspect-9-16,
.single-article.entry-content .wp-block-embed.is-provider-youtube.wp-embed-aspect-9-16 {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.75rem auto;
  text-align: center;
}

.single-article.entry-content figure.wp-block-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 1.75rem 0;
}

.single-article.entry-content p:has(> .wp-video) {
  display: flex;
  justify-content: center;
  margin: 1.75rem 0;
}

.single-article.entry-content .wp-video {
  display: block;
  float: none !important;
  clear: both;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.sa-blog .single-article.entry-content .wp-video .mejs-container,
body.sa-blog .single-article.entry-content .mejs-container.wp-video-shortcode {
  display: block;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  max-width: 100%;
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
  border: 1px solid var(--sa-border);
  box-shadow: var(--sa-shadow-md);
  background: #000;
}

.single-article.entry-content figure.wp-block-video video,
.single-article.entry-content .wp-video video.wp-video-shortcode {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(85vh, 960px);
  margin-inline: auto;
  border-radius: var(--sa-radius-lg);
  border: 1px solid var(--sa-border);
  box-shadow: var(--sa-shadow-md);
  background: #000;
}

.single-article.entry-content .sa-youtube-short-embed iframe,
.single-article.entry-content .wp-block-embed.wp-embed-aspect-9-16 iframe,
.single-article.entry-content .wp-block-embed.is-provider-youtube.wp-embed-aspect-9-16 iframe {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border: 0;
  border-radius: var(--sa-radius-lg);
  box-shadow: var(--sa-shadow-md);
}

.single-article.entry-content .sa-youtube-short-embed .wp-block-embed__wrapper,
.single-article.entry-content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper {
  position: relative;
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
}

.single-article.entry-content .sa-youtube-short-embed .wp-block-embed__wrapper iframe,
.single-article.entry-content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper iframe {
  position: static;
  width: 315px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
}

@media (max-width: 480px) {
  .single-article.entry-content .sa-youtube-short-embed .wp-block-embed__wrapper iframe,
  .single-article.entry-content .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper iframe {
    width: 100%;
  }
}

.related-posts {
  padding: 0 0 72px;
  border-top: 1px solid var(--sa-border);
  background: var(--sa-off);
}

.related-posts__title {
  margin: 40px 0 28px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sa-black);
}

.blog-grid--related {
  padding-bottom: 8px;
}

/* 404 */
.sa-not-found .not-found__inner {
  text-align: center;
  padding: 80px 20px 100px;
  max-width: 640px;
}

.not-found__code {
  margin: 0 0 8px;
  font-size: 4rem;
  font-weight: 700;
  color: var(--sa-midnight);
  line-height: 1;
}

.not-found__title {
  margin: 0 0 28px;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 600;
  color: var(--sa-black);
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn-sa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: var(--sa-radius);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-sa--primary {
  background: var(--sa-green);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
  border: 0;
}

.btn-sa--primary:hover {
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-sa--ghost {
  background: #fff;
  color: var(--sa-midnight) !important;
  border: 1px solid var(--sa-border-m);
}

.btn-sa--ghost:hover {
  background: var(--sa-lavender);
}

/* Responsive */
/* Footer / header icon alignment with StartupAdvisory FA stack */
body.sa-blog .footer-social a,
body.sa-blog .footer-contact__item i {
  line-height: 1;
}

body.sa-blog nav#nav .fa,
body.sa-blog nav#nav .fas,
body.sa-blog footer .fa,
body.sa-blog footer .fab {
  pointer-events: none;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-layout--with-sidebar {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sa-single .single-layout--with-sidebar > .single-sidebar {
    min-height: 0 !important;
  }

  .single-sidebar__sticky {
    overflow: visible;
    max-height: none !important;
  }

  .single-sidebar__sticky.is-pinned-fixed,
  .single-sidebar__sticky.is-pinned-end {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
  }

  .single-toc__toggle {
    display: block;
    width: 100%;
    margin: -4px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--sa-border);
    border-radius: var(--sa-radius);
    background: var(--sa-off);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sa-midnight);
    cursor: pointer;
  }

  .single-toc__toggle::after {
    content: "Show / hide sections";
  }

  .single-toc__nav:not(.is-open) {
    display: none;
  }

  .single-toc__nav.is-open {
    display: block;
  }

  .single-toc__list {
    max-height: none;
  }
}

@media (max-width: 768px) {
  /* Single post: hide Summary + TOC sidebar on mobile */
  .sa-single .single-sidebar {
    display: none;
  }

  .sa-single .single-layout--with-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 640px) {
  .blog-grid,
  .blog-grid--related {
    grid-template-columns: 1fr;
  }

  .sa-blog-main:not(.sa-blog-index):not(.sa-single) {
    padding-top: calc(var(--sa-header-offset) + 4px);
  }

  .single-hero {
    padding: calc(16px + var(--sa-header-offset) + 8px) 0 14px;
  }

  .blog-hero {
    padding: calc(16px + var(--sa-header-offset) + 8px) 0 32px;
  }
}
