/* =========================================================
   ToolXone FAQ Component
   Clean Shared Replacement
   ---------------------------------------------------------
   Responsibilities:
   - Shared FAQ section styling
   - Desktop / tablet / mobile responsiveness
   - 344px mobile overflow protection
   - Light / dark theme support
   - Accessible focus states
   ========================================================= */


/* =========================================================
   1. FAQ SECTION
   ========================================================= */

.tx-faq-section {
    width: min(100%, 1000px);
    max-width: 100%;
    min-width: 0;

    margin: 60px auto 80px;
    padding: 35px;

    box-sizing: border-box;

    background: #162235;
    border: 1px solid #2f4058;
    border-radius: 22px;

    color: #e5e7eb;

    overflow: hidden;
}


/* =========================================================
   2. FAQ HEADER
   ========================================================= */

.tx-faq-header {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0 0 36px;

    text-align: center;

    box-sizing: border-box;
}

.tx-faq-header h2,
.tx-faq-section h2 {
    max-width: 100%;
    margin: 0 0 12px;

    color: #10b981;

    font-size: 2rem;
    line-height: 1.25;
    font-weight: 800;

    text-align: center;

    overflow-wrap: anywhere;
    word-break: normal;
}

.tx-faq-subtitle {
    width: 100%;
    max-width: 700px;
    min-width: 0;

    margin: 0 auto;

    color: #94a3b8;

    line-height: 1.8;

    overflow-wrap: anywhere;
}


/* =========================================================
   3. FAQ ITEMS
   ========================================================= */

.toolxone-faq-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0 0 18px;
    padding: 20px 22px;

    box-sizing: border-box;

    background: #172235;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;

    transition:
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.28s ease;

    overflow: hidden;
}

.toolxone-faq-item:last-child {
    margin-bottom: 0;
}


/* =========================================================
   4. OPEN STATE
   ========================================================= */

.toolxone-faq-item[open] {
    border-color: #10b981;

    box-shadow:
        0 12px 28px rgba(16, 185, 129, 0.12);
}


/* =========================================================
   5. FAQ QUESTION / SUMMARY
   ========================================================= */

.toolxone-faq-item summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    color: #e5e7eb;

    font-weight: 700;
    line-height: 1.5;

    transition: color 0.25s ease;

    overflow-wrap: anywhere;
    word-break: normal;
}


/*
   Allow the summary text itself to shrink
   instead of forcing horizontal overflow.
*/

.toolxone-faq-item summary > * {
    min-width: 0;
}

.toolxone-faq-item summary::marker {
    color: #10b981;
}


/* =========================================================
   6. FAQ ANSWER
   ========================================================= */

.toolxone-faq-answer {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;

    overflow-wrap: anywhere;
}

.toolxone-faq-answer p {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 14px 0 0;

    color: #cbd5e1;

    line-height: 1.85;

    overflow-wrap: anywhere;
    word-break: normal;
}


/* =========================================================
   7. HOVER
   ========================================================= */

.toolxone-faq-item:hover {
    border-color: #10b981;

    transform: translateY(-3px);

    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   8. KEYBOARD FOCUS
   ========================================================= */

.toolxone-faq-item summary:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.25);
    outline-offset: 4px;

    border-radius: 4px;
}


/* =========================================================
   9. LIGHT THEME
   ========================================================= */

body:not(.dark-mode) .tx-faq-section {
    background: #ffffff;

    color: #1f2937;

    border-color: #e5e7eb;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.08);
}

body:not(.dark-mode) .toolxone-faq-item {
    background: #f8fafc;

    border-color: #e5e7eb;
}

body:not(.dark-mode) .toolxone-faq-item summary {
    color: #1f2937;
}

body:not(.dark-mode) .toolxone-faq-answer p {
    color: #475569;
}

body:not(.dark-mode) .toolxone-faq-item:hover {
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   10. TABLET
   ========================================================= */

@media (max-width: 768px) {

    .tx-faq-section {
        width: calc(100% - 24px);
        max-width: 100%;

        margin: 40px auto 60px;
        padding: 28px;

        border-radius: 18px;
    }

    .tx-faq-header {
        margin-bottom: 28px;
    }

    .tx-faq-header h2,
    .tx-faq-section h2 {
        font-size: 1.8rem;
    }

    .toolxone-faq-item {
        padding: 18px 20px;
    }

}


/* =========================================================
   11. MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .tx-faq-section {
        width: calc(100% - 20px);
        max-width: 100%;

        margin: 28px auto 45px;
        padding: 20px;

        border-radius: 16px;
    }

    .tx-faq-header {
        margin-bottom: 24px;
    }

    .tx-faq-header h2,
    .tx-faq-section h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .tx-faq-subtitle {
        font-size: 15px;
        line-height: 1.65;
    }

    .toolxone-faq-item {
        margin-bottom: 12px;
        padding: 16px;

        border-radius: 13px;
    }

    .toolxone-faq-item summary {
        gap: 10px;

        font-size: 15px;
        line-height: 1.5;
    }

    .toolxone-faq-answer p {
        margin-top: 12px;

        font-size: 15px;
        line-height: 1.7;
    }

}


/* =========================================================
   12. VERY SMALL MOBILE — 344px / 360px
   ========================================================= */

@media (max-width: 360px) {

    .tx-faq-section {
        width: calc(100% - 16px);
        max-width: 100%;

        margin: 22px auto 36px;
        padding: 16px;

        border-radius: 14px;
    }

    .tx-faq-header {
        margin-bottom: 20px;
    }

    .tx-faq-header h2,
    .tx-faq-section h2 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .tx-faq-subtitle {
        font-size: 14px;
        line-height: 1.6;
    }

    .toolxone-faq-item {
        margin-bottom: 10px;
        padding: 14px;

        border-radius: 12px;
    }

    .toolxone-faq-item summary {
        gap: 8px;

        font-size: 14px;
        line-height: 1.45;
    }

    .toolxone-faq-answer p {
        margin-top: 10px;

        font-size: 14px;
        line-height: 1.65;
    }

}


/* =========================================================
   13. TOUCH DEVICES
   ========================================================= */

@media (hover: none) {

    .toolxone-faq-item:hover {
        transform: none;
    }

}