/* ---------------------------------------------------------------
   BLOG: listing (/blog/) and single post (includes/post-view.php)

   The layout is the Wagley Agency blog's, dimension for dimension:
   a 68ch reading column, 18px / 1.72 body copy, a 64px share rail and
   a 280px sticky sidebar from 1080px, a 300px sidebar on the listing
   from 1000px, a featured row at 1.15fr / 1fr from 760px, and cards on
   a six-track grid (half width from 700px, thirds from 1100px). Colour,
   type and buttons are HCBI's --sk-* tokens.

   ONE COLUMN, ALWAYS. The post body shares no class with the prose
   panels in pages.css, and blog pages are out of every :has() gate
   there, so no multicol or grid split can reach an article. Text is
   never clipped: nothing in here sets overflow on a text container
   except the breadcrumb's current item, which truncates by design.
--------------------------------------------------------------- */

.blog-section {
  padding: clamp(32px, 4vw, 48px) 0;
}

.blog-section--fog {
  background: var(--sk-panel);
}

.blog-section__title {
  margin: 0 0 24px;
}

.blog-meta {
  font-family: var(--sk-body);
  font-size: 14px;
  color: var(--sk-muted);
  margin: 0;
}

/* Two equal buttons, edge-aligned. One row from 480px; stacked at
   full width below it, where "Call (337) 270-2271" cannot fit half a
   phone-width card without wrapping its label. */
.blog-btn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .blog-btn-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 480px;
  }
}

.blog-btn-row .btn {
  width: 100%;
  min-height: 48px;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---------------------------------------------------------------
   BREADCRUMB: one line at every width. The current page is the only
   item allowed to shrink, and it ends in an ellipsis.
--------------------------------------------------------------- */

.blog-crumbs {
  padding: 20px 0 0;
  font-family: var(--sk-body);
  font-size: 13px;
}

.blog-crumbs ol {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  min-width: 0;
}

.blog-crumbs li {
  flex: 0 0 auto;
  color: var(--sk-muted);
}

.blog-crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--sk-number);
}

.blog-crumbs li[aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  color: var(--sk-body-copy);
}

.blog-crumbs li[aria-current="page"] > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-crumbs a {
  color: var(--sk-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  /* 44px tall tap target without moving the line. */
  display: inline-block;
  padding: 12px 0;
  margin: -12px 0;
}

.blog-crumbs a:hover {
  color: var(--sk-navy);
}

/* ---------------------------------------------------------------
   SIDEBAR (listing and post)
--------------------------------------------------------------- */

.blog-sidebar h2 {
  font-family: var(--sk-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--sk-navy);
  margin: 0 0 14px;
}

.blog-sidebar h2 ~ h2 {
  margin-top: 32px;
}

.blog-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-sidebar li {
  padding: 14px 0;
  border-bottom: 1px solid var(--sk-hairline);
}

.blog-sidebar li:first-child {
  padding-top: 0;
}

.blog-sidebar a {
  display: block;
  font-family: var(--sk-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--sk-navy);
  text-decoration: none;
}

.blog-sidebar a:hover {
  text-decoration: underline;
}

.blog-sidebar__when {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--sk-muted);
}

@media (min-width: 1000px) {
  .blog-sidebar__sticky {
    position: sticky;
    top: 110px;
  }
}

/* ---------------------------------------------------------------
   LISTING
--------------------------------------------------------------- */

.blog-layout {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1000px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

.blog-main {
  min-width: 0;
}

.blog-featured {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

@media (min-width: 760px) {
  .blog-featured {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}

.blog-featured--noimage {
  grid-template-columns: minmax(0, 1fr);
  max-width: 62ch;
}

.blog-featured__media,
.blog-featured__picture {
  display: block;
}

.blog-featured__picture img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
}

.blog-featured__text > * {
  margin: 0 0 12px;
}

.blog-featured__text > :last-child {
  margin-bottom: 0;
}

:is(.page-blog) .blog-featured h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

.blog-featured h2 a {
  color: var(--sk-navy);
  text-decoration: none;
}

.blog-featured h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.blog-featured__text > p:not(.blog-meta) {
  font-family: var(--sk-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--sk-body-copy);
}

/* Cards: six tracks, a card spans a half (3) or a third (2) as
   blogCardSpans() decides, so an odd count never strands one card. */
.blog-cards {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.blog-cards--listing {
  margin-top: 48px;
}

.blog-cards > * {
  grid-column: auto;
  min-width: 0;
}

@media (min-width: 700px) {
  .blog-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .blog-cards > * {
    grid-column: span 3;
  }
  .blog-cards > :last-child:nth-child(odd) {
    grid-column: span 6;
  }
}

@media (min-width: 1100px) {
  .blog-cards > *,
  .blog-cards > :last-child:nth-child(odd) {
    grid-column: span var(--span, 2);
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  background: var(--sk-white);
  border-radius: 24px;
  box-shadow: rgba(11, 11, 69, 0.05) 0 0 0 1px, rgba(11, 11, 69, 0.10) 0 20px 25px -5px, rgba(11, 11, 69, 0.08) 0 8px 10px -6px;
  text-decoration: none;
  transition: box-shadow 0.3s var(--sk-ease), transform 0.3s var(--sk-ease);
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: rgba(11, 11, 69, 0.08) 0 0 0 1px, rgba(11, 11, 69, 0.14) 0 24px 30px -6px, rgba(11, 11, 69, 0.10) 0 10px 12px -7px;
}

.blog-card__media {
  display: block;
  margin: 0 0 16px;
}

.blog-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
}

.blog-card__rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--sk-green);
  margin: 0 0 16px;
}

:is(.page-blog, .page-blog-post) .blog-card h3 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--sk-navy);
  text-decoration: underline;
  text-decoration-color: var(--sk-number);
  text-underline-offset: 4px;
}

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

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 48px;
}

.pager__status {
  font-family: var(--sk-body);
  font-size: 13.5px;
  color: var(--sk-muted);
}

/* ---------------------------------------------------------------
   SINGLE POST
--------------------------------------------------------------- */

.post-layout {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1080px) {
  .post-layout {
    grid-template-columns: 64px minmax(0, 1fr) 280px;
  }
}

/* Share rail: a row above the article, a sticky column from 1080px. */
.share-rail {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (min-width: 1080px) {
  .share-rail {
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 110px;
    align-self: start;
  }
}

.share-rail__label {
  font-family: var(--sk-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sk-muted);
}

.share-rail__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--sk-radius-pill);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s var(--sk-ease);
}

.share-rail__btn:hover,
.share-rail__btn:focus-visible {
  transform: translateY(-2px);
}

.share-rail__btn svg {
  width: 19px;
  height: 19px;
  fill: #FFFFFF;
}

.share-rail__btn--facebook { background: #1877F2; }
.share-rail__btn--linkedin { background: #0A66C2; }
.share-rail__btn--x { background: #000000; }

.share-rail__btn--copy {
  background: var(--sk-white);
  border: 1px solid rgba(11, 11, 69, 0.16);
}

.share-rail__btn--copy svg {
  fill: none;
  stroke: var(--sk-navy);
  stroke-width: 1.8;
}

.share-rail__btn--copy.is-copied {
  background: var(--sk-panel);
}

/* The reading column. 68ch at 17px is the Wagley measure, about 680px. */
.post-measure {
  min-width: 0;
  max-width: 68ch;
  font-size: 17px;
}

.post-byline {
  font-family: var(--sk-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--sk-muted);
  margin: 0 0 24px;
}

.post-intro {
  font-family: var(--sk-body);
  font-size: 20px;
  line-height: 1.6;
  color: var(--sk-utility);
  margin: 0;
}

.post-hero-img {
  margin: 32px 0;
}

.post-hero-img picture,
.post-hero-img img {
  display: block;
  width: 100%;
}

.post-hero-img img {
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}

.post-toc {
  background: var(--sk-panel);
  border-radius: 24px;
  padding: 24px;
  margin: 0 0 40px;
}

:is(.page-blog-post) .post-toc h2 {
  font-family: var(--sk-body);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  margin: 0 0 12px;
}

.post-toc ol {
  list-style: decimal;
  margin: 0;
  padding-left: 20px;
}

.post-toc li {
  margin-bottom: 8px;
  font-family: var(--sk-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--sk-muted);
}

.post-toc li:last-child {
  margin-bottom: 0;
}

.post-toc a {
  color: var(--sk-muted);
  text-underline-offset: 3px;
}

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

/* Article body. */
.article-body {
  font-family: var(--sk-body);
  font-size: 18px;
  line-height: 1.72;
  color: var(--sk-body-copy);
  overflow-wrap: break-word;
}

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

:is(.page-blog-post) .article-body :is(p, li) {
  font-size: 18px;
  line-height: 1.72;
}

.article-body p {
  margin: 0 0 1.25em;
}

:is(.page-blog-post) .article-body h2 {
  font-family: var(--sk-heading);
  font-size: clamp(28px, 2.4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--sk-navy);
  margin: 1.8em 0 0.6em;
  scroll-margin-top: 110px;
}

:is(.page-blog-post) .article-body h3 {
  font-family: var(--sk-heading);
  font-size: 21px;
  line-height: 1.3;
  color: var(--sk-navy);
  margin: 1.4em 0 0.5em;
  scroll-margin-top: 110px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25em;
  padding-left: 22px;
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

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

.article-body a {
  color: var(--sk-green-cta);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.article-body strong {
  color: var(--sk-navy);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 20px 24px;
  background: var(--sk-panel);
  border-radius: 20px;
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--sk-hairline);
  margin: 2em 0;
}

.article-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
}

.article-body th,
.article-body td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sk-hairline);
}

/* Author box: a tinted card, no accent edge. */
.post-author {
  margin: 40px 0 0;
  padding: 24px;
  background: var(--sk-panel);
  border-radius: 24px;
  font-family: var(--sk-body);
}

.post-author > * {
  margin: 0;
}

.post-author > * + * {
  margin-top: 6px;
}

:is(.page-blog-post) .post-author__name {
  font-family: var(--sk-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--sk-navy);
}

.post-author__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--sk-green-cta);
}

.post-author__npn,
.post-author__spec {
  font-size: 14px;
  line-height: 1.6;
  color: var(--sk-muted);
}

/* Inline CTA: the Wagley card-accent, tinted in HCBI green. */
.post-cta {
  margin: 24px 0 0;
  padding: 28px;
  background: rgba(108, 153, 52, 0.10);
  border-radius: 24px;
}

:is(.page-blog-post) .post-cta h2 {
  font-family: var(--sk-body);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 8px;
}

.post-cta p {
  font-family: var(--sk-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sk-body-copy);
  margin: 0 0 16px;
}

@media (max-width: 560px) {
  .post-cta,
  .post-toc,
  .post-author {
    padding: 20px;
  }
}

/* ---------------------------------------------------------------
   QUOTE BAND: navy, full bleed, closes both pages.
--------------------------------------------------------------- */

.blog-quote-band {
  background: var(--sk-navy);
  color: var(--sk-white);
  padding: 64px 0;
  margin-top: clamp(48px, 7vw, 80px);
}

:is(.page-blog, .page-blog-post) .blog-quote-band h2 {
  color: var(--sk-white);
  margin: 0 0 12px;
}

.blog-quote-band p {
  font-family: var(--sk-body);
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 58ch;
  margin: 0 0 24px;
}

:is(.page-blog, .page-blog-post) .blog-quote-band .btn--primary {
  background: var(--sk-green-cta);
  border-color: var(--sk-green-cta);
  color: var(--sk-white);
}

:is(.page-blog, .page-blog-post) .blog-quote-band .btn--primary:hover,
:is(.page-blog, .page-blog-post) .blog-quote-band .btn--primary:focus-visible {
  background: var(--sk-green-cta-hover);
  border-color: var(--sk-green-cta-hover);
}

:is(.page-blog, .page-blog-post) .blog-quote-band .btn--secondary {
  background: transparent;
  color: var(--sk-white);
  border-color: rgba(255, 255, 255, 0.7);
}

:is(.page-blog, .page-blog-post) .blog-quote-band .btn--secondary:hover,
:is(.page-blog, .page-blog-post) .blog-quote-band .btn--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sk-white);
  border-color: var(--sk-white);
}

/* ---------------------------------------------------------------
   PREVIEW BANNER (admin only, never public)
--------------------------------------------------------------- */

.preview-banner {
  background: #6B4A05;
  color: #FFFFFF;
  padding: 0.625rem 0;
  font-size: 14px;
  text-align: center;
}

.preview-banner a {
  color: #FFFFFF;
  font-weight: 600;
}
