/* R1 v5.1 residual delta. Load AFTER edur-ui-v5-responsive.css.
 * LOCAL proposal: based on R1_after.md / R1_raw.json, not rendered in this pass.
 * Existing v5 CSS/JS remain intact. See RESIDUALS_NOTES.md for evidence/limits.
 */

@media (max-width: 390px) {
/* R01 — a_word_wider_than_box; home@320x640, Basgitary / Orchester.
 * Higher specificity than the banner's embedded .round-categories-grid p and
 * edur-ui.css body.template-13.type-index .round-categories-grid p.
 * 11px at 320, up to the existing 12px; retain whole words and the existing grid.
 * Banner's margin:0 !important is unrelated; no forced declaration is needed.
 * Undo: remove R01, including this media wrapper if empty. */
html body.template-13.type-index div.round-categories-grid > a > p {
  font-size: clamp(11px, 3.4375vw, 12px);
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

/* R02 — c_clipped; home@320x640 / home@390x844, all occurrences of
 * CM5044FTCDK COMET, GIBSON Les Paul, Elixir Acoustic NANOWEB.
 * Deliberately overrides v5 B14 with more classes than the saved theme's
 * .columns-mobile-2 .product-slider-holder .products-block .p .name (two-line
 * clamp). v5 B14 has fewer classes; source order alone does not beat that rule.
 * Five line-heights reserve the tallest measured name; longer names still grow.
 * Undo: remove R02. */
html body.template-13.columns-mobile-2 :is(.products-block, .product-slider) .p div.p-in > div.p-in-in > a.name {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: none;
  height: auto;
  max-height: none;
  min-height: 7.5em;
  min-height: 5lh;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
}

/* R03 — e_orphan_last_word; korg-nts-4 / reloop-rmx-10-bt
 * @320x640,390x844,1024x768,1280x800. v5 B20 already wraps the outer row.
 * Give the ordinary link group the available width and equal flex bases;
 * intrinsic label width determines when a row wraps. B21 keeps labels intact.
 * Undo: remove R03. */
html body.template-13.type-product div.p-data-wrapper div.buttons-wrapper.social-buttons-wrapper > div.link-icons {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px;
}

/* R04 — e_orphan_last_word; same product states as R03.
 * Equal bases replace the legacy margin-driven distribution. Higher specificity
 * also beats style_c.css's hover padding selector; label text is never split.
 * Three ordinary actions can still form two plus one; see probe caveat in notes.
 * Undo: remove R04. */
html body.template-13.type-product div.p-data-wrapper div.buttons-wrapper.social-buttons-wrapper > div.link-icons > a.link-icon {
  box-sizing: border-box;
  flex: 1 1 8em;
  min-inline-size: max-content;
  margin-inline: 0;
  padding-inline: 8px;
  justify-content: center;
}

/* R05 — e_orphan_last_word; same product states as R03; hidden sharing state.
 * Saved theme keeps .social-buttons.no-display rendered at opacity:0; the
 * probe tests descendants without checking ancestor opacity. Visibility is
 * inherited, so its Zavriet label stops masquerading as a fourth ordinary action.
 * Only the closed state is selected; opening removes no-display as before.
 * Undo: remove R05. */
html body.template-13.type-product div.p-data-wrapper div.buttons-wrapper.social-buttons-wrapper > div.social-buttons.no-display {
  visibility: hidden;
  pointer-events: none;
}

/* R06 — e_orphan_last_word; same product states as R03; sharing panel open.
 * Keep the absolute panel's positioning/visibility contract; equal bases allow
 * its Twitter/Facebook/close groups to wrap without changing the product split.
 * Undo: remove R06. */
html body.template-13.type-product div.p-data-wrapper div.buttons-wrapper.social-buttons-wrapper > div.social-buttons:not(.no-display) {
  flex-wrap: wrap;
  gap: 8px;
}

/* R07 — e_orphan_last_word; same product states as R03; sharing panel open.
 * Each panel group gets the same basis; the close control remains in its panel.
 * External widget intrinsic widths require a later rendered check.
 * Undo: remove R07. */
html body.template-13.type-product div.p-data-wrapper div.buttons-wrapper.social-buttons-wrapper > div.social-buttons:not(.no-display) > div {
  flex: 1 1 8em;
  min-width: 0;
}

/* R08 — g_line_over_90; gitary / basgitary / korg-nts-4
 * @768x1024,1024x768,1280x800,1440x900. Higher-specificity residual override
 * of v5 B02: 70ch is slightly below its existing 72ch (already plausibly active).
 * Paragraphs ONLY: gallery/info widths and the 62/38 split remain untouched.
 * Undo: remove R08. */
html body.template-13.type-category div.category-top > div.category-perex > p,
html body.template-13.type-product div.description-inner > div#edur-description-text > p {
  max-width: min(100%, 70ch);
}

/* R09 — e_orphan_last_word; all seven R1 pages@1280x800;
 * fieldset.box.box-sm h2 "Bezpecnostna kontrola". v5 B16 already balances it;
 * two words still need two lines if their combined advance exceeds the box.
 * Reduce only this heading; keep wrapping available on narrower containers.
 * Undo: remove R09. */
html body.template-13 fieldset > fieldset.box.box-sm > h2 {
  font-size: clamp(18px, 1.5625vw, 20px);
}

/* R10 — g_line_under_25; home@320x640, info-banner-left p.
 * Higher-specificity override of v5 B02 pretty wrapping. Balancing is a hint;
 * some engines limit it to short paragraphs. Required content fallback is in notes.
 * Undo: remove R10. */
@media (max-width: 390px) {
html body.template-13.type-index div.info-banner-left > div > p {
  text-wrap: balance;
}
}
