/* ================================================================
 *  custom.css — your own CSS
 *
 *  Loads after the template and theme.css, so a rule here wins any
 *  tie. Every template update ships this file empty: keep your copy
 *  when you update.
 * ================================================================ */

/* ---- Global white background ----
   The factory-1 theme tints the whole page concrete grey (#eeeeeb) via
   --color-bg / --color-bg-soft / --color-bg-muted. Override them here so the
   entire site reads clean white. Borders stay grey-derived on purpose: they
   keep section divisions visible now that fills are uniform. */
html[data-demo='factory-1'] {
    --color-bg: #fff;
    --color-bg-soft: #f7f7f5;
    --color-bg-muted: #f1f1ee;
}

/* ---- Transparent header ----
   The header floats over the hero image, so it is fully transparent
   with white text. On hover or scroll it picks up a solid backdrop. */
html[data-demo='factory-1'] .site-header {
    background: transparent !important;
    color: #fff;
    border-bottom-color: transparent !important;
    box-shadow: none !important;
    transition:
        background-color 0.3s var(--ease-out),
        color 0.3s var(--ease-out),
        border-color 0.3s var(--ease-out),
        box-shadow 0.3s var(--ease-out);
}

/* On hover: white background + dark text so the nav is readable */
html[data-demo='factory-1'] .site-header:hover {
    background: #fff !important;
    color: var(--color-text);
    border-bottom-color: var(--color-border) !important;
    box-shadow: 0 1px 0 var(--color-border) !important;
}

/* Brand & hamburger: white by default, dark on header hover */
html[data-demo='factory-1'] .site-header .brand,
html[data-demo='factory-1'] .site-header .hamburger {
    color: #fff !important;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header:hover .brand,
html[data-demo='factory-1'] .site-header:hover .hamburger {
    color: var(--color-text) !important;
}

/* ---- Nav item spacing ----
   Template default is a tight gap 0.25rem (4px) + padding-inline 1rem (16px),
   which makes the menu look cramped. Widen the breathing room between items.
   Scaled by viewport so the right-side language switch / socials never get
   squeezed (measured headroom: 1920px ~788px, 1366px ~298px). */
@media (width >= 1440px) {
    html[data-demo='factory-1'] .site-header .nav-links {
        gap: 0.875rem !important;
    }
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link {
        padding-inline: 1.625rem !important;
    }
}
@media (width >= 1200px) and (width < 1440px) {
    html[data-demo='factory-1'] .site-header .nav-links {
        gap: 0.5rem !important;
    }
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link {
        padding-inline: 1.125rem !important;
    }
}
/* Narrow desktop notch (1024–1199px): the template keeps the full two-row
   desktop header down to 1024px, but with widened nav spacing the language
   switch + RFQ button no longer fit and get clipped off the right edge. Tighten
   the gap/padding back so the whole header stays inside the viewport until the
   1023px mobile (hamburger) breakpoint takes over. */
@media (width >= 1024px) and (width < 1200px) {
    html[data-demo='factory-1'] .site-header .nav-links {
        gap: 0.25rem !important;
    }
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link {
        padding-inline: 0.75rem !important;
    }
}

/* Active nav underline: demo-factory-1.css anchors it at left:1rem to hug the
   original 16px padding. Now that padding grew, shift the line by the same
   amount so it stays aligned with the label's left edge. */
@media (width >= 1440px) {
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link.active:after {
        left: 1.625rem !important;
    }
}
@media (width >= 1200px) and (width < 1440px) {
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link.active:after {
        left: 1.125rem !important;
    }
}
@media (width >= 1024px) and (width < 1200px) {
    html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link.active:after {
        left: 0.75rem !important;
    }
}

/* Nav links: translucent white → solid white on hover/active;
   dark when the header itself is hovered. */
html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link {
    color: #ffffffbd !important;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link:hover,
html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link.active,
html[data-demo='factory-1'] .site-header .nav-links > li > .nav-link[aria-expanded='true'],
html[data-demo='factory-1'] .site-header .nav-links > li:is(:hover, :focus-within) > .nav-link {
    color: #fff !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-links > li > .nav-link {
    color: var(--color-text-soft) !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-links > li > .nav-link:hover,
html[data-demo='factory-1'] .site-header:hover .nav-links > li > .nav-link.active,
html[data-demo='factory-1'] .site-header:hover .nav-links > li > .nav-link[aria-expanded='true'],
html[data-demo='factory-1'] .site-header:hover .nav-links > li:is(:hover, :focus-within) > .nav-link {
    color: var(--color-text) !important;
}

/* Meta row: search, phone, RFQ mail, certs, socials — white by default,
   dark on header hover. */
html[data-demo='factory-1'] .site-header .nav-search-toggle,
html[data-demo='factory-1'] .site-header .nav-contact {
    color: #fff !important;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header .nav-search-toggle:hover,
html[data-demo='factory-1'] .site-header .nav-contact:hover {
    color: #fff !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-search-toggle,
html[data-demo='factory-1'] .site-header:hover .nav-contact {
    color: var(--color-text) !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-search-toggle:hover,
html[data-demo='factory-1'] .site-header:hover .nav-contact:hover {
    color: var(--color-primary-ink) !important;
}

html[data-demo='factory-1'] .site-header .nav-contact .btn {
    color: var(--color-primary-ink) !important;
}

/* Divider lines: subtle white → light border on header hover */
html[data-demo='factory-1'] .site-header .nav-contact:before,
html[data-demo='factory-1'] .site-header .nav-search-toggle:before {
    background: #ffffff24 !important;
    transition: background-color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header:hover .nav-contact:before,
html[data-demo='factory-1'] .site-header:hover .nav-search-toggle:before {
    background: var(--color-border) !important;
}

/* Social links */
html[data-demo='factory-1'] .site-header .nav-actions .nav-social .social-link {
    color: #ffffffb3 !important;
    transition: color 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header .nav-actions .nav-social .social-link:hover {
    color: #fff !important;
    background: #ffffff1a !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-actions .nav-social .social-link {
    color: var(--color-text-muted) !important;
}

html[data-demo='factory-1'] .site-header:hover .nav-actions .nav-social .social-link:hover {
    color: var(--color-text) !important;
    background: var(--color-bg-soft) !important;
}

/* Vertically center the icon links inside their list items. The template's
   .social-link is inline-flex, which leaves a baseline gap inside the <li>
   and pushes the icon ~2px above the SALES / EMAIL text baseline. Making the
   li a centered flex box puts every icon on the same horizontal mid-line. */
html[data-demo='factory-1'] .site-header .nav-social li {
    display: flex;
    align-items: center;
}

/* Local PNG social icons (replace the Phosphor font glyphs) */
html[data-demo='factory-1'] .site-header .nav-social .social-icon-img {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    object-fit: contain;
}

/* Header contact labels: the demo CSS paints these pure red, which disappears
   over the hero photo. Use the same translucent-white → muted-dark pattern as
   the rest of the meta row so the labels stay legible without shouting. */
html[data-demo='factory-1'] .site-header .custom-nav-key {
    color: #ffffffcc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header:hover .custom-nav-key,
html[data-demo='factory-1'] .site-header.scrolled .custom-nav-key {
    color: var(--color-text-muted) !important;
    text-shadow: none;
}

/* RFQ mail & certs */
html[data-demo='factory-1'] .site-header .custom-nav-mail {
    color: #fff !important;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header .custom-nav-mail:hover {
    color: #fff !important;
}

html[data-demo='factory-1'] .site-header:hover .custom-nav-mail {
    color: var(--color-text) !important;
}

html[data-demo='factory-1'] .site-header:hover .custom-nav-mail:hover {
    color: var(--color-primary-ink) !important;
}

html[data-demo='factory-1'] .site-header .custom-nav-certs {
    color: #ffffffb3 !important;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header:hover .custom-nav-certs {
    color: var(--color-text-muted) !important;
}

html[data-demo='factory-1'] .site-header .custom-nav-certs:before {
    background: #ffffff24 !important;
    transition: background-color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header:hover .custom-nav-certs:before {
    background: var(--color-border) !important;
}

/* ---- Bigger logo ----
   Header mark is logo_en.png (1125x467, ~2.41:1), so height sets the width.
   3.5rem = 56px tall, ~135px wide — fits inside the 76px logo row
   (--stack-lock) and the 176px brand slot (--stack-brand-w) without
   crowding the nav. The SVG tint filter floods the mark with currentColor,
   which is white while the header is transparent — a pure-white logo. */
html[data-demo='factory-1'] .site-header .brand-logo {
    filter: var(--logo-tint, none) !important;
    height: 3.5rem;
    width: auto;
}

/* Pointer over the header (nav included) restores the original coloured mark.
   Scrolled keeps the white logo so it stays legible on the dark frosted bar. */
html[data-demo='factory-1'] .site-header:not(.scrolled):hover .brand-logo {
    filter: none !important;
}

html[data-demo='factory-1'] .site-header .brand {
    font-size: 1.5rem;
}

@media (width >= 1024px) {
    html[data-demo='factory-1'] .site-header.header-stacked {
        --stack-brand-w: 11rem;
    }
}

/* ---- Row divider ----
   The stacked header already draws a 1px rule at the boundary between the
   logo row and the nav row. Make it a 50%-opaque white hairline. On hover the
   header turns solid white, so swap to a soft border to keep it visible. */
@media (width >= 1024px) {
    html[data-demo='factory-1'] .header-stacked:not(.scrolled) .navbar:before {
        background: rgb(255 255 255 / 0.5) !important;
        transition:
            background-color 0.3s var(--ease-out),
            opacity var(--stack-fade, 0.16s) var(--ease-out);
    }

    html[data-demo='factory-1'] .header-stacked:not(.scrolled):hover .navbar:before {
        background: var(--color-border) !important;
    }
}

/* The header is transparent so the hero slides up underneath it. */
html[data-demo='factory-1'] body:has(.header-stacked) {
    padding-top: 0;
}

html[data-demo='factory-1'] .custom-hero {
    height: 100svh !important;
}

/* Push the hero copy down so it clears the stacked header */
html[data-demo='factory-1'] .custom-hero .container {
    padding-top: calc(var(--stack-open-h) + clamp(1rem, 3vh, 2.5rem)) !important;
    padding-bottom: clamp(6rem, 4rem + 8vh, 9rem);
}

/* Inner-page headers use .custom-ph instead of .custom-hero. Push their
   content (breadcrumb + title) down by the same amount so the crumb clears
   the transparent stacked header instead of sitting underneath it. */
html[data-demo='factory-1'] .custom-ph .container {
    padding-top: calc(var(--stack-open-h) + clamp(1rem, 3vh, 2.5rem)) !important;
}

/* ---- Scrolled header ----
   Once the header folds down it sits over page content, so switch to a solid
   white bar with the original coloured logo and dark text. This mirrors the
   hover appearance, which keeps the two states visually consistent. */
html[data-demo='factory-1'] .site-header.scrolled,
html[data-demo='factory-1'] .site-header.scrolled:hover {
    background: #fff !important;
    color: var(--color-text) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 2px 16px rgb(0 0 0 / 0.12) !important;
    border-bottom-color: var(--color-border) !important;
}

/* Restore the coloured logo in the scrolled state */
html[data-demo='factory-1'] .site-header.scrolled .brand-logo,
html[data-demo='factory-1'] .site-header.scrolled:hover .brand-logo {
    filter: none !important;
}

/* Dark text on the white scrolled bar */
html[data-demo='factory-1'] .site-header.scrolled .brand,
html[data-demo='factory-1'] .site-header.scrolled .hamburger,
html[data-demo='factory-1'] .site-header.scrolled .nav-search-toggle,
html[data-demo='factory-1'] .site-header.scrolled .nav-contact,
html[data-demo='factory-1'] .site-header.scrolled .custom-nav-mail {
    color: var(--color-text) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-links > li > .nav-link {
    color: var(--color-text-soft) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-links > li > .nav-link:hover,
html[data-demo='factory-1'] .site-header.scrolled .nav-links > li > .nav-link.active,
html[data-demo='factory-1'] .site-header.scrolled .nav-links > li > .nav-link[aria-expanded='true'],
html[data-demo='factory-1'] .site-header.scrolled .nav-links > li:is(:hover, :focus-within) > .nav-link {
    color: var(--color-text) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-search-toggle:hover,
html[data-demo='factory-1'] .site-header.scrolled .nav-contact:hover,
html[data-demo='factory-1'] .site-header.scrolled .custom-nav-mail:hover {
    color: var(--color-primary-ink) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-contact .btn {
    color: var(--color-primary-ink) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-actions .nav-social .social-link {
    color: var(--color-text-muted) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-actions .nav-social .social-link:hover {
    color: var(--color-text) !important;
    background: var(--color-bg-soft) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .custom-nav-certs {
    color: var(--color-text-muted) !important;
}

html[data-demo='factory-1'] .site-header.scrolled .nav-contact:before,
html[data-demo='factory-1'] .site-header.scrolled .nav-search-toggle:before,
html[data-demo='factory-1'] .site-header.scrolled .custom-nav-certs:before {
    background: var(--color-border) !important;
}

/* ---- Hero arrows ----
   The traveller card is gone, so the slides are switched by these two
   arrows. They stay hidden until the pointer is over the hero. */
html[data-demo='factory-1'] .custom-hero {
    --hero-arrow-size: 3.25rem;
}

html[data-demo='factory-1'] .custom-hero .carousel-nav-hover {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    inset: 0;
}

html[data-demo='factory-1'] .custom-hero .carousel-nav-hover .carousel-btn {
    color: #fff;
    background: rgb(0 0 0 / 0.28);
    border-color: #ffffff40;
    border-radius: 50%;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
    width: var(--hero-arrow-size);
    height: var(--hero-arrow-size);
    font-size: 1.25rem;
    opacity: 0;
    transition:
        opacity 0.3s var(--ease-out),
        background-color 0.3s var(--ease-out),
        border-color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .custom-hero:hover .carousel-nav-hover .carousel-btn,
html[data-demo='factory-1'] .custom-hero .carousel-nav-hover:focus-within .carousel-btn {
    opacity: 1;
}

html[data-demo='factory-1'] .custom-hero .carousel-nav-hover .carousel-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

html[data-demo='factory-1'] .custom-hero .carousel-nav-hover .carousel-btn-prev {
    left: clamp(1rem, 3vw, 2.5rem);
}

html[data-demo='factory-1'] .custom-hero .carousel-nav-hover .carousel-btn-next {
    right: clamp(1rem, 3vw, 2.5rem);
}

/* The slide counter stands alone in the bottom row now */
html[data-demo='factory-1'] .custom-hero .custom-hero-count {
    font-size: 1.375rem;
    color: #ffffffb3;
}

html[data-demo='factory-1'] .custom-hero .custom-hero-count .swiper-pagination-current {
    color: #fff;
}

/* "Explore Products" button: red text (brand red) on the hero, including hover. */
html[data-demo='factory-1'] .custom-explore-btn,
html[data-demo='factory-1'] .custom-explore-btn:hover,
html[data-demo='factory-1'] .custom-explore-btn:focus-visible {
    color: var(--color-primary) !important;
}

/* ---- Language switcher ----
   Two plain links (中文 / EN) on the nav row, just left of the RFQ button.
   Colours follow the header state: white on the transparent hero, dark once
   the header turns solid on hover or scroll. */
html[data-demo='factory-1'] .site-header .nav-lang {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

html[data-demo='factory-1'] .site-header .nav-lang-link {
    color: #ffffff8f;
    text-decoration: none;
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .site-header .nav-lang-link:hover,
html[data-demo='factory-1'] .site-header .nav-lang-link.is-active {
    color: #fff;
}

html[data-demo='factory-1'] .site-header .nav-lang-divider {
    width: 1px;
    height: 0.875rem;
    background: #ffffff4d;
    transition: background-color 0.3s var(--ease-out);
}

/* Header hovered -> white background, so use dark text */
html[data-demo='factory-1'] .site-header:hover .nav-lang-link {
    color: var(--color-text-muted);
}

html[data-demo='factory-1'] .site-header:hover .nav-lang-link:hover,
html[data-demo='factory-1'] .site-header:hover .nav-lang-link.is-active {
    color: var(--color-text);
}

html[data-demo='factory-1'] .site-header:hover .nav-lang-divider {
    background: var(--color-border);
}

/* Scrolled -> white background, dark text (wins over the hover rules above) */
html[data-demo='factory-1'] .site-header.scrolled .nav-lang-link,
html[data-demo='factory-1'] .site-header.scrolled:hover .nav-lang-link {
    color: var(--color-text-muted);
}

html[data-demo='factory-1'] .site-header.scrolled .nav-lang-link:hover,
html[data-demo='factory-1'] .site-header.scrolled .nav-lang-link.is-active,
html[data-demo='factory-1'] .site-header.scrolled:hover .nav-lang-link:hover,
html[data-demo='factory-1'] .site-header.scrolled:hover .nav-lang-link.is-active {
    color: var(--color-text);
}

html[data-demo='factory-1'] .site-header.scrolled .nav-lang-divider,
html[data-demo='factory-1'] .site-header.scrolled:hover .nav-lang-divider {
    background: var(--color-border);
}

/* Desktop: give the nav row a third grid column so the switcher sits between
   the nav links (2/1) and the RFQ button (2/3). */
@media (width >= 1024px) {
    html[data-demo='factory-1'] .site-header.header-stacked .navbar-inner {
        grid-template-columns: 1fr auto auto;
    }

    html[data-demo='factory-1'] .site-header.header-stacked .nav-lang {
        grid-area: 2 / 2;
        justify-self: end;
        padding-inline-end: 0.75rem;
    }

    html[data-demo='factory-1'] .site-header.header-stacked .nav-actions > .btn {
        grid-area: 2 / 3;
    }
}

/* Mobile: the switcher lives inside the collapsible panel, not the bar. */
@media (width <= 1023px) {
    html[data-demo='factory-1'] .site-header .nav-lang {
        display: none;
    }
}

/* Products Portfolio (#mf-industries) top/bottom padding.
   Aligned with the site-wide uniform rhythm: every content section uses
   --section-space/3 above and below, so neighbouring seams are ~98px. */
html[data-demo='factory-1'] #mf-industries {
    padding-top: calc(var(--section-space) / 3) !important;
    padding-bottom: calc(var(--section-space) / 3) !important;
}

/* ---- Product Portfolio: 4 cards per row, both rows visible in one screen ----
   Template is 3 columns with tall 4:4.6 cards, so the 6 tiles need ~1340px and
   the 2nd row falls below the fold. On desktop switch to 4 columns and a squarer
   ~4:3.9 aspect so the 4+2 layout fits in a single viewport. Titles/descriptions
   are scaled down to fit the narrower cards; mobile keeps the template's 2/1
   column layout. */
@media (width >= 1024px) {
    html[data-demo='factory-1'] #mf-industries ul.grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    html[data-demo='factory-1'] #mf-industries .custom-tile {
        aspect-ratio: 4 / 3.9 !important;
        padding: clamp(1rem, 0.7rem + 0.7vw, 1.5rem) !important;
    }
    html[data-demo='factory-1'] #mf-industries .custom-tile > span.font-heading:nth-of-type(2) {
        font-size: clamp(1.25rem, 0.95rem + 0.7vw, 1.75rem) !important;
    }
    html[data-demo='factory-1'] #mf-industries .custom-tile > span:last-child {
        font-size: 0.8125rem !important;
        margin-top: 0.5rem !important;
        line-height: 1.3 !important;
    }
}

html[data-demo='factory-1'] #mf-story {
    padding-top: calc(var(--section-space) / 3) !important;
    padding-bottom: calc(var(--section-space) / 3) !important;
}

/* Story vertical slider: make each slide's image 16:9. The template fixes the
   swiper viewport and the images at 380px; override both with aspect-ratio so
   the width drives a 16:9 height. The swiper keeps a definite computed height,
   so vertical sliding/autoplay still work. */
html[data-demo='factory-1'] #mf-story .carousel-vertical .swiper {
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
}

html[data-demo='factory-1'] #mf-story .carousel-vertical .swiper-slide,
html[data-demo='factory-1'] #mf-story .carousel-vertical .carousel-slide {
    height: 100% !important;
}

html[data-demo='factory-1'] #mf-story .carousel-vertical .carousel-slide img {
    height: 100% !important;
    aspect-ratio: 16 / 9 !important;
}

/* Align the first line of the story copy with the top of the slider image.
   The image sits below the left column's eyebrow (21px) plus a 1.5rem gap,
   so push the right column down by the same amount. Desktop only — on narrow
   screens the columns stack and no offset is needed. */
@media (width >= 1024px) {
    html[data-demo='factory-1'] #mf-story .grid.lg\:col-span-5 {
        padding-top: 3.1rem !important;
    }
}

/* Capability stack cards: 16:9 photo at desktop.
   Keep the grid columns from overflowing (min-width:0) and let the image
   column fix the row height via aspect-ratio, without stretching. */
@media (width >= 1024px) {
    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] {
        min-height: 0 !important;
    }

    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] > div:first-child {
        min-width: 0;
        width: 100%;
        align-self: stretch !important;
        aspect-ratio: 16 / 9 !important;
    }

    /* Trim the text column so it fits the 16:9 image height, avoiding blank
       space under the photo. */
    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] > div:last-child {
        padding-block: 1.75rem !important;
    }

    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] h3 {
        padding-top: 1.5rem !important;
    }

    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] .custom-spec {
        margin-top: 1.5rem !important;
    }

    html[data-demo='factory-1'] #mf-capabilities [data-stack-panel] .btn-link {
        margin-top: 1.5rem !important;
    }
}

/* Blog post cards are wrapped in an <a> so the image and title both link to
   the article. Reset the anchor to behave like the original .card block. */
html[data-demo='factory-1'] .post-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

html[data-demo='factory-1'] .post-card-link .card-title {
    transition: color 0.3s var(--ease-out);
}

html[data-demo='factory-1'] .post-card-link:hover .card-title {
    color: var(--color-primary-ink);
}

/* ---- Global content width ----
   Desktop (≥2048px, e.g. 2560x1440): keep the 1680px cap — this width was
   approved as looking right on the large monitor.
   Laptop (1280–2047px, e.g. 1920x1200): fill the viewport up to 1840px instead
   of the old narrow cap. The old 80rem step used min(93.33rem, max) and the
   96rem step jumped straight to 1680px, which left a塌陷 between 1280–1536px
   (at 1440px the content区 was only 1280px). min(1840px, 100%) removes that
  塌陷 and lets the laptop layout breathe. 100% is relative to the parent's
  content box, so Chrome/Edge scrollbar-gutter differences cannot shift it
  (100vw includes the scrollbar and varies between browsers).
   Small screens (<1280px): keep the original responsive steps. */
html[data-demo='factory-1'] {
    --container-max: 1680px;
}

@media (width >= 40rem) {
    html[data-demo='factory-1'] { --container-width: min(46.67rem, var(--container-max)); }
}
@media (width >= 48rem) {
    html[data-demo='factory-1'] { --container-width: min(56rem, var(--container-max)); }
}
@media (width >= 64rem) {
    html[data-demo='factory-1'] { --container-width: min(74.67rem, var(--container-max)); }
}
/* The template hard-codes .container max-width as min(80rem, --container-max),
   min(96rem, ...) etc. inside its media queries — it does NOT read
   --container-width for the main content, so editing that variable does
   nothing here. Override .container directly instead.
   Laptop range: fluid up to 1840px, which also fixes the 1280–1536px塌陷
   (the template left it stuck at 1280px). Large desktop keeps 1680px. */
@media (width >= 80rem) and (width < 128rem) {
    html[data-demo='factory-1'] .container {
        max-width: min(1840px, 100%) !important;
    }
}
@media (width >= 128rem) {
    html[data-demo='factory-1'] .container {
        max-width: var(--container-max) !important;
    }
}

/* ---- Footer logo: white + larger ----
   The footer mark is logo.png (a white/transparent Stone Medical lockup).
   All pages now reference this same white asset; the old footer tint filter
   ref has been removed from the markup, so force no filter here as a safety.
   Default .brand-logo height is 1.6em (~38px inside text-2xl) — too small.
   Set an explicit pixel height so the mark reads clearly in the dark footer. */
html[data-demo='factory-1'] .site-footer .brand-logo {
    filter: none !important;
    height: 4rem !important;
    width: auto !important;
}

/* ---- Product megamenu: 7 tiles (template hardcodes 6) ----
   A 7th product was added, so the wide-screen grid must go from 6 to 7 columns
   or the last tile drops to a lonely second row. Below 1280px the template
   already uses 3 columns and wraps naturally, so leave that untouched. */
@media (width >= 1280px) {
    html[data-demo='factory-1'] .custom-mega .custom-mega-tiles {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }
}

/* ---- Site-wide uniform section spacing ----
   Reference: the seam between #mf-industries and #mf-story is
   (--section-space/3 bottom) + (--section-space/3 top) ≈ 98px. Apply that
   same rhythm to EVERY content section (all pages) so the whitespace
   between any two adjacent sections is identical. Attribute selector is
   used because the Tailwind class py-(--section-space) contains parentheses.
   Hero / page-head (padding 0) are intentionally not matched. */
html[data-demo='factory-1'] section[class*="py-(--section-space)"] {
    padding-top: calc(var(--section-space) / 3) !important;
    padding-bottom: calc(var(--section-space) / 3) !important;
}

/* Two spacing variants that don't use py-(--section-space) but still produce
   real inter-section whitespace:
   - index.html blog area uses the template .section.border-b (white bg), so
     both its top and bottom padding are visible gaps -> normalise to /3.
   - capability.html #mf-cnc-gallery uses pb-(--section-space) with pt:0; set
     it to /3 top and bottom so its seams match the 98px rhythm.
   The dark .custom-cta block is intentionally left alone: its padding is
   internal colour-block whitespace, not an inter-section gap. */
html[data-demo='factory-1'] section.section.border-b {
    padding-top: calc(var(--section-space) / 3) !important;
    padding-bottom: calc(var(--section-space) / 3) !important;
}
html[data-demo='factory-1'] #mf-cnc-gallery {
    padding-top: calc(var(--section-space) / 3) !important;
    padding-bottom: calc(var(--section-space) / 3) !important;
}

/* ---- Site-wide: cancel all forced uppercase ----
   The template applies `text-transform: uppercase` in app.css, the factory
   demo theme, and via Tailwind's `.uppercase` utility on ~150 elements.
   custom.css loads last, so this single high-specificity rule neutralises
   every one of them without touching the markup. Text keeps whatever case
   it was authored in; pseudo-elements are covered too. */
html[data-demo='factory-1'] *,
html[data-demo='factory-1'] *::before,
html[data-demo='factory-1'] *::after {
    text-transform: none !important;
}

/* ---- AMap locator placeholder notice (until a real key is configured) ---- */
.amap-notice {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: var(--color-background-secondary, #eef1f4);
    padding: 2rem;
}
.amap-notice-card {
    max-width: 30rem;
    display: grid;
    gap: 0.75rem;
    text-align: center;
}
.amap-notice-card strong {
    font-family: var(--font-heading, var(--font-sans));
    font-size: 1.5rem;
    line-height: 1.1;
}
.amap-notice-card span {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.75;
}
.amap-notice-card code {
    font-family: var(--font-mono, monospace);
    font-size: 0.85em;
}

/* ---- Contact page: site addresses as refined plain text beside RFQ form; map full width ---- */
html[data-demo='factory-1'] .custom-rfq-sites {
    display: grid;
    align-content: center;
    gap: 1.75rem;
}
html[data-demo='factory-1'] .custom-rfq-sites-title {
    margin: 0;
    font-family: var(--font-heading, var(--font-sans));
    font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
}
html[data-demo='factory-1'] .custom-rfq-site {
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-border);
}
html[data-demo='factory-1'] .custom-rfq-site:first-of-type {
    padding-top: 0;
    border-top: 0;
}
html[data-demo='factory-1'] .custom-rfq-site-title {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading, var(--font-sans));
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
}
html[data-demo='factory-1'] .custom-rfq-site-address {
    margin: 0 0 0.5rem;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.7;
}
html[data-demo='factory-1'] .custom-rfq-site-map {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary-ink);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}
html[data-demo='factory-1'] .custom-rfq-site-map:hover {
    color: var(--color-primary);
}
html[data-demo='factory-1'] .custom-rfq-site-map i {
    font-size: 0.95em;
}
html[data-demo='factory-1'] .map-locator--solo {
    grid-template-columns: minmax(0, 1fr);
}

/* ---- About page: figures block copied from another demo (custom-figures had no styles in factory-1) ---- */
html[data-demo='factory-1'] .custom-figures {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-self: end;
}
html[data-demo='factory-1'] .custom-figures > div {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem clamp(1rem, 2vw, 2rem);
    border: 0 !important;
}
html[data-demo='factory-1'] .custom-figures dt {
    color: var(--color-text-soft);
    font-size: 0.9375rem;
    line-height: 1.3;
}
html[data-demo='factory-1'] .custom-figures dd {
    margin: 0;
    font-family: var(--font-heading, var(--font-sans));
    font-size: clamp(2.25rem, 1.6rem + 2.5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary-ink, #d42a20);
}

/* ---- About page: OUR STORY + global footprint on white ---- */
html[data-demo='factory-1'] section[aria-labelledby='lo1-ab-title'] {
    background: #fff;
}
html[data-demo='factory-1'] #mf-ab-global {
    background: #fff;
}
html[data-demo='factory-1'] .custom-globe {
    display: flex;
    justify-content: center;
    background: #fff;
}
html[data-demo='factory-1'] .custom-globe video {
    display: block;
    width: min(100%, 26rem);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 0;
}

/* ---- Home page: make the team panel's muted background bleed full viewport width ---- */
html[data-demo='factory-1'] .marquee-panel.bg-muted {
    background-color: var(--color-bg, #eee);
    border-radius: 0;
    box-shadow: 0 0 0 100vmax var(--color-bg, #eee);
    clip-path: inset(0 -100vmax);
}

/* ---- Quality page: numbers band — transparent, separated from the section above, refined structure ---- */
html[data-demo='factory-1'] #mf-q-numbers.section-dark {
    position: relative;
    background: transparent !important;
    color: var(--color-text, #232323) !important;
    --on-surface: var(--color-text, #232323);
}
/* top rule echoes the site's custom-rule: short red lead-in into a hairline */
html[data-demo='factory-1'] #mf-q-numbers.section-dark::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(to right,
        var(--color-primary) 0 14%,
        color-mix(in srgb, var(--color-text, #232323) 14%, transparent) 14% 100%);
}
html[data-demo='factory-1'] #mf-q-numbers .text-white {
    color: var(--color-text, #232323);
}
html[data-demo='factory-1'] #mf-q-numbers .text-white\/60,
html[data-demo='factory-1'] #mf-q-numbers .text-white\/70 {
    color: var(--color-text-soft, #475569);
}
/* leading eyebrow reads like a traveler tag */
html[data-demo='factory-1'] #mf-q-numbers p.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5em 0.85em 0.45em;
    border: 1px solid color-mix(in srgb, var(--color-primary-ink, #d42a20) 36%, transparent);
}
html[data-demo='factory-1'] #mf-q-numbers p.eyebrow::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    flex: none;
    background: var(--color-primary);
}
/* quote gets a red left rule */
html[data-demo='factory-1'] #mf-q-numbers blockquote {
    padding-inline-start: 1.35rem;
    border-inline-start: 3px solid var(--color-primary);
}
/* stats: drop the grid hairlines, give each figure a red tick */
html[data-demo='factory-1'] #mf-q-numbers dl > div {
    border: 0 !important;
    position: relative;
    padding-block-start: 1.35rem;
}
html[data-demo='factory-1'] #mf-q-numbers dl > div::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 2.5rem;
    height: 2px;
    background: var(--color-primary);
}
/* right column cells carry ps-6 — indent the tick by the same amount so it lines up with the figure */
html[data-demo='factory-1'] #mf-q-numbers dl > div.ps-6::before {
    inset-inline-start: calc(var(--spacing) * 6);
}

/* ---- Products page: one product per row (8), hover zoom + animated copy ---- */
html[data-demo='factory-1'] .product-platform {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 1rem + 4vw, 5.5rem);
    scroll-margin-top: calc(var(--navbar-h, 5rem) + 2rem);
}
html[data-demo='factory-1'] .product-platform--soft {
    position: relative;
    isolation: isolate;
}
html[data-demo='factory-1'] .product-platform--soft::before {
    content: '';
    position: absolute;
    inset: calc(-1 * clamp(1.25rem, 0.75rem + 1vw, 2rem));
    background: var(--color-bg-soft, #f8fafc);
    border-radius: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
    z-index: -1;
}
html[data-demo='factory-1'] .product-platform--flip .product-platform-media {
    order: 2;
}
html[data-demo='factory-1'] .product-platform-media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    width: 100%;
    overflow: hidden;
}
html[data-demo='factory-1'] .product-platform-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-demo='factory-1'] .product-platform-img--primary {
    opacity: 1;
    transform: scale(1);
}
html[data-demo='factory-1'] .product-platform-img--alternate {
    opacity: 0;
    transform: scale(0.96);
}
html[data-demo='factory-1'] .product-platform:hover .product-platform-img--primary,
html[data-demo='factory-1'] .product-platform:focus-within .product-platform-img--primary {
    opacity: 0;
    transform: scale(1.03);
}
html[data-demo='factory-1'] .product-platform:hover .product-platform-img--alternate,
html[data-demo='factory-1'] .product-platform:focus-within .product-platform-img--alternate {
    opacity: 1;
    transform: scale(1);
}
html[data-demo='factory-1'] .product-platform-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
html[data-demo='factory-1'] .product-platform-tag {
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-demo='factory-1'] .product-platform-title {
    margin: 1.5rem 0 0;
    font-family: var(--font-heading, var(--font-sans));
    font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.95;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-demo='factory-1'] .product-platform-line {
    margin: 1.25rem 0 0;
    max-width: 34rem;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--color-text-soft, #475569);
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-demo='factory-1'] .product-platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.75rem 0 0;
}
html[data-demo='factory-1'] .product-platform-tags span {
    padding: 0.4em 0.75em;
    border: 1px solid color-mix(in srgb, var(--color-text, #232323) 20%, transparent);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
html[data-demo='factory-1'] .product-platform-link {
    margin-top: 1.75rem;
}
html[data-demo='factory-1'] .product-platform:hover .product-platform-tag,
html[data-demo='factory-1'] .product-platform:focus-within .product-platform-tag { transform: translateX(8px); }
html[data-demo='factory-1'] .product-platform:hover .product-platform-title,
html[data-demo='factory-1'] .product-platform:focus-within .product-platform-title { transform: translateX(14px); }
html[data-demo='factory-1'] .product-platform:hover .product-platform-line,
html[data-demo='factory-1'] .product-platform:focus-within .product-platform-line { transform: translateX(10px); }
html[data-demo='factory-1'] .product-platform--flip:hover .product-platform-tag,
html[data-demo='factory-1'] .product-platform--flip:focus-within .product-platform-tag { transform: translateX(-8px); }
html[data-demo='factory-1'] .product-platform--flip:hover .product-platform-title,
html[data-demo='factory-1'] .product-platform--flip:focus-within .product-platform-title { transform: translateX(-14px); }
html[data-demo='factory-1'] .product-platform--flip:hover .product-platform-line,
html[data-demo='factory-1'] .product-platform--flip:focus-within .product-platform-line { transform: translateX(-10px); }
@media (max-width: 1023px) {
    html[data-demo='factory-1'] .product-platform { grid-template-columns: minmax(0, 1fr); }
    html[data-demo='factory-1'] .product-platform--flip .product-platform-media { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html[data-demo='factory-1'] .product-platform-img,
    html[data-demo='factory-1'] .product-platform-tag,
    html[data-demo='factory-1'] .product-platform-title,
    html[data-demo='factory-1'] .product-platform-line { transition: none; }
}

/* Products page: catalog CTA — dark card, distinct from light product rows */
html[data-demo='factory-1'] .catalog-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
    padding: clamp(2.5rem, 2rem + 2vw, 4rem) 1.5rem;
    background: var(--custom-ink, #1a1c1e);
    color: #fff;
    border-radius: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
    scroll-margin-top: calc(var(--navbar-h, 5rem) + 2rem);
}
html[data-demo='factory-1'] .catalog-cta-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 1.75rem;
}
html[data-demo='factory-1'] .catalog-cta-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--color-primary, #d42a20);
    border-radius: 50%;
}
html[data-demo='factory-1'] .catalog-cta-icon .ph {
    font-size: 2.5rem;
    color: #fff;
    line-height: 1;
}
html[data-demo='factory-1'] .catalog-cta-title {
    color: #fff;
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
html[data-demo='factory-1'] .catalog-cta-btn {
    display: inline-block;
    margin-top: 2.25rem;
    padding: 0.85em 2.25em;
    background: var(--color-primary, #d42a20);
    color: #fff;
    font-weight: 700;
    border-radius: 0.35rem;
    transition: background 0.25s ease, transform 0.25s ease;
}
html[data-demo='factory-1'] .catalog-cta-btn:hover,
html[data-demo='factory-1'] .catalog-cta-btn:focus-visible {
    background: var(--color-primary-ink, #b82119);
    transform: translateY(-2px);
}
@media (max-width: 1023px) {
    html[data-demo='factory-1'] .catalog-cta { grid-column: 1 / -1; }
}


/* Quality page: story layout — intro + alternating text/photo rows with brand-coloured headings */
html[data-demo='factory-1'] .q-story-title {
    color: var(--color-primary, #d42a20);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
html[data-demo='factory-1'] .q-story-img {
    aspect-ratio: 16 / 9;
    border-radius: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
}

/* Quality page: full-bleed wide photo band flush against the footer — no section padding, keeps the template parallax reveal + drift */
html[data-demo='factory-1'] .q-image-band {
    padding: 0;
    border: 0;
}
html[data-demo='factory-1'] .q-image-band .parallax-unfold {
    width: 100%;
    height: clamp(24rem, 60vw, 46rem);
}

/* Article sidebar: Company Story card + author details card */
html[data-demo='factory-1'] .mf-company-card {
    display: grid;
    gap: 1.25rem;
}
html[data-demo='factory-1'] .mf-company-card-title {
    margin: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-default, #e5e7eb);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.4rem, 1.2rem + 0.7vw, 1.75rem);
    font-weight: 400;
    line-height: 1.25;
    color: var(--color-text, #111827);
}
html[data-demo='factory-1'] .mf-company-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
html[data-demo='factory-1'] .mf-company-card-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--color-text-soft, #6b7280);
}
html[data-demo='factory-1'] .mf-company-card-mail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: start;
    font-size: 0.9rem;
    font-weight: 600;
    color: #102868;
    text-decoration: none;
    overflow-wrap: anywhere;
}
html[data-demo='factory-1'] .mf-company-card-mail i {
    font-size: 1.15em;
}
html[data-demo='factory-1'] .mf-company-card-btn {
    display: block;
    padding: 0.85rem 1rem;
    background: #16181d;
    color: #fff;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.35rem;
    transition: background 0.25s ease, transform 0.25s ease;
}
html[data-demo='factory-1'] .mf-company-card-btn:hover,
html[data-demo='factory-1'] .mf-company-card-btn:focus-visible {
    background: #000;
    transform: translateY(-2px);
}

html[data-demo='factory-1'] .mf-author-card {
    padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    background: var(--color-bg-soft, #f5f5f3);
}
html[data-demo='factory-1'] .mf-author-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border-default, #e5e7eb);
}
html[data-demo='factory-1'] .mf-author-avatar {
    flex: none;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
}
html[data-demo='factory-1'] .mf-author-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-text, #111827);
}
html[data-demo='factory-1'] .mf-author-role {
    display: block;
    font-size: 0.9375rem;
    color: var(--color-text-soft, #6b7280);
}
html[data-demo='factory-1'] .mf-author-spec > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--color-border-default, #e5e7eb);
}
html[data-demo='factory-1'] .mf-author-spec dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-soft, #6b7280);
}
html[data-demo='factory-1'] .mf-author-spec dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}
html[data-demo='factory-1'] .mf-author-social {
    margin-top: 1.25rem;
}
html[data-demo='factory-1'] .mf-author-social .social-link {
    --social-size: 2.5rem;
    border: 1px solid var(--color-border-default, #d1d5db);
    border-radius: 50%;
}

/* Chinese banner headings: CJK glyphs are full-height squares, so the Latin-tuned
   0.86 line-height makes multi-line headlines collide. Give them breathing room
   only on zh-CN pages; English pages keep the original tight leading. */
html[lang="zh-CN"] #mf-hero-title,
html[lang="zh-CN"] #mf-page-title {
    line-height: 1.15 !important;
}

/* Equipment capacity section (competences): tighten layout, drop the oversized
   empty right column, and keep a clean white surface in both languages. */
html[data-demo='factory-1'] #mf-cap-equipment {
    background: #fff;
}
html[data-demo='factory-1'] #mf-cap-equipment > .container {
    max-width: 68rem;
    margin-inline: auto;
}
/* header: bring the two columns closer and give the note more weight */
html[data-demo='factory-1'] #mf-cap-equipment > .container > div:first-child {
    margin-bottom: clamp(1.75rem, 1rem + 2vw, 2.75rem);
    column-gap: 3rem;
}
html[data-demo='factory-1'] #mf-cap-equipment .custom-tabs .tabs-nav {
    margin-bottom: 1.5rem;
    border-bottom-color: rgba(0, 0, 0, 0.12);
}
/* table: balanced column weights, larger body text, tighter rows */
html[data-demo='factory-1'] #mf-cap-equipment .custom-table th:first-child,
html[data-demo='factory-1'] #mf-cap-equipment .custom-table td:first-child {
    width: 40%;
}
html[data-demo='factory-1'] #mf-cap-equipment .custom-table th:nth-child(2),
html[data-demo='factory-1'] #mf-cap-equipment .custom-table td:nth-child(2) {
    width: 15%;
}
html[data-demo='factory-1'] #mf-cap-equipment .custom-table th:nth-child(3),
html[data-demo='factory-1'] #mf-cap-equipment .custom-table td:nth-child(3) {
    width: 45%;
}
html[data-demo='factory-1'] #mf-cap-equipment .custom-table th {
    opacity: 0.75;
    padding-bottom: 0.75rem;
}
html[data-demo='factory-1'] #mf-cap-equipment .custom-table td {
    font-size: 1rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

/* Mobile header hotline: the inherited 16px font size and normal white-space
   wrap the phone number into 4 lines beside the small label. Stack the label
   above a single-line number with a clear size hierarchy. */
@media (width < 1024px) {
    html[data-demo='factory-1'] .site-header .nav-contact-value {
        display: block;
        white-space: nowrap;
        font-size: 0.8125rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        line-height: 1.15;
    }
    html[data-demo='factory-1'] .site-header .custom-nav-key {
        display: block;
        font-size: 0.625rem;
        letter-spacing: 0.04em;
        margin-inline-end: 0;
        line-height: 1.3;
    }
}

/* ---- Chinese site logo ----
   The CN pages use logo_cn.png (500x188, 2.66:1 — icon + 世通给药 + Stone Medical)
   instead of logo_en.png. It behaves exactly like the English mark: the inline
   --logo-tint filter paints it as a pure-white silhouette while the header is
   transparent, and the coloured mark is restored on header hover and once the
   header turns solid white on scroll. Only the box size differs: the CN lockup
   is 2.66:1 (the EN mark 2.17:1), so 3.5rem tall / 4rem in the footer keeps the
   wordmark readable. */
html[data-demo='factory-1'] .site-header .brand-logo[src*='logo_cn.png'] {
    filter: var(--logo-tint, none) !important;
    height: 3.5rem;
    width: auto;
}

html[data-demo='factory-1'] .site-header:not(.scrolled):hover .brand-logo[src*='logo_cn.png'],
html[data-demo='factory-1'] .site-header.scrolled .brand-logo[src*='logo_cn.png'],
html[data-demo='factory-1'] .site-header.scrolled:hover .brand-logo[src*='logo_cn.png'] {
    filter: none !important;
}

html[data-demo='factory-1'] .site-footer .brand-logo[src*='logo_cn.png'] {
    filter: none !important;
    height: 4rem !important;
    width: auto !important;
}

@media (width <= 767px) {
    html[data-demo='factory-1'] .site-header .brand-logo[src*='logo_cn.png'] {
        height: 2.75rem;
    }
}

/* Homepage section headings: center "Expertise people..." and "News".
   The News header keeps its carousel arrows on the right on desktop.
   On phones the arrows drop to their own line so they never overlap the title. */
html[data-demo='factory-1'] .carousel-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
}
html[data-demo='factory-1'] .carousel-heading-centered {
    grid-column: 2;
    text-align: center;
}
html[data-demo='factory-1'] .carousel-header .carousel-btns {
    grid-column: 3;
    justify-self: end;
}
@media (width <= 767px) {
    html[data-demo='factory-1'] .carousel-header {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        row-gap: 1rem;
    }
    html[data-demo='factory-1'] .carousel-heading-centered,
    html[data-demo='factory-1'] .carousel-header .carousel-btns {
        grid-column: 1;
        justify-self: center;
    }
}
