/* News Index page styles moved from inline page styles */

/* ============================================
   VARIABLES - Mode Clair (défaut)
============================================ */
.news-index-page {
    --primary-gold: #C4A962;
    --primary-gold-light: #D4B97A;
    --primary-gold-dark: #A8894A;
    --primary-blue: #2C5F8A;
    --primary-coral: #FF6B6B;
    --primary-mint: #4ECDC4;
    --primary-lavender: #A06CD5;
    
    /* Mode Clair */
    --bg-page: #F8F6F3;
    --bg-card: #FFFFFF;
    --bg-card-hover: #f5f3ef;
    --bg-container: #ffffff;
    --bg-filter: #ffffff;
    --bg-input: #F8F9FA;
    --bg-input-focus: #ffffff;
    --text-primary: #1A1A1A;
    --text-secondary: #3A3A3A;
    --text-muted: #6B6356;
    --text-on-gold: #ffffff;
    --border-color: #EAE7E2;
    --shadow-color: rgba(44, 95, 138, 0.08);
    --shadow-hover: rgba(44, 95, 138, 0.15);
    --badge-bg: #fff8eb;
    --badge-text: #4e3721;
    --filter-chip-border: #E8E8E8;
    --filter-chip-bg: #ffffff;
    --filter-chip-text: #555;
    --filter-chip-active-bg: linear-gradient(135deg, #C4A962, #D4B97A);
    --filter-chip-active-text: #ffffff;
    --news-excerpt: #666;
    --news-meta: #888;
    --pagination-link-bg: #ffffff;
    --pagination-link-border: #EAE7E2;
    --pagination-link-text: #555;
    --empty-state-bg: #ffffff;
    --empty-state-text: #333;
    --empty-state-desc: #888;
    --section-bg: #f8f6f3;
}

/* ============================================
   MODE SOMBRE - Appliqué via html.dark
============================================ */
html.dark .news-index-page {
    --bg-page: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --bg-container: #1a1a1a;
    --bg-filter: #1a1a1a;
    --bg-input: #2a2a2a;
    --bg-input-focus: #2a2a2a;
    --text-primary: #e8e8e8;
    --text-secondary: #c8c8c8;
    --text-muted: #a8a8a8;
    --text-on-gold: #1a1a1a;
    --border-color: #2a2a2a;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-hover: rgba(0, 0, 0, 0.7);
    --badge-bg: #2a2418;
    --badge-text: #e8d5a8;
    --filter-chip-border: #333;
    --filter-chip-bg: #222;
    --filter-chip-text: #aaa;
    --filter-chip-active-bg: linear-gradient(135deg, #C4A962, #D4B97A);
    --filter-chip-active-text: #1a1a1a;
    --news-excerpt: #999;
    --news-meta: #777;
    --pagination-link-bg: #222;
    --pagination-link-border: #333;
    --pagination-link-text: #aaa;
    --empty-state-bg: #1a1a1a;
    --empty-state-text: #e8e8e8;
    --empty-state-desc: #888;
    --section-bg: #0a0a0a;
}

/* ============================================
   RTL Support
============================================ */
[dir="rtl"] .search-input-group .search-icon {
    left: auto !important;
    right: 18px !important;
}

[dir="rtl"] .search-input-group input {
    padding: 14px 50px 14px 45px !important;
}

[dir="rtl"] .search-clear {
    right: auto !important;
    left: 110px !important;
}

[dir="rtl"] .archive-news-category {
    left: auto !important;
    right: 15px !important;
}

[dir="rtl"] .news-badge-new {
    right: auto !important;
    left: 15px !important;
}

[dir="rtl"] .archive-news-link i.fa-arrow-right {
    transform: rotate(180deg);
    display: inline-block;
}

[dir="rtl"] .archive-news-link:hover i.fa-arrow-right {
    transform: rotate(180deg) translateX(4px);
}

[dir="rtl"] .archive-news-meta i {
    margin-right: 0 !important;
    margin-left: 5px !important;
}

/* ============================================
   PAGE CONTAINER
============================================ */
.news-index-page {
    position: relative;
    min-height: 100vh;
    background: var(--bg-page);
    transition: background 0.4s ease, color 0.4s ease;
}

/* ============================================
   ANIMATED BACKGROUND
============================================ */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
    transition: background 0.4s ease;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #FF6B6B20, transparent);
    top: 10%;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #4ECDC420, transparent);
    bottom: 20%;
    right: -50px;
    animation-delay: 3s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #C4A96220, transparent);
    top: 50%;
    left: 30%;
    animation-delay: 6s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #A06CD520, transparent);
    bottom: 10%;
    left: 20%;
    animation-delay: 9s;
}

.shape-5 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #45B7D120, transparent);
    top: 20%;
    right: 20%;
    animation-delay: 12s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(10deg); }
}

/* ============================================
   HERO SECTION - Toujours sombre (inchangé)
============================================ */
.news-hero {
    position: relative;
    background: #14100c;
    padding: 160px 20px 48px;
    text-align: center;
    margin-bottom: 0;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    overflow: visible;
    z-index: 10;
    min-height: 260px;
}

.hero-bg-images {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.bg-calligraphy {
    position: absolute;
    user-select: none;
    pointer-events: none;
    opacity: 0.3;
}

.calligraphy-1 {
    top: -5%;
    left: -8%;
    width: 50%;
    transform: rotate(-18deg);
}

.calligraphy-2 {
    bottom: -5%;
    right: -8%;
    width: 48%;
    transform: rotate(14deg);
}

.calligraphy-3 {
    top: 30%;
    left: -10%;
    width: 42%;
    transform: rotate(-8deg);
}

.calligraphy-4 {
    top: 20%;
    right: -10%;
    width: 44%;
    transform: rotate(20deg);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-bg);
    padding: 10px 20px;
    border-radius: 999px;
    margin-bottom: 20px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--badge-text);
    letter-spacing: 0.03em;
    border: 1px solid rgba(196, 169, 98, 0.75);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 2;
    transition: background 0.4s ease, color 0.4s ease;
}

.badge-icon {
    font-size: 1.1rem;
    color: var(--primary-gold);
}

.news-hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
    padding-top: 6px;
}

.news-hero-content h1 {
    font-size: clamp(1.9rem, 4.6vw, 3.2rem);
    color: #fff;
    margin-bottom: 12px;
    font-family: 'Cormorant Garamond', serif;
    line-height: 1.14;
}

.news-hero-content h1 .highlight {
    color: var(--primary-gold);
    position: relative;
    display: inline-block;
}

.news-hero-content h1 .highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gold);
    border-radius: 3px;
}

.news-hero-content p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.88);
    max-width: 620px;
    margin: 0 auto;
}

/* ============================================
   RESPONSIVE - HERO
============================================ */
@media (max-width: 1200px) {
    .calligraphy-1 { width: 60%; top: -8%; left: -12%; }
    .calligraphy-2 { width: 58%; bottom: -8%; right: -12%; }
    .calligraphy-3 { width: 52%; left: -14%; top: 32%; }
    .calligraphy-4 { width: 54%; right: -14%; top: 22%; }
}

@media (max-width: 992px) {
    .news-hero { min-height: 380px; padding: 60px 20px 80px; }
    .calligraphy-1 { width: 70%; top: -10%; left: -15%; }
    .calligraphy-2 { width: 68%; bottom: -10%; right: -15%; }
    .calligraphy-3 { width: 62%; left: -18%; top: 35%; }
    .calligraphy-4 { width: 64%; right: -18%; top: 25%; }
}

@media (max-width: 768px) {
    .news-hero { padding: 50px 20px 70px; min-height: 320px; }
    .calligraphy-1 { width: 85%; top: -15%; left: -20%; transform: rotate(-18deg) scale(0.9); }
    .calligraphy-2 { width: 82%; bottom: -15%; right: -20%; transform: rotate(14deg) scale(0.9); }
    .calligraphy-3 { width: 75%; left: -22%; top: 38%; transform: rotate(-8deg) scale(0.85); }
    .calligraphy-4 { width: 78%; right: -22%; top: 28%; transform: rotate(20deg) scale(0.85); }
}

@media (max-width: 480px) {
    .news-hero { padding: 40px 15px 60px; min-height: 280px; }
    .calligraphy-1 { width: 100%; top: -20%; left: -30%; transform: rotate(-18deg) scale(0.8); }
    .calligraphy-2 { width: 95%; bottom: -20%; right: -30%; transform: rotate(14deg) scale(0.8); }
    .calligraphy-3 { width: 88%; left: -30%; top: 40%; transform: rotate(-8deg) scale(0.7); }
    .calligraphy-4 { width: 90%; right: -30%; top: 30%; transform: rotate(20deg) scale(0.7); }
}

/* ============================================
   ARCHIVE SECTION
============================================ */
.news-archive-section {
    position: relative;
    z-index: 1;
    background: var(--section-bg);
    padding: 80px 20px 80px;
    margin-top: 28px;
    transition: background 0.4s ease;
}

.news-archive-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/arabic-calligraphy_long.jpg') center / cover no-repeat;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}

html.dark .news-archive-section::before {
    opacity: 0.03;
}

.news-archive-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    background: var(--bg-container);
    border-radius: 32px;
    padding: 28px;
    box-shadow: 0 32px 80px var(--shadow-color);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* ============================================
   FILTRES
============================================ */
.news-filters-wrapper {
    background: var(--bg-filter);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 35px var(--shadow-color);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.search-form {
    margin-bottom: 25px;
}

.search-input-group {
    position: relative;
    display: flex;
    gap: 10px;
}

.search-input-group .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    z-index: 2;
    transition: color 0.4s ease;
}

.search-input-group input {
    flex: 1;
    padding: 14px 45px 14px 50px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(196,169,98,0.1);
}

.search-input-group input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 110px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 18px;
    padding: 5px;
    z-index: 2;
    transition: color 0.3s ease;
}

.search-clear:hover {
    color: var(--text-primary);
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    border: none;
    border-radius: 50px;
    padding: 0 25px;
    color: var(--text-on-gold);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196,169,98,0.3);
}

.news-category-filter {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    padding: 6px 8px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 2px solid var(--filter-chip-border);
    background: var(--filter-chip-bg);
    color: var(--filter-chip-text);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s ease;
    flex: 0 0 auto;
}

.filter-chip .filter-icon {
    font-size: 0.9rem;
    color: var(--primary-gold);
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-right: 4px;
}

.filter-chip:hover {
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.filter-chip.active {
    background: var(--filter-chip-active-bg);
    border-color: var(--primary-gold);
    color: var(--filter-chip-active-text);
}

.filter-chip.active .filter-icon {
    color: var(--filter-chip-active-text);
}

/* ============================================
   RESULTS HEADER
============================================ */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.count-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-gold);
}

.count-text {
    color: var(--text-muted);
    transition: color 0.4s ease;
}

.order-select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.4s ease;
}

/* ============================================
   GRILLE DES CARTES
============================================ */
.news-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.archive-news-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: all 0.4s ease;
    position: relative;
}

.archive-news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-hover);
    background: var(--bg-card-hover);
}

.archive-news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent);
}

.archive-news-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--border-color);
}

.archive-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.archive-news-card:hover .archive-news-image img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
}

.archive-news-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-news-category i {
    font-size: 0.7rem;
    color: var(--primary-gold);
}

.news-badge-new {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B6B, #FF4757);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.archive-news-body {
    padding: 22px;
}

.archive-news-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: var(--news-meta);
    flex-wrap: wrap;
    transition: color 0.4s ease;
}

.archive-news-meta i {
    margin-right: 5px;
    font-size: 0.75rem;
    color: var(--primary-gold);
}

.archive-news-body h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.4s ease;
}

.archive-news-excerpt {
    color: var(--news-excerpt);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.9rem;
    transition: color 0.4s ease;
}

.archive-news-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.archive-news-link i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.archive-news-link:hover {
    gap: 12px;
    color: var(--primary-gold-dark);
}

.archive-news-link:hover i {
    transform: translateX(4px);
}

/* ============================================
   ÉTAT VIDE
============================================ */
.news-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--empty-state-bg);
    border-radius: 24px;
    transition: background 0.4s ease;
}

.empty-emoji {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--primary-gold);
}

.news-empty-state h3 {
    font-size: 1.5rem;
    color: var(--empty-state-text);
    margin-bottom: 10px;
    transition: color 0.4s ease;
}

.news-empty-state p {
    color: var(--empty-state-desc);
    margin-bottom: 25px;
    transition: color 0.4s ease;
}

.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    color: var(--text-on-gold);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196,169,98,0.3);
    color: var(--text-on-gold);
}

/* ============================================
   PAGINATION
============================================ */
.news-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.news-pagination .pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-pagination .page-item {
    display: inline-block;
}

.news-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 2px solid var(--pagination-link-border);
    border-radius: 12px;
    color: var(--pagination-link-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--pagination-link-bg);
}

.news-pagination .page-link:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    transform: translateY(-2px);
}

.news-pagination .active .page-link {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-gold-light));
    border-color: var(--primary-gold);
    color: var(--text-on-gold);
}

.news-pagination .disabled .page-link {
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE GLOBAL
============================================ */
@media (max-width: 768px) {
    .news-filters-wrapper {
        padding: 20px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-clear {
        right: 15px !important;
    }

    [dir="rtl"] .search-clear {
        left: 15px !important;
        right: auto !important;
    }

    .search-btn {
        padding: 12px;
    }

    .news-archive-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-chip {
        padding: 6px 15px;
        font-size: 0.8rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .news-category-filter {
        gap: 8px;
    }

    .filter-chip {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
}
