/* ===== RESET & VARIABLES ===== */
:root {
    --primary-color: #0056b3;
    --primary-dark: #004494;
    --secondary-color: #6c757d;
    --accent-color: #ff6b35;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --text-dark: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    width: 100%;
}

.header .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .tagline {
    font-size: 13px;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-color);
    color: var(--white);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
}

.search-box form {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 200px;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 240px;
}

.search-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===== AD SPACE ===== */
.ad-space {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 30px 0;
    text-align: center;
    border: 2px dashed var(--border-color);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.ad-space.large {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.ad-space.sidebar {
    height: 300px;
    margin-bottom: 30px;
    position: sticky;
    top: 100px;
}

.ad-space.inline {
    margin: 40px auto;
    max-width: 728px;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 14px;
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===== LAYOUT GRID ===== */
.content-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 40px 0;
    width: 100%;
}

@media (min-width: 992px) {
    .content-grid {
        flex-direction: row;
    }
    
    .main-content {
        flex: 1;
        min-width: 0; /* Important pour flexbox */
    }
    
    .sidebar {
        width: 300px;
        flex-shrink: 0;
    }
}

/* ===== SIDEBAR WIDGETS ===== */
.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    width: 100%;
}

.sidebar-widget h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-dark);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 700;
}

.trending-articles {
    list-style: none;
}

.trending-articles li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.trending-articles li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.trending-articles a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    display: block;
    transition: var(--transition);
    line-height: 1.5;
}

.trending-articles a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.newsletter-widget {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.newsletter-widget h3 {
    color: var(--white);
    border-bottom-color: var(--accent-color);
}

.newsletter-widget p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 14px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-form input {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.newsletter-form input:focus {
    outline: none;
    background: var(--white);
}

.newsletter-form button {
    padding: 12px;
    background: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #ff5722;
    transform: translateY(-2px);
}

/* ===== HOME PAGE ===== */
.featured-news {
    margin-bottom: 60px;
    width: 100%;
}

.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 15px;
    font-weight: 800;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.news-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    width: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-image img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.card-title {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: 700;
    word-break: break-word;
}

.card-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.card-title a:hover {
    color: var(--primary-color);
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.card-excerpt {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.6;
    flex-grow: 1;
    word-break: break-word;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    margin-top: auto;
}

.read-more:hover {
    gap: 12px;
    color: var(--primary-dark);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 12px 24px;
    background: var(--white);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination .page-info {
    color: var(--text-light);
    font-size: 14px;
    padding: 0 15px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: 80px;
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--white), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--white);
    font-weight: 600;
}

.footer-section p {
    color: #b0b7c3;
    font-size: 15px;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #b0b7c3;
    text-decoration: none;
    transition: var(--transition);
    font-size: 15px;
}

.footer-section a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #8a94a6;
    font-size: 14px;
}

.footer-bottom p {
    margin-bottom: 10px;
}

.footer-bottom a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
    margin: 0 10px;
}

.footer-bottom a:hover {
    color: var(--white);
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .content-grid {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .section-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .header .container {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .main-nav ul {
        justify-content: center;
    }
    
    .search-box form {
        justify-content: center;
    }
    
    .search-box input {
        width: 100%;
        max-width: 300px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .ad-space.large {
        height: 100px;
    }
    
    .ad-space.sidebar {
        height: 250px;
        position: static;
    }
    
    .content-grid {
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .main-nav ul {
        gap: 2px;
    }
    
    .main-nav a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .news-card {
        margin-bottom: 20px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section a:hover {
        padding-left: 0;
    }
}

/* ===== LOADING ANIMATION ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== FIXES POUR L'ARTICLE ===== */
.full-article {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.main-content {
    width: 100%;
    overflow: hidden;
}

/* ===== UTILITY CLASSES ===== */
.width-100 {
    width: 100% !important;
}

.no-overflow {
    overflow: hidden !important;
}

.box-border {
    box-sizing: border-box !important;
}