/* ==========================================================================
   Taqafa 24 — Modern Knowledge & Culture Portal Design System
   Aesthetic: Clean Editorial, Rich Card UI, High Readability & Performance
   ========================================================================== */

:root {
    --font-ar: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Palette Tokens */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #7c3aed;
    --accent: #059669;
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 20px 35px -8px rgba(37, 99, 235, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
    text-align: right;
}

body {
    font-family: var(--font-ar);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.8;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

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

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-top-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.top-bar-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-links {
    display: flex;
    gap: 16px;
}

.top-bar-links a:hover {
    color: #ffffff;
}

.header-main-bar {
    padding: 16px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon-box {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-name {
    font-size: 26px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.brand-name span {
    color: var(--primary);
}

.brand-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* Nav Menu */
.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    color: #334155;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--dark);
    cursor: pointer;
}

/* ==========================================================================
   Hero Featured Section
   ========================================================================== */
.hero-featured-section {
    padding: 30px 0 20px;
}

.hero-featured-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.hero-featured-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: #bfdbfe;
}

.featured-content-wrap {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-meta-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.featured-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.35;
    margin-bottom: 16px;
}

.featured-title a:hover {
    color: var(--primary);
}

.featured-excerpt {
    color: #475569;
    font-size: 16.5px;
    line-height: 1.8;
    margin-bottom: 24px;
}

.featured-visual-wrap {
    background: linear-gradient(135deg, #1e3a8a, #4338ca);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.featured-visual-icon {
    font-size: 120px;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.3));
    animation: floatAnim 6s ease-in-out infinite;
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ==========================================================================
   Category Filter Bar
   ========================================================================== */
.categories-filter-bar {
    padding: 15px 0 25px;
}

.categories-pills-wrap {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.categories-pills-wrap::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    padding: 10px 20px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 14.5px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.cat-pill:hover, .cat-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   Articles Grid
   ========================================================================== */
.articles-grid-section {
    padding: 10px 0 40px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.section-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 26px;
}

.article-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.card-visual {
    height: 180px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-visual-icon {
    font-size: 64px;
    filter: drop-shadow(0 8px 14px rgba(0,0,0,0.25));
}

.card-category-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 800;
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.card-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.45;
    margin-bottom: 12px;
}

.card-title a:hover {
    color: var(--primary);
}

.card-snippet {
    font-size: 14.5px;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
    margin-top: auto;
}

.author-info-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
}

.author-avatar-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.card-read-more {
    font-weight: 800;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-read-more:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Article Single Page Details
   ========================================================================== */
.article-page-layout {
    padding: 25px 0 50px;
}

.article-main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.article-article-surface {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

/* Breadcrumbs */
.breadcrumbs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumbs-bar a:hover {
    color: var(--primary);
}

.article-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 28px;
}

.article-header-title {
    font-size: 34px;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.35;
    margin-bottom: 18px;
}

.article-header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.author-full-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-full-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid #bfdbfe;
}

.author-full-name {
    font-weight: 800;
    font-size: 15.5px;
    color: var(--dark);
}

.author-full-role {
    font-size: 13px;
    color: var(--text-muted);
}

.article-read-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--text-muted);
}

/* Key Takeaways Box */
.key-takeaways-card {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-right: 5px solid #16a34a;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 30px;
}

.takeaways-title {
    font-size: 18px;
    font-weight: 900;
    color: #166534;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.takeaways-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.takeaways-list li {
    font-size: 15.5px;
    color: #14532d;
    line-height: 1.7;
    position: relative;
    padding-right: 22px;
}

.takeaways-list li::before {
    content: "✓";
    position: absolute;
    right: 0;
    color: #16a34a;
    font-weight: 900;
}

/* Article Prose Typography */
.article-prose {
    font-size: 18px;
    line-height: 2.1;
    color: #1e293b;
}

.article-prose h2 {
    font-size: 24px;
    font-weight: 900;
    color: var(--dark);
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.article-prose h3 {
    font-size: 20px;
    font-weight: 800;
    color: #1e3a8a;
    margin-top: 28px;
    margin-bottom: 12px;
}

.article-prose p {
    margin-bottom: 20px;
}

.article-prose ul, .article-prose ol {
    margin: 16px 0 24px 24px;
    padding-right: 20px;
}

.article-prose li {
    margin-bottom: 10px;
}

.article-prose blockquote {
    background: #f8fafc;
    border-right: 4px solid var(--primary);
    padding: 18px 24px;
    margin: 28px 0;
    border-radius: var(--radius-sm);
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    font-style: italic;
}

.info-callout {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin: 26px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.callout-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.callout-body {
    font-size: 16px;
    color: #1e3a8a;
    line-height: 1.8;
}

/* Share & Actions */
.article-share-bar {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    margin-top: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.share-label {
    font-weight: 800;
    font-size: 15px;
    color: var(--dark);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 13.5px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #0f1419; }
.share-btn.wa { background: #25d366; }
.share-btn.copy { background: #475569; cursor: pointer; border: none; }

/* Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.sidebar-widget {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.widget-post-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.widget-post-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.widget-post-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.45;
}

.widget-post-title:hover {
    color: var(--primary);
}

.widget-post-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==========================================================================
   Google AdSense Compliant Banner Styling
   ========================================================================== */
.ad-compliant-wrapper {
    margin: 28px auto;
    text-align: center;
    max-width: 100%;
    clear: both;
}

.ad-label-bar {
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-family: var(--font-en), var(--font-ar);
}

.ad-box-surface {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    margin-top: auto;
    padding-top: 50px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-top-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
    gap: 36px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-col-title {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 18px;
}

.footer-desc {
    font-size: 14.5px;
    color: #94a3b8;
    line-height: 1.8;
    margin-top: 12px;
}

.footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-list a {
    font-size: 14.5px;
    color: #94a3b8;
    transition: color 0.2s;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-right: 4px;
}

.footer-bottom-bar {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: #64748b;
    flex-wrap: wrap;
    gap: 14px;
}

/* ==========================================================================
   Static Pages (About, Contact, Privacy, Terms)
   ========================================================================== */
.static-page-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 44px;
    margin: 30px 0 50px;
    box-shadow: var(--shadow-sm);
}

.static-page-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-color);
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.contact-form .form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-ar);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-submit-btn {
    background: var(--primary);
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    font-family: var(--font-ar);
    transition: background 0.2s;
}

.form-submit-btn:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .hero-featured-card {
        grid-template-columns: 1fr;
    }
    .featured-visual-wrap {
        height: 220px;
    }
    .article-main-grid {
        grid-template-columns: 1fr;
    }
    .footer-top-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    .header-top-bar {
        display: none;
    }
    .featured-content-wrap {
        padding: 24px;
    }
    .featured-title {
        font-size: 24px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-article-surface {
        padding: 24px;
    }
    .article-header-title {
        font-size: 26px;
    }
    .contact-form {
        grid-template-columns: 1fr;
    }
    .footer-top-grid {
        grid-template-columns: 1fr;
    }
}
