/**
 * Voicenews Trends Block Styles
 *
 * Professional horizontal scrolling trends bar that displays
 * the latest 10 posts with a smooth marquee animation.
 *
 * Features:
 * - Dark navy background with white text
 * - Blue accent label with trend icon
 * - Numbered posts for visual hierarchy
 * - Smooth infinite scrolling animation
 * - Pauses on hover
 * - Fully responsive
 *
 * @package Voicenews_Trends
 * @since 1.0.0
 */

/* Main container */
.voicenews-trends {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Label section with icon */
.voicenews-trends__label {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1.5px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}

.voicenews-trends__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Container for overflow hidden */
.voicenews-trends__container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

/* Fade edges for smooth visual */
.voicenews-trends__container::before,
.voicenews-trends__container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.voicenews-trends__container::before {
    left: 0;
    background: linear-gradient(90deg, #f8fafc 0%, transparent 100%);
}

.voicenews-trends__container::after {
    right: 0;
    background: linear-gradient(90deg, transparent 0%, #f8fafc 100%);
}

/* Track that holds both inner containers */
.voicenews-trends__track {
    display: flex;
    flex-direction: row;
    width: max-content;
    animation: voicenewsTrendsScroll 90s linear infinite;
}

/* Pause animation on hover */
.voicenews-trends__track:hover {
    animation-play-state: paused;
}

/* Inner container with items */
.voicenews-trends__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding-right: 30px;
}

/* Link styles */
.voicenews-trends__link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 0;
    transition: color 0.2s ease;
}

.voicenews-trends__link:hover {
    color: #2563eb;
    text-decoration: none;
}

/* Number badge */
.voicenews-trends__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Separator between links */
.voicenews-trends__separator {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 50%;
    margin: 0 20px;
    flex-shrink: 0;
}

/* Empty state message */
.voicenews-trends__message {
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
    padding: 12px 0;
}

/* Empty state modifier */
.voicenews-trends--empty .voicenews-trends__track {
    animation: none;
}

/* Marquee animation - continuous scroll */
@keyframes voicenewsTrendsScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* =========================================
   Responsive Styles
   ========================================= */

/* Tablet and below */
@media screen and (max-width: 1024px) {
    .voicenews-trends__label {
        padding: 10px 14px;
        font-size: 11px;
        letter-spacing: 1px;
    }

    .voicenews-trends__icon {
        width: 14px;
        height: 14px;
    }

    .voicenews-trends__container {
        padding: 0 15px;
    }

    .voicenews-trends__container::before,
    .voicenews-trends__container::after {
        width: 30px;
    }

    .voicenews-trends__link {
        font-size: 12px;
        padding: 10px 0;
    }

    .voicenews-trends__number {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .voicenews-trends__separator {
        margin: 0 15px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .voicenews-trends__label {
        padding: 8px 12px;
        font-size: 10px;
        gap: 4px;
    }

    .voicenews-trends__label span {
        display: none;
    }

    .voicenews-trends__icon {
        width: 16px;
        height: 16px;
    }

    .voicenews-trends__container {
        padding: 0 10px;
    }

    .voicenews-trends__container::before,
    .voicenews-trends__container::after {
        width: 20px;
    }

    .voicenews-trends__link {
        font-size: 12px;
        padding: 8px 0;
        gap: 6px;
    }

    .voicenews-trends__number {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
        padding: 0 4px;
    }

    .voicenews-trends__separator {
        width: 3px;
        height: 3px;
        margin: 0 12px;
    }

    .voicenews-trends__track {
        animation-duration: 70s;
    }
}

/* Small mobile */
@media screen and (max-width: 480px) {
    .voicenews-trends__link {
        font-size: 11px;
    }

    .voicenews-trends__separator {
        margin: 0 10px;
    }

    .voicenews-trends__track {
        animation-duration: 60s;
    }
}

/* =========================================
   Block Editor Styles
   ========================================= */

.editor-styles-wrapper .voicenews-trends {
    margin: 0;
}

/* Full width alignment support */
.voicenews-trends.alignfull {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.voicenews-trends.alignwide {
    width: calc(100% + 4rem);
    margin-left: -2rem;
}

/* =========================================
   Reduced Motion Preference
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .voicenews-trends__track {
        animation: none;
    }
}
