/**
 * Product Highlights Module Styles
 * Modular stylesheet for the Key Capabilities tabbed section
 * Figma Node: 159-1132
 */

/* ==========================================================================
   Section Container
   ========================================================================== */

.workjam-product-highlights {
    padding: 80px 106px;
    background-color: #ffffff;
    width: 100%;
}

.workjam-product-highlights__container {
    max-width: 1265px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 70px;
}

/* ==========================================================================
   Section Title
   ========================================================================== */

.workjam-product-highlights__title {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: normal;
    color: #121c66;
    text-align: left;
    margin: 0;
    width: 100%;
}

/* ==========================================================================
   Content Layout (Horizontal Split)
   ========================================================================== */

.workjam-product-highlights__content {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

/* ==========================================================================
   Left Side: Visual/Image Container
   ========================================================================== */

.workjam-product-highlights__visual {
    position: relative;
    max-width: 500px;
    width: 100%;
    aspect-ratio: 5 / 6.4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 1 1 50%;
}

.workjam-product-highlights__image {
    position: absolute;
    inset: 0;
    opacity: 0;
    display: flex;
    justify-content: center;
}

.workjam-product-highlights__image[data-active] {
    opacity: 1;
    z-index: 1;
}

.workjam-product-highlights__img:not(picture) {
    width: 100%;
    height: auto;
    max-width: 650px;
    display: block;
}

/* Handle WordPress picture tag */
.workjam-product-highlights__image picture {
    width: 100%;
    height: auto;
    display: flex;
}

.workjam-product-highlights__image picture img {
    width: 100%;
    height: auto;
    max-width: 650px;
    display: block;
}

/* ==========================================================================
   Right Side: Tabs Wrapper
   ========================================================================== */

.workjam-product-highlights__tabs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 21px;
    flex: 1 1 50%;
    max-width: 565px;
    width: 100%;
    align-items: center;
}

/* ==========================================================================
   Tab: Default/Inactive State
   ========================================================================== */

.workjam-product-highlights__tab {
    background-color: rgba(43, 56, 143, 0.1);
    border-radius: 50px;
    padding: 18px 36px 0px 36px;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto;
    gap: 0px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.workjam-product-highlights__tab:hover {
    background-color: rgba(43, 56, 143, 0.15);
}

/* Tab Arrow (Hidden by default) */
.workjam-product-highlights__tab-arrow {
    opacity: 0;
    transform: scale(0.8);
    width: 0px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: auto;
    margin-top: 3px;
}

.workjam-product-highlights__tab-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Tab Content Wrapper */
.workjam-product-highlights__tab-wrapper {
    width: auto;
    display: grid;
}

.workjam-product-highlights__tab[data-active] .workjam-product-highlights__tab-wrapper {
    width: 100%;
}

/* Tab Title (Always Visible) */
.workjam-product-highlights__tab-title {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #121c66;
    line-height: normal;
    margin-bottom: 16px;
    width: fit-content;
}

/* Expanded Content (Hidden by default) */
.workjam-product-highlights__tab-content {
    display: block;
    overflow: hidden;
    cursor: default;
    pointer-events: auto;
}

/* ==========================================================================
   Tab: Closing State (temporary state for smooth closing animation)
   ========================================================================== */

.workjam-product-highlights__tab[data-closing] {
    /* Preserve active state styles during closing */
    background-color: #121c66 !important;
    border-radius: 40px !important;
    padding: 39px 33px !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 20px 1fr !important;
    gap: 16px !important;
    align-items: start !important;
    border: 1px solid #d9d9d9 !important;
}

/* When BOTH closing AND active - prepare for animation */
.workjam-product-highlights__tab[data-closing][data-active] .workjam-product-highlights__tab-content {
    /* Keep active state but prepare for when active is removed */
}

/* When closing WITHOUT active - animate to collapsed */
.workjam-product-highlights__tab[data-closing]:not([data-active]) .workjam-product-highlights__tab-content {
    /* These values come from the base state */
}

.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__tab-arrow {
    /* Preserve visibility during closing */
    opacity: 1 !important;
    transform: scale(1) !important;
}

.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__tab-title {
    /* Keep text white during closing */
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Keep wrapper full width during closing for proper text alignment */
.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__tab-wrapper {
    width: 100% !important;
}

/* Keep content text white during closing */
.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__content-subtitle,
.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__content-description,
.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__content-description p,
.workjam-product-highlights__tab[data-closing] .workjam-product-highlights__content-link {
    color: #ffffff !important;
}

/* ==========================================================================
   Tab: Active State
   ========================================================================== */

.workjam-product-highlights__tab[data-active] {
    background-color: #121c66;
    border-radius: 40px;
    padding: 39px 33px;
    width: 100%;
    height: fit-content;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 16px;
    align-items: start;
    border: 1px solid #d9d9d9;
}

.workjam-product-highlights__tab[data-active]:hover {
    background-color: #121c66;
}

/* Arrow visible when active */
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__tab-arrow {
    opacity: 1;
    transform: scale(1);
}

/* Title styling when active */
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__tab-title {
    color: #ffffff;
    font-weight: 600;
}

/* Content visible when active */
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__tab-content {
    display: block;
}

/* ==========================================================================
   Expanded Content Styles
   ========================================================================== */

.workjam-product-highlights__content-subtitle {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #121c66;
    line-height: normal;
    margin: 0 0 16px 0;
}

.workjam-product-highlights__content-description {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #121c66;
    line-height: 1.5;
    margin-bottom: 16px;
}

.workjam-product-highlights__content-description p {
    margin: 0 0 8px 0;
    color: #121c66;
}

.workjam-product-highlights__content-description p:last-child {
    margin-bottom: 0;
}

.workjam-product-highlights__content-link {
    font-family: 'Avenir Next', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #121c66;
    text-decoration: underline;
    text-underline-position: from-font;
    display: inline-block;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.workjam-product-highlights__content-link:hover {
    opacity: 0.85;
}

/* Content text color when active - must come after base styles for proper cascade */
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__content-subtitle,
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__content-description,
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__content-description p,
.workjam-product-highlights__tab[data-active] .workjam-product-highlights__content-link {
    color: #ffffff;
}

/* ==========================================================================
   Keyboard & Accessibility Support
   ========================================================================== */

.workjam-product-highlights__tab:focus-visible {
    outline: 2px solid #121c66;
    outline-offset: 2px;
}

.workjam-product-highlights__tab[data-active]:focus-visible {
    outline-color: #ffffff;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large Tablets (1024px and below) */
@media (max-width: 1024px) {
    .workjam-product-highlights {
        padding: 60px 80px;
    }

    .workjam-product-highlights__container {
        gap: 50px;
    }

    .workjam-product-highlights__visual {
        max-width: 50%;
    }

    .workjam-product-highlights__tabs-wrapper {
        width: 100%;
        max-width: 50%;
    }

    .workjam-product-highlights__tab[data-active] {
        width: 100%;
    }
}

/* Tablets (980px and below) */
@media (max-width: 980px) {
    .workjam-product-highlights {
        padding: 60px 40px;
    }

    .workjam-product-highlights__title {
        font-size: 36px;
    }
}

/* Mobile (768px and below) - All Expanded Pattern */
@media (max-width: 768px) {
    .workjam-product-highlights {
        padding: 40px 20px;
    }

    .workjam-product-highlights__container {
        gap: 30px;
    }

    .workjam-product-highlights__title {
        font-size: 32px;
        text-align: center;
        margin-bottom: 10px;
    }

    /* Hide images on mobile to save space */
    .workjam-product-highlights__visual {
        display: none;
    }

    /* Content takes full width */
    .workjam-product-highlights__content {
        width: 100%;
    }

    /* Stack tabs vertically - all expanded */
    .workjam-product-highlights__tabs-wrapper {
        max-width: 100%;
        width: 100%;
        gap: 16px;
    }

    /* All tabs are full-width and expanded */
    .workjam-product-highlights__tab {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        border-radius: 12px !important;
        display: block !important;
        background-color: #121c66 !important;
        border: 1px solid #d9d9d9 !important;
        cursor: default !important;
        overflow: hidden !important;
    }

    /* Hide arrow completely on mobile */
    .workjam-product-highlights__tab-arrow {
        display: none !important;
    }

    /* Tab wrapper takes full width */
    .workjam-product-highlights__tab-wrapper {
        padding-right: 0;
        width: 100%;
    }

    /* Title styling for mobile */
    .workjam-product-highlights__tab-title {
        font-size: 18px;
        margin-bottom: 12px !important;
        line-height: 1.3;
        color: #ffffff !important;
        font-weight: 600 !important;
        transform: none !important;
        white-space: normal !important;
    }

    /* Content always visible on mobile */
    .workjam-product-highlights__tab-content {
        display: block !important;
        height: auto !important;
        opacity: 1 !important;
        max-height: none !important;
        padding-top: 0;
    }

    /* Content text styling */
    .workjam-product-highlights__content-subtitle,
    .workjam-product-highlights__content-description,
    .workjam-product-highlights__content-description p,
    .workjam-product-highlights__content-link {
        font-size: 15px;
        color: #ffffff !important;
        line-height: 1.5;
    }

    .workjam-product-highlights__content-subtitle {
        margin-bottom: 8px;
    }

    .workjam-product-highlights__content-description {
        margin-bottom: 12px;
    }

    .workjam-product-highlights__content-link {
        text-decoration: underline;
        display: inline-block;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .workjam-product-highlights {
        padding: 32px 16px;
    }

    .workjam-product-highlights__title {
        font-size: 28px;
    }

    .workjam-product-highlights__tab {
        padding: 14px 20px;
    }

    .workjam-product-highlights__tab[data-active] {
        padding: 28px 20px;
    }

    .workjam-product-highlights__content-description {
        font-size: 15px;
    }
}