/* Recce NI Storefront rc5.30: prevent clipped responsive content.
 * Intentional horizontal rows remain scrollable; product listing grids remain
 * four columns on desktop and two columns on small devices.
 * Overrides only Storefront-owned public components and narrow content wrappers.
 */

/* The 17-link primary menu cannot reliably fit as one row on ordinary desktops.
 * Earlier styles only enabled wrapping in the 1181–1320px interval, and forced
 * nowrap again at 1321px.  Remove that discontinuity.
 */
@media (min-width: 1181px) {
  body.rni-canonical-public-shell .rni-storefront-primary-nav .rni-storefront-menu {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 0 !important;
  }
  body.rni-canonical-public-shell .rni-storefront-primary-nav .rni-storefront-menu > li {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.rni-canonical-public-shell .rni-storefront-primary-nav .rni-storefront-menu > li > a {
    min-height: 44px !important;
    padding: .62rem .72rem !important;
    font-size: clamp(.78rem, .85vw, .94rem) !important;
    white-space: nowrap !important;
  }
}

/* Make the first AND last item reachable by a proper native horizontal scroll.
 * A small end guard also allows the last item to clear the clipped parent
 * edge.  Preserve touch scrolling, scroll snapping, and existing destinations.
 */
body.rni-canonical-public-shell .rni-department-navigation__track,
body.rni-canonical-public-shell .rni-brand-strip .rni-storefront-container > div {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 12px;
  -webkit-overflow-scrolling: touch;
}
body.rni-canonical-public-shell .rni-department-navigation__track::after,
body.rni-canonical-public-shell .rni-brand-strip .rni-storefront-container > div::after {
  content: "";
  display: block;
  flex: 0 0 18px;
  width: 18px;
  pointer-events: none;
}
body.rni-canonical-public-shell .rni-department-navigation__track > a,
body.rni-canonical-public-shell .rni-brand-strip .rni-storefront-container > div > a {
  flex-shrink: 0 !important;
}

/* Prevent theme/plugin columns from enforcing a viewport wider than the
 * actual content area, while retaining overflow within purpose-built rows.
 */
body.rni-canonical-public-shell .content-container,
body.rni-canonical-public-shell .content-wrap,
body.rni-canonical-public-shell .entry-content,
body.rni-canonical-public-shell .rni-storefront-container,
body.rni-canonical-public-shell .rni-policy-content,
body.rni-canonical-public-shell .rni-info-hub,
body.rni-canonical-public-shell .rni-contact-page {
  min-width: 0;
  box-sizing: border-box;
}
body.rni-canonical-public-shell .woocommerce img,
body.rni-canonical-public-shell .entry-content img,
body.rni-canonical-public-shell .rni-storefront-container img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  body.rni-canonical-public-shell #inner-wrap,
  body.rni-canonical-public-shell .content-container,
  body.rni-canonical-public-shell .content-wrap,
  body.rni-canonical-public-shell .entry-content,
  body.rni-canonical-public-shell .rni-storefront-container,
  body.rni-canonical-public-shell .rni-policy-layout,
  body.rni-canonical-public-shell .rni-info-hub,
  body.rni-canonical-public-shell .rni-contact-page {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.rni-canonical-public-shell .entry-content :is(h1, h2, h3, p, a),
  body.rni-canonical-public-shell .rni-storefront-container :is(h1, h2, h3, p, a) {
    overflow-wrap: break-word;
  }
  body.rni-canonical-public-shell .woocommerce :is(input, select, textarea),
  body.rni-canonical-public-shell .rni-storefront-search :is(input, button) {
    min-width: 0;
    max-width: 100%;
  }
  body.rni-canonical-public-shell .woocommerce table.shop_table,
  body.rni-canonical-public-shell .woocommerce table.woocommerce-product-attributes {
    max-width: 100%;
  }
  body.rni-canonical-public-shell .woocommerce table.woocommerce-product-attributes {
    width: 100%;
    table-layout: fixed;
  }
  body.rni-canonical-public-shell .woocommerce table.woocommerce-product-attributes :is(th, td) {
    overflow-wrap: anywhere;
  }
  /* The earlier 3.25rem mobile hero minimum could push its text/actions
   * outside small phone viewports.  Do not alter hero photography or overlays.
   */
  body #rni-storefront-homepage .rni-hero-content h1 {
    max-width: 100% !important;
    font-size: clamp(2.1rem, 9vw, 3.3rem) !important;
    line-height: 1.03 !important;
    overflow-wrap: break-word;
  }
  body #rni-storefront-homepage .rni-home-actions > a {
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center;
  }
}

/* rc5.31 — measured mobile layouts / screenshot-derived fixes.
 * A rendered [recce_ni_policy_centre] must NOT inherit policy detail columns.
 * Keep the page within the visual viewport; don't hide overflowing content.
 */
body.rni-information-page .rni-info-hub,
body.rni-information-page .rni-policy-layout,
body.rni-information-page .rni-info-hero,
body.rni-information-page .rni-info-section,
body.rni-information-page .rni-policy-content,
body.rni-information-page .rni-info-search {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.rni-information-page .rni-info-hub { width: 100%; }
body.rni-information-page .rni-info-hero { width: 100%; min-inline-size: 0; }
body.rni-information-page .rni-info-hero :is(h2,p),
body.rni-information-page .rni-policy-content :is(h1,h2,p) {
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}
body.rni-information-page .rni-info-search {
  display: block;
  width: 100%;
  min-inline-size: 0;
}
body.rni-information-page .rni-info-search input {
  display: block;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
body.rni-information-page .rni-info-sections,
body.rni-information-page .rni-info-card-grid,
body.rni-information-page .rni-info-section-heading,
body.rni-information-page .rni-info-card {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
body.rni-information-page .rni-info-card-grid > * { min-width: 0; }
body.rni-information-page .rni-policy-nav,
body.rni-information-page .rni-policy-nav nav { min-width: 0; max-width: 100%; }
body.rni-information-page .rni-policy-nav nav ul {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
@media(max-width: 1000px) {
  body.rni-information-page .rni-policy-layout { grid-template-columns: minmax(0,1fr) !important; }
}
@media(max-width: 767px) {
  body.rni-information-page .rni-info-hub { padding: 18px 12px 28px !important; }
  body.rni-information-page .rni-info-hero { padding: 24px 16px !important; }
  body.rni-information-page .rni-info-hero h2 {
    max-width: 100%;
    font-size: clamp(1.9rem, 8.4vw, 2.75rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.025em;
    white-space: normal !important;
  }
  body.rni-information-page .rni-info-hero > p { font-size: 1rem; line-height: 1.5; }
  body.rni-information-page .rni-info-search input { font-size: 16px; min-height: 48px; padding: 8px 12px; }
  body.rni-information-page .rni-info-section { padding: 18px 14px; }
  body.rni-information-page .rni-info-card-grid { grid-template-columns: minmax(0,1fr) !important; }
  body.rni-information-page .rni-policy-layout { padding: 16px 12px !important; }
  body.rni-information-page .rni-policy-content { padding: 20px 16px !important; }
  body.rni-information-page .rni-policy-content > h1 { font-size: clamp(1.85rem,8vw,2.5rem) !important; }
}
/* Department track: keep the last tile wholly reachable (not clipped to a
 * parent padding boundary) at both 320px phones and tablet widths. */
body.rni-premium-archive .rni-department-navigation { box-sizing: border-box; max-width: 100%; }
body.rni-premium-archive .rni-department-navigation__track {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 5px 12px 12px !important;
  scroll-padding-inline: 12px;
  scroll-snap-type: x mandatory;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}
body.rni-premium-archive .rni-department-navigation__track > a {
  min-width: 0;
  width: max-content;
  max-width: calc(100% - 16px);
  flex: 0 0 auto !important;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  white-space: nowrap;
}
body.rni-premium-archive .rni-department-navigation__track::after { flex: 0 0 16px !important; }
@media(max-width: 767px) {
  body.rni-premium-archive .rni-department-navigation { padding-inline: 8px !important; }
  body.rni-premium-archive .rni-category-hero {
    background-position: 68% center; /* photograph detail, not embedded left-side lettering */
  }
  body.rni-premium-archive .rni-category-hero h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.05;
    font-size: clamp(2rem, 9.5vw, 2.55rem) !important;
  }
  body.rni-premium-archive .rni-category-hero__content { box-sizing: border-box; max-width: 100%; }
}

/* rc5.32 — guard against a cached legacy hub/detail composite and make the
 * final quick-filter/tab chip reachable. These are Storefront-owned elements.
 * We deliberately avoid body {overflow-x:hidden}: it masks genuine problems.
 */
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) {
  display: block !important;
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) > .rni-policy-nav,
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) > .rni-policy-content > .rni-info-eyebrow,
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) > .rni-policy-content > h1,
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) > .rni-policy-content > .rni-policy-help {
  display: none !important;
}
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) > .rni-policy-content {
  display: block;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: none !important;
}
body.rni-information-page .rni-policy-layout:has(> .rni-policy-content .rni-info-hub) .rni-policy-copy {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.rni-premium-archive .rni-quick-filters,
body.rni-storefront-homepage .rni-product-tabs {
  box-sizing: border-box;
  display: flex;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 12px !important;
  scroll-padding-inline: 12px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
body.rni-premium-archive .rni-quick-filters::after,
body.rni-storefront-homepage .rni-product-tabs::after {
  content: '';
  display: block;
  width: 14px;
  min-width: 14px;
  flex: 0 0 14px;
  pointer-events: none;
}
body.rni-premium-archive .rni-quick-filters > a,
body.rni-storefront-homepage .rni-product-tabs > button {
  flex-shrink: 0;
}
@media(max-width: 767px) {
  body.rni-premium-archive .rni-quick-filters {
    padding-block: 12px 9px !important;
    margin-inline: 0 !important;
  }
  body.rni-information-page .rni-info-section-heading {
    display: block;
  }
  body.rni-information-page .rni-info-contact,
  body.rni-information-page .rni-info-contact > div,
  body.rni-information-page .rni-info-contact .button {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
