/* Relia mobile layout, 2026-10-22. Desktop composition and page content stay intact. */
@media (max-width:1199px) {
  /* The drawer host must not create a second grid row in the mobile header. */
  body .f-header .f-header__mobile {
    grid-template-rows: minmax(66px, auto);
    align-content: center;
  }
  body .f-header .f-header__mobile > mega-menu { display: contents; }
  body .f-header .f-header__mobile > :is(.f-menu-button,.f-logo,.f-header__mobile-right) {
    grid-row: 1;
    align-self: center;
  }
  body .f-header .f-header__mobile .f-logo__image { padding-block: 0; }
  body .f-header .f-header__mobile .f-menu-button {
    height: 44px;
    justify-content: flex-start;
  }
  body .f-header .f-header__mobile .f-header__search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
    padding: 10px;
  }
  body .f-header .mws-header-quote--mobile {
    min-height: 44px;
    padding-block: 10px;
  }
}

@media (max-width:767px) {
  /* Give each home section one shared outer gutter, with room inside cards. */
  body.template-home .mws9-section :is(.container,.container-fluid),
  body.template-home .mws2-section :is(.container,.container-fluid) {
    padding-inline: 18px;
  }
  body.template-home .mws9-section .f-section-py {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
  body.template-home .mws9-hero .f-slide__wrapper { width: calc(100% - 36px); }
  body.template-home .mws9-home :is(.mws9-company,.mws9-order,.mws9-process-grid,.mws9-guide-grid) {
    min-width: 0;
    gap: 24px;
  }
  body.template-home .mws9-home .mws9-lead { line-height: 1.75; }
  body.template-home .mws9-capabilities { grid-template-columns: minmax(0,1fr); gap: 18px; }
  body.template-home .mws9-capabilities dt { font-size: 15px; margin-bottom: 6px; }
  body.template-home .mws9-capabilities dd { font-size: 14px; line-height: 1.7; }
  body.template-home .mws9-process-card,
  body.template-home .mws9-process-card.mws9-process-compact {
    grid-template-columns: minmax(0,1fr);
  }
  body.template-home .mws9-process-card figure img {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16/9;
    object-fit: cover;
  }
  body.template-home .mws9-process-card figcaption { padding: 8px 18px; font-size: 10px; }
  body.template-home .mws9-process-card .mws9-process-copy {
    padding: 22px 18px 18px;
  }
  body.template-home .mws9-process-card .mws9-process-copy h3 { font-size: 22px; line-height: 1.35; }
  body.template-home .mws9-process-card .mws9-process-copy > p { font-size: 15px; line-height: 1.75; }
  body.template-home .mws9-process-compact .mws9-spec-strip { gap: 10px; padding-block: 12px; }
  body.template-home .mws9-process-compact .mws9-spec-strip dt { font-size: 11px; }
  body.template-home .mws9-process-compact .mws9-spec-strip dd { font-size: 13px; }
  body.template-home .mws9-process-card .mws9-text-link { font-size: 14px; }
  body.template-home .mws9-inspection { padding: 26px 18px; }
  body.template-home .mws9-inspection p { font-size: 15px; line-height: 1.75; }
  body.template-home .mws9-checkpoints p { font-size: 14px; }
  body.template-home .mws9-guide-card { padding: 24px 18px 0; }
  body.template-home .mws9-guide-card > p:not(.mws9-overline) { font-size: 15px; line-height: 1.75; }
  body.template-home .mws9-library-link { margin-inline: -18px; padding-inline: 18px; }
  body.template-home .mws9-order-path { grid-template-columns: minmax(0,1fr); gap: 18px; }
  body.template-home .mws9-order-path h3 { font-size: 16px; }
  body.template-home .mws9-order-path p { font-size: 14px; line-height: 1.7; }
  body.template-home .mws2-rfq { padding: 28px 18px; }
  body.template-home .mws2-bottom { gap: 32px; }
  body.template-home .mws2-bottom summary { min-height: 44px; line-height: 1.65; }

  /* Remove nested outer+inner gutters on the long-form custom pages. */
  body.template-page .main-page > :is(.container,.container-fluid):has(.relia-screens) {
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
  }
  body.template-page article.relia-screens {
    --rg-ui-inset: 20px;
    max-width: 100% !important;
  }
  body.template-page article.relia-screens .rg-screen {
    min-height: 0;
    padding: 48px var(--rg-ui-inset) 36px !important;
    margin-bottom: 12px !important;
    border-inline: 0;
    scroll-margin-top: 82px;
  }
  body.template-page article.relia-screens .rg-screen-hero { padding-top: 36px !important; }
  body.template-page article.relia-screens .rg-screen-index { top: 16px; }
  body.template-page article.relia-screens h1 {
    font-size: clamp(28px,7.7vw,34px) !important;
    line-height: 1.23 !important;
    margin-bottom: 20px !important;
    max-width: none;
    text-wrap: balance;
  }
  body.template-page article.relia-screens :is(h2,.rg-chart-title,.rg-enquiry-brief h2) {
    font-size: clamp(24px,6.5vw,28px) !important;
    line-height: 1.3 !important;
    margin-bottom: 20px !important;
    max-width: none;
    text-wrap: balance;
  }
  body.template-page article.relia-screens h3 {
    font-size: 21px !important;
    line-height: 1.4 !important;
    margin-bottom: 14px !important;
  }
  body.template-page article.relia-screens p {
    font-size: 16px !important;
    line-height: 1.75 !important;
    margin-bottom: 20px !important;
    max-width: none;
  }
  body.template-page article.relia-screens .rg-screen-photo .rg-takeaway {
    font-size: 17px !important;
    line-height: 1.75 !important;
  }
  body.template-page article.relia-screens .rg-screen-photo,
  body.template-page article.relia-screens .rg-screen-detail,
  body.template-page article.relia-screens .rg-decision-grid,
  body.template-page article.relia-screens .rg-screen-enquiry { gap: 24px; }
  body.template-page article.relia-screens .rg-screen-hero { gap: 0; }
  body.template-page article.relia-screens .rg-screen-hero > .rg-figure { margin-bottom: 24px !important; }
  body.template-page article.relia-screens .rg-kicker { margin-bottom: 14px; }
  body.template-page article.relia-screens .rg-hero-actions { margin-top: 22px; gap: 12px; }
  body.template-page article.relia-screens .rg-hero-actions > :is(a,button) { min-height: 46px; }
  body.template-page article.relia-screens .rg-reading-nav {
    position: static;
    padding: 12px;
    overflow: visible;
    margin-bottom: 12px;
    border-inline: 0;
  }
  body.template-page article.relia-screens .rg-reading-nav ol {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
    min-width: 0;
    gap: 8px;
  }
  body.template-page article.relia-screens .rg-reading-nav li { width: auto; }
  body.template-page article.relia-screens .rg-reading-nav a { min-height: 48px; padding: 9px; font-size: 12px; }
  body.template-page article.relia-screens .rg-reading-label { display: none; }
  body.template-page article.relia-screens .rg-nodes strong { font-size: 17px; margin-bottom: 7px; }
  body.template-page article.relia-screens .rg-nodes div > span { font-size: 15px; line-height: 1.75; }
  body.template-page article.relia-screens .rg-product-card { padding: 24px 18px; }
  body.template-page article.relia-screens .rg-guide-card { padding: 24px 42px 24px 18px; }
  body.template-page article.relia-screens .rg-guide-card > span:last-child { line-height: 1.75; }
  body.template-page article.relia-screens .rg-rfq { padding: 24px 18px; }
  body.template-page article.relia-screens .rg-contacts { gap: 20px; padding-top: 24px; }
  body.template-page article.relia-screens :is(.rg-copy,.rg-explanation,.rg-visual,.rg-figure,.rg-product-card,.rg-guide-card) {
    min-width: 0;
    max-width: 100%;
  }
  body.template-page article.relia-screens :is(p,li,td,a) { overflow-wrap: anywhere; }
}

@media (max-width:600px) {
  /* Let the fixed enquiry bar participate in the root stack above the footer. */
  body article.relia-screens { isolation: auto !important; }
  body:has(.rg-mobile-actions) .f-footer {
    position: relative;
    z-index: 0;
    isolation: isolate;
  }
  body article.relia-screens .rg-mobile-actions {
    z-index: 45;
    background: #fff;
    isolation: isolate;
    padding: 10px 14px max(10px,env(safe-area-inset-bottom));
  }
  body article.relia-screens .rg-mobile-actions > a { flex: 0 0 auto; }
  body article.relia-screens .rg-mobile-actions > button { min-width: 0; }
  body.template-page article.relia-screens :is(th,td) { padding: 15px 16px !important; line-height: 1.75; }
  body.template-page article.relia-screens .rg-table-wrap { overflow-x: visible; }
}

@media (max-width:360px) {
  body .f-header .f-header__mobile { padding-inline: 12px; grid-template-columns: 40px minmax(0,1fr) 100px; }
  body .f-header .f-header__mobile .f-logo a { width: min(144px,100%); }
  body .f-header .f-header__mobile-right { width: 100px; gap: 4px; }
  body .f-header .mws-header-quote--mobile { padding-inline: 9px; font-size: 12px; }
  body.template-page article.relia-screens { --rg-ui-inset: 18px; }
  body.template-home .mws9-process-copy .mws9-route-four { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body.template-home .mws9-process-copy .mws9-route-four li::before { display: none; }
}
