/*
 * .hero--inner — hero of inner pages and resource posts
 * (template-parts/global/hero-inner.php).
 * Figma: D 337:17012, 337:15897, 337:12378, 337:10721, 337:9218;
 * M 337:16606, 337:15370, 337:11962, 337:10461.
 *
 * Builds on the homepage .hero rules from index.css (heading size, buttons)
 * and only overrides them under .hero--inner, so the homepage is untouched.
 * Like the homepage hero it fills the window with the content in the middle
 * (Matt 1.1, 2026-10-23; the Figma frames put it at the bottom of a 600 → 900 px
 * box): the small viewport height, so phones see the whole hero with the browser
 * bars shown; taller content makes the hero grow instead of being cut off.
 * The tint is a CSS overlay (the homepage bakes it into its media).
 */

.hero--inner {
  align-items: center;
  min-height: 100svh;
  background-color: var(--nv-navy);

  /* .hero--inner::after — tint between the media (z 1) and the content (z 2) */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
      radial-gradient(ellipse 40% 45% at 80% 86%, rgba(33, 118, 190, 0.6), transparent 70%),
      radial-gradient(ellipse 35% 40% at 95% 5%, rgba(33, 118, 190, 0.6), transparent 70%),
      linear-gradient(217deg, rgba(19, 33, 50, 0) 0%, rgba(19, 33, 50, 0.36) 64%, rgba(19, 33, 50, 0.6) 100%),
      linear-gradient(320deg, rgba(19, 33, 50, 0) 0%, rgba(19, 33, 50, 0.42) 64%, rgba(26, 121, 191, 0.7) 100%);
    pointer-events: none;

    /* @media (width < 48em) .hero--inner::after — the two Figma M fills (image 24 at 70 %, image 23
       gradient at 60 %, same on every phone frame) mapped onto the 375 × 700 box; the desktop stops
       stretched over a tall box leave the photo too bright */
    @media (width < 48em) {
      background:
        linear-gradient(320.3deg, rgba(19, 33, 50, 0) -5.9%, rgba(19, 33, 50, 0.42) 27.4%, rgba(26, 121, 191, 0.7) 62%),
        linear-gradient(239.6deg, rgba(19, 33, 50, 0) 14.5%, rgba(19, 33, 50, 0.36) 49.3%, rgba(19, 33, 50, 0.6) 68.9%);
    }
  }

  /*
   * .hero--inner .hero__video — above the photo (its cover, which comes first
   * in the markup; the homepage photo is a see-through overlay on top instead).
   */
  & .hero__video {
    z-index: 1;
  }

  /* .hero--inner .hero__bg-image — index.css stretches it (fill) */
  & .hero__bg-image {
    object-fit: cover;
  }

  /* .hero--inner .hero__container */
  & .hero__container {
    flex-direction: column;
    padding-top: clamp(7.25rem, 5.5616rem + 7.2037vw, 12rem);
    padding-bottom: clamp(3.125rem, 2.0142rem + 4.7393vw, 6.25rem);
  }

  /* .hero--inner .hero__content */
  & .hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(2.5rem, 2.2778rem + 0.9479vw, 3.125rem);
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* .hero--inner .hero__heading — spacing comes from the content gap;
     long words in post titles wrap instead of overflowing on phones */
  & .hero__heading {
    max-width: 100%;
    /* Figma measures gaps from the glyphs: drop the space above the cap height and under the baseline */
    margin-top: -0.14em;
    margin-bottom: -0.14em;
    font-size: var(--nv-fs-h2);
    overflow-wrap: break-word;

    /* @media (width < 48em) .hero--inner .hero__heading br — desktop line breaks only */
    @media (width < 48em) {
      & br {
        display: none;
      }
    }
  }

  /* .hero--inner .hero__text — trim the line box to cap top / baseline, as Figma */
  & .hero__text {
    margin-block: -0.23em -0.25em;

    /* @media (width >= 48em) .hero--inner .hero__text — line-height 1.4 */
    @media (width >= 48em) {
      margin-block: -0.33em -0.35em;
    }
  }

  /* .hero--inner .hero__actions — text → buttons is 50 px at every width (the content gap is 40 → 50) */
  & .hero__actions {
    width: 100%;
    margin-top: clamp(0rem, 0.8472rem - 0.9479vw, 0.625rem);
  }

  /* .hero--inner.hero--fit — pages without a Figma frame (speaker, resource tag):
     height follows the content; the container padding still clears the header */
  &.hero--fit {
    min-height: auto;
  }
}

/* .hero__tags — webinar type and status pills */
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* .hero__tag */
.hero__tag {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  height: 2.5rem;
  border-radius: var(--nv-radius-pill);
  padding: 0 0.9375rem;
  color: var(--nv-white);
  font-weight: 500;
  font-size: clamp(0.875rem, 0.7861rem + 0.3792vw, 1.125rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* .hero__tag--type */
.hero__tag--type {
  background: linear-gradient(90deg, var(--nv-navy) 0%, var(--nv-blue) 100%);

  /* .hero__tag--type:has(.hero__tag-icon) — 36 px circle hugs the left edge (Figma) */
  &:has(.hero__tag-icon) {
    padding-left: 0.125rem;
  }
}

/* .hero__tag--status */
.hero__tag--status {
  border: 1px solid var(--nv-green);
  color: var(--nv-green);
  font-weight: 600;
  font-size: clamp(0.875rem, 0.8305rem + 0.1896vw, 1rem);
  letter-spacing: 0;
}

/* .hero__tag-icon — white circle with the type icon */
.hero__tag-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--nv-white);

  & img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
  }
}

/* .hero__meta — Article: topic • date */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--nv-white);
  font-size: clamp(1.25rem, 0.9834rem + 1.1375vw, 2rem);
  line-height: 1;
  letter-spacing: -0.04em;

  /* @media (width >= 48em) .hero__meta */
  @media (width >= 48em) {
    line-height: 1.4;
    letter-spacing: -0.02em;
  }
}

/* .hero__meta-topic */
.hero__meta-topic {
  font-weight: 500;
}

/* .hero__meta-date — green rhomb before the date when a topic precedes it */
.hero__meta-date {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.7;
}

/* .hero__meta-topic + .hero__meta-date::before */
.hero__meta-topic + .hero__meta-date::before {
  content: "";
  flex: 0 0 auto;
  width: 0.375rem;
  height: 0.375rem;
  background-color: var(--nv-green);
  rotate: 45deg;
}

/* .hero__columns — one column, or intro + main on desktop; phones stack both columns as far
   apart as two paragraphs: 1em + both trims (the phone frames show one column — Pavlo,
   2026-10-12: keep the text) */
.hero__columns {
  display: grid;
  gap: calc(1.48 * clamp(1rem, 0.9111rem + 0.3792vw, 1.25rem));
  width: 100%;
  max-width: 57.875rem;

  /* @media (width >= 48em) .hero__columns */
  @media (width >= 48em) {
    gap: 3.75rem;
  }
}

/* .hero__columns--two */
.hero__columns--two {
  max-width: 77.5rem;

  /* @media (width >= 64.0625em) .hero__columns--two */
  @media (width >= 64.0625em) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* .postid-78 .hero__columns — Specialty Metals only: text box 1124 px in Figma (Plastics keeps its sprint-2 width) */
.postid-78 .hero__columns {
  max-width: 70.25rem;
}

/* .postid-81 .hero__columns — Industrial only: text box 947 px in Figma */
.postid-81 .hero__columns {
  max-width: 59.1875rem;
}

/* :is(.page-id-124 … .page-id-127, .page-id-117) .hero__columns — Solutions and Contact: text box 941 px in Figma */
:is(.page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-id-117) .hero__columns {
  max-width: 58.8125rem;
}

/* .page-id-119 .hero__columns — Manufacturing Strategy Session: text box 1091 px in Figma (18:42701) */
.page-id-119 .hero__columns {
  max-width: 68.1875rem;
}

/* :is(phase 2 pages) .hero--inner .hero__heading — phones: the Figma M text box is 340 px from x 20,
   5 px past the 335 px container (the nine phase 2 phone frames of batch 1 and Strategy Session 18:50347;
   "Struggling to improve" fits one line; About 18:49949 too) */
:is(.postid-78, .postid-79, .postid-80, .postid-81, .page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-erp-readiness-assessment, .page-id-119, .page-id-116) .hero--inner .hero__heading {
  max-width: calc(100% + 0.3125rem);
  margin-right: -0.3125rem;

  /* @media (width >= 48em) :is(phase 2 pages) .hero--inner .hero__heading */
  @media (width >= 48em) {
    max-width: 100%;
    margin-right: 0;
  }
}

/* .page-id-117 .hero--inner .hero__text — Contact, phones: the Figma M text box is 339 px, 4 px past the
   335 px container (18:50674: four lines, "…an ERP upgrade, or" on the second) */
.page-id-117 .hero--inner .hero__text {
  max-width: calc(100% + 0.25rem);
  margin-right: -0.25rem;

  /* @media (width >= 48em) .page-id-117 .hero--inner .hero__text */
  @media (width >= 48em) {
    max-width: 100%;
    margin-right: 0;
  }
}

/* .page-slug-erp-readiness-assessment .hero--inner .hero__heading — Assessment: the desktop frame breaks "Could your current ERP /
   system be limiting growth / without you realizing it?"; 11.5em sits between the longest line (10.84 em)
   and "…ERP system" (13.05 em) */
.page-slug-erp-readiness-assessment .hero--inner .hero__heading {
  /* @media (width >= 48em) .page-slug-erp-readiness-assessment .hero--inner .hero__heading */
  @media (width >= 48em) {
    max-width: 11.5em;
  }
}

/* :is(phase 2 pages) .hero--inner .hero__text br — a Shift+Enter break shows from tablet width;
   the Figma M frames run the hero text on (Process, Implementation, 2026-11-13) */
:is(.postid-78, .postid-79, .postid-80, .postid-81, .page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-erp-readiness-assessment) .hero--inner .hero__text br {
  display: none;

  /* @media (width >= 48em) :is(phase 2 pages) .hero--inner .hero__text br */
  @media (width >= 48em) {
    display: inline;
  }
}

/* :is(Solutions) .hero--inner .hero__heading br — the D and M frames break the heading at the same words
   (Implementation, Upgrades, Support), so the editor's line break shows on phones too */
/* (FAQ 905 too: both frames break after "Frequently Asked Questions") */
:is(.page-id-124, .page-id-125, .page-id-126, .page-id-127, .page-slug-frequently-asked-questions) .hero--inner .hero__heading br {
  display: inline;
}

/* .page-slug-frequently-asked-questions .hero--inner .hero__heading — FAQ phone frame: "manufacturing" / "ERP, Microsoft" (Figma 18:50961; the browser fits
   "manufacturing ERP," into 335 px, Figma does not): between 7.42 and 8.33 em; the desktop wraps by the full width */
.page-slug-frequently-asked-questions .hero--inner .hero__heading {
  max-width: 8em;

  /* @media (width >= 48em) .page-slug-frequently-asked-questions .hero--inner .hero__heading */
  @media (width >= 48em) {
    max-width: none;
  }
}

/* .page-id-124 .hero--inner .hero__heading — Implementation only: "Business central Implementation" /
   "Services built around" / "manufacturing outcomes" as in Figma (between 13.77 and 15.21 em) */
.page-id-124 .hero--inner .hero__heading {
  max-width: 14.5em;
}

/* .page-id-125 .hero--inner .hero__heading — Upgrades only: "Modernize your manufacturing" /
   "ERP without losing sight of the" / "business outcomes that matter" (between 13.09 and 15.01 em) */
.page-id-125 .hero--inner .hero__heading {
  max-width: 14em;
}

/* .page-id-126 .hero--inner .hero__heading — Support only: with the editor's line break after "support" the
   Figma lines are "and optimization for manufacturers" / "that want more value from their" / "ERP platform"
   (between 14.78 and 15.08 em) */
.page-id-126 .hero--inner .hero__heading {
  max-width: 14.9em;
}

/* .hero--has-facts .hero__columns — text box 829 px in the facts hero (Figma 510:64377 D) */
.hero--has-facts .hero__columns {
  max-width: 51.8125rem;
}

/* .hero__facts — facts row under the text (Figma 510:64377 D, 510:70511 M): 32 px on desktop (wraps),
   23 px stacked on phones; the margin brings text → row and row → buttons to 50 px like text → buttons */
.hero__facts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  margin-top: clamp(0rem, 0.8472rem - 0.9479vw, 0.625rem);
  color: var(--nv-white);
  font-weight: 500;
  font-size: clamp(1.4375rem, 1.2394rem + 0.8451vw, 2rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  list-style: none;
  padding: 0;

  /* @media (width >= 48em) .hero__facts — one row, wraps when it does not fit */
  @media (width >= 48em) {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 0.875rem;
  }
}

/* .hero__fact — green rhomb before the text; trims the line box to cap top / baseline, as Figma */
.hero__fact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  margin-block: -0.33em -0.35em;
  overflow-wrap: anywhere;

  &::before {
    content: "";
    flex: 0 0 auto;
    width: 0.375rem;
    height: 0.375rem;
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }

  /* @media (width >= 48em) .hero__fact */
  @media (width >= 48em) {
    gap: 0.8125rem;

    /* rhomb 8 px on desktop (Figma 510:64377) */
    &::before {
      width: 0.5rem;
      height: 0.5rem;
    }
  }
}

/* .hero__text */
.hero__text {
  color: var(--nv-white);
  font-size: clamp(1rem, 0.9111rem + 0.3792vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.04em;

  & p + p {
    margin-top: 1em;
  }

  & strong {
    color: var(--nv-green);
    font-weight: 600;
  }

  /* @media (width >= 48em) .hero__text */
  @media (width >= 48em) {
    line-height: 1.4;
    letter-spacing: -0.02em;
  }
}

/* .hero--webinar .hero__columns */
.hero--webinar .hero__columns {
  max-width: 50.5rem;
}

/* .hero--webinar .hero__heading — wraps as in Figma (box 1007 px, /Webinar Landing Page) */
.hero--webinar .hero__heading {
  max-width: 62.9375rem;
}

/* .hero--inner .hero__heading strong — green run inside the line (index.css makes it a block for
   the home page); the editor breaks the line with <br> where the Figma text does */
.hero--inner .hero__heading strong {
  display: inline;
}

/* .hero--narrow-heading .hero__heading — wraps as in Figma (box 1044 px, /industries) */
.hero--narrow-heading .hero__heading {
  max-width: 67.1875rem;
}

/* .page-id-116 .hero--inner — About only: heading 866 px and text 831 px at 90 / 20 px (Figma 18:42244), in em
   so the lines break as in the frame at every size ("Manufacturing-" opens its own line) */
.page-id-116 .hero--inner {
  & .hero__heading {
    max-width: 9.62em;
  }

  & .hero__text {
    max-width: 41.55em;
  }
}

/* .page-id-120 .hero--inner — Case Studies only (Pavlo, 2026-10-13): heading 900 px, text 820 px;
   h1 → text 75 px on desktop (Figma 1574:14468; other inner pages 50) */
.page-id-120 .hero--inner {
  & .hero__heading {
    max-width: 56.25rem;
  }

  & .hero__text {
    max-width: 51.25rem;
  }

  /* @media (width >= 64.0625em) .page-id-120 .hero--inner .hero__columns */
  @media (width >= 64.0625em) {
    & .hero__columns {
      margin-top: 1.5625rem;
    }
  }
}

/* .page-id-115 .hero--inner — Resources hub only (Pavlo, 2026-10-13): heading 1200 px, text 958 px */
.page-id-115 .hero--inner {
  & .hero__heading {
    max-width: 75rem;
  }

  & .hero__columns {
    max-width: 59.875rem;
  }
}

/* .page-id-121 .hero--inner .hero__heading — Articles & Insights only (Pavlo, 2026-10-14): heading 1250 px */
.page-id-121 .hero--inner .hero__heading {
  max-width: 78.125rem;
}

/* .page-id-423 .hero--inner .hero__heading — Webinars only (Pavlo, 2026-10-14): heading 1100 px at 90 px;
   in em so "Manufacturing ERP / Webinars" breaks as in Figma at every size (width, not a manual break) */
.page-id-423 .hero--inner .hero__heading {
  max-width: 12.2222em;
}

/* .hero__aside — right column (webinar event facts); from 1025 px only,
   the caller repeats its content under the hero on smaller screens */
.hero__aside {
  display: none;
}

/* @media (width >= 64.0625em) .hero--has-aside .hero__container — text left, 335 px column right */
@media (width >= 64.0625em) {
  .hero--has-aside .hero__container {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  /* .hero--has-aside .hero__content — index.css sets flex: 0 0 100% */
  .hero--has-aside .hero__content {
    flex: 1 1 auto;
  }

  /* .hero--has-aside .hero__aside */
  .hero--has-aside .hero__aside {
    display: block;
    flex: 0 0 20.9375rem;
  }
}

/* .page-id-335 .hero--inner .hero__text — Customer Stories only: 800 px (Pavlo, 2026-10-17;
   Figma 337:13036 — "and build" opens the second line) */
.page-id-335 .hero--inner .hero__text {
  max-width: 50rem;
}

/* @media (width >= 64.0625em) .page-id-335 .hero--inner .hero__columns — Customer Stories only
   (Pavlo, 2026-10-13): h1 → text 75 px on desktop (Figma 1574:14076; other inner pages 50).
   The extra 20 px above the content is gone: the client wants every hero text centred (2026-11-20). */
@media (width >= 64.0625em) {
  .page-id-335 .hero--inner .hero__columns {
    margin-top: 1.5625rem;
  }
}

/* .hero--not-found .hero__heading strong — the bold run ("404.") stands on its own line at every
   width (404.php; Figma 510:62422 / 510:69212); the field hint tells the editor */
.hero--not-found .hero__heading strong {
  display: block;
}

/* .hero--not-found .hero__columns — the 404 text box is 752 px on desktop (Figma 18:43111): 2 lines */
.hero--not-found .hero__columns {
  /* @media (width >= 48em) .hero--not-found .hero__columns */
  @media (width >= 48em) {
    max-width: 47rem;
  }
}

/* .hero--not-found .hero__actions — text → button is 40 px on the 404 phone frame (18:50612),
   not the 50 px of the other inner heroes */
.hero--not-found .hero__actions {
  margin-top: 0;

  /* @media (width >= 48em) .hero--not-found .hero__actions — back to the shared value */
  @media (width >= 48em) {
    margin-top: clamp(0rem, 0.8472rem - 0.9479vw, 0.625rem);
  }
}

/* :is(Contact, Guides, FAQ) .hero--inner + section — under the hero on desktop — hero-inner.css loads on every hero page, sections-adopt.css does not (Figma 18:43218, 18:45098, 18:43696 / 18:43480 / 18:43311) */
:is(.page-id-117, .page-id-122, .page-slug-frequently-asked-questions) .hero--inner + section {
  /* @media (width >= 48em) :is(…) .hero--inner + section */
  @media (width >= 48em) {
    border-top: 0.0625rem solid rgba(26, 121, 191, 0.1);
  }
}

/* .page-id-116 .hero--inner + section — About: under the hero on every width (Figma D 18:42243, M 18:49949) */
.page-id-116 .hero--inner + section {
  border-top: 0.0625rem solid rgba(26, 121, 191, 0.1);
}
