/* HR page typography and spacing aligned with the Website service page. */
body.hr-page {
  --hr-section-gap: 72px;
  --hr-section-heading: 42px;
  --hr-section-heading-line: 1.25;
  --hr-body-size: 16px;
  --hr-card-heading: 30px;
}

body.hr-page main > section:not(.hero) {
  margin-top: 0;
  margin-bottom: var(--hr-section-gap);
}

body.hr-page .hero { padding-bottom: 0 !important; }

body.hr-page main > .faq-section {
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: var(--hr-section-gap) !important;
}

/* HR challenges: match the Website benefits section on phone/tablet only. */
#hr-challenges .website-benefits__intro { background: #fff; }
#hr-challenges .website-benefits__cta--after { display: none; }

@media (max-width: 1024px) {
  #hr-challenges .website-benefits__number { display: none; }

  #hr-challenges .website-benefits__intro {
    width: min(700px, calc(100% - 40px));
    margin: 0 auto 28px;
    text-align: left;
  }

  #hr-challenges .website-benefits__intro h2,
  #hr-challenges .website-benefits__intro p {
    margin-left: 0;
    text-align: left;
  }

  #hr-challenges .website-benefits__intro .website-benefits__cta {
    display: none;
  }

  #hr-challenges .website-benefits__cta--after {
    display: inline-flex;
    align-self: flex-start;
    min-height: 48px !important;
    margin: 8px 0 0 max(20px, calc((100% - 700px) / 2));
    padding: 12px 22px;
    font-size: 15px;
    line-height: 1.2;
  }

  #hr-challenges .website-benefits__orbit {
    padding-inline: max(20px, calc((100% - 700px) / 2));
    scroll-padding-inline: max(20px, calc((100% - 700px) / 2));
  }

  #hr-challenges .website-benefits__card {
    height: 360px;
    min-height: 360px;
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  #hr-challenges .website-benefits__intro { margin-bottom: 24px; }
  #hr-challenges .website-benefits__cta--after { margin-left: 20px; }
  #hr-challenges .website-benefits__orbit {
    padding-inline: 20px;
    scroll-padding-inline: 20px;
  }
  #hr-challenges .website-benefits__card {
    height: 400px;
    min-height: 400px;
  }
}

body.hr-page :is(
  .website-benefits__intro h2,
  .ect-web-solutions__heading,
  .ect-key-features__heading,
  .ect-hr-base__heading,
  .ect-hr-perf__heading,
  .ect-hr-strat__heading,
  .hr-compare .intro h2,
  .ect-zoho-process__heading,
  .ect-dm-ind__heading,
  .ect-zoho-req__heading,
  .ect-why__heading,
  .ect-zoho-cost__heading,
  .ect-it-banner__title,
  .faq-title
) {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  font-family: "Montserrat", "Montserrat Variable", sans-serif !important;
  font-size: var(--hr-section-heading) !important;
  font-weight: 700 !important;
  line-height: var(--hr-section-heading-line) !important;
  letter-spacing: -0.02em !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: break-word;
}

body.hr-page :is(
  .website-benefits__intro p,
  .ect-web-solutions__intro,
  .ect-key-features__intro,
  .ect-hr-base__intro,
  .ect-hr-perf__intro,
  .ect-hr-strat__intro,
  .hr-compare .intro p,
  .ect-zoho-process__intro,
  .ect-dm-ind__intro,
  .ect-zoho-req__intro,
  .ect-why__lead,
  .ect-zoho-cost__intro,
  .ect-it-banner__desc,
  .faq-sub
) {
  font-family: "Montserrat", "Montserrat Variable", sans-serif !important;
  font-size: var(--hr-body-size) !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
}

body.hr-page :is(
  .website-benefits__card h4,
  .ect-web-solutions__content-title,
  .ect-key-features__title,
  .ect-hr-base__title,
  .ect-hr-perf__title,
  .ect-hr-strat__title,
  .ect-zoho-process__title,
  .ect-dm-ind__title,
  .ect-zoho-req__title,
  .ect-why__title,
  .ect-zoho-cost__title
) {
  font-family: "Montserrat", "Montserrat Variable", sans-serif !important;
  font-size: var(--hr-card-heading) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em !important;
}

@media (max-width: 1199px) {
  body.hr-page :is(
    .ect-mobile-toggle,
    .hero__cta,
    .website-benefits__cta,
    .ect-web-solutions__arrow,
    .ect-web-solutions__cta,
    .ect-key-features__cta,
    .ect-why__cta,
    .ect-it-banner__cta,
    .faq-q
  ) { min-height: 44px !important; }
}

@media (min-width: 641px) and (max-width: 1199px) {
  body.hr-page {
    --hr-section-gap: 64px;
    --hr-section-heading: 32px;
    --hr-section-heading-line: 1.2;
    --hr-body-size: 15px;
    --hr-card-heading: 22px;
  }

  body.hr-page main > section:not(.hero) {
    margin-bottom: var(--hr-section-gap) !important;
  }

  body.hr-page main > .faq-section {
    padding-bottom: var(--hr-section-gap) !important;
  }
}

@media (max-width: 640px) {
  body.hr-page {
    --hr-section-gap: 48px;
    --hr-section-heading: 26px;
    --hr-section-heading-line: 1.18;
    --hr-body-size: 14px;
    --hr-card-heading: 20px;
  }

  body.hr-page main > section:not(.hero) {
    width: calc(100% - 32px);
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
    margin-bottom: 32px !important;
    padding-top: 0 !important;
  }

  /* The fixed mobile nav and hero already establish the opening space; use
     the Website page's 48px transition into the first content section. */
  body.hr-page main > #hr-challenges {
    padding-top: 48px !important;
  }

  body.hr-page main > section:not(.hero) + section:not(.hero) {
    margin-top: 0 !important;
  }

  body.hr-page main > :is(.website-benefits, .ect-why, .hr-compare) {
    width: 100%;
    max-width: none;
  }

  body.hr-page main > .faq-section {
    padding-bottom: var(--hr-section-gap) !important;
  }
}

/* HR services: mirror the Website page's solutions component on touch sizes.
   Everything here ends at 1199px so the existing HR desktop composition is
   preserved exactly as it is. */
@media (max-width: 1199px) {
  body.hr-page #hr-solutions {
    width: calc(100% - 48px) !important;
    max-width: 1240px;
    height: auto !important;
    min-height: 0 !important;
    margin-right: auto !important;
    margin-left: auto !important;
    overflow: visible !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__header {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end;
    gap: 12px 20px;
    height: auto !important;
    margin-bottom: 28px;
  }

  body.hr-page #hr-solutions .ect-web-solutions__heading-group {
    min-width: 0;
  }

  body.hr-page #hr-solutions .ect-web-solutions__heading,
  body.hr-page #hr-solutions .ect-web-solutions__intro,
  body.hr-page #hr-solutions .ect-web-solutions__controls,
  body.hr-page #hr-solutions .ect-web-solutions__component,
  body.hr-page #hr-solutions .ect-web-solutions__tabs {
    position: static !important;
    inset: auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__heading {
    grid-column: 1;
    margin: 0 !important;
    text-align: left !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__intro {
    width: min(948px, 100%) !important;
    margin: 8px 0 0 !important;
    text-align: left !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__controls {
    display: none !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__arrow {
    width: 44px !important;
    min-width: 44px;
    height: 44px !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__component {
    width: 100% !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tabs {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 calc(50% - 130px) 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tabs::-webkit-scrollbar {
    display: none;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tab,
  body.hr-page #hr-solutions .ect-web-solutions__tab.is-active {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 260px !important;
    width: 260px !important;
    height: 72px !important;
    min-height: 72px !important;
    padding: 12px 18px !important;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tab-label {
    font-size: 16px !important;
    line-height: 1.3 !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__panel,
  body.hr-page #hr-solutions .ect-web-solutions__panel.is-active {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 16px 0 0 !important;
    padding: 28px !important;
    border-radius: 20px !important;
    background: var(--ect-muted-background, #f9f9f7) !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__panel {
    display: none !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__panel.is-active {
    display: grid !important;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    grid-template-rows: repeat(3, auto);
    align-items: start;
    gap: 12px 24px;
  }

  body.hr-page #hr-solutions .ect-web-solutions__content {
    display: contents;
  }

  body.hr-page #hr-solutions :is(
    .ect-web-solutions__content-title,
    .ect-web-solutions__description,
    .ect-web-solutions__cta,
    .ect-web-solutions__media
  ) {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__content-title {
    grid-column: 2;
    grid-row: 1;
    order: 0;
  }

  body.hr-page #hr-solutions .ect-web-solutions__description {
    grid-column: 2;
    grid-row: 2;
    order: 0;
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__media {
    grid-column: 1;
    grid-row: 1 / 4;
    order: 0;
    min-height: 300px;
    aspect-ratio: auto;
    overflow: hidden !important;
    border-radius: 16px !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__cta {
    grid-column: 2;
    grid-row: 3;
    order: 0;
    justify-self: start;
    min-height: 44px !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 640px) {
  body.hr-page #hr-solutions {
    width: calc(100% - 32px) !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__header {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    margin-bottom: 22px;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tabs {
    padding-right: calc(50% - 118px) !important;
    padding-left: calc(50% - 118px) !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tab,
  body.hr-page #hr-solutions .ect-web-solutions__tab.is-active {
    flex-basis: 236px !important;
    width: 236px !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__tab-label {
    font-size: 14px !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__panel,
  body.hr-page #hr-solutions .ect-web-solutions__panel.is-active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 12px;
    padding: 20px !important;
    border-radius: 18px !important;
  }

  body.hr-page #hr-solutions :is(
    .ect-web-solutions__media,
    .ect-web-solutions__content-title,
    .ect-web-solutions__description,
    .ect-web-solutions__cta
  ) {
    grid-column: 1;
    grid-row: auto;
    order: 0;
  }

  body.hr-page #hr-solutions .ect-web-solutions__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  body.hr-page #hr-solutions .ect-web-solutions__description {
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  body.hr-page #hr-solutions .ect-web-solutions__cta {
    width: 100% !important;
    justify-self: stretch;
  }
}

/* HR lifecycle: use the same touch layout as the Website industries section.
   The desktop card composition stays untouched; only the header baseline is
   corrected so the title and supporting copy begin together. */
@media (min-width: 1200px) {
  body.hr-page #hr-lifecycle .ect-dm-ind__header {
    align-items: flex-start;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__intro {
    margin-top: 0;
  }
}

@media (max-width: 1199px) {
  body.hr-page #hr-lifecycle {
    display: flex;
    flex-direction: column;
    width: calc(100% - 48px);
    max-width: 1240px;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__header {
    display: contents;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__heading {
    order: 1;
    margin-bottom: 24px !important;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__grid {
    order: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__intro {
    order: 3;
    width: auto;
    max-width: 560px;
    margin: 24px 0 0;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__image {
    display: none;
  }

  body.hr-page #hr-lifecycle :is(.ect-dm-ind__card, .ect-dm-ind__card--wide) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body.hr-page #hr-lifecycle {
    width: calc(100% - 32px);
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.hr-page #hr-lifecycle .ect-dm-ind__card {
    min-height: 0;
    gap: 28px;
  }
}

/* FAQ: keep the section clean; remove the decorative floating glow behind it. */
body.hr-page .faq-section::before {
  display: none;
  animation: none;
}

/* Align the HR performance/security feature layout with the Software page. */
@media (min-width: 1200px) {
  body.hr-page #hr-performance .ect-hr-perf__header {
    gap: 24px;
    margin-bottom: 16px;
  }

  body.hr-page #hr-performance .ect-hr-perf__heading {
    flex-basis: 749px;
  }

  body.hr-page #hr-performance .ect-hr-perf__intro {
    flex-basis: 467px;
    margin-top: 8px;
  }

  body.hr-page #hr-performance .ect-hr-perf__list {
    gap: 16px;
  }

  body.hr-page #hr-performance .ect-hr-perf__item:last-child {
    margin-top: 0;
  }
}
