/* ==========================================================================
   Success Stories Section
   ========================================================================== */

   .success-stories-section {
    position: relative;
    background-color: #FEF6F0;
    overflow: hidden;
}

/* Background */
.success-stories-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 0;
}

.success-stories-bg-picture {
    display: block;
    width: 100%;
}

.success-stories-bg-image {
    width: 100%;
    height: auto;
}

/* Container */
.success-stories-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px;
}

/* Header */
.success-stories-header {
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.success-stories-header.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.success-stories-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-stories-icon img {
    height: 60px;
    width: auto;
}

.success-stories-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-primary, #153C6D);
    margin: 0 0 16px;
    line-height: 1.2;
}

.success-stories-description {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tabs */
.success-stories-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.success-stories-tabs-wrapper.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.success-stories-tabs {
    display: inline-flex;
    background: white;
    border-radius: 100px;
    padding: 6px;
    border: 1px solid #E5E5E5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.success-stories-tab {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: 2px solid #E0E0E0;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin: 0 2px;
}

.success-stories-tab:hover {
    color: var(--color-primary, #153C6D);
    border-color: var(--color-primary, #153C6D);
}

.success-stories-tab.active {
    background: #F6B38D;
    color: white;
    border-color: #F6B38D;
}


/* Content Wrapper */
.success-stories-content-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.success-stories-content-wrapper.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.success-stories-tab-content {
    display: none;
}

.success-stories-tab-content.active {
    display: block;
}

/* ==========================================================================
   Slider
   ========================================================================== */

.stories-slider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    direction: ltr;
    padding: 0 72px;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    z-index: 10;
}

.slider-arrow:hover:not(.disabled) {
    background: var(--color-primary, #153C6D);
    border-color: var(--color-primary, #153C6D);
    color: white;
}

.slider-arrow.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slider-arrow svg {
    width: 20px;
    height: 20px;
}

.slider-arrow-left svg {
    transform: none;
}

.slider-arrow-left {
    left: 16px;
}

.slider-arrow-right {
    right: 16px;
}

.slider-arrow-right svg {
    /* transform: rotate(180deg); */
}

.slider-container {
    flex: 1;
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    padding: 20px 0;
}

.slider-track {
    display: flex;
    gap: 32px;
    transition: transform 0.4s ease-out;
}

.stories-slider.slider-static {
    justify-content: center;
}

.stories-slider.slider-static .slider-arrow {
    display: none;
}

/* ==========================================================================
   Grid (No Slider)
   ========================================================================== */

.stories-grid {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stories-grid-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.stories-grid .story-card {
    width: 100%;
    max-width: none;
    opacity: 1;
    transform: none !important;
}

.stories-grid .story-card:not(.active) {
    opacity: 1;
    transform: none;
}

.stories-grid .story-card.active {
    transform: none;
}

.stories-grid .story-card-inner {
    height: 100%;
}

.grid-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.grid-page-btn {
    transform: rotate(180deg);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #E5E5E5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-page-btn:hover:not(.disabled):not(:disabled) {
    background: var(--color-primary, #153C6D);
    color: #fff;
    border-color: var(--color-primary, #153C6D);
}

.grid-page-btn:disabled,
.grid-page-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.grid-page-btn-next svg {
    transform: rotate(180deg);
}

.grid-page-indicator {
    font-weight: 700;
    color: var(--color-primary, #153C6D);
}

.grid-single-page .grid-pagination,
.grid-pagination[data-single-page="1"] {
    display: none;
}

/* ==========================================================================
   Story Cards
   ========================================================================== */

.story-card {
    flex-shrink: 0;
    width: 320px;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    visibility: hidden;
}

.story-card.visible {
    opacity: 0.5;
    visibility: visible;
}

.story-card.active {
    opacity: 1;
    transform: scale(1.12);
    z-index: 5;
}

.story-card-inner {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.story-card-icon {
    margin-bottom: 16px;
}

.story-card-icon svg {
    width: 32px;
    height: 32px;
}

.story-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    line-height: 1.4;
}

.story-card-text {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    min-height: 0;
}

.story-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: #C97E53;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-top: auto;

}
.page-id-514 .story-card-read-more {
  flex-direction: row !important;
  }

.story-card-read-more:hover {
    color: var(--color-primary, #153C6D);
}

.story-card-read-more svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   CTA & Bottom Line
   ========================================================================== */

.success-stories-cta {
    text-align: center;
    padding: 48px 0 64px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.success-stories-cta.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.success-stories-cta-button {
    display: inline-block;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--color-primary, #153C6D);
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.success-stories-cta-button:hover {
    background: #0f2d52;
    transform: translateY(-2px);
}

.success-stories-bottom-line {
    height: 8px;
    background: #F6B38D;
}

.no-stories {
    text-align: center;
    padding: 64px;
    color: #999;
    font-size: 18px;
}

/* ==========================================================================
   Popup Modal
   ========================================================================== */

.story-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.story-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.story-popup {
    background: white;
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.story-popup-overlay.active .story-popup {
    transform: translateY(0) scale(1);
}

.story-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    z-index: 10;
}

.story-popup-close:hover {
    background: #e5e5e5;
    color: #333;
}

.story-popup-header {
    padding: 32px 32px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.story-popup-icon {
    margin-bottom: 16px;
}

.story-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary, #153C6D);
    margin: 0;
    line-height: 1.4;
}

.story-popup-content {
    padding: 24px 32px 32px;
    max-height: calc(85vh - 150px);
    overflow-y: auto;
}

.story-popup-loading {
    text-align: center;
    padding: 32px;
    color: #999;
}

.story-popup-body {
    font-size: 16px;
    color: #444;
    line-height: 1.8;
}

.story-popup-body p {
    margin: 0 0 16px;
}

.story-popup-body a {
    color: var(--color-primary, #153C6D);
    text-decoration: underline;
}

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

@media (max-width: 1024px) {
    .success-stories-container {
        padding: 60px 16px;
    }

    .slider-container {
        max-width: 100%;
    }

    .story-card {
        width: 300px;
    }

    .stories-grid-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .success-stories-title {
        font-size: 30px;
    }

    .slider-track {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .success-stories-container {
        padding: 40px 16px;
    }

    .success-stories-header {
        margin-bottom: 28px;
    }

    .success-stories-icon img {
        height: 40px;
    }

    .success-stories-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .success-stories-description {
        font-size: 14px;
        line-height: 1.6;
    }

    .success-stories-tabs-wrapper {
        margin-bottom: 28px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 4px;
    }

    .success-stories-tabs {
        padding: 4px;
    }

    .success-stories-tab {
        padding: 10px 18px;
        font-size: 14px;
    }

    /* Mobile slider layout */
    .stories-slider {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 0 80px 0;
        position: relative;
    }

    .slider-container {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        position: relative;
        padding: 0 12px;
    }

    .slider-track {
        gap: 16px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .story-card {
        width: calc(100% - 24px);
        max-width: 100%;
        min-width: calc(100% - 24px);
        flex-shrink: 0;
    }

    .story-card.active {
        opacity: 1 !important;
        transform: scale(1) !important;
        z-index: 5;
    }

    .story-card:not(.active) {
        opacity: 0.5;
        transform: scale(0.92);
    }

    .stories-grid-inner {
        grid-template-columns: 1fr;
    }

    .story-card-inner {
        min-height: 44rem;
        padding: 28px 20px;
        min-height: auto;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        border-radius: 16px;
    }

    .story-card-icon {
        margin-bottom: 12px;
    }

    .story-card-icon svg {
        width: 28px;
        height: 28px;
    }

    .story-card-title {
        font-size: 17px;
        margin-bottom: 14px;
        line-height: 1.3;
    }

    .story-card-text {
        font-size: 14px;
        line-height: 1.6;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        min-height: 0;
        margin-bottom: 8px;
    }

    .story-card-read-more {
        margin-top: 12px;
        font-size: 14px;
        padding: 6px 0;
    }

    .slider-arrow {
        width: 44px;
        height: 44px;
        position: absolute;
        top: auto;
        bottom: -60px;
        transform: translateX(-50%);
        z-index: 10;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
        border: 1px solid #E5E5E5;
    }

    .slider-arrow svg {
        width: 18px;
        height: 18px;
    }

    .slider-arrow-left {
        left: calc(50% - 28px);
    }

    .slider-arrow-right {
        right: auto;
        left: calc(50% + 28px);
    }


    .success-stories-cta-button {
        padding: 12px 32px;
        font-size: 14px;
    }

    /* Mobile popup */
    .story-popup {
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .story-popup-header {
        padding: 24px;
    }

    .story-popup-title {
        font-size: 18px;
    }

    .story-popup-content {
        padding: 16px 24px 24px;
        max-height: calc(90vh - 130px);
    }

    .story-popup-body {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .success-stories-container {
        padding: 40px 12px;
    }

    .success-stories-title {
        font-size: 20px;
    }

    .stories-slider {
        padding: 0 0 70px 0;
    }

    .slider-container {
        padding: 0 10px;
    }

    .slider-track {
        gap: 14px;
    }

    .story-card {
        /* min-height: 18rem; */
        width: calc(100% - 20px);
        max-width: 100%;
        min-width: calc(100% - 20px);
    }

    .story-card-inner {
        padding: 24px 18px;
        min-height: auto;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        border-radius: 14px;
    }

    .story-card-icon {
        margin-bottom: 10px;
    }

    .story-card-icon svg {
        width: 26px;
        height: 26px;
    }

    .story-card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .story-card-text {
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 5;
        line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        min-height: 0;
    }

    .slider-arrow {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: 0;
        transform: translateX(-50%);
    }

    .slider-arrow svg {
        width: 16px;
        height: 16px;
    }

    .slider-arrow-left {
        left: calc(50% - 26px);
    }

    .slider-arrow-right {
        right: auto;
        left: calc(50% + 26px);
    }
}
.stories-slider .story-card:not(.active) {
    transform: scale(0.95);
}
