/**
 * 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;
    min-height: 76px;
    contain: style;
    border-bottom: 2px solid #1a1a1a;
    display: flex;
    align-items: center;
}

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

.ticker-inner-multi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 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: 5px 12px;
    font-weight: 700;
    font-size: 12px;
    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: 10px;
    overflow: visible;
    position: relative;
    min-height: 55px;
}

/* CLS Fix: Stack all items in a single row. Items belonging to the same column
   overlap so swapping visibility never changes the grid height.
   Column assignment: items 1,4,7 → col 1 | items 2,5,8 → col 2 | items 3,6,9 → col 3 */
.ticker-item-multi {
    grid-row: 1;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.ticker-item-multi:nth-child(3n+1) { grid-column: 1; }
.ticker-item-multi:nth-child(3n+2) { grid-column: 2; }
.ticker-item-multi:nth-child(3n+3) { grid-column: 3; }

/* Show first 3 items by default (desktop) — visible immediately before JS loads */
.ticker-item-multi:nth-child(-n+3) {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    /* On mobile, only show first item by default */
    .ticker-item-multi:nth-child(-n+3) {
        opacity: 0;
        visibility: hidden;
    }
    .ticker-item-multi:nth-child(1) {
        opacity: 1;
        visibility: visible;
    }
    /* Mobile: all items in single column, single row (overlap) */
    .ticker-item-multi {
        grid-column: 1 !important;
    }
}

.ticker-item-multi.ticker-visible {
    opacity: 1;
    visibility: visible;
}

.ticker-item-multi.ticker-hidden {
    opacity: 0;
    visibility: hidden;
}

.ticker-item-link {
    display: block;
    text-decoration: none;
    color: #1a1a1a;
    padding: 3px 8px;
    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: center;
    justify-content: space-between;
    gap: 6px;
    position: relative;
    z-index: 1;
}

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


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

.ticker-headline-multi a {
    color: #1a1a1a !important;
    text-decoration: none;
}

.ticker-item-link:hover .ticker-headline-multi a {
    color: #0033cc !important;
}

.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;
}

/* RTL: flip nav arrows and push nav to the left end */
[dir="rtl"] .ticker-nav-multi {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .ticker-nav-btn svg {
    transform: scaleX(-1);
}

/*--------------------------------------------------------------
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: 44px !important;
        margin-bottom: 0 !important;
        background: #f8f9fa !important;
        border-bottom: 2px solid #1a1a1a !important;
        contain: style;
    }
    
    .ticker-headline-multi {
        font-size: 14px !important;
        -webkit-line-clamp: 2 !important;
        line-height: 1.35 !important;
        font-weight: 600 !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !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;
    }
}
