/* =========================================================
   AI Math Solver — content sections (CO-8318)
   Sits below #aiMathSolver, so it re-declares the tokens it
   needs rather than relying on #aiMathSolver's scoped vars.
   ========================================================= */

.ams-content {
    --amsc-blue: #1670a7;
    --amsc-border: #e6e9ee;
    --amsc-muted: #6b7280;
    --amsc-text: #2b2f36;
    --amsc-soft: #f6f8fb;
    --amsc-icon-bg: #eaf1fe;
    --amsc-badge-bg: #cfe3fb;
    font-family: 'Inter', sans-serif;
    color: var(--amsc-text);
}

/* Sections are full-bleed (so a section can carry its own full-width
   background); .ams-c-inner constrains the actual content width. */
.ams-c-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.ams-content h2,
.ams-content h3,
.ams-content h4 {
    font-family: 'Inter', sans-serif;
    color: var(--amsc-text);
}

p, h1, h2, h3, h4, div, span {
    font-weight: unset;
}

.ams-content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ams-ads-slot {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
}

.ams-c-section {
    padding: 70px 0;
}
.ams-c-section:first-of-type { border-top: none; }
.ams-c-section.ams-c-intro .ams-c-inner p{
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 14px;
    line-height: 27px;
    letter-spacing: 0%;
    text-align: center;

}
.ams-c-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 10px;
}
.ams-c-title.faq-title {
    margin: 0 0 40px;
}

.ams-c-subtitle {
    text-align: center;
    margin: 0 auto 40px;
}


.ams-c-intro p:last-child { margin-bottom: 0; }

/* ---------- How to Use — full-width shaded section, numbered steps ---------- */
.ams-c-steps {
    background: #F6F8FBDD;
}
.ams-steps-grid {
    width: min(1029px, 90vw);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
/* Neutral wrapper on larger screens — .ams-step-card stays a direct grid
   item of .ams-steps-grid. Only becomes a real slide track on small
   devices (see the 575px media query), where it's driven by JS. */
.ams-steps-track {
    display: contents;
}
.ams-step-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
}
.ams-step-badge {
    position: absolute;
    top: 0;
    left: 11px;
    z-index: 2;
    background: var(--amsc-badge-bg);
    color: var(--amsc-blue);
    font-family: Inter;
    font-style: Bold;
    line-height: 100%;
    letter-spacing: 0%;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
    width: 31.78px;
    height: 46.39px;
}
.ams-step-img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--amsc-border);
    margin-bottom: 20px;
    padding: 10px;
    box-sizing: border-box;
}
.ams-step-card h3 {
    font-family: Inter;
    font-weight: 600;
    font-style: Semi Bold;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0%;
    margin-bottom: 10px;
    height: 22px;

}
.ams-step-card p {
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 16px;
    line-height: 27px;
    letter-spacing: 0%;

}

/* ---------- Why Choose — 2x2 icon cards ---------- */
.ams-why-grid {
    width: min(1030px, 90vw);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: auto;
}
.ams-why-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--amsc-border);
    border-radius: 14px;
    padding: 24px;
}
.ams-why-icon {
    flex: 0 0 auto;
    width: 45px;
    height: 45px;
    background: var(--amsc-icon-bg);
    border-radius: 10px;
    box-sizing: border-box;
}
.ams-why-card h3 {
    font-size: 18px;
    font-weight: 700;
    height: 22px;
    margin: 0 0 7px;
}
.ams-why-card p { 
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 16px;
    line-height: 23px;
    letter-spacing: 0%; 
}

/* ---------- Topics grid — full-width shaded section, icon-badge cards ---------- */
.ams-c-topics {
    background: #F6F8FBDD;
}
.ams-topics-grid {
    width: min(1029px, 90vw);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 23px;
    margin: auto;
}
/* Neutral wrapper on larger screens — .ams-topics-col stays a direct grid
   item of .ams-topics-grid. Only becomes a real slide track on small
   devices (see the 575px media query), where it's driven by JS. */
.ams-topics-track {
    display: contents;
}
.ams-topics-col {
    background: #fff;
    border-radius: 14px;
    padding: 20px 20px 34px 20px;
}
.ams-topics-col h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--amsc-text);
    margin: 0 0 13px;
}
.ams-topics-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amsc-icon-bg);
    border-radius: 8px;
    color: var(--amsc-blue);
    font-size: 17px;
    font-weight: 700;
    font-style: italic;
    box-sizing: border-box;
}
.ams-topics-icon-x2 { font-style: normal; }
.ams-topics-icon sup { font-size: 11px; }
.ams-topics-col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 10px;
}
.ams-topics-col li {
    position: relative;
    padding-left: 14px;
    font-family: Inter;
    font-weight: 400;
    font-style: Regular;
    font-size: 14px;
    leading-trim: NONE;
    line-height: 24px;
    letter-spacing: 0%;

}
.ams-topics-col li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--amsc-muted);
}

/* ---------- Features — 2-col bordered cards, shaded icon rail ---------- */
.ams-features-grid {
    width: min(1030px, 90vw);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: auto;
}
.ams-feature-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .15);
    padding-right: 33px;
    overflow: hidden;
}
.ams-feature-icon-col {
    flex: 0 0 auto;
    width: 50px;
    min-height: 149px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amsc-soft);
    
}
/* .ams-feature-icon {
    width: 24px;
    height: 24px;
} */
.ams-feature-card > div {
    flex: 1 1 auto;
    min-width: 0;
    padding: 15px   ;
}
.ams-feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    color: #000;
    margin: 0 0 7px;
}
.ams-feature-card p { margin: 0; font-size: 16px; line-height: 22px; color: #000; }

/* ---------- User Reviews ---------- */
.ams-reviews-grid {
    width: min(1030px, 90vw);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: auto;
}
.ams-review-card {
    background: #fdfdfd;
    border: 1px solid var(--amsc-border);
    border-radius: 10px;
    padding: 19px;
    margin: auto;
}
.ams-review-stars {
    display: flex;
    gap: 2px;
    color: var(--amsc-blue);
    margin-bottom: 10px;
}
.ams-review-card > p {
    font-size: 15px;
    color: var(--amsc-text);
    margin: 0 0 16px;
}
.ams-review-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ams-review-author img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.ams-review-author strong {
    display: block;
    font-size: 14px;
    color: var(--amsc-text);
}
.ams-review-author span {
    font-size: 14px;
}

/* ---------- FAQ accordion ---------- */
.ams-c-faq {
    background: #F6F8FBDD;
}
.ams-faq-list {
    max-width: min(811.68px, 90vw);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ams-faq-item {
    padding-bottom: 20px;
    border-bottom: 0.91px solid #DEE0E3;
}
.ams-faq-q {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 21.82px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 25.45px;
    color: #000;
    padding: 0;
    cursor: pointer;
}
.ams-faq-caret {
    flex: 0 0 auto;
    margin-top: 1.82px;
    margin-right: 1px;
}
.ams-faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease;
}
.ams-faq-item.is-open .ams-faq-a {
    grid-template-rows: 1fr;
}
.ams-faq-a p {
    overflow: hidden;
    margin: 7.27px 0 0;
    padding-right: 43.64px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 27px;
    color: #000;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .ams-steps-grid { grid-template-columns: 1fr;  margin: auto }
    .ams-why-grid { grid-template-columns: 1fr;  margin: auto }
    .ams-topics-grid { grid-template-columns: repeat(2, 1fr);  margin: auto }
    .ams-features-grid { grid-template-columns: 1fr;  margin: auto;}
    .ams-reviews-grid { grid-template-columns: 1fr;  margin: auto }
}
@media (max-width: 575px) {
    /* Verified against the Figma mobile frame (iPhone 13/14, ~390px) —
       "Frame 1000002560" under the "Ai math solve" page, which mocks up
       every content section, not just the intro. Side padding differs
       per section (measured from each section's own wrapper frame). */
    .ams-topics-grid { grid-template-columns: 1fr; }
    .ams-c-title { font-size: 20px; font-weight: 700; }
    .ams-c-title p{ font-size: 14px; }
    .ams-c-subtitle { font-size: 14px; margin-bottom: 24px; }
    .ams-c-section { padding: 30px 0; }
    .ams-c-inner { padding: 0 27px; }
    .ams-c-reviews { display: none; }

    /* How to Use — cards had no gap on mobile (bug: 0 by default); card
       padding/radius measured from "Component 51" (337.45 × 336.52 Hug). */
    .ams-step-card { padding: 15px 15px 11px 15px; border-radius: 10px; }
    .ams-step-card h3 { font-size: 16px; }
    .ams-step-card p { font-size: 14px; line-height: 23px; }

    /* Why Choose — section side padding 19.5px; card padding/gap/radius
       measured from "Frame 1000002365" (354 Fill × 174 Hug). */
    .ams-c-why .ams-c-inner { padding: 0 19.5px; }
    .ams-why-grid { gap: 25px; }
    .ams-why-card { padding: 15px 33px 15px 15px; gap: 15px; border-radius: 10px; }
    .ams-why-card h3 { font-size: 16px; }
    .ams-why-card p { font-size: 14px; line-height: 20px; }

    /* Topics — section side padding 19.5px; card padding/radius measured
       from "Component 55" (240 × 302.76 Hug). */
    .ams-c-topics .ams-c-inner { padding: 0 19.5px; }
    .ams-topics-col { border-radius: 10px; }
    .ams-topics-col h4 { font-size: 16px; }
    .ams-topics-col li { font-size: 14px; line-height: 23px; }

    /* Features — section side padding 17.5px; card padding/radius
       measured from "Frame 1000002460" (357 Fill × 164.72 Hug). */
    .ams-c-features .ams-c-inner { padding: 0 17.5px; }
    .ams-features-grid { gap: 25px; }
    .ams-feature-card { padding-right: 26px; border-radius: 10px; }
    .ams-feature-card h3 { font-size: 16px; }
    .ams-feature-card p { font-size: 14px; line-height: 20px; }

    /* FAQ — section side padding 22px (matches measured 346px list width). */
    .ams-c-faq .ams-c-inner { padding: 0 22px; }
    .ams-faq-q { font-size: 16px; gap: 16px; }
    .ams-faq-a p { font-size: 14px; line-height: 20px; padding-right: 0; }

    /* "How to Use" becomes an auto-sliding, arrow-less carousel (JS-driven
       via .ams-steps-track's transform) — one card fills the viewport,
       auto-advancing every 2s. */
    .ams-steps-grid {
        display: block;
        overflow: hidden;
        position: relative;
        width: 100%;
    }
    .ams-steps-track {
        display: flex;
        gap: 15px;
        transition: transform .5s ease;
    }
    .ams-steps-track .ams-step-card {
        flex: 0 0 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* "What Topics Does AI Math Solver Handle?" — same auto-sliding,
       arrow-less carousel treatment as "How to Use" above. */
    .ams-topics-grid {
        display: block;
        overflow: hidden;
        position: relative;
        width: 100%;
    }
    .ams-topics-track {
        display: flex;
        gap: 25px;
        transition: transform .5s ease;
    }
    .ams-topics-track .ams-topics-col {
        flex: 0 0 240px;
        width: 240px;
        box-sizing: border-box;
    }
    .ams-faq-caret {
        width: 15px;
        height: 15px;
    }
}
