/**
 * WeXchange Section de Texte Collaboratif Stylesheet
 * Matches WeXchange 2026 design standards.
 * Reference: Clean collaborative text block with stacked paragraphs and accent action link.
 */

:root {
    --wex-collab-font: 'Gotham', 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --wex-collab-header-color: #6f6aa6;
    --wex-collab-text-color: #231c42;
    --wex-collab-link-color: #f08150;
    --wex-collab-link-hover-color: #d96a38;
}

/* Outer Wrapper */
.wex-collab-text-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.wex-collab-text-wrapper *,
.wex-collab-text-wrapper *::before,
.wex-collab-text-wrapper *::after {
    box-sizing: border-box;
}

/* Primary Header */
.wex-collab-text-header {
    font-family: var(--wex-collab-font);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.5px;
    color: var(--wex-collab-header-color);
    margin: 0 0 24px 0;
    padding: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-wrap: balance;
    transition: color 0.25s ease;
}

/* Paragraphs Container & Items */
.wex-collab-text-paragraphs {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.wex-collab-text-paragraph {
    font-family: var(--wex-collab-font);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--wex-collab-text-color);
    margin: 0 0 22px 0;
    padding: 0;
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
    overflow-wrap: break-word;
    word-wrap: break-word;
    transition: color 0.25s ease;
}

.wex-collab-expandable-content .wex-collab-text-paragraph:last-child {
    margin-bottom: 0;
}

/* Expandable Section */
.wex-collab-expandable-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.wex-is-expanded .wex-collab-expandable-content {
    opacity: 1;
}

/* Action Link Wrapper */
.wex-collab-text-link-wrap {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin-top: 18px;
}

.wex-collab-text-link-wrap.wex-align-left {
    justify-content: flex-start;
}

.wex-collab-text-link-wrap.wex-align-center {
    justify-content: center;
}

.wex-collab-text-link-wrap.wex-align-right {
    justify-content: flex-end;
}

/* Action Link & Button */
.wex-collab-text-link,
.wex-collab-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--wex-collab-font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--wex-collab-link-color);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    outline: none !important;
    outline-color: transparent !important;
    outline-style: none !important;
    outline-width: 0 !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: color 0.25s ease, transform 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.wex-collab-text-link:hover,
.wex-collab-text-link:focus,
.wex-collab-text-link:focus-visible,
.wex-collab-text-link:active,
.wex-collab-toggle-btn:hover,
.wex-collab-toggle-btn:focus,
.wex-collab-toggle-btn:focus-visible,
.wex-collab-toggle-btn:active {
    color: var(--wex-collab-link-hover-color);
    text-decoration: none;
    outline: none !important;
    outline-color: transparent !important;
    outline-style: none !important;
    outline-width: 0 !important;
    box-shadow: none !important;
}

.wex-collab-text-link::-moz-focus-inner,
.wex-collab-toggle-btn::-moz-focus-inner {
    border: 0 !important;
    padding: 0 !important;
}

/* Icon */
.wex-collab-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: inherit;
    transition: transform 0.3s ease, color 0.25s ease;
}

.wex-collab-link-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    transition: transform 0.3s ease, fill 0.25s ease;
}

/* Arrow nudge on hover when collapsed */
.wex-collab-text-link:hover .wex-collab-link-icon {
    transform: translateX(4px);
}

/* Arrow rotate / flip when expanded */
.wex-is-expanded .wex-collab-link-icon {
    transform: rotate(90deg);
}

.wex-is-expanded .wex-collab-text-link:hover .wex-collab-link-icon {
    transform: rotate(90deg) translateX(3px);
}

.wex-collab-icon-before .wex-collab-link-icon {
    order: -1;
}

.wex-collab-text-link.wex-collab-icon-before:hover .wex-collab-link-icon {
    transform: translateX(-4px);
}

/* Responsive Fallbacks */
@media (max-width: 1024px) {
    .wex-collab-text-header {
        font-size: 34px;
        margin-bottom: 20px;
    }
    .wex-collab-text-paragraph {
        font-size: 15px;
        line-height: 1.65;
        margin-bottom: 18px;
    }
}

@media (max-width: 767px) {
    .wex-collab-text-header {
        font-size: 26px;
        line-height: 1.22;
        margin-bottom: 16px;
    }
    .wex-collab-text-paragraph {
        font-size: 14.5px;
        line-height: 1.6;
        margin-bottom: 16px;
        text-align: left;
    }
    .wex-collab-text-link-wrap {
        margin-top: 14px;
    }
    .wex-collab-text-link,
    .wex-collab-toggle-btn {
        min-height: 40px;
        touch-action: manipulation;
    }
}

@media (max-width: 360px) {
    .wex-collab-text-header {
        font-size: 23px;
        line-height: 1.25;
    }
    .wex-collab-text-paragraph {
        font-size: 13.5px;
        line-height: 1.55;
    }
}
