/* ============================================================
   MAGAZINE SCROLLER - STABLE v2.0
   Removes 'Breakdance' shaking and enables smooth JS scrolling
   ============================================================ */

/* 1. Main Outer Container */
.stable-scroller-container {
    display: block;
    width: 100%;
    overflow-x: auto; /* MUST BE AUTO OR SCROLL */
    white-space: nowrap;
    scrollbar-width: none;
}
.stable-scroller-container::-webkit-scrollbar { display: none; }

.stable-scroller-container:active {
    cursor: grabbing;
}

/* 2. The Sliding Track */
#dynamic-track, 
.magnetic-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 25px;
    align-items: flex-start;
    will-change: transform;
}

/* 3. Individual Magazine Item */
.mag-item {
    flex: 0 0 160px !important; /* Forces width stability */
    width: 160px !important;
    text-align: center;
    display: inline-block;
    vertical-align: top;
    transition: transform 0.3s ease;
}

/* 4. The Magazine Cover (The Stabilizer) */
.mag-item img {
    width: 160px !important;
    height: 220px !important; /* CRITICAL: Prevents height-jumping */
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    background-color: #222; /* Placeholder while loading */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
}

/* 5. Text Styling */
.mag-item p {
    color: #ffc107;
    font-size: 13px;
    margin-top: 12px;
    font-weight: 500;
    white-space: normal; /* Allows title to wrap if long */
    line-height: 1.3;
}

/* 6. Hover Effects */
.stable-scroller-container:hover .mag-item img {
    filter: brightness(0.7);
}

.mag-item:hover img {
    transform: translateY(-8px) scale(1.05);
    filter: brightness(1.1) !important;
    border-color: #ffc107;
    z-index: 10;
}

/* 7. Pulse Animation (For the Read Buttons) */
.pulse-loop {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(255, 193, 7, 0.4); }
    100% { box-shadow: 0 0 0 15px rgba(255, 193, 7, 0); }
}

/* 8. Responsive Adjustments */
@media (max-width: 768px) {
    .mag-item {
        flex: 0 0 130px !important;
        width: 130px !important;
    }
    
    .mag-item img {
        width: 130px !important;
        height: 180px !important;
    }
}

.mag-item img {
    width: 160px !important;
    height: 220px !important; /* This is the anchor that stops the shaking */
    object-fit: cover;
    background-color: #1a1a1a; 
}