/* ===== MODERN NEWS HOMEPAGE STYLES ===== */
.news-homepage {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2c3e50;
    background: #f8f9fa;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== HEADER SECTION ===== */
.news-header {
    background: linear-gradient(135deg, #1a4fb3 0%, #316ce8 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.news-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M1200 120L0 16.48 0 0 1200 0 1200 120z" fill="%23ffffff" fill-opacity="0.1"/></svg>');
    background-size: cover;
}

.news-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
}

.news-header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    font-weight: 400;
}

/* ===== MAIN LAYOUT ===== */
.news-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
}

.news-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(1.5rem, 3vw, 3rem);
    margin-top: 2rem;
}

/* ===== FEATURED NEWS SECTION ===== */
.featured-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-left: 4px solid #316ce8;
    padding-left: 1rem;
    line-height: 1.2;
}

/* Main Featured Article */
.main-featured {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    height: min(60vh, 500px);
    margin-bottom: 1.5rem;
    background: #000;
}

.main-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-featured:hover img {
    transform: scale(1.08);
}

.featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.featured-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.featured-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.featured-date {
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Side Featured Container - Desktop Layout */
.side-featured-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.side-featured-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.side-featured-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.side-featured-img {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.side-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.side-featured-item:hover .side-featured-img img {
    transform: scale(1.08);
}

.side-featured-content {
    /* Natural block layout for desktop */
}

.side-featured-date {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin:7px 0 3px 0;
}

.side-featured-title {
    font-size: 1rem;
    font-weight: 700;
    //margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #2c3e50;
    display: -webkit-box;
    //-webkit-line-clamp: 2;
    //line-clamp: 2;
    //-webkit-box-orient: vertical;
    //overflow: hidden;
    margin:0;
}

/* ===== NEWS GRID ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}

.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .card-img-container img {
    transform: scale(1.1);
}

.card-body {
    padding: 1.75rem;
}

.news-date {
    color: #316ce8;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: #2c3e50;
    //display: -webkit-box;
    // -webkit-line-clamp: 2;
    //-webkit-box-orient: vertical;
    //overflow: hidden;
}

.news-excerpt {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    color: #316ce8;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more-link:hover {
    color: #1a4fb3;
    transform: translateX(8px);
}

.read-more-link i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.read-more-link:hover i {
    transform: translateX(4px);
}

/* ===== SIDEBAR ===== */
.news-sidebar {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    height: fit-content;
    border: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 3px solid #316ce8;
    padding-bottom: 0.75rem;
    line-height: 1.2;
}

/* Trending List */
.trending-list, .recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-item, .recent-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.trending-item:hover, .recent-item:hover {
    background: #f8f9fa;
    margin: 0 -1rem;
    padding: 1.25rem 1rem;
    border-radius: 12px;
}

.trending-item:last-child, .recent-item:last-child {
    border-bottom: none;
}

.trending-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #316ce8, #1a4fb3);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(49, 108, 232, 0.3);
    align-self: flex-start;
    margin-top: 0;
}

.trending-content, .recent-content {
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

.trending-item a, .recent-item a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    //display: -webkit-box;
    //-webkit-line-clamp: 2;
    //-webkit-box-orient: vertical;
    //overflow: hidden;
    margin-top: 0;
}

.trending-item a:hover, .recent-item a:hover {
    color: #316ce8;
}

.item-date, .item-views {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    margin-top: 0;
}

.item-views {
    color: #316ce8;
    font-weight: 600;
}

/* Newsletter */
.newsletter-form {
    background: linear-gradient(135deg, #316ce8 0%, #1a4fb3 100%);
    padding: 2rem;
    border-radius: 16px;
    color: white;
    text-align: center;
    box-shadow: 0 8px 32px rgba(49, 108, 232, 0.3);
}

.newsletter-form h4 {
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.newsletter-form p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-size: 0.95rem;
}

.newsletter-form input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.newsletter-form input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}

.newsletter-form button {
    background: white;
    color: #316ce8;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(255,255,255,0.2);
}

.newsletter-form button:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.3);
}

/* ===== LOADING AND LOAD MORE ===== */
.loading {
    text-align: center;
    padding: 3rem;
    display: none;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #316ce8;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.load-more-container {
    text-align: center;
    margin: 4rem 0 2rem;
}

.load-more-btn {
    background: linear-gradient(135deg, #316ce8 0%, #1a4fb3 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(49, 108, 232, 0.4);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(49, 108, 232, 0.6);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(49, 108, 232, 0.3);
}

.no-more-news {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
    grid-column: 1 / -1;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .news-container {
        padding: 1.5rem;
    }
    
    .side-featured-container {
        gap: 1.25rem;
    }
    
    .side-featured-item {
        padding: 1.25rem;
    }
}

@media (max-width: 968px) {
    .news-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .side-featured-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-sidebar {
        position: static;
    }
    
    .main-featured {
        height: min(50vh, 400px);
    }
}

/* ===== MOBILE LAYOUT - CRITICAL FIXES ===== */
@media (max-width: 768px) {
    /* Side Featured Items - Mobile Layout (Image + Content Side by Side) */
    .side-featured-item {
        display: flex;
        gap: 1.25rem;
        align-items: flex-start;
        padding: 1.5rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }
    
    .side-featured-img {
        width: 120px;
        height: 90px;
        margin-bottom: 0;
        flex-shrink: 0;
        border-radius: 8px;
        overflow: hidden;
        align-self: flex-start;
    }
    
    .side-featured-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    .side-featured-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-self: flex-start;
        min-height: 0;
    }
    
    .side-featured-title {
        font-size: 1rem;
        //margin-bottom: 0.5rem;
        line-height: 1.4;
        color: #2c3e50;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 0;
        padding-top: 0;
    }
    
    .side-featured-date {
        font-size: 0.8rem;
        color: #6c757d;
        margin-top: 0;
        margin-bottom: 0;
    }

    /* Trending Items - Mobile Layout Fixes */
    .trending-item, .recent-item {
        padding: 1rem 0;
        border-bottom: 1px solid #e9ecef;
        display: flex;
        align-items: flex-start;
        gap: 0.875rem;
    }
    
    .trending-item:hover, .recent-item:hover {
        background: #f8f9fa;
        margin: 0 -1rem;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .trending-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        align-self: flex-start;
        margin-top: 0;
    }
    
    .trending-content, .recent-content {
        flex: 1;
        min-width: 0;
        align-self: flex-start;
    }
    
    .trending-item a, .recent-item a {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        margin-top: 0;
    }
    
    .item-date, .item-views {
        font-size: 0.8rem;
        margin-top: 0;
    }

    /* General Mobile Styles */
    .news-container {
        padding: 1rem;
    }
    
    .news-header {
        padding: 3rem 0 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-featured {
        height: min(45vh, 350px);
    }
    
    .featured-content {
        padding: 1.5rem;
    }
    
    .load-more-btn {
        padding: 1.125rem 2.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .news-header {
        padding: 2.5rem 0 1.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .main-featured {
        height: min(40vh, 300px);
    }
    
    .featured-title {
        font-size: 1.2rem;
    }
    
    .side-featured-item {
        padding: 1.25rem;
        gap: 1rem;
    }
    
    .side-featured-img {
        width: 100px;
        height: 80px;
    }
    
    .news-sidebar {
        padding: 1.5rem;
    }
    
    .newsletter-form {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .load-more-container {
        margin: 3rem 0 1rem;
    }
    
    .trending-item, .recent-item {
        padding: 0.875rem 0;
        gap: 0.75rem;
    }
    
    .trending-item:hover, .recent-item:hover {
        padding: 0.875rem;
    }
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.read-more-link:focus,
.load-more-btn:focus,
.newsletter-form input:focus,
.newsletter-form button:focus {
    outline: 2px solid #316ce8;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .news-header {
        background: #316ce8 !important;
        color: black !important;
    }
    
    .news-card:hover {
        transform: none !important;
    }
    
    .load-more-container {
        display: none;
    }
}

/* ===== CRITICAL ALIGNMENT FIXES ===== */
/* Ensure all flex children align to top */
.side-featured-item > *,
.trending-item > * {
    align-self: flex-start;
}

/* Remove any default margins that might affect alignment */
.side-featured-content > *,
.trending-content > * {
    margin-top: 0;
}

/* Prevent content from being pushed down */
.side-featured-item,
.trending-item {
    align-items: flex-start;
}

/* Trending Badge Styles */
.trending-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.news-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.view-count {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

.trending-score {
    font-size: 0.7rem;
    color: #316ce8;
    font-weight: 600;
}