/* Edition-scoped policy. The source theme keeps its existing fonts and layout. */
body.csm-edition { --csm-copy-leading: 1.5; }
body.csm-edition:lang(zh),body.csm-edition:lang(ja) { --csm-copy-leading: 1.75; }
body.csm-edition:lang(ko) { --csm-copy-leading: 1.7; }
/* Installed system fallbacks only; no new font request or late font swap. */
body.csm-edition:lang(zh-CN) { font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
body.csm-edition:lang(zh-TW) { font-family: system-ui, "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif; }
body.csm-edition:lang(ja) { font-family: system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", sans-serif; }
body.csm-edition:lang(ko) { font-family: system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif; }
body.csm-edition:lang(ar) { --csm-copy-leading: 1.7; font-family: system-ui, "Segoe UI", "Geeza Pro", "Tahoma", "Noto Sans Arabic", "Arial", sans-serif; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) { direction: rtl; text-align: start; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card,.yg-summary,.yg-product-card-content,.yg-faq-content) { text-align: start; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) :is(p,li,td,th,dd,dt,h1,h2,h3,h4,.yg-description-content) { text-align: start; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(ul,ol) { padding-inline-start: 1.5rem; padding-inline-end: 0; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(.yg-product-info,.yg-product-card-content,.yg-faq-item) { gap: 0.75rem; }
/* Long translated prose can break without widening the containing column. */
body.csm-edition :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) { overflow-wrap: break-word; }
body.csm-edition :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) :is(p,li,td,th,dd,.yg-description-content) { line-height: var(--csm-copy-leading); }
body.csm-edition :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) :is(:lang(zh),:lang(ja)) { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
body.csm-edition :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) :lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
/* Keep product headings free of automatic word splitting. Unsupported balance
   falls back to normal wrapping without a JavaScript layout dependency. */
body.csm-edition :is(h1,h2,h3,.yg-product-title) { text-wrap: balance; hyphens: manual; }
body.csm-edition :is(code,.csm-literal) { hyphens: none; }
body.csm-edition :is(bdi,.csm-ltr,.csm-literal,code) { unicode-bidi: isolate; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(bdi[dir="ltr"],.csm-ltr,code) { direction: ltr; unicode-bidi: isolate; }
:is([dir="rtl"] body.csm-edition,body.csm-edition[dir="rtl"],body.csm-edition:lang(ar)) :is(td,th) :is(bdi,.csm-ltr,.csm-literal,code) { unicode-bidi: isolate; }
/* Text-bearing flex children must be allowed to shrink inside the theme columns. */
body.csm-edition :is(.yg-product-info,.yg-summary,.yg-product-card-content,.yg-faq-content) { min-width: 0; }
@media(max-width:767px) {
  /* Locale-aware wrapping of prose, never a blanket break-all rule. Dictionary
     hyphenation varies by browser; break-word remains the safe fallback. */
  body.csm-edition :is(.yg-post-content,.yg-rich-text,.yg-product-info,.yg-faq,.yg-product-card) :is(p,li,td,th,dd,.yg-description-content):is(:lang(de),:lang(fr),:lang(es),:lang(pt),:lang(vi)) { hyphens: auto; }
  /* Comparison columns need local scrolling rather than squeezed compound words. */
  body.csm-edition :is(.yg-post-content,.yg-rich-text,.elementor-widget-text-editor) table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.csm-edition :is(.yg-post-content,.yg-rich-text,.elementor-widget-text-editor) :is(th,td) { min-width: 10rem; white-space: normal; }
  /* Saved phone captures place long lines behind the theme's fixed 32px sidebar. */
  body.csm-edition:has(.yg-sidebar) :is(.yg-product-info,.yg-post-content) { padding-inline-end: 32px; }
  /* The theme's one-line teaser cut C-Pad mid-sentence; three lines keep the teaser, its fade and "read more". */
  body.csm-edition .yg-description .yg-description-content:not(.expanded) { height: calc(3em * var(--csm-copy-leading)); -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 62%, transparent 100%); }
}
/* The existing summary transition respects the visitor's motion preference. */
@media(prefers-reduced-motion:reduce) { body.csm-edition .yg-description .yg-description-content { transition: none; } }
