/**
 * Shared CMS prose — category bottom copy, home CMS blocks, PDP Description rhythm.
 * Matches .acme-pdp-prose typography / checkmark lists / read-more controls.
 */
.acme-cms-prose,
.acme-category-description.acme-cms-prose,
.acme-home-cms.acme-cms-prose {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #0f2d52;
    font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
}

.acme-cms-prose h1,
.acme-cms-prose h2,
.acme-cms-prose h3,
.acme-cms-prose h4,
.acme-cms-prose h5,
.acme-cms-prose h6 {
    margin: 0.85rem 0 0.35rem;
    font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
    color: #0f2d52;
}

.acme-cms-prose h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.acme-cms-prose h2 {
    font-size: 1.5rem;
    line-height: 1.35;
}

.acme-cms-prose h3 {
    font-size: 1.25rem;
    line-height: 1.35;
}

.acme-cms-prose h4,
.acme-cms-prose h5,
.acme-cms-prose h6 {
    font-size: 1.125rem;
    line-height: 1.35;
}

.acme-cms-prose p,
.acme-cms-prose li {
    margin: 0 0 0.5rem;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.5;
    color: #0f2d52;
}

.acme-cms-prose ul,
.acme-cms-prose ol {
    margin: 0 0 0.85rem;
    max-width: none;
}

.acme-cms-prose ul {
    list-style: none !important;
    padding-left: 0 !important;
}

.acme-cms-prose ol {
    list-style-type: decimal !important;
    padding-left: 1.5rem !important;
}

.acme-cms-prose ul > li {
    position: relative;
    display: block !important;
    margin: 0 0 0.35rem;
    padding: 0 0 0 1.75rem;
    line-height: 1.5;
}

/* PageBuilder wraps each bullet in <p> — kill the extra paragraph margin or gaps stack */
.acme-cms-prose ul > li > p,
.acme-cms-prose ul > li > p:last-child {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

/* Linked vs plain bullets must share the same box model (PB <a> was adding rhythm) */
.acme-cms-prose ul > li:has(a),
.acme-cms-prose ul > li:not(:has(a)) {
    margin: 0 0 0.35rem !important;
}

.acme-cms-prose ul > li a {
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    vertical-align: baseline !important;
    line-height: inherit !important;
    font-size: inherit !important;
}

.acme-cms-prose ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: #1f99ce url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7.5 12.2L10.3 15L16.5 8.8' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}

.acme-cms-prose ol > li {
    display: list-item !important;
    margin: 0 0 0.4rem;
    padding: 0;
}

.acme-cms-prose strong,
.acme-cms-prose b {
    font-weight: 700;
    color: #0f2d52;
}

.acme-cms-prose a {
    color: #0a5f8a;
    text-decoration: underline;
}

/*
 * Authored Page Builder / TinyMCE tables — Admin shows padded bordered cells;
 * Hyvä Tailwind preflight + TinyMCE inline padding:1px made storefront look crushed.
 * Match acme-cms-page.css table treatment (category + CMS prose hosts).
 */
.acme-cms-prose table {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 1.5rem;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
    font-size: 1rem;
    line-height: 1.45;
    color: #0f2d52;
    border: 1px solid #d7dee8;
    background: #ffffff;
}

.acme-cms-prose thead th,
.acme-cms-prose th {
    background: #f3f6fa;
    font-weight: 600;
    color: #0f2d52;
}

.acme-cms-prose th,
.acme-cms-prose td {
    padding: 0.7rem 0.85rem !important;
    border: 1px solid #d7dee8 !important;
    text-align: left !important;
    vertical-align: top;
    word-break: break-word;
}

.acme-cms-prose th > p,
.acme-cms-prose td > p,
.acme-cms-prose th > p:last-child,
.acme-cms-prose td > p:last-child {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

.acme-cms-prose th > p strong,
.acme-cms-prose td > p strong,
.acme-cms-prose th strong,
.acme-cms-prose td strong {
    font-weight: 700;
}

.acme-cms-prose__more[hidden] {
    display: none !important;
}

.acme-cms-prose__ellipsis {
    display: inline;
    margin: 0;
    color: #0f2d52;
    font-weight: 600;
    letter-spacing: 0.08em;
    vertical-align: baseline;
}

.acme-cms-prose__trail {
    display: inline;
    white-space: nowrap;
    vertical-align: baseline;
}

.acme-home-seo.acme-home-prose.acme-cms-prose,
.acme-home-seo.acme-home-prose {
    text-align: center;
}

.acme-home-seo.acme-home-prose > h1,
.acme-home-seo.acme-home-prose > h2,
.acme-home-seo.acme-home-prose > h3:not(.acme-faq__title):not(.acme-faq__question),
.acme-home-seo.acme-home-prose > p {
    text-align: center;
    color: #5a6a7e;
}

.acme-home-seo.acme-home-prose > h1,
.acme-home-seo.acme-home-prose > h1.acme-home-seo__lead,
.acme-home-seo.acme-home-prose > h2 {
    color: #0f2d52;
}

.acme-home-seo.acme-home-prose > p:has(.acme-cms-prose__trail) {
    text-align: center;
    max-width: var(--acme-home-prose-measure, 60rem);
    margin-inline: auto;
}

.acme-cms-prose.is-expanded .acme-cms-prose__ellipsis {
    display: none !important;
}

.acme-cms-prose__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 0 0 0.15em;
    padding: 0.2rem 0.65rem;
    border: 1px solid rgba(10, 95, 138, 0.55);
    border-radius: 0.375rem;
    background:
        linear-gradient(180deg, rgba(10, 95, 138, 0.08) 0%, rgba(10, 95, 138, 0.02) 100%),
        #ffffff;
    /* WCAG AA on white — brand #1f99ce fails contrast. */
    color: #0a5f8a;
    font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-decoration: none;
    vertical-align: baseline;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 45, 82, 0.06);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.acme-cms-prose__toggle::after {
    content: "";
    display: inline-block;
    width: 0.45em;
    height: 0.45em;
    margin-top: -0.15em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin-top 0.2s ease;
}

.acme-cms-prose__toggle:hover,
.acme-cms-prose__toggle:focus-visible {
    background: #1f99ce;
    border-color: #0a5f8a;
    color: #ffffff;
    outline: none;
    box-shadow: 0 4px 12px rgba(31, 153, 206, 0.28);
}

.acme-cms-prose__toggle:active {
    transform: translateY(1px);
}

.acme-cms-prose__toggle[aria-expanded="true"]::after {
    margin-top: 0.15em;
    transform: rotate(-135deg);
}

.acme-cms-prose__toggle-label {
    text-decoration: none;
}

.acme-cms-prose__toggle-slot {
    display: inline;
}

.acme-cms-prose__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 1.25rem;
}

.acme-cms-prose__actions:empty {
    display: none;
}

/* Home CMS sections — body copy uses PDP Description prose rhythm */
.acme-home-trust p,
.acme-home-custom p,
.acme-home-certs p,
.acme-home-blogs p,
.acme-home-trust li,
.acme-home-custom li,
.acme-home-certs li,
.acme-home-blogs li {
    font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.5;
    color: #0f2d52;
}

.acme-home-trust h2,
.acme-home-trust h3,
.acme-home-custom h2,
.acme-home-custom h3,
.acme-home-certs h2,
.acme-home-certs h3,
.acme-home-blogs h2:not(.acme-home-blog__title),
.acme-home-blogs h3:not(.acme-home-blog__title) {
    font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
    color: #0f2d52;
}

/* ---- Responsive pass — phone/tablet only, desktop (>=1024) untouched ---- */
@media (max-width: 1023px) {
    .acme-cms-prose {
        overflow-wrap: break-word;
    }

    .acme-cms-prose img {
        max-width: 100%;
        height: auto;
    }

    /* Keep real table layout (display:block crushed columns). Scroll the host. */
    .acme-cms-prose {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .acme-cms-prose table {
        display: table;
        width: 100%;
        min-width: 36rem;
        max-width: none;
    }

    .acme-cms-prose th,
    .acme-cms-prose td {
        padding: 0.55rem 0.65rem !important;
        font-size: 0.9375rem;
    }

    /* 44px tap area for the inline Read More without reflowing the copy */
    .acme-cms-prose__toggle {
        position: relative;
    }

    .acme-cms-prose__toggle::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        height: 2.75rem;
        transform: translateY(-50%);
    }
}

@media (max-width: 639px) {
    .acme-cms-prose,
    .acme-category-description.acme-cms-prose,
    .acme-home-cms.acme-cms-prose {
        font-size: 1rem;
        line-height: 1.6;
    }

    .acme-cms-prose p,
    .acme-cms-prose li,
    .acme-home-trust p,
    .acme-home-custom p,
    .acme-home-certs p,
    .acme-home-blogs p,
    .acme-home-trust li,
    .acme-home-custom li,
    .acme-home-certs li,
    .acme-home-blogs li {
        font-size: 1rem;
        line-height: 1.6;
    }

    .acme-cms-prose h1 {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .acme-cms-prose h2 {
        font-size: 1.375rem;
    }

    .acme-cms-prose h3 {
        font-size: 1.1875rem;
    }

    .acme-cms-prose h4,
    .acme-cms-prose h5,
    .acme-cms-prose h6 {
        font-size: 1.0625rem;
    }

    .acme-cms-prose ul > li {
        padding-left: 1.6rem;
    }
}
