/* ========================================
   BLOG STYLES - Twilight Tree and Landscape
======================================== */

/* Blog Hero */
.blog-hero {
  background: linear-gradient(135deg, #2b2013 0%, #3a2c1c 100%);
  color: white;
  padding: 52px 0 44px;
  text-align: center;
}

.blog-hero h1 {
  font-size: 38px;
  margin-bottom: 10px;
}

.blog-hero p {
  font-size: 17px;
  opacity: 0.85;
  max-width: 620px;
  margin: 0 auto;
}

.blog-hero p a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Blog Container: same width as the service pages (section .container 1100px) */
.blog-container {
  max-width: 1100px;
}

/* Blog Listing */
.blog-listing {
  padding: 48px 0 64px;
  background: var(--bg-light);
  min-height: 50vh;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Blog Card */
.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.blog-card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-body .blog-read-more {
  margin-top: auto;
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-cream);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-meta {
  flex-wrap: wrap;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.blog-card h2,
.blog-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text-dark);
  line-height: 1.3;
}

.blog-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  transition: gap 0.2s ease;
}

.blog-card:hover .blog-read-more {
  gap: 10px;
}

/* Blog Tag */
.blog-tag {
  display: inline-block;
  background: var(--bg-cream);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: capitalize;
}

/* Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
}

.blog-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  border: 1px solid var(--border);
  background: var(--bg-white);
  transition: all 0.15s ease;
}

.blog-page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.blog-page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========================================
   SINGLE POST
======================================== */
.blog-post {
  padding: 150px 0 64px;
}

.blog-post-header {
  margin-bottom: 32px;
}

.blog-breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.blog-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.blog-breadcrumb li + li::before {
  content: "\203A";
  margin: 0 8px;
  opacity: 0.6;
}

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

.blog-breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.blog-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.blog-post-header h1 {
  font-size: 38px;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 16px;
  max-width: 900px;
}

/* Post Content Prose */
.blog-post-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-dark);
}

.blog-post-content h2 {
  font-size: 26px;
  line-height: 1.3;
  margin-top: 44px;
  margin-bottom: 14px;
  color: var(--text-dark);
  scroll-margin-top: 185px;
}

.blog-post-content h3 {
  scroll-margin-top: 185px;
}

.blog-post-content h3 {
  font-size: 20px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.blog-post-content p {
  margin-bottom: 16px;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.blog-post-content li {
  margin-bottom: 6px;
}

.blog-post-content strong {
  font-weight: 600;
  color: var(--text-dark);
}

.blog-post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--bg-cream);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.blog-post-content code {
  background: var(--bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}

.blog-post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.blog-post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-post-content a:hover {
  color: var(--primary-dark);
}

/* Author Byline (in post meta) */
.blog-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-author-link:hover {
  color: var(--primary);
}

.blog-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.blog-meta-sep {
  color: var(--text-light);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.blog-card-author {
  font-weight: 600;
  color: var(--text-dark);
}

/* Author Box (bottom of post) */
.blog-author-box {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 0;
  padding: 28px;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.blog-author-box-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.2s;
  border: 2px solid var(--border);
}

.blog-author-box-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.blog-author-box-avatar:hover {
  transform: scale(1.05);
}

.blog-author-box-info {
  flex: 1;
}

.blog-author-box-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 600;
}

.blog-author-box-name {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.blog-author-box-name:hover {
  color: var(--primary);
}

.blog-author-box-info p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.blog-author-box-info .blog-author-box-role {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 8px;
}

/* Author Page */
.author-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.author-hero {
  padding-top: 150px;
}

.author-hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.4);
}

.author-hero-role {
  opacity: 0.8;
  font-size: 16px;
}

.author-bio-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 36px;
}

.author-bio-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.author-bio-section p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.author-bio-section a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.author-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.author-credentials {
  list-style: none;
  margin-bottom: 14px;
}

.author-credentials li {
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.author-credentials li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.author-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.author-posts-header h2 {
  font-size: 22px;
  color: var(--text-dark);
}

.author-post-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-white);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 50px;
}

/* Post Footer CTA */

.blog-cta-box {
  background: var(--bg-cream);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.blog-cta-box h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.blog-cta-box p a {
  color: var(--primary);
  font-weight: 600;
}

.blog-cta-box p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 15px;
}


/* ========================================
   POST LAYOUT: article column + sticky sidebar
======================================== */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "main side"
    "bottom side";
  column-gap: 56px;
  align-items: start;
}

.blog-main { grid-area: main; min-width: 0; }
.blog-sidebar { grid-area: side; align-self: stretch; }
.blog-post-bottom {
  grid-area: bottom;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

/* The inner wrapper sticks; the aside spans both rows, so it stops at the
   end of the post (never over the footer). Top offset clears the fixed header. */
.blog-sidebar-inner {
  position: sticky;
  top: var(--blog-sticky-top, 172px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--blog-sticky-top, 172px) - 16px);
}

.blog-sidebar-inner > * { flex: none; }

/* When space runs out, only the contents list shrinks (and scrolls inside
   its box); the service card and the sign-up stay fully visible. */
.blog-sidebar-inner > .blog-toc {
  flex: 0 1 auto;
  min-height: 230px;
  display: flex;
  flex-direction: column;
}

.blog-toc .blog-toc-list {
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  margin-right: -8px;
  padding-right: 8px;
}

@media (min-width: 1025px) {
  .blog-sidebar .blog-side-title { font-size: 16px; margin-bottom: 6px; }
  .blog-sidebar .blog-side-box p { font-size: 13px; line-height: 1.5; }
  .blog-sidebar .blog-service-card .blog-side-link { margin-top: 6px; font-size: 13px; }
  .blog-sidebar .blog-signup-form label:not(.blog-signup-consent) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .blog-sidebar .blog-signup-form input[type="text"],
  .blog-sidebar .blog-signup-form input[type="email"] { margin-top: 8px; font-size: 14px; padding: 7px 10px; }
  .blog-sidebar .blog-signup-form .blog-signup-consent { font-size: 11.5px; margin: 8px 0; }
  .blog-sidebar .blog-signup-button { padding: 10px 16px; font-size: 14px; }
  .blog-sidebar .blog-signup-intro { margin-bottom: 2px; }
}

@media (max-height: 1000px) {
  .blog-signup-intro { display: none; }
  .blog-service-card .blog-side-link { display: none; }
}

/* Very short windows: no sticking at all. */
@media (max-height: 760px) {
  .blog-sidebar-inner { position: static; max-height: none; }
  .blog-sidebar-inner > .blog-toc { display: block; }
}

.blog-side-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.blog-side-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.blog-side-title {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.blog-side-title a { color: inherit; }
.blog-side-title a:hover { color: var(--primary); }

.blog-side-box p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.blog-side-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.blog-side-link:hover { gap: 10px; }

.blog-service-card {
  background: var(--bg-cream);
  border-left: 4px solid var(--primary);
}

/* Table of contents + progress */
.blog-progress {
  height: 4px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.blog-progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.15s linear;
}

.blog-toc .blog-progress-label {
  font-size: 12px;
  margin: 6px 0 10px;
}

.blog-toc-list {
  list-style: none;
  counter-reset: toc;
}

.blog-toc-list li { counter-increment: toc; }

.blog-toc-list a {
  display: block;
  position: relative;
  padding: 5px 0 5px 26px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.blog-toc-list a::before {
  content: counter(toc);
  position: absolute;
  left: 8px;
  top: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
}

.blog-toc-list a:hover { color: var(--primary); }

.blog-toc-list a.active {
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary);
  background: var(--bg-cream);
}

.blog-toc-mobile { display: none; }

/* Email sign-up */
.blog-signup-intro { margin-bottom: 12px; }

.blog-signup-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 8px 0 3px;
}

.blog-signup-form input[type="text"],
.blog-signup-form input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-dark);
}

.blog-signup-form input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.blog-signup-form .blog-signup-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 10px 0;
}

.blog-signup-consent input { margin-top: 2px; flex-shrink: 0; }

.blog-signup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.blog-signup-button {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.blog-signup-button[disabled] { opacity: 0.6; cursor: not-allowed; }

.blog-signup-form .blog-signup-status {
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}

.blog-signup-status.is-ok { color: var(--primary-dark); }
.blog-signup-status.is-error { color: #a33a1f; }

/* Tables (GFM). The global reset (* { padding: 0 }) leaves bare tables with
   no cell spacing, so they read as run-together text without these rules. */
.blog-table-wrap {
  margin: 20px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
}

.blog-table-wrap:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.blog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  min-width: 560px;
}

.blog-table th,
.blog-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
}

.blog-table thead th {
  background: var(--bg-cream);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.blog-table tbody tr:nth-child(even) td { background: rgba(236, 224, 204, 0.25); }
.blog-table tbody tr:last-child td { border-bottom: none; }
.blog-table td:first-child { font-weight: 600; min-width: 140px; }

/* Figures */
.blog-figure {
  margin: 28px 0;
}

.blog-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.blog-figure figcaption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 8px;
  padding-left: 12px;
  border-left: 3px solid var(--primary-light);
}

/* Callout (quick answer) */
.blog-callout {
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px 6px;
  margin: 24px 0 28px;
}

.blog-callout-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-dark);
  margin-bottom: 8px !important;
}

.blog-post-content ol { padding-left: 26px; }
.blog-post-content ol li { padding-left: 4px; }

/* Related posts */
.blog-related h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.blog-related-grid .blog-card h3 { font-size: 18px; }
.blog-related-grid .blog-card p { font-size: 14px; }

@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main"
      "side"
      "bottom";
  }
  .blog-sidebar { margin-top: 40px; }
  .blog-sidebar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
  }
  .blog-sidebar-inner > .blog-toc { display: none; }
  .blog-toc-mobile {
    display: block;
    margin: 8px 0 28px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    background: var(--bg-cream);
  }
  .blog-toc-mobile summary {
    cursor: pointer;
    padding: 14px 18px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 15px;
    list-style-position: inside;
  }
  .blog-toc-count {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 6px;
  }
  .blog-toc-mobile .blog-toc-list { padding: 0 14px 12px; }
  .blog-post-content .blog-toc-mobile ol { padding-left: 14px; margin-bottom: 0; }
  .blog-toc-mobile .blog-toc-list a { text-decoration: none; color: var(--text-dark); font-size: 15px; }
  .author-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
  .blog-hero {
    padding: 120px 0 40px;
  }

  .blog-post {
    padding: 120px 0 48px;
  }

  .author-hero { padding-top: 120px; }

  .blog-post-content { font-size: 16px; }

  .blog-table { font-size: 14px; }

  .blog-callout { padding: 16px 18px 4px; }

  .blog-hero h1 {
    font-size: 28px;
  }

  .blog-card-body {
    padding: 20px 22px;
  }

  .blog-card h2,
.blog-card h3 {
    font-size: 19px;
  }

  .blog-post-header h1 {
    font-size: 26px;
  }

  .blog-post-content h2 {
    font-size: 22px;
  }

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

  .blog-cta-box {
    padding: 24px 20px;
  }

  .blog-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
  }

  .author-hero-avatar {
    width: 96px;
    height: 96px;
  }

  .author-bio-section {
    padding: 22px 20px;
  }

  .author-posts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Empty state (no published posts yet) */
.blog-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
}

.blog-empty p {
  margin-bottom: 20px;
}
