/* ── A single blog post (0.44.0, next step 0.47.0) ───────────────────────────
   Markup (class-single-post.php): div.hero-block.hero-post holding
   .hero-block__inner > .hero-post__layout, which holds article
   .hero-post__article (.hero-post__header: date, h1 .hero-post__title; an
   optional figure .hero-post__image; .hero-post__body, the post's own content)
   and, when the site has a phone, a Schedule link or a form, aside
   .hero-post__aside with one .hero-post__card (label, Call Now, Schedule
   Service, the form). Then section.hero-block.hero-posts.hero-post__more: the
   newest other posts as hero-posts cards and More Posts.

   The block supplies family, colour, width and the type scale; this file sets
   the reading column, the card and the spacing of ordinary post content.
   Tokens only.

   Desktop (from 1025px, the library's desktop breakpoint): the article left,
   the card right, sticky below the site header while the article scrolls and
   stopping at the article's end (the aside is as tall as the article). Phone
   and tablet: one column, the article, then the card in the flow. */

.hero-post { padding-block: var(--hero-pad); }

/* Hello Elementor's page wrapper adds its own width and padding; the block
   owns both on a post. */
body.single-post #content.site-main,
body.single-post #content .page-content { max-width: none; width: 100%; padding: 0; margin: 0; }

.hero-post__header,
.hero-post__image,
.hero-post__body { max-width: var(--hero-measure); margin-inline: auto; }

.hero-post__date { margin: 0 0 .75rem; font-size: var(--hero-text-small); opacity: .75; }
.hero-block .hero-post__title { margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); }

.hero-post__image { margin-block: 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero-post__image img { display: block; width: 100%; height: auto; border-radius: var(--hero-radius-media); }

.hero-post__body > * { margin-block: 0 1.25em; }
.hero-post__body > :last-child { margin-bottom: 0; }
.hero-post__body :is(h2, h3, h4) { margin-top: 1.75em; margin-bottom: .6em; }
.hero-post__body :is(ul, ol) { padding-left: 1.4em; }
.hero-post__body li + li { margin-top: .4em; }
.hero-post__body a { color: var(--hero-action-text, var(--hero-primary)); text-decoration: underline; text-underline-offset: .2em; }
.hero-post__body img { max-width: 100%; height: auto; border-radius: var(--hero-radius-media); }
.hero-post__body blockquote { margin-inline: 0; padding-left: 1.25em; border-left: 3px solid var(--hero-primary); }

/* ── The card ────────────────────────────────────────────────────────────── */
/* The offer cards' card (hero-cards card_style "offer"): white, the pack's
   panel radius, hairline border and panel shadow. */
.hero-post__aside { min-width: 0; max-width: var(--hero-measure); margin: clamp(2rem, 5vw, 3rem) auto 0; }
.hero-post__card {
  display: grid; gap: 1.25rem; padding: var(--hero-card-pad);
  border: 1px solid var(--hero-hairline); border-radius: var(--hero-radius-panel, var(--hero-radius-card));
  background: var(--hero-surface); color: var(--hero-text); box-shadow: var(--hero-shadow-panel);
}
.hero-block .hero-post__card-title { margin: 0; font-size: var(--hero-h3); line-height: var(--hero-heading-leading); }

/* Outside any Elementor document, so the theme's underline on links reaches
   these unless they say otherwise. */
.hero-post__card a, .hero-post__more a { text-decoration: none; }

.hero-post__actions { display: grid; gap: .5rem; }
.hero-post__actions .hero-block__button { width: 100%; }
/* Call first, on the pack's button geometry: the label small over the number. */
.hero-post__call {
  display: grid; gap: .1rem; text-align: center; text-decoration: none;
  padding: var(--hero-button-pad-y) var(--hero-button-pad-x);
  border-radius: var(--hero-radius-button); background: var(--hero-primary); color: var(--hero-on-primary);
}
.hero-post__call:hover { background: var(--hero-secondary); color: var(--hero-on-secondary); }
.hero-post__call-label {
  font-size: var(--hero-eyebrow-size); font-weight: var(--hero-eyebrow-weight);
  letter-spacing: var(--hero-eyebrow-tracking); text-transform: var(--hero-eyebrow-transform);
}
.hero-post__call-number { font-size: var(--hero-text-lead); font-weight: var(--hero-button-weight); letter-spacing: var(--hero-heading-tracking); }
.hero-post__card :focus-visible { outline: 2px solid var(--hero-primary); outline-offset: 2px; }

/* The client's own form plugin renders inside; only its rhythm is set here,
   one field to a row (the card is narrow). The submit takes the colour roles'
   Gravity Forms button. */
.hero-post__form .gform_wrapper { margin: 0; }
.hero-post__form .gform_heading { display: none; }
.hero-post__form .gform_fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.hero-post__form .gfield { grid-column: 1 / -1; margin: 0; }
.hero-post__form input:not([type="submit"]):not([type="hidden"]), .hero-post__form select, .hero-post__form textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--hero-hairline);
  border-radius: var(--hero-radius-button); background: var(--hero-surface); color: var(--hero-text); font: inherit;
}
/* A short message box, over the form theme's tall one: the card stays within
   a laptop screen. */
.hero-post .hero-post__form .gform_wrapper textarea { height: 6.5rem; min-height: 0; block-size: 6.5rem; resize: vertical; }
.hero-post__form .gform_footer { margin: .75rem 0 0; padding: 0; }
.hero-post__form :is(.gform_button, input[type="submit"], button[type="submit"]) {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  min-height: 2.75rem; padding: var(--hero-button-pad-y) var(--hero-button-pad-x); cursor: pointer;
  border: var(--hero-button-border) solid var(--hero-primary); border-radius: var(--hero-radius-button);
  background: var(--hero-primary); color: var(--hero-on-primary); font-weight: var(--hero-button-weight);
}

/* ── More posts ──────────────────────────────────────────────────────────── */
/* hero-posts.css draws the cards; three across from 900px. */
.hero-block .hero-post__more-title { margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero-post__more-link { margin: clamp(2rem, 5vw, 3rem) 0 0; }

/* ── Desktop: article and card side by side ──────────────────────────────── */
@media (min-width: 1025px) {
  .hero-post[data-hero-aside] .hero-post__layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: clamp(2.5rem, 4vw, 4rem);
  }
  .hero-post[data-hero-aside] :is(.hero-post__header, .hero-post__image, .hero-post__body) { margin-inline: 0; }
  /* The aside is as tall as the article, so the card sticks inside it and
     stops where the article ends. Below the sticky site header (its height is
     the pack's header offset token), and never taller than the screen. */
  .hero-post[data-hero-aside] .hero-post__aside { max-width: none; margin: 0; }
  .hero-post__card {
    --hero-post-card-top: 1.5rem;
    position: sticky; top: var(--hero-post-card-top);
    max-height: calc(100vh - var(--hero-post-card-top) - 1.5rem); overflow-y: auto; overscroll-behavior: contain;
  }
  :root:has(.hero-site-header[data-hero-sticky="sticky"]) .hero-post__card { --hero-post-card-top: calc(var(--hero-header-offset) + 1.5rem); }
  body.admin-bar .hero-post__card { top: calc(var(--hero-post-card-top) + 32px); }
}
