/* ==========================================================================
   LEARNER STORIES / LINKEDIN HIGHLIGHTS SECTION
   ========================================================================== */

.learner-stories-section {
    padding: 80px 20px;
    background-color: var(--bg-primary, #ffffff);
    overflow: hidden; /* Prevent horizontal scroll from track */
}

.learner-stories-container {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    width: 100%;
}

.learner-stories-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 0 16px;
}

.learner-stories-title {
    font-size: 44px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.learner-stories-subtitle {
    font-size: 18px;
    color: var(--text-secondary, #4b5563);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   CAROUSEL LAYOUT
   ========================================================================== */

.ls-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 auto;
}

.ls-carousel-viewport {
    overflow: hidden;
    width: 100%;
    /* Add horizontal padding to allow shadows to show */
    padding: 10px 0;
}

.ls-carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    /* Gap is managed in JS via card width/margins, but let's set a CSS gap for JS to read if needed, or just handle manually. We will handle layout via fixed flex-basis. */
}

.ls-slide {
    flex: 0 0 33.333%;
    padding: 0 12px;
    box-sizing: border-box;
}

/* ==========================================================================
   CARD DESIGN
   ========================================================================== */

.ls-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    height: 460px; /* FIXED HEIGHT - CRITICAL */
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden; /* For rounded corners */
}

.ls-card-header {
    display: flex;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid transparent; /* Keeps structure */
}

.ls-initials {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.1); /* Light LearnDepth green */
    color: var(--primary-green, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    margin-right: 16px;
    flex-shrink: 0;
}

.ls-user-info {
    flex: 1;
    min-width: 0; /* Prevent text overflow */
}

.ls-user-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-user-role {
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-linkedin-link {
    color: #0a66c2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.ls-linkedin-link:hover {
    background-color: #f3f4f6;
}

.ls-linkedin-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.ls-card-label {
    margin: 0 24px 12px 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--primary-green, #10b981);
    text-transform: uppercase;
}

/* ==========================================================================
   SCROLLABLE CONTENT AREA
   ========================================================================== */

.ls-card-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
    position: relative;
    /* Custom thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.ls-card-content-scroll::-webkit-scrollbar {
    width: 4px;
}

.ls-card-content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ls-card-content-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.ls-post-text {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 16px 0;
    white-space: pre-wrap; /* Preserve line breaks */
}

/* Scroll Fade overlay to indicate more content */
.ls-card-scroll-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
    border-radius: 0 0 16px 16px;
    opacity: 0.9;
}

.ls-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ls-topic-tag {
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 500;
}

/* ==========================================================================
   CONTROLS
   ========================================================================== */

.ls-carousel-arrow {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: var(--text-primary, #111827);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 20px;
    line-height: 1;
}

.ls-carousel-arrow:hover {
    border-color: var(--primary-green, #10b981);
    color: var(--primary-green, #10b981);
}

.ls-prev {
    left: -24px;
}

.ls-next {
    right: -24px;
}

.ls-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.ls-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.ls-dot.active {
    background-color: var(--primary-green, #10b981);
    transform: scale(1.2);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1240px) {
    .ls-prev { left: 0; }
    .ls-next { right: 0; }
    .ls-slide { padding: 0 8px; }
}

@media (max-width: 1024px) {
    .ls-slide {
        flex: 0 0 50%; /* 2 cards on tablet */
    }
    .learner-stories-title {
        font-size: 38px;
    }
}

@media (max-width: 768px) {
    .learner-stories-section {
        padding: 60px 16px;
    }
    .learner-stories-title {
        font-size: 32px;
    }
    .ls-slide {
        flex: 0 0 100%; /* 1 card on mobile */
    }
    .ls-card {
        height: 420px; /* Slightly shorter on mobile */
    }
    .ls-prev { left: -10px; }
    .ls-next { right: -10px; }
}

@media (max-width: 480px) {
    .ls-carousel-arrow {
        width: 40px;
        height: 40px;
        /* Position them below the card for easier tapping on small screens, or keep them centered but smaller */
    }
    .ls-prev { left: 4px; }
    .ls-next { right: 4px; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ls-carousel-track {
        transition: none !important;
    }
}
