/* --------------------------------------------------------------------------
   MeasureMaster shared responsive layer
   Loaded after the page themes so every public page uses the same masthead,
   page artwork and viewport rules.
   -------------------------------------------------------------------------- */

/* The masthead is defined once in mm.css (see /partials/site-header.html and
   the --mm-* tokens). This file must not repeat or override header rules. */

/* The artwork is intentionally subtle so it reads as a page watermark without
   reducing contrast. The old mm.css rule hid this layer completely. */
.page-bg {
    display: block !important;
    background-attachment: fixed !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    opacity: .075;
    mix-blend-mode: multiply;
}
body[data-page="index.html"] .page-bg { background-image: url('/bg/bg-home.svg') !important; }
body[data-page="die-ovality.html"] .page-bg { background-image: url('/bg/bg-ovality.svg') !important; }
body[data-page="technology.html"] .page-bg { background-image: url('/bg/bg-technology.svg') !important; }
body[data-page="solutions.html"] .page-bg { background-image: url('/bg/bg-solutions.svg') !important; }
body[data-page="achievements.html"] .page-bg { background-image: url('/bg/bg-achievements.svg') !important; }
body[data-page="about.html"] .page-bg { background-image: url('/bg/bg-about.svg') !important; }
body[data-page="contact.html"] .page-bg { background-image: url('/bg/bg-contact.svg') !important; }
body[data-page="ip-notice.html"] .page-bg { background-image: url('/bg/bg-ip.svg') !important; }
body[data-page="404.html"] .page-bg { background-image: url('/bg/bg-404.svg') !important; }
body[data-page="ovality-calculator.html"] .page-bg,
body[data-page="how-to-measure-ovality.html"] .page-bg,
body[data-page="glossary.html"] .page-bg { background-image: url('/bg/bg-ovality.svg') !important; }
body.agency-page .page-bg {
    display: block !important;
    background-image: url('/bg/bg-agency.svg') !important;
    opacity: .13;
    mix-blend-mode: screen;
}
body.agency-page main { background: transparent; }

/* Avoid clipped cards, tables and long labels at narrow widths. */
.container, .footer-grid { width: 100%; }
.hub-hero-inner, .hub-section-head, .hub-product-head,
.ag-section-head, .ag-intro-grid, .ag-proof, .ag-cta-inner,
.ag-subgrid, .pay-detail, .pay-checkout { min-width: 0; }
table { max-width: 100%; }
@media (max-width: 900px) {
    .hub-section-head, .hub-product-head { grid-template-columns: 1fr; gap: 18px; }
    .hub-section-head .hub-lead, .hub-product-head .hub-lead { justify-self: start; }
    .hub-hero-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-hero-rail > div:nth-child(2) { border-right: 0; }
    .hub-hero-rail > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.07); }
}
@media (max-width: 680px) {
    .container, .container-narrow { padding-left: 20px; padding-right: 20px; }
    .hub-hero-inner { padding-left: 20px; padding-right: 20px; }
    .hub-hero-copy { padding-top: 60px; padding-bottom: 64px; padding-right: 0; }
    .hub-hero h1 { font-size: clamp(2.35rem, 11vw, 3.35rem); }
    .hub-hero-actions, .hero-buttons, .cta-buttons { align-items: stretch; flex-direction: column; }
    .hub-btn, .btn-primary, .btn-ghost { width: 100%; justify-content: center; white-space: normal; text-align: center; }
    .hub-hero-rail > div { padding: 16px 18px; gap: 10px; }
    .hub-hero-rail b { white-space: normal; font-size: .78rem; }
    .hub-practices, .hub-product-grid { grid-template-columns: 1fr; }
    .hub-practice { padding: 30px 24px 28px; }
    .hub-resources { align-items: flex-start; flex-direction: column; gap: 12px; }
    .hub-readout { right: 20px; bottom: 22px; }
    .page-bg { opacity: .045; background-attachment: scroll !important; }
    body.agency-page .page-bg { opacity: .08; }
}
@media (max-width: 420px) {
    .hub-hero-rail { grid-template-columns: 1fr; }
    .hub-hero-rail > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
    .hub-hero-rail > div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .page-bg { background-attachment: scroll !important; }
}

/* Keep wide content inside the viewport on public pages. */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
table.mm-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
}
table.mm-table th,
table.mm-table td {
    overflow-wrap: anywhere;
}
.ag-ticker {
    width: 100%;
    max-width: 100%;
}
