/* Importation de polices arabes depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;500;600;700&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

/* Réinitialisation et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette de couleurs - Style journalistique élégant */
    --primary-color: #1a1a2e;
    --secondary-color: #c9a227;
    --accent-color: #b8860b;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-color: #1a1a2e;
    --text-secondary: #4a4a4a;
    --text-light: #6b7280;
    --border-color: #e5e5e5;
    --border-accent: #c9a227;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --gradient-gold: linear-gradient(135deg, #c9a227 0%, #d4af37 50%, #b8860b 100%);
}

body {
    font-family: 'Cairo', 'Noto Naskh Arabic', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.9;
    direction: rtl;
    text-align: right;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== HEADER ==================== */
header {
    background: var(--primary-color);
    color: white;
    padding: 0;
    margin-bottom: 0;
    position: relative;
}

/* Arabesque texture effect for header */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M40 0c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10S34.5 0 40 0zm0 60c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10 4.5-10 10-10zM0 40c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10S0 45.5 0 40zm60 0c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3Cpath d='M40 20c11 0 20 9 20 20s-9 20-20 20-20-9-20-20 9-20 20-20zm0 5c-8.3 0-15 6.7-15 15s6.7 15 15 15 15-6.7 15-15-6.7-15-15-15z'/%3E%3Cpath d='M25 25L40 10l15 15-15 15-15-15zm0 30L40 70l15-15-15-15-15 15zM10 40L25 25l15 15-15 15L10 40zm45 0l15-15 15 15-15 15-15-15z' fill-opacity='0.02'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 12px 12px;
    pointer-events: none;
    z-index: 0;
}

/* Subtle inner shadow for depth */
header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 -10px 30px rgba(0, 0, 0, 0.15), inset 0 10px 30px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 0;
}

header > * {
    position: relative;
    z-index: 1;
}

.header-top {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-date {
    color: rgba(255, 255, 255, 0.8);
}

.header-main {
    padding: 2rem 0;
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
}

header h1 {
    font-family: 'Amiri', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--secondary-color);
}

/* Navigation bar */
.nav-bar {
    background: var(--secondary-color);
    padding: 0;
}

.nav-bar .container {
    display: flex;
    justify-content: center;
    gap: 0;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-link:first-child {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(0, 0, 0, 0.15);
}

/* ==================== MAIN CONTENT ==================== */
main {
    min-height: 60vh;
    padding: 3rem 0;
}

/* Section headings */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
    position: relative;
    padding-right: 1rem;
}

.section-header h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
    border-radius: 2px;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border-color));
    margin-right: 1.5rem;
}

h2 {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* ==================== ARTICLE CARDS ==================== */
.articles-list {
    display: grid;
    gap: 2rem;
}

/* Featured article (first article) */
.article-card:first-child {
    background: var(--card-bg);
    border-radius: 0;
    padding: 0;
    box-shadow: var(--shadow);
    border: none;
    overflow: hidden;
}

.article-card:first-child .article-header {
    background: var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 0;
}

.article-card:first-child .article-header h3 {
    font-size: 1.8rem;
    line-height: 1.5;
}

.article-card:first-child .article-header h3 a {
    color: white;
}

.article-card:first-child .article-header h3 a:hover {
    color: var(--secondary-color);
}

.article-card:first-child .article-date {
    color: var(--secondary-color);
    font-weight: 500;
}

.article-card:first-child .article-excerpt {
    padding: 2rem;
    font-size: 1.1rem;
    border-right: 4px solid var(--secondary-color);
    margin: 0;
    background: linear-gradient(to left, transparent, rgba(201, 162, 39, 0.05));
}

.article-card:first-child .article-meta {
    padding: 1.5rem 2rem;
    background: var(--bg-color);
    border-top: none;
}

/* Regular article cards */
.article-card {
    background: var(--card-bg);
    border-radius: 0;
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    border-right: 3px solid var(--secondary-color);
    overflow: hidden;
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(-4px);
    border-right-color: var(--accent-color);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-header h3 {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    font-weight: 700;
    flex: 1;
    min-width: 200px;
    line-height: 1.6;
}

.article-header h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-header h3 a:hover {
    color: var(--secondary-color);
}

.article-date {
    color: var(--text-light);
    font-size: 0.85rem;
    font-family: 'Cairo', sans-serif;
    background: var(--bg-color);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 2;
    padding: 1rem 1.5rem;
    font-size: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background: rgba(250, 250, 250, 0.5);
}

.article-category {
    background: var(--primary-color);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.read-more:hover {
    color: var(--accent-color);
    gap: 0.8rem;
}

/* ==================== ARTICLE PAGE ==================== */
.article-content {
    background: var(--card-bg);
    border-radius: 0;
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.article-title {
    font-family: 'Amiri', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    background: var(--primary-color);
    padding: 2.5rem 3rem;
    margin: 0;
    line-height: 1.4;
    border-bottom: 5px solid var(--secondary-color);
}

.article-info {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 3rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.article-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-body {
    font-size: 1.15rem;
    line-height: 2.2;
    color: var(--text-color);
    padding: 2.5rem 3rem;
}

.article-body p {
    margin-bottom: 1.8rem;
    text-align: justify;
}

.article-body p:first-of-type::first-line {
    font-weight: 600;
}

.article-body h3 {
    font-family: 'Amiri', serif;
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    padding-right: 1rem;
    border-right: 4px solid var(--secondary-color);
}

.article-body h4 {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.article-body ul,
.article-body ol {
    margin-right: 2rem;
    margin-bottom: 1.8rem;
}

.article-body li {
    margin-bottom: 0.6rem;
}

.article-body blockquote {
    background: linear-gradient(to left, transparent, rgba(201, 162, 39, 0.1));
    border-right: 4px solid var(--secondary-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    padding: 0.6rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    background: rgba(201, 162, 39, 0.05);
}

/* ==================== SOCIAL SHARE BUTTONS ==================== */
.share-section {
    margin: 0;
    padding: 2rem 3rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.share-section h4 {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.share-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.share-btn.twitter {
    background-color: #000000;
    color: white;
}

.share-btn.twitter:hover {
    background-color: #333333;
}

.share-btn.facebook {
    background-color: #1877f2;
    color: white;
}

.share-btn.facebook:hover {
    background-color: #0d65d9;
}

.share-btn.whatsapp {
    background-color: #25d366;
    color: white;
}

.share-btn.whatsapp:hover {
    background-color: #1da851;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--primary-color);
    color: white;
    margin-top: 0;
    padding: 0;
    position: relative;
}

/* Arabesque texture effect for footer */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M40 0c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10S34.5 0 40 0zm0 60c5.5 0 10 4.5 10 10s-4.5 10-10 10-10-4.5-10-10 4.5-10 10-10zM0 40c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10S0 45.5 0 40zm60 0c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3Cpath d='M40 20c11 0 20 9 20 20s-9 20-20 20-20-9-20-20 9-20 20-20zm0 5c-8.3 0-15 6.7-15 15s6.7 15 15 15 15-6.7 15-15-6.7-15-15-15z'/%3E%3Cpath d='M25 25L40 10l15 15-15 15-15-15zm0 30L40 70l15-15-15-15-15 15zM10 40L25 25l15 15-15 15L10 40zm45 0l15-15 15 15-15 15-15-15z' fill-opacity='0.02'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 12px 12px;
    pointer-events: none;
    z-index: 0;
}

/* Subtle inner shadow for depth */
footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.15), inset 0 -10px 30px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 0;
}

footer > * {
    position: relative;
    z-index: 1;
}

.footer-main {
    padding: 3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-main .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-brand h3 {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.footer-brand p {
    opacity: 0.7;
    font-size: 0.95rem;
}

.footer-bottom {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Simple footer fallback */
footer p {
    opacity: 0.9;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .article-title {
        font-size: 2.2rem;
        padding: 2rem;
    }

    .article-body,
    .article-info,
    .share-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }

    header .subtitle {
        font-size: 0.9rem;
    }

    .header-main {
        padding: 1.5rem 0;
    }

    .nav-bar .container {
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    h2, .section-header h2 {
        font-size: 1.5rem;
    }

    .article-card:first-child .article-header h3 {
        font-size: 1.4rem;
    }

    .article-card:first-child .article-header,
    .article-card:first-child .article-excerpt,
    .article-card:first-child .article-meta {
        padding: 1.2rem 1.5rem;
    }

    .article-header h3 {
        font-size: 1.2rem;
    }

    .article-title {
        font-size: 1.8rem;
        padding: 1.5rem;
    }

    .article-body,
    .article-info,
    .share-section {
        padding: 1.5rem;
    }

    .article-body {
        font-size: 1.05rem;
    }

    .article-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .footer-main .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .article-header,
    .article-excerpt,
    .article-meta {
        padding: 1rem;
    }

    .article-title {
        font-size: 1.5rem;
        padding: 1.2rem;
    }

    .article-body,
    .article-info,
    .share-section {
        padding: 1.2rem;
    }

    .share-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ==================== SEARCH BAR ==================== */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1.2rem;
    padding-left: 2.5rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    text-align: right;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
}

.no-results {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    header, footer, .share-section, .back-link, .search-container, .back-to-top {
        display: none;
    }

    .article-content {
        box-shadow: none;
        border: none;
    }

    .article-title {
        background: none;
        color: black;
        border-bottom: 2px solid black;
    }

    .article-body {
        font-size: 12pt;
        line-height: 1.6;
    }
}
