/* ============================================================
   Base template — small template-specific CSS.

   Everything structural/component comes from the shared Microweber
   CSS framework (which vendors Bootstrap). This file only holds the
   few things that are specific to the Base template itself.

   Shop-filter (/shop sidebar) refinements moved to the framework's
   components/mw-shop.css so every template shares them.
   ============================================================ */

/* Template font. */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700&display=swap');

/* Touch-target safety: interactive targets >= 44px (WCAG 2.5.5).
   The framework already pads buttons; this covers bare links/icons/nav. */
@media (pointer: coarse), (max-width: 1024px) {
    .main a.btn,
    .header-background a,
    .footer-background a,
    .menu a,
    .navbar a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ============================================================
   Mobile layout normalizer (task-2026-10-11 — Base/Big layout parity).

   Mirror of the block in Templates/Bootstrap/.../public-touch.css (which the
   Big + Bootstrap templates load). Base is independent of those templates, so
   it carries its own copy here. The layout skin .blade files are identical
   across templates, so the same two rules fix both:
     (1) nothing in a layout section may overflow the viewport width;
     (2) horizontal spacing utilities (me / ms) that only gap a DESKTOP
         flex row (.d-md-flex / .d-lg-flex) collapse to 0 once the row stacks
         on mobile, so content stays symmetric instead of being pushed aside.
   Scoped to [data-layout-container] + below the md breakpoint so admin/form
   chrome and desktop layouts are untouched.
   ============================================================ */
@media (max-width: 767.98px) {
    [data-layout-container] img,
    [data-layout-container] video,
    [data-layout-container] iframe,
    [data-layout-container] table {
        max-width: 100% !important;
        height: auto;
    }

    [data-layout-container] h1,
    [data-layout-container] h2,
    [data-layout-container] h3,
    [data-layout-container] h4,
    [data-layout-container] h5,
    [data-layout-container] h6,
    [data-layout-container] p,
    [data-layout-container] a,
    [data-layout-container] span,
    [data-layout-container] li {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    [data-layout-container] .d-md-flex > .me-1,
    [data-layout-container] .d-md-flex > .me-2,
    [data-layout-container] .d-md-flex > .me-3,
    [data-layout-container] .d-md-flex > .me-4,
    [data-layout-container] .d-md-flex > .me-5,
    [data-layout-container] .d-lg-flex > .me-1,
    [data-layout-container] .d-lg-flex > .me-2,
    [data-layout-container] .d-lg-flex > .me-3,
    [data-layout-container] .d-lg-flex > .me-4,
    [data-layout-container] .d-lg-flex > .me-5 {
        /* Bootstrap .me-* use the logical margin-inline-end (RTL-aware), so the
           override must use the same property to win the cascade. */
        margin-inline-end: 0 !important;
    }

    [data-layout-container] .d-md-flex > .ms-1,
    [data-layout-container] .d-md-flex > .ms-2,
    [data-layout-container] .d-md-flex > .ms-3,
    [data-layout-container] .d-md-flex > .ms-4,
    [data-layout-container] .d-md-flex > .ms-5,
    [data-layout-container] .d-lg-flex > .ms-1,
    [data-layout-container] .d-lg-flex > .ms-2,
    [data-layout-container] .d-lg-flex > .ms-3,
    [data-layout-container] .d-lg-flex > .ms-4,
    [data-layout-container] .d-lg-flex > .ms-5 {
        margin-inline-start: 0 !important;
    }

    /* Columns that only define a >=md width (no base col / col-sm) size to their
       content on phones instead of stacking, which leaves the grid lop-sided.
       Force those full-width. Columns WITH an explicit mobile width
       (col / col-1..12 / col-sm-*) are excluded so intended multi-up mobile
       layouts (e.g. col-6 col-lg-3) are preserved. */
    [data-layout-container] .row > [class*="col-md-"]:not([class~="col"]):not([class~="col-1"]):not([class~="col-2"]):not([class~="col-3"]):not([class~="col-4"]):not([class~="col-5"]):not([class~="col-6"]):not([class~="col-7"]):not([class~="col-8"]):not([class~="col-9"]):not([class~="col-10"]):not([class~="col-11"]):not([class~="col-12"]):not([class*="col-sm-"]),
    [data-layout-container] .row > [class*="col-lg-"]:not([class~="col"]):not([class~="col-1"]):not([class~="col-2"]):not([class~="col-3"]):not([class~="col-4"]):not([class~="col-5"]):not([class~="col-6"]):not([class~="col-7"]):not([class~="col-8"]):not([class~="col-9"]):not([class~="col-10"]):not([class~="col-11"]):not([class~="col-12"]):not([class*="col-sm-"]):not([class*="col-md-"]) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Shop products / posts grids: these modules nest a `.row.big-news` whose
       negative gutters, combined with the container padding, skew the stacked
       cards to one side on phones (e.g. blog/skin-1 posts render L0/R24). Zero
       the horizontal gutters so the stacked cards sit symmetrically. */
    [data-layout-container] .module-shop-products .row,
    [data-layout-container] .module-posts .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Breadcrumbs: a long page title (one unbreakable token) must wrap/break
       instead of pushing the trail past the viewport edge. */
    [data-layout-container] .breadcrumb {
        flex-wrap: wrap;
    }
    [data-layout-container] .breadcrumb-item,
    [data-layout-container] .breadcrumb-item > a {
        min-width: 0;
        flex-shrink: 1;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Pagination: the page-number list must wrap instead of marching off the
       right edge on phones. Contact-form (skin-3) and shop/ecommerce skins embed
       a .pagination whose .page-item LIs otherwise overflow the viewport. */
    [data-layout-container] .pagination {
        flex-wrap: wrap;
    }
}
