/* ============================================================
   SD Assembly Pros — Blog post template stylesheet.
   Shared layout for every /blog/{slug}/ page. Linked by each
   post AFTER styles.css with ?v= cache-busting. Per-post inline
   <style> is for signature touches only.
   Uses the site's design tokens from styles.css :root.
   ============================================================ */

/* ── Post hero ── */
.post-hero {
  position: relative;
  color: var(--white);
  padding: 10rem 0 4rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 26, 46, 0.92) 0%, rgba(27, 42, 74, 0.85) 60%, rgba(232, 116, 12, 0.35) 130%);
  z-index: 1;
}

.post-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.04' /%3E%3C/svg%3E");
  z-index: 2;
}

.post-hero .container {
  position: relative;
  z-index: 3;
  max-width: 860px;
}

/* Breadcrumb inside the post hero (overrides the centered site default) */
.post-hero .breadcrumb {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.post-hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.9);
}

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

.post-hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.post-hero__category {
  background: var(--secondary);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: var(--radius-sm);
}

/* ── Layout: article + sidebar ── */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 3rem;
  align-items: start;
  padding: 4rem 0 5rem;
}

.post-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── TOC ── */
.post-toc {
  background: rgba(var(--primary-rgb), 0.05);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.post-toc h2 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.post-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  counter-reset: toc;
}

.post-toc li {
  counter-increment: toc;
  font-size: 0.92rem;
  line-height: 1.4;
}

.post-toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 0.6em;
}

.post-toc a {
  color: var(--text);
}

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

/* ── Sidebar CTA card ── */
.post-cta-card {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.post-cta-card h3 {
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1.3;
  text-wrap: balance;
  margin-bottom: 0.75rem;
}

.post-cta-card p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.post-cta-card .btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
}

.post-cta-card__phone {
  display: block;
  margin-top: 0.75rem;
  color: var(--secondary-light);
  font-family: var(--font-heading);
  font-weight: 600;
}

.post-cta-card__phone:hover {
  color: var(--accent);
}

/* ── Article body ── */
.post-body {
  max-width: 72ch;
}

.post-body > p,
.post-body > ul,
.post-body > ol {
  line-height: 1.75;
  margin-bottom: 1.25rem;
  color: var(--text-light);
}

.post-body h2 {
  font-family: var(--font-heading);
  color: var(--primary);
  font-size: 1.7rem;
  line-height: 1.25;
  text-wrap: balance;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.post-body h3 {
  color: var(--primary);
  font-size: 1.2rem;
  margin: 1.75rem 0 0.5rem;
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.post-body a {
  color: var(--secondary);
  text-decoration: underline;
  text-decoration-color: rgba(var(--secondary-rgb), 0.4);
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: var(--secondary-dark);
}

.post-body ul,
.post-body ol {
  list-style: revert;
  padding-left: 1.4em;
}

.post-body li {
  margin-bottom: 0.5em;
}

.post-body img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 1.75rem 0;
}

/* Answer-first AEO block */
.post-body .answer-block {
  background: rgba(var(--secondary-rgb), 0.07);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.75rem;
}

.post-body .answer-block p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

/* Pull-quote / field-note callout */
.post-callout {
  background: rgba(var(--primary-rgb), 0.05);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-light);
  position: relative;
}

.post-callout strong {
  font-style: normal;
  color: var(--primary);
}

/* Comparison / spec table */
.post-table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.post-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.post-table-wrap th {
  background: var(--primary);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: left;
  padding: 0.7em 1em;
  white-space: nowrap;
}

.post-table-wrap td {
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--light-gray);
  color: var(--text-light);
}

.post-table-wrap tr:nth-child(even) td {
  background: var(--off-white);
}

/* ── Post FAQ (details/summary) ── */
.post-faq {
  margin-top: 2.5rem;
}

.post-faq details {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: background var(--transition);
}

.post-faq details[open] {
  background: rgba(var(--primary-rgb), 0.05);
}

.post-faq summary {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.post-faq summary:hover {
  color: var(--secondary);
}

.post-faq details p {
  margin: 0.75rem 0 0;
  line-height: 1.65;
  color: var(--text-light);
}

/* ── Related services strip ── */
.post-related-services {
  background: rgba(var(--primary-rgb), 0.05);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2.5rem;
}

.post-related-services h2 {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.post-related-services ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-related-services a {
  display: inline-block;
  background: var(--surface);
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.post-related-services a:hover {
  background: var(--secondary);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Related articles (registry cards) ── */
.post-related-articles {
  padding: 4rem 0 5rem;
  background: var(--surface-alt);
}

.post-related-articles .section-title {
  margin-bottom: 2rem;
}

.post-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-related-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.post-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-related-card__image {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.post-related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform var(--transition);
}

.post-related-card:hover .post-related-card__image img {
  transform: scale(1.05);
}

.post-related-card__category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--secondary);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3em 0.8em;
  border-radius: var(--radius-sm);
}

.post-related-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.post-related-card__body h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
  text-wrap: balance;
}

.post-related-card__body h3 a {
  color: var(--primary);
}

.post-related-card__body h3 a:hover {
  color: var(--secondary);
}

.post-related-card__meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-sidebar {
    position: static;
    order: -1;
  }

  .post-toc {
    display: none;
  }
}

@media (max-width: 600px) {
  .post-hero {
    padding: 8rem 0 3rem;
  }

  .post-layout {
    padding: 2.5rem 0 3.5rem;
  }
}
