/**
 * Breaking News Ticker - Simple Design (No Images)
 * Israel News Theme
 */

/*--------------------------------------------------------------
1.0 Ticker Container
--------------------------------------------------------------*/
.breaking-news-ticker-multi {
    background: #fff;
    position: relative;
    z-index: 800;
    overflow: visible;
}

.ticker-container-multi {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.ticker-inner-multi {
    display: flex;
    align-items: flex-start; /* Align to top so breaking news label doesn't move */
    gap: 20px;
    padding: 12px 0;
    position: relative;
}

/*--------------------------------------------------------------
2.0 Breaking News Label - Simple
--------------------------------------------------------------*/
.ticker-label-multi {
    background:  linear-gradient(90deg,#03c 0,#0345d8 50%,#05f 100%)!important;
    color: #fff;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 2px;
}

.ticker-title-multi {
    font-size: 13px;
    color: #fff !important;
    text-decoration: none;
    display: inline-block;
}

/*--------------------------------------------------------------
3.0 Ticker Grid (No Thumbnails)
--------------------------------------------------------------*/
.ticker-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow: visible;
    position: relative;
    /* Reserve vertical space so ticker content doesn't "pop in" and push
       the page down once JavaScript finishes initialising.
       This stabilises layout and prevents CLS on first paint. */
    min-height: 90px;
}

.ticker-item-multi {
    min-width: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    display: none; /* Hide by default to prevent flash */
}

/* Show first 3 items by default (desktop) or first item (mobile) - visible immediately before JS loads */
.ticker-item-multi:nth-child(-n+3) {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    /* On mobile, only show first item by default */
    .ticker-item-multi:nth-child(-n+3) {
        display: none;
    }
    .ticker-item-multi:nth-child(1) {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }
}

.ticker-item-multi.ticker-visible {
    opacity: 1;
    transform: translateX(0);
    display: block;
}

.ticker-item-link {
    display: block;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 3px;
    transition: background 0.2s;
    position: relative;
}

.ticker-item-link:hover {
    background: #f8f9fa;
}

/*--------------------------------------------------------------
4.0 Content (Text Only)
--------------------------------------------------------------*/
.ticker-content-multi {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.ticker-content-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.ticker-headline-multi {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticker-item-link:hover .ticker-headline-multi {
    color: #c30000;
}

.ticker-time-multi {
    font-size: 11px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
}

/* Excerpt Dropdown Button - Right Aligned */
.ticker-excerpt-toggle {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0;
}

.ticker-excerpt-toggle:hover {
    color: #c30000;
}

.ticker-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    line-height: 1;
}

.ticker-dropdown-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ticker-excerpt-toggle[aria-expanded="true"] .ticker-dropdown-icon {
    transform: rotate(180deg);
}

/* Excerpt Dropdown */
.ticker-excerpt-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #c30000;
    border-radius: 3px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 1000;
    pointer-events: none;
}

.ticker-excerpt-dropdown.ticker-dropdown-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ticker-excerpt-dropdown p {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.ticker-read-more {
    display: inline-block;
    font-size: 12px;
    color: #c30000;
    font-weight: 600;
    text-decoration: none;
}

.ticker-read-more:hover {
    text-decoration: underline;
}

/*--------------------------------------------------------------
5.0 Navigation Arrows
--------------------------------------------------------------*/
.ticker-nav-multi {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
    margin-left: auto;
}

.ticker-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.ticker-nav-btn:hover {
    background: transparent;
    border: none;
    color: #c30000;
}

.ticker-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/*--------------------------------------------------------------
6.0 Tablet Responsive
--------------------------------------------------------------*/
@media (max-width: 1024px) {
    .ticker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .ticker-headline-multi {
        font-size: 13px;
    }
}

/*--------------------------------------------------------------
7.0 Mobile Responsive - ULTRA COMPACT FOR MAXIMUM CONTENT
--------------------------------------------------------------*/
@media (max-width: 768px) {
    /* HIDE BREAKING NEWS LABEL ON MOBILE */
    .ticker-label-multi {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }
    
    /* HIDE EXCERPT TOGGLE AND DROPDOWN ON MOBILE */
    .ticker-excerpt-toggle,
    .ticker-excerpt-dropdown {
        display: none !important;
        visibility: hidden !important;
    }
    
    .ticker-container-multi {
        padding: 0 10px !important;
    }
    
    .ticker-inner-multi {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 0 !important;
        padding: 8px 0 !important;
        flex-wrap: wrap !important;
        position: relative !important;
    }
    
    .ticker-grid {
        grid-template-columns: 1fr;
        gap: 0 !important;
        min-height: auto !important;
        flex: 1 1 100% !important;
        padding-right: 0 !important;
        width: 100% !important;
        order: 1 !important;
    }
    
    .ticker-item-link {
        padding: 8px !important;
        background: transparent !important;
    }
    
    .ticker-content-multi {
        flex-direction: column !important;
        gap: 4px;
        align-items: flex-start !important;
    }
    
    .ticker-content-left {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    
    /* Timestamp row wrapper - create space for navigation */
    .ticker-time-multi {
        display: inline-block !important;
        width: calc(100% - 80px) !important; /* Leave space for navigation */
    }
    
    /* Navigation buttons - position on same row as timestamp */
    .ticker-nav-multi {
        display: flex !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-end !important;
        margin-left: auto !important;
        position: absolute !important;
        right: 8px !important;
        bottom: 8px !important;
        width: auto !important;
        order: 2 !important;
    }
    
    .ticker-nav-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
        padding: 6px !important;
        background: transparent !important;
        border: none !important;
    }
    
    .ticker-nav-btn:hover {
        background: transparent !important;
        border: none !important;
        color: #0033cc !important;
    }
    
    .ticker-nav-btn svg {
        width: 12px !important;
        height: 12px !important;
    }
    
    .ticker-grid {
        overflow: visible;
    }
    
    .breaking-news-ticker-multi {
        overflow: visible;
        min-height: 60px !important;
        margin-bottom: 4px !important;
        background: #f8f9fa !important;
        border-bottom: 2px solid #0033cc !important;
    }
    
    .ticker-headline-multi {
        font-size: 14px !important;
        -webkit-line-clamp: 2 !important;
        line-height: 1.35 !important;
        font-weight: 600 !important;
    }
    
    .ticker-time-multi {
        font-size: 10px !important;
        color: #666 !important;
    }
}

/*--------------------------------------------------------------
8.0 Small Mobile
--------------------------------------------------------------*/
@media (max-width: 480px) {
    .ticker-grid {
        grid-template-columns: 1fr;
    }
    
    .ticker-label-multi {
        font-size: 12px;
    }
    
    .ticker-headline-multi {
        font-size: 14px;
    }
}

/*--------------------------------------------------------------
9.0 Accessibility
--------------------------------------------------------------*/
.ticker-nav-btn:focus,
.ticker-item-link:focus {
    outline: none;
    outline-offset: 0;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/*--------------------------------------------------------------
10.0 Print
--------------------------------------------------------------*/
@media print {
    .breaking-news-ticker-multi {
        display: none;
    }
}
