body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    text-align: center;
}

.header .subtitle {
    text-align: center;
    font-size: 1.1em;
    margin-top: 5px;
    opacity: 0.9;
}

/* Navigation */
.nav {
    background: #34495e;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

/* Mobile navigation toggle button */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    width: 100%;
    justify-content: space-between;
}

.mobile-nav-toggle:hover {
    background-color: #2c3e50;
}

/* Hamburger icon */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: transform 0.3s ease;
}

.hamburger-icon span {
    width: 20px;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Animated hamburger when active */
.mobile-nav-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-nav-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.nav li {
    margin: 0;
}

.nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
    min-height: 44px; /* Touch-friendly size for mobile */
    display: flex;
    align-items: center;
}

.nav a:hover {
    background-color: #2c3e50;
}

.nav a.active {
    background-color: #3498db;
}

/* Main content */
.main {
    padding: 2rem 0;
    min-height: 500px;
}

/* Reduced padding for article pages */
.main.article-page {
    padding: 1rem 0;
}

/* Reduced margin for article main card */
.main.article-page .article-main {
    margin-bottom: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: #ecf0f1;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #bdc3c7;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.card-text {
    color: #7f8c8d;
    line-height: 1.6;
}

/* Article cards */
.article-card {
    border-left: 4px solid #3498db;
}

.article-meta {
    color: #95a5a6;
    font-size: 0.9em;
    margin-bottom: 1rem;
}

.article-tags {
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    background: #ecf0f1;
    color: #7f8c8d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag.candidate {
    background: #e8f4f8;
    color: #2980b9;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.tag.candidate:hover {
    background: #2980b9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.3);
}

/* Liens candidats en dehors des tags */
.candidate-link {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
    font-weight: 500;
}

.candidate-link:hover {
    color: #3498db;
    text-decoration: underline;
}

/* Nom de candidat dans les sondages */
.candidate-name.candidate-link {
    font-weight: 600;
    color: var(--poll-title-color, #2c3e50);
}

.candidate-name.candidate-link:hover {
    color: var(--percentage-color, #3498db);
}

.tag.hashtag {
    background: #fdf2e9;
    color: #e67e22;
}

/* Candidate cards */
.candidate-card {
    border-left: 4px solid #e74c3c;
    text-align: center;
}

.candidate-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    background: #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: white;
}

.candidate-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.candidate-party {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 1rem;
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Search */
.search-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-select {
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    background: white;
    font-size: 1em;
}

.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.newsletter-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.8em;
}

.newsletter-section p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-size: 1.1em;
}

.newsletter-form {
    margin-bottom: 1rem;
}

.newsletter-input-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 1em;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.3s;
}

.newsletter-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.2);
}

.newsletter-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.newsletter-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.8);
    transform: translateY(-1px);
}

.newsletter-message {
    margin-top: 1rem;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    animation: slideIn 0.3s ease;
}

.newsletter-message.success {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.newsletter-message.error {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.newsletter-info {
    margin-bottom: 0;
    opacity: 0.8;
    font-size: 0.9em;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Newsletter responsive */
@media (max-width: 768px) {
    .newsletter-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .newsletter-input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .newsletter-btn {
        width: 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 2rem 0;
}

.pagination a {
    display: block;
    padding: 10px 15px;
    background: white;
    color: #3498db;
    text-decoration: none;
    border-radius: 6px;
    border: 2px solid #ecf0f1;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
    border-top: 4px solid #3498db;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.footer-section h4 {
    color: #ecf0f1;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.6rem;
}

.footer-section a {
    color: #f1f2f6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.2rem 0;
    display: inline-block;
}

.footer-section a:hover {
    color: #74b9ff;
    text-decoration: underline;
    transform: translateX(3px);
}

/* Enhanced Legal Section Styles */
.legal-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .legal-section {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .legal-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.legal-section .legal-group {
    margin-bottom: 1.5rem;
}

.legal-section .legal-group:last-child {
    margin-bottom: 0;
}

.legal-subheading {
    color: #7f8c8d;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.8rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 0.4rem;
}

.legal-links-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legal-links-group li {
    margin-bottom: 0.5rem;
}

.legal-links-group a {
    color: #f1f2f6;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    padding: 0.15rem 0;
    display: inline-block;
    position: relative;
}

.legal-links-group a:hover {
    color: #74b9ff;
    transform: translateX(5px);
}

.legal-links-group a::before {
    content: "▸";
    position: absolute;
    left: -12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #74b9ff;
}

.legal-links-group a:hover::before {
    opacity: 1;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.social-links li {
    margin-bottom: 0;
}

.social-links a {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    transform: none;
}

.social-links a:hover {
    background: rgba(116, 185, 255, 0.2);
    border-color: #74b9ff;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Footer Language Switcher */
.language-switcher-dropdown {
    margin-top: 0.5rem;
}

.language-switcher-dropdown label {
    display: block;
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.language-switcher-dropdown select {
    background-color: #34495e;
    color: #ecf0f1;
    border: 1px solid #4a5f7a;
    border-radius: 6px;
    padding: 0.7rem;
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23bdc3c7' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.7rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

.language-switcher-dropdown select:hover {
    border-color: #3498db;
    background-color: #3c566e;
}

.language-switcher-dropdown select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    margin-top: 1rem;
}

.footer-bottom p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.footer-bottom p:first-child {
    font-weight: 500;
    color: #ecf0f1;
}

.footer-bottom a {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #74b9ff;
}

/* Responsive */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    /* Logo header responsive */
    #site-header .container {
        flex-direction: column !important;
        text-align: center;
        gap: 0.5rem !important;
    }
    
    #site-header .container > div h1 {
        font-size: 1.5rem !important;
    }
    
    #site-header .container > div span {
        font-size: 0.9rem !important;
    }
    
    /* Footer responsive */
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section h4 {
        justify-content: center;
        font-size: 1.05rem;
    }
    
    .social-links {
        justify-content: center;
        gap: 0.6rem;
    }
    
    .social-links a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
    }
}

/* Enhanced mobile footer for very small screens */
@media (max-width: 480px) {
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .footer-section a {
        font-size: 0.85rem;
    }
    
    /* Enhanced legal section mobile */
    .legal-section .legal-group {
        margin-bottom: 1.2rem;
    }
    
    .legal-subheading {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .legal-links-group {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .legal-links-group a {
        font-size: 0.8rem;
        padding: 0.25rem 0;
    }
    
    .social-links {
        gap: 0.5rem;
    }
    
    .social-links a {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    /* Legal section optimizations for very small screens */
    .legal-section .legal-group {
        margin-bottom: 1rem;
    }
    
    .legal-subheading {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .legal-links-group a {
        font-size: 0.75rem;
        padding: 0.2rem 0;
    }
    
    .legal-links-group a::before {
        display: none; /* Hide arrow on very small screens */
    }
    
    .language-switcher-dropdown select {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .footer-bottom {
        padding-top: 1rem;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
    }
}
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: #7f8c8d;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Article content */
.article-content {
    font-size: 1.1em;
    line-height: 1.8;
}

/* Remove excessive top margin for article content */
.article-main .article-content.mt-1 {
    margin-top: 0.5rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content h2 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    color: #34495e;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* No results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.no-results h3 {
    margin-bottom: 1rem;
    color: #95a5a6;
}

/* Images des articles */
.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
}

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

.article-image img:hover {
    transform: scale(1.05);
}

/* Badge pour compter les images multiples */
.image-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.article-featured-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin-bottom: 1rem;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.img-responsive {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Styles pour les cartes avec images */
.article-card {
    overflow: hidden;
}

.article-card .card-body {
    padding: 1rem;
}

.article-card .article-image + .card-body {
    padding-top: 1rem;
}

/* Media queries pour les images */
@media (max-width: 768px) {
    .article-image {
        height: 150px;
    }
    
    .article-featured-image {
        height: 250px;
    }
}

/* Hashtags system styles */
.hashtags-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.hashtags-section h2 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.hashtags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hashtag-link {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9em;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.hashtag-link:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.hashtag-link.trending {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-color: #ee5a52;
    position: relative;
    overflow: hidden;
}

.hashtag-link.trending::before {
    content: '🔥';
    margin-right: 4px;
}

.hashtag-link.trending:hover {
    background: linear-gradient(135deg, #ee5a52, #e74c3c);
    border-color: #e74c3c;
}

@media (max-width: 768px) {
    .hashtags-container {
        gap: 6px;
    }
    
    .hashtag-link {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* Styles pour la nouvelle gestion d'images avec figure/figcaption */
.article-featured-image figure {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
}

.article-featured-image figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.article-featured-image figure img:hover {
    transform: scale(1.02);
}

.image-caption {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    margin: 0;
    font-size: 0.85em;
    text-align: right;
    position: relative;
    margin-top: -40px;
    margin-bottom: 40px;
    border-radius: 0 0 8px 8px;
}

.image-caption small {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.3;
}

/* Style pour les images des articles connexes avec nouveau système */
.article-card figure {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.article-card figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card figure img:hover {
    transform: scale(1.05);
}

.article-card .image-caption {
    display: none; /* Masquer la source sur les petites cartes */
}

/* Fallback d'image responsive */
img[onerror] {
    transition: opacity 0.3s ease;
}

/* Media queries pour les nouvelles images */
@media (max-width: 768px) {
    .article-featured-image figure {
        height: 250px;
    }
    
    .image-caption {
        font-size: 0.75em;
        padding: 6px 10px;
        margin-top: -35px;
        margin-bottom: 35px;
    }
    
    .article-card figure {
        height: 150px;
    }
}

/* ===================================
   HASHTAGS CLIQUABLES
   =================================== */

/* Container principal des hashtags */
.hashtags-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.hashtags-container.hashtags-popular {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    border-left-color: #4caf50;
}

/* Titre des hashtags */
.hashtags-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2a5298;
    display: flex;
    align-items: center;
}

.hashtags-title::before {
    content: "#";
    margin-right: 8px;
    font-size: 1.2em;
    color: #4caf50;
}

/* Liste des hashtags */
.hashtags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Style des liens hashtags */
.hashtag-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #ffffff;
    color: #2a5298;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #e0e6ed;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hashtag-link:hover {
    background: #2a5298;
    color: #ffffff;
    border-color: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(42, 82, 152, 0.2);
    text-decoration: none;
}

/* Hashtags trending */
.hashtag-link.trending {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #ffffff;
    border-color: #4caf50;
    position: relative;
    animation: trending-pulse 2s ease-in-out infinite alternate;
}

.hashtag-link.trending:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px) scale(1.05);
}

.hashtag-link.trending::after {
    content: "🔥";
    margin-left: 4px;
    font-size: 0.8em;
}

/* Animation pour les hashtags trending */
@keyframes trending-pulse {
    0% { box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3); }
    100% { box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5); }
}

/* Compteur d'articles pour hashtags populaires */
.hashtag-link .count {
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
}

.hashtag-link.trending .count {
    background: rgba(255, 255, 255, 0.3);
}

/* Message quand aucun hashtag */
.no-hashtags {
    color: #6c757d;
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 10px;
}

/* Section hashtags dans les articles */
.article-hashtags {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e6ed;
    border-bottom: 1px solid #e0e6ed;
}

/* Hashtags intégrés dans le texte */
.article-content .hashtag-link {
    font-size: 0.95em;
    padding: 3px 8px;
    margin: 0 2px;
    vertical-align: baseline;
}

/* Responsive design pour hashtags */
@media (max-width: 768px) {
    .hashtags-container {
        padding: 12px;
        margin: 15px 0;
    }
    
    .hashtags-title {
        font-size: 1em;
    }
    
    .hashtag-link {
        font-size: 0.85em;
        padding: 5px 10px;
    }
    
    .hashtags-list {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .hashtags-list {
        justify-content: center;
    }
    
    .hashtag-link {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* ===================================
   OPTIMISATIONS RESPONSIVE AVANCÉES
   =================================== */

/* Navigation mobile optimisée */
@media (max-width: 768px) {
    /* Header mobile amélioré */
    #site-header .container {
        flex-direction: column !important;
        text-align: center;
        gap: 0.5rem !important;
        padding: 10px;
    }
    
    #site-header .container > div h1 {
        font-size: 1.5rem !important;
        margin: 0;
        line-height: 1.2;
    }
    
    #site-header .container > div span {
        font-size: 0.9rem !important;
        display: block;
        margin-top: 5px;
    }
    
    /* Navigation collapsible avec hamburger menu */
    .nav {
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* Afficher le bouton hamburger sur mobile */
    .mobile-nav-toggle {
        display: flex !important;
        background-color: #34495e;
        border-bottom: 1px solid #2c3e50;
    }
    
    /* Menu de navigation mobile */
    .nav-menu {
        display: none !important; /* Force hide by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #34495e;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-top: 1px solid #2c3e50;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 999;
    }
    
    /* Menu ouvert */
    .nav-menu.active {
        display: flex !important;
        max-height: 400px;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #2c3e50;
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        white-space: nowrap;
        font-size: 1rem;
        border-radius: 0;
        margin: 0;
        width: 100%;
        text-align: left;
        min-height: 50px; /* Touch-friendly */
    }
    
    /* Fallback: Navigation horizontale scrollable si JS désactivé */
    .nav ul:not(.nav-menu) {
        overflow-x: auto;
        display: flex;
        flex-direction: row;
        padding: 0 10px;
        gap: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav ul:not(.nav-menu)::-webkit-scrollbar {
        display: none;
    }
    
    .nav ul:not(.nav-menu) li {
        flex-shrink: 0;
        width: auto;
    }
    
    .nav ul:not(.nav-menu) a {
        padding: 10px 15px;
        white-space: nowrap;
        font-size: 0.9em;
        border-bottom: none;
        border-radius: 4px;
        margin: 5px 0;
    }
    
    /* Articles grid mobile */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Images optimisées mobile */
    .article-image {
        max-height: 200px;
        overflow: hidden;
    }
    
    .article-featured-image {
        height: 200px; /* Hauteur fixe pour maintenir le centrage */
        overflow: hidden;
    }
    
    .article-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    .article-featured-image img {
        width: 100%;
        height: 100%; /* Maintenir la hauteur fixe pour le centrage */
        object-fit: cover;
        object-position: center; /* Renforcer le centrage */
    }
    
    /* Figures également cohérentes sur mobile */
    .article-featured-image figure {
        height: 200px;
    }
    
    /* Cartes articles mobile */
    .card-title {
        font-size: 1.1em;
        line-height: 1.3;
    }
    
    .card-text {
        font-size: 0.9em;
        line-height: 1.4;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    /* Masquer AdSense sur très petits écrans pour améliorer UX */
    .adsense-container {
        display: none;
    }
    
    /* Optimisation des textes */
    .card-title a {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .card-text {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Espacement réduit */
    .container {
        padding: 0 5px;
    }
    
    .card {
        margin-bottom: 15px;
    }
}

/* Optimisations de performance */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Préventions de scroll horizontal */
body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* ===================================
   MODAL DE PARTAGE SOCIAL
   =================================== */

/* Modal overlay */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.show {
    opacity: 1;
    visibility: visible;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Contenu du modal */
.share-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
    z-index: 1;
}

.share-modal.show .share-modal-content {
    transform: scale(1) translateY(0);
}

/* Header du modal */
.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.share-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.share-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Container des options de partage */
.share-options {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

/* Options de partage individuelles */
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    text-decoration: none;
    color: #495057;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.share-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #495057;
}

.share-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.share-name {
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* Couleurs spécifiques par plateforme */
.share-email:hover {
    border-color: #6c757d;
    background: #f8f9fa;
}

.share-whatsapp:hover {
    border-color: #25d366;
    background: #f0fdf4;
    color: #166534;
}

.share-facebook:hover {
    border-color: #1877f2;
    background: #eff6ff;
    color: #1d4ed8;
}

.share-twitter:hover {
    border-color: #1da1f2;
    background: #eff6ff;
    color: #1d4ed8;
}

.share-linkedin:hover {
    border-color: #0a66c2;
    background: #eff6ff;
    color: #1d4ed8;
}

.share-messenger:hover {
    border-color: #0084ff;
    background: #eff6ff;
    color: #1d4ed8;
}

.share-sms:hover {
    border-color: #34c759;
    background: #f0fdf4;
    color: #166534;
}

.share-copy:hover {
    border-color: #6f42c1;
    background: #f8f5ff;
    color: #5b21b6;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .share-modal-content {
        max-width: 95%;
        margin: 20px;
    }
    
    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px;
    }
    
    .share-option {
        padding: 14px 10px;
    }
    
    .share-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .share-name {
        font-size: 12px;
    }
    
    .share-modal-header {
        padding: 16px 20px;
    }
    
    .share-modal-header h3 {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 16px;
    }
    
    .share-option {
        padding: 12px 8px;
    }
    
    .share-icon {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .share-name {
        font-size: 11px;
    }
}

/* ===================================
   ENHANCED CSS OPTIMIZATIONS 
   (Merged from enhanced.css)
   =================================== */

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.9rem;
}

.language-switcher .lang-label {
    color: #ccc;
    font-weight: 500;
}

.language-switcher .lang-link {
    color: #fff;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.language-switcher .lang-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.language-switcher .lang-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

/* Enhanced Animations with Hardware Acceleration */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Enhanced Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-toggle:hover,
.nav-toggle:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.nav-toggle.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Enhanced Search Loading States */
.search-input.loading {
    background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200px 100%;
    background-repeat: no-repeat;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Enhanced Focus Management for Accessibility */
.keyboard-navigation :focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.skip-link:focus {
    top: 6px !important;
}

/* Enhanced Grid System for Better Responsiveness */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Enhanced Mobile-First Responsive Design */
@media (max-width: 480px) {
    /* === OPTIMISATIONS IPHONE SPÉCIFIQUES === */
    
    /* Prévention du zoom sur les inputs iPhone */
    input, textarea, select {
        font-size: 16px !important; /* Évite le zoom automatique sur iOS */
    }
    
    /* Amélioration tactile pour iPhone */
    .mobile-nav-toggle,
    .nav a,
    .btn,
    button {
        min-height: 44px; /* Taille minimale recommandée par Apple */
        min-width: 44px;
    }
    
    /* Interface compacte pour iPhone */
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .search-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input {
        width: 100%;
        min-width: auto;
        padding: 12px; /* Taille tactile confortable */
        border-radius: 8px;
    }
    
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* Header optimisé iPhone */
    #site-header .container {
        padding: 15px 10px !important;
    }
    
    #site-header .container > div h1 {
        font-size: 1.3rem !important;
    }
    
    /* Navigation mobile iPhone */
    .mobile-nav-toggle {
        padding: 15px 20px;
        touch-action: manipulation; /* Optimisation tactile */
    }
    
    .nav-menu a {
        padding: 16px 20px;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    /* Contenu adapté iPhone */
    .container {
        padding: 0 15px;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    /* Cartes optimisées pour iPhone */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    /* Footer compact iPhone */
    .footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .footer-section a {
        font-size: 0.9rem;
        padding: 8px 0;
        display: block;
    }
    
    /* Mode PWA iPhone */
    @media (display-mode: standalone) {
        /* Ajustements pour le mode PWA standalone */
        body {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
        }
        
        .header {
            padding-top: calc(1rem + env(safe-area-inset-top));
        }
        
        .footer {
            padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        }
    }
}
        display: block;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .container {
        padding: 0 15px;
    }
    
    .search-form {
        gap: 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Enhanced Performance Optimizations */
img.loaded {
    transition: opacity 0.3s ease;
}

img:not(.loaded) {
    opacity: 0.7;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

img.error {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Enhanced Typography for Better Readability */
body {
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Form Styling */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group.focused label {
    color: #3498db;
    transform: translateY(-1.5rem) scale(0.85);
}

.form-group.has-value label {
    transform: translateY(-1.5rem) scale(0.85);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Enhanced Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* Enhanced Header Scroll Effects */
#site-header.scrolled {
    backdrop-filter: blur(10px);
    background: rgba(30, 60, 114, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    .nav,
    .adsense-container,
    .share-button,
    .notification {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        margin-bottom: 1rem;
        break-inside: avoid;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .auto-dark .card {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .auto-dark .form-input,
    .auto-dark .form-textarea {
        background-color: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
