/* ==========================================================================
   Social Wall - Scrolling Tweet Carousel
   ========================================================================== */

.sw-section {
    padding: 80px 0 60px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.sw-carousel-wrapper {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Track container clips overflow */
.sw-track-container {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

/* The scrolling track */
.sw-track {
    display: flex;
    gap: 20px;
    width: max-content;
    will-change: transform;
}

/* Right-to-left animation */
.sw-track-rtl {
    animation: sw-scroll-rtl var(--sw-duration, 60s) linear infinite;
}

/* Left-to-right animation */
.sw-track-ltr {
    animation: sw-scroll-ltr var(--sw-duration, 60s) linear infinite;
}

@keyframes sw-scroll-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes sw-scroll-ltr {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Pause on hover (desktop) and touch (mobile) */
.sw-track-container:hover .sw-track,
.sw-track-container.sw-paused .sw-track {
    animation-play-state: paused;
}

/* Individual tweet card (now an <a> tag) */
a.sw-card {
    flex-shrink: 0;
    width: 340px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

a.sw-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
}

/* Card header: avatar + name */
.sw-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* Profile picture avatar */
.sw-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

/* Author info */
.sw-author {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sw-name {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sw-handle {
    font-size: 13px;
    color: #64748b;
    line-height: 1.3;
}

/* Tweet text */
.sw-text {
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */

/* Tablet */
@media (max-width: 991px) {
    .sw-section {
        padding: 60px 0 40px;
    }

    .sw-carousel-wrapper {
        margin-top: 36px;
        gap: 16px;
    }

    a.sw-card {
        width: 300px;
        padding: 16px 18px;
    }
}

/* Mobile: single swipeable row with all tweets */
@media (max-width: 767px) {
    .sw-section {
        padding: 48px 0 32px;
    }

    .sw-carousel-wrapper {
        margin-top: 28px;
    }

    /* Hide empty row 2 (cards moved to row 1 via JS) */
    .sw-mobile .sw-row-2 {
        display: none;
    }

    /* Enable horizontal scroll for swipe + JS auto-scroll */
    .sw-mobile .sw-track-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: none;
        mask-image: none;
        padding: 0 16px;
    }

    /* Hide scrollbar */
    .sw-mobile .sw-track-container::-webkit-scrollbar {
        display: none;
    }
    .sw-mobile .sw-track-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Disable CSS animation, JS handles scrolling */
    .sw-mobile .sw-track {
        animation: none !important;
        will-change: auto;
        gap: 12px;
    }

    a.sw-card {
        width: 280px;
        padding: 16px;
    }

    .sw-text {
        font-size: 13px;
        -webkit-line-clamp: 4;
    }
}
