/**
 * acf-post-single — Pacific Blog Single
 */

.acf-post-single,
.wp-block-acf-acf-post-single {
  background-color: var(--color-off-white, #f8f8f8);
  color: var(--color-dark);
  overflow: visible;
}

.acf-post-single.alignfull,
.acf-post-single.alignwide {
  inline-size: 100%;
  max-inline-size: none;
}

/* —— Hero (off-white) —— */
.acf-post-single__hero {
  /* Pull grass up so blades cross the lower portion of the media frame.
     The container has a fixed 347/211 aspect-ratio so the layout is stable
     regardless of the uploaded image size. The image uses object-fit:contain
     (natural proportions, no crop/stretch); empty space inside the frame is
     filled by the hero background. Overlap coefficient 0.25 ≈ 41% of the
     frame height is tucked behind the grass. */
  --acf-post-single-media-max: 46.875rem;
  --acf-post-single-overlap: calc(0.25 * min(var(--acf-post-single-media-max), 100%));
  position: relative;
  isolation: isolate;
  background-color: var(--color-off-white, #f8f8f8);
  overflow: visible;
}

.acf-post-single__hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding-block: var(--block-pad-block);
  padding-inline: var(--block-pad-inline);
  text-align: center;
}

.acf-post-single__back {
  display: flex;
  justify-content: center;
  inline-size: 100%;
}

.acf-post-single__back-button.bpa-button {
  min-block-size: 2.5rem;
  padding-inline: var(--space-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.acf-post-single__back-button--has-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
}

.acf-post-single__back-button-icon {
  flex-shrink: 0;
  inline-size: 10px; /* styleguide-exception: Figma back nav arrow */
  block-size: 10px;
  color: var(--color-brand-green);
}

.acf-post-single__back-link {
  color: var(--color-brand-forest);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.acf-post-single__back-link:hover,
.acf-post-single__back-link:focus-visible {
  text-decoration: underline;
}

.acf-post-single h1.acf-post-single__title {
  margin: 0;
  max-inline-size: 60rem; /* styleguide-exception: ~960px title column */
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h2-display); /* 40px — Source Serif display title */
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight); /* 120% */
  letter-spacing: 0;
  text-align: center;
  color: var(--color-brand-forest);
}

.acf-post-single__hero--has-media .acf-post-single__hero-inner {
  padding-block-end: 0;
}

.acf-post-single__hero-media {
  position: relative;
  z-index: 2;
  /* Stretch inside the centered flex column so the media frame always fills
     the available width (up to the 750px cap) instead of shrinking to the
     intrinsic width of a small uploaded banner. */
  align-self: stretch;
  inline-size: 100%;
  max-inline-size: var(--acf-post-single-media-max); /* 750px — Figma hero image cap */
  margin-inline: auto; /* center the 750px frame within the hero column */
  /* Fixed frame so the layout never collapses when a small/banner image is
     uploaded. Same ratio as the blog cards (token from tokens.css). */
  aspect-ratio: var(--featured-blog-card-media-aspect, 347 / 211);
  overflow: hidden;
  border-radius: var(--radius-leaf-sm);
  /* Transparent so the empty space around a small/banner image blends with
     the hero background — no visible gray "fill" box. */
  background-color: transparent;
  /* Flex-center the image so it keeps natural proportions AND gets its own
     border-radius on the visible image (not just the frame). */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  /* Frame sits on top of the grass. Blades read on the left and right. */
  margin-block-end: calc(-1 * var(--acf-post-single-overlap));
}

/* picture wrapper (if WP renders <picture>) — let it shrink to the img. */
.acf-post-single__hero-media picture {
  display: flex;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  max-block-size: 100%;
  line-height: 0;
}

.acf-post-single__hero-media img,
.acf-post-single__hero-media-img {
  display: block;
  /* Size to natural dimensions, capped by the frame. This keeps the image
     proportions without object-fit, so border-radius rounds the actual
     visible image corners (not just the container box). */
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: 100%;
  border-radius: var(--radius-leaf-sm);
}

/* Grass stays behind the photo (Figma 7329:2304). */
.acf-post-single__grass.bpa-local-grass-divider {
  position: relative;
  z-index: 1;
  margin-block: 0;
  margin-inline: 0;
  inline-size: 100%;
  background-color: transparent;
  pointer-events: none;
}

.acf-post-single__hero > .bpa-local-grass-divider .bpa-local-grass-divider__img {
  margin-block-end: -4px; /* styleguide-exception: grass fringe into the green band */
}

.acf-post-single__hero-band {
  position: relative;
  z-index: 0;
  background-color: var(--color-franchise-green, #11733f);
  color: var(--color-light);
}

.acf-post-single__hero-band-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-md) var(--space-xl);
  padding-inline: var(--block-pad-inline);
  text-align: center;
}

/* Keep date + excerpt below the overlapping photo. */
.acf-post-single__hero--has-media .acf-post-single__hero-band-inner {
  padding-block-start: calc(
    var(--acf-post-single-overlap) - min(7.9375rem, calc(100vw * 127 / 1440)) + var(--space-md)
  );
}

.acf-post-single__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--color-light);
}

.acf-post-single__meta-sep {
  opacity: 0.9;
}

.acf-post-single__hero-excerpt {
  max-inline-size: 55.25rem; /* styleguide-exception: ~884px excerpt */
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-light);
}

.acf-post-single__hero-excerpt p {
  margin: 0;
}

/* TL;DR — off-white band; white bordered card inside (Figma 7329:2463). */
.acf-post-single__tldr {
  inline-size: 100vw;
  max-inline-size: 100vw;
  margin-inline: calc(50% - 50vw);
  padding-block: var(--space-xl);
  padding-inline: calc(50vw - 50%);
  background-color: var(--color-off-white, #f8f8f8);
  color: var(--color-dark);
}

.acf-post-single__tldr-copy {
  inline-size: 100%;
  max-inline-size: var(--container-blog, 48rem);
  margin-inline: auto;
  padding: var(--space-md);
  border: 2px solid var(--color-brand-green-alt, #30b454);
  border-radius: var(--radius-button);
  background-color: var(--color-light);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
}

/* Pull the TL;DR band flush to the body top when it leads the column. */
.acf-post-single__body-inner > .acf-post-single__tldr:first-child {
  margin-block-start: calc(-1 * var(--space-2xl));
}

.acf-post-single__tldr-copy > :first-child {
  display: inline;
  margin: 0;
}

.acf-post-single__tldr-label {
  font-weight: var(--font-weight-bold);
  color: var(--color-brand-forest);
}

.acf-post-single__tldr-label + * {
  display: inline;
  margin: 0;
}

/* —— Post body (768px column) —— */
.acf-post-single__body {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-2xl);
  padding-inline: var(--block-pad-inline);
  background-color: var(--color-light);
}

.acf-post-single__body--has-bottom-wave {
  padding-block-end: 0;
}

.acf-post-single__body--has-bottom-wave .acf-post-single__body-inner {
  padding-block-end: var(--space-2xl);
}

.acf-post-single__body-wave {
  display: block;
  line-height: 0;
}

.acf-post-single__body-wave--bottom {
  margin-inline: calc(-1 * var(--block-pad-inline));
  inline-size: calc(100% + (2 * var(--block-pad-inline)));
}

.acf-post-single__body-wave--bottom svg {
  display: block;
  inline-size: 100%;
  block-size: auto;
  min-block-size: 50px; /* styleguide-exception: wave decorative min */
  transform: scaleY(-1);
}

.acf-post-single__body--has-bottom-wave + .acf-post-single__related {
  margin-block-start: -4px; /* styleguide-exception: flush wave handoff into off-white band */
}

.acf-post-single__body-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  inline-size: 100%;
  max-inline-size: var(--container-blog, 48rem);
  margin-inline: auto;
}

.acf-post-single__content {
  inline-size: 100%;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__content > :first-child {
  margin-block-start: 0;
}

.acf-post-single__content > :last-child {
  margin-block-end: 0;
}

.acf-post-single__content p {
  margin: 0 0 1em;
}

.acf-post-single__content p:last-child {
  margin-block-end: 0;
}

/* Beat .entry-content h2 serif + --color-dark from reset.css (Figma 7329:2424). */
.acf-post-single .acf-post-single__content.entry-content h2,
.acf-post-single .acf-post-single__content h2 {
  margin: 1.5em 0 0.75em;
  font-family: var(--font-family-base); /* Roboto */
  font-size: var(--font-size-3xl); /* 32px */
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--color-brand-forest); /* #03400f */
}

.acf-post-single .acf-post-single__content.entry-content h3,
.acf-post-single .acf-post-single__content.entry-content h4,
.acf-post-single .acf-post-single__content h3,
.acf-post-single .acf-post-single__content h4 {
  margin: 1.25em 0 0.5em;
  font-family: var(--font-family-base); /* Roboto */
  font-size: var(--font-size-h5); /* 20px */
  font-weight: var(--font-weight-bold);
  line-height: 1.4;
  color: var(--color-brand-forest); /* #03400f */
}

.acf-post-single__content h2:first-child,
.acf-post-single__content h3:first-child,
.acf-post-single__content h4:first-child {
  margin-block-start: 0;
}

/* In-body images — editor Image block (Figma 7329:2426, full 768px column). */
.acf-post-single__content .wp-block-image,
.acf-post-single__content figure.wp-block-image {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  margin: var(--space-xl) 0;
  overflow: hidden;
  border-radius: var(--radius-leaf-sm);
  line-height: 0;
}

.acf-post-single__content img,
.acf-post-single__content figure:not(.wp-block-image) {
  display: block;
  max-inline-size: 100%;
  inline-size: 100%;
  block-size: auto;
  margin: var(--space-xl) 0;
}

.acf-post-single__content .wp-block-image img,
.acf-post-single__content figure.wp-block-image img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  margin: 0;
  border-radius: var(--radius-leaf-sm);
  object-fit: cover;
}

.acf-post-single__content figure img {
  margin: 0;
}

.acf-post-single__content .wp-block-image figcaption,
.acf-post-single__content figure.wp-block-image figcaption {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
  text-align: center;
  background-color: var(--color-light);
}

.acf-post-single__content ul,
.acf-post-single__content ol {
  margin: 0 0 1em;
  padding-inline-start: 1.25rem;
}

.acf-post-single__content li {
  margin-block-end: 0.5em;
}

.acf-post-single__content li:last-child {
  margin-block-end: 0;
}

.acf-post-single__content a {
  color: var(--color-brand-forest);
  font-weight: var(--font-weight-bold);
}

.acf-post-single__divider {
  inline-size: 100%;
  block-size: 4px; /* styleguide-exception: forest divider bar */
  background-color: var(--color-brand-forest);
}

/* Category / tag pills + share */
.acf-post-single__footer-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-md);
  inline-size: 100%;
}

.acf-post-single__pills {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: var(--space-sm);
  min-inline-size: 0;
}

.acf-post-single__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 2.5rem;
  padding-inline: var(--space-md);
  border: 1px solid var(--color-border, #dee1e1);
  border-radius: var(--radius-button);
  background-color: var(--color-off-white, #f8f8f8);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__share {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm);
}

.acf-post-single__share-label {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__share-link {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}

.acf-post-single__share-icon .bpa-inline-svg,
.acf-post-single__share-icon svg {
  display: block;
  inline-size: 1.25rem; /* styleguide-exception: Figma 20px share icons */
  block-size: 1.25rem;
}

/* Figma share circles — #30B454 (--color-franchise-green-bright). Hard fallback if SVG still uses currentColor. */
.acf-post-single__share-icon svg path[fill="currentColor"] {
  fill: #30b454;
  fill: var(--color-franchise-green-bright, #30b454);
}

/* Author box */
.acf-post-single__author {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background-color: var(--color-author-bg);
}

.acf-post-single__author-photo {
  inline-size: 100%;
  max-inline-size: 7.5rem;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  line-height: 0;
  background-color: var(--color-light);
}

.acf-post-single__author-photo picture,
.acf-post-single__author-photo img,
.acf-post-single__author-photo-img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center top;
}

.acf-post-single__author-photo-placeholder {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  background-color: var(--color-light);
}

.acf-post-single__author-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-inline-size: 0;
}

.acf-post-single__author-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-brand-navy);
}

.acf-post-single__author-position {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-normal);
  color: var(--color-brand-green);
}

.acf-post-single__author-bio {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__author-bio p {
  margin: 0 0 1em;
}

.acf-post-single__author-bio p:last-child {
  margin-block-end: 0;
}

/* CTA band (off-white, no photo) */
.acf-post-single__cta-band {
  padding-block: var(--space-2xl);
  padding-inline: var(--block-pad-inline);
  background-color: var(--color-off-white, #f8f8f8);
}

.acf-post-single__cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  max-inline-size: 51.75rem; /* styleguide-exception: ~828px CTA copy */
  margin-inline: auto;
  text-align: center;
}

.acf-post-single h2.acf-post-single__cta-title {
  margin: 0;
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h2-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  text-align: center;
  color: var(--color-brand-forest);
}

.acf-post-single__cta-text {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.acf-post-single__cta-button--has-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
}

.acf-post-single__cta-button-icon {
  flex-shrink: 0;
  inline-size: 10px; /* styleguide-exception: Figma secondary CTA arrow */
  block-size: 10px;
  color: var(--color-brand-green);
}

/* Related articles — featured-blog-style cards on off-white band */
.acf-post-single__related {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-2xl);
  padding-inline: var(--block-pad-inline);
  background-color: var(--color-off-white, #f8f8f8);
}

.acf-post-single__related-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  padding-inline: 0;
}

.acf-post-single__related-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.acf-post-single h2.acf-post-single__related-title {
  margin: 0;
  max-inline-size: 48rem;
  font-family: var(--font-family-serif);
  font-size: var(--font-size-h2-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  text-align: center;
  color: var(--color-brand-forest);
}

.acf-post-single__related-intro {
  margin: 0;
  max-inline-size: 60.375rem;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single__related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-12);
  inline-size: 100%;
}

.acf-post-single__related-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-6);
  padding: var(--spacing-6);
  box-sizing: border-box;
  border: var(--border-card-accent);
  border-radius: var(--radius-leaf-lg);
  overflow: hidden;
  background-color: var(--color-off-white, #f8f8f8);
}

.entry-content .acf-post-single__related-card,
.wp-block-post-content .acf-post-single__related-card {
  border-radius: var(--radius-leaf-lg);
}

.acf-post-single__related-card-media {
  overflow: hidden;
  border-radius: var(--radius-leaf-sm);
  background-color: var(--color-placeholder-bg);
  aspect-ratio: 347 / 211;
  line-height: 0;
}

.acf-post-single__related-card-media picture,
.acf-post-single__related-card-media img,
.acf-post-single__related-card-img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.acf-post-single__related-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
}

.acf-post-single__related-date {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
}

.acf-post-single .acf-post-single__related-card-title,
.acf-post-single h3.acf-post-single__related-card-title {
  margin: var(--spacing-2) 0 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-h5);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  color: var(--color-brand-forest);
}

.acf-post-single__related-card-text {
  margin-block-start: var(--spacing-4);
  color: var(--color-dark);
  font-weight: var(--font-weight-normal);
}

.acf-post-single__related-card-text p {
  margin: 0;
}

.acf-post-single__related-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  max-inline-size: 100%;
  margin-block-start: var(--spacing-8);
  border-radius: var(--radius-button);
  color: var(--color-brand-forest);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-normal);
  text-decoration: none;
}

.acf-post-single__related-link-label {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--color-brand-green-alt);
}

.acf-post-single__related-link-icon {
  display: block;
  inline-size: 10px; /* styleguide-exception: Figma Button Under arrow */
  block-size: 10px;
  flex-shrink: 0;
  color: var(--color-brand-green);
  line-height: 0;
}

@media (min-width: 640px) {
  .acf-post-single__footer-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
  }

  .acf-post-single__share {
    justify-content: flex-end;
  }
}

@media (min-width: 768px) {
  .acf-post-single__author {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: var(--space-xl);
    padding: var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .acf-post-single__related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-8);
  }
}

@media (max-width: 767px) {
  .acf-post-single h1.acf-post-single__title,
  .acf-post-single h2.acf-post-single__cta-title,
  .acf-post-single h2.acf-post-single__related-title {
    font-size: var(--font-size-2xl);
  }

  .acf-post-single__body {
    padding-block: var(--space-xl);
  }

  .acf-post-single__body-inner {
    gap: var(--space-lg);
  }

  .acf-post-single__hero-inner {
    padding-block: var(--space-xl);
  }

  /* Keep the photo hanging into the grass on small screens. */
  .acf-post-single__hero--has-media .acf-post-single__hero-inner {
    padding-block-end: 0;
  }

  .acf-post-single__hero {
    /* Matches the desktop coefficient now that the photo has a fixed
       aspect-ratio on both breakpoints (height ≈ width * 0.608). */
    --acf-post-single-overlap: calc(0.25 * min(var(--acf-post-single-media-max), 100%));
  }

  .acf-post-single__hero > .bpa-local-grass-divider .bpa-local-grass-divider__img {
    margin-block-end: -6px; /* styleguide-exception: tighter mobile grass seam */
  }

  .acf-post-single__body,
  .acf-post-single__cta-band,
  .acf-post-single__related {
    padding-inline: var(--space-sm);
  }

  .acf-post-single__cta-actions {
    flex-direction: column;
    inline-size: 100%;
  }

  .acf-post-single__cta-actions .acf-post-single__cta-button.bpa-button {
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .acf-post-single__author-photo {
    max-inline-size: 6rem;
  }
}
