/**
 * News and Insights Widget - Styles
 */

/* ========================================
   Wrapper
   ======================================== */

.ni-wrapper {
    width: 100%;
    margin: 0 auto;
    clear: both;
}

/* ========================================
   Filter Header
   ======================================== */

.ni-filter-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

/* Filter Top Row */
.ni-filter-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 15px;
}

.ni-filter-menu {
    display: flex;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ni-menu-item {
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.3px;
}

.ni-menu-item.active {
    font-weight: 600;
    color: #000;
}

.ni-menu-item:hover {
    color: #000;
}

/* Filter Divider */
.ni-filter-divider {
    height: 1px;
    background-color: #e0e0e0;
}

/* Filter Bottom Row */
.ni-filter-bottom-row {
    display: flex;
    padding: 20px 0;
}

.ni-channel-filter {
    display: flex;
    gap: 30px;
    align-items: center;
    flex: 1;
}

.ni-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.2s ease;
}

.ni-filter-option:hover {
    color: #000;
}

.ni-filter-option input[type="radio"] {
    display: none;
}

.ni-radio {
    width: 14px;
    height: 14px;
    border: 2px solid #000;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.ni-filter-option input[type="radio"]:checked + .ni-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #000;
    border-radius: 50%;
}

.ni-filter-option:hover .ni-radio {
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}

/* ========================================
   Content
   ======================================== */

.ni-content {
    margin-bottom: 40px;
}

.ni-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.ni-no-posts {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #999;
}

/* ========================================
   Section Headers
   ======================================== */

.ni-section-header {
    margin-bottom: 40px;
}

.ni-section-title {
    font-size: 32px;
    font-weight: 600;
    color: #000;
    margin: 0 0 15px 0;
}

.ni-section-text {
    font-size: 16px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   Posts Grid
   ======================================== */

.ni-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

@media (max-width: 1024px) {
    .ni-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ni-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Post Card
   ======================================== */

.ni-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.ni-post-image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    margin-bottom: 20px;
}

.ni-post-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ni-post-card:hover .ni-post-image-wrapper img {
    transform: scale(1.05);
}

.ni-no-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.ni-post-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Post Title Row */
.ni-post-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.ni-post-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.ni-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ni-post-title a:hover {
    color: #666;
}

.ni-post-date {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Post Excerpt */
.ni-post-excerpt {
    font-size: 15px;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

/* Post Meta */
.ni-post-meta {
    font-size: 14px;
    color: #999;
    margin: 0 0 15px 0;
}

/* Post Content */
.ni-post-content {
    font-size: 15px;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.6;
    flex: 1;
}

/* Publication Link */
.ni-publication-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #000;
    text-decoration: none;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.ni-publication-link:hover {
    color: #666;
    gap: 12px;
}

.ni-publication-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    stroke-width: 3;
    flex-shrink: 0;
}

.ni-publication-link:hover .ni-publication-arrow {
    transform: translate(3px, -3px);
}

/* Post Channels */
.ni-post-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
}

.ni-channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.ni-channel-dot {
    width: 20px;
    height: 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ========================================
   Pagination
   ======================================== */

.ni-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.ni-pagination-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ni-load-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 44px;
    padding: 12px 28px;
    border: 1px solid #000;
    background: #000;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.ni-load-more-button:hover:not(:disabled) {
    background: #fff;
    color: #000;
}

.ni-load-more-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .ni-filter-top-row {
        flex-direction: column;
        align-items: stretch;
        background-color: #ffffff;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* When stuck: pin to the top of the viewport for the full page scroll.
       Using position:fixed (instead of position:sticky) so the row stays
       visible even after the user scrolls past its original container. */
    .ni-filter-top-row.is-stuck {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9999;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }
    
    .ni-filter-menu {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .ni-channel-filter {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .ni-section-title {
        font-size: 24px;
    }
    
    .ni-post-title-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .ni-post-date {
        align-self: flex-start;
    }
}
