/* Fulmor v56 — editorial detail refinement.
 * Prevent short final lines in compact interface copy without changing the
 * supplied wording or applying balanced wrapping to long-form research text.
 */

/* The Support FAQ was constrained to 68ch plus a 36px end inset, which left
 * short answers with an isolated final word on notebook and tablet widths. */
.fulmor-reference-page .frp-faq-wrap details > div {
  max-width: min(76ch, calc(100% - 24px));
  margin-inline-start: 24px;
  padding-inline-end: min(24px, 4vw);
}

/* Questions and answers are short UI copy: prefer a balanced last line while
 * retaining `pretty` as the fallback on browsers without balance support. */
:is(
  .home-page.home-v20 .faq-items summary,
  .home-page.home-v20 .faq-items details > p,
  .order-conversion-page.product-order-page .checkout-qa-list summary,
  .order-conversion-page.product-order-page .checkout-qa-list details > p,
  .fulmor-reference-page .frp-faq-wrap summary,
  .fulmor-reference-page .frp-faq-wrap details > div > p
) {
  letter-spacing: normal !important;
  text-wrap: pretty;
  text-wrap: balance;
}

/* Absolute controls remain centred when a translated question wraps. */
.home-page.home-v20 .faq-items summary::after,
.order-conversion-page.product-order-page .checkout-qa-list summary::after {
  top: 50%;
  transform: translateY(-50%);
}

/* Apply the same restrained treatment to compact cards and short supporting
 * copy. Long policy and Research article paragraphs intentionally stay pretty. */
:is(
  .home-page.home-v20 .science-grid article p,
  .home-page.home-v20 .benefits-grid article p,
  .home-page.home-v20 .use-steps article p,
  .home-page.home-v20 .scenario-active-copy p,
  .home-page.home-v20 .architecture-stage .callout em,
  .home-page.home-v20 .architecture-stage .callout small,
  .home-page.home-v20 .spec-list dd,
  .home-page.home-v20 .faq-intro > p,
  .order-conversion-page.product-order-page .order-unavailable-card p,
  .order-conversion-page.product-order-page .order-lede,
  .order-conversion-page.product-order-page .checkout-trust-grid article > strong,
  .order-conversion-page.product-order-page .checkout-trust-grid article > span,
  .order-conversion-page.product-order-page .checkout-benefits article > strong,
  .order-conversion-page.product-order-page .checkout-benefits article > span,
  .order-conversion-page.product-order-page .checkout-flow-grid article > strong,
  .order-conversion-page.product-order-page .checkout-flow-grid article > span,
  .order-conversion-page.product-order-page .checkout-qa-copy > p,
  .fulmor-reference-page .frp-lead,
  .fulmor-reference-page .frp-support-contact__grid article p,
  .fulmor-reference-page .frp-support-contact__grid article small,
  .fulmor-reference-page .frp-article-grid article > p,
  .fulmor-reference-page .frp-community-intro > p:last-child,
  .fulmor-reference-page .frp-research-library > div > p:last-child,
  .fulmor-reference-page .frp-topic-card > div > p:last-child,
  .fulmor-subpage-v2 .fulmor-subhero__intro,
  .fulmor-subpage-v2 .fulmor-subcards article > p,
  .fulmor-subpage-v2 .fulmor-subcontact__copy > p:last-child
) {
  text-wrap: pretty;
  text-wrap: balance;
}

/* Preserve Japanese kinsoku rules while balancing compact lines. */
:is(
  .home-page.home-v20,
  .order-conversion-page.product-order-page,
  .fulmor-reference-page,
  .fulmor-subpage-v2
)[lang^="ja"] :is(
  .faq-items summary,
  .faq-items details > p,
  .checkout-qa-list summary,
  .checkout-qa-list details > p,
  .frp-faq-wrap summary,
  .frp-faq-wrap details > div > p,
  .science-grid article p,
  .benefits-grid article p,
  .use-steps article p,
  .scenario-active-copy p,
  .architecture-stage .callout em,
  .architecture-stage .callout small,
  .spec-list dd,
  .faq-intro > p,
  .order-unavailable-card p,
  .order-lede,
  .checkout-trust-grid article > strong,
  .checkout-trust-grid article > span,
  .checkout-benefits article > strong,
  .checkout-benefits article > span,
  .checkout-flow-grid article > strong,
  .checkout-flow-grid article > span,
  .checkout-qa-copy > p,
  .frp-lead,
  .frp-support-contact__grid article p,
  .frp-support-contact__grid article small,
  .frp-article-grid article > p,
  .frp-community-intro > p:last-child,
  .frp-research-library > div > p:last-child,
  .frp-topic-card > div > p:last-child,
  .fulmor-subhero__intro,
  .fulmor-subcards article > p,
  .fulmor-subcontact__copy > p:last-child
) {
  line-break: strict;
  overflow-wrap: break-word;
  word-break: normal;
}

@supports (word-break: auto-phrase) {
  :is(
    .home-page.home-v20,
    .order-conversion-page.product-order-page,
    .fulmor-reference-page,
    .fulmor-subpage-v2
  )[lang^="ja"] :is(
    .faq-items summary,
    .faq-items details > p,
    .checkout-qa-list summary,
    .checkout-qa-list details > p,
    .frp-faq-wrap summary,
    .frp-faq-wrap details > div > p,
    .science-grid article p,
    .benefits-grid article p,
    .use-steps article p,
    .scenario-active-copy p,
    .architecture-stage .callout em,
    .architecture-stage .callout small,
    .spec-list dd,
    .faq-intro > p,
    .order-unavailable-card p,
    .order-lede,
    .checkout-trust-grid article > strong,
    .checkout-trust-grid article > span,
    .checkout-benefits article > strong,
    .checkout-benefits article > span,
    .checkout-flow-grid article > strong,
    .checkout-flow-grid article > span,
    .checkout-qa-copy > p,
    .frp-lead,
    .frp-support-contact__grid article p,
    .frp-support-contact__grid article small,
    .frp-article-grid article > p,
    .frp-community-intro > p:last-child,
    .frp-research-library > div > p:last-child,
    .frp-topic-card > div > p:last-child,
    .fulmor-subhero__intro,
    .fulmor-subcards article > p,
    .fulmor-subcontact__copy > p:last-child
  ) {
    word-break: auto-phrase;
  }
}

/* Compact information-page heroes previously kept a desktop-like 11ch measure
 * on phones and portrait tablets, creating isolated one-word lines. The wider
 * measure stays within the copy column and leaves Japanese phrasing untouched. */
@media (max-width: 820px) {
  .fulmor-subpage-v2:not([lang^="ja"]) .fulmor-subhero h1 {
    max-width: min(18ch, 100%);
  }
}

@media (min-width: 1081px) {
  .fulmor-subpage-v2:not([lang^="ja"]):is(
    [data-page="shipping"],
    [data-page="warranty"],
    [data-page="privacy"],
    [data-page="terms"]
  ) .fulmor-subhero h1 {
    max-width: 100%;
    font-size: clamp(44px, 4.15vw, 60px) !important;
  }
}
