@import url("https://fonts.googleapis.com/css2?family=Droid+Arabic+Naskh&display=swap");

/* ===== Unified Arabic Tech Blog Theme ===== */

:root {
    --primary: #0066cc;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #ffffff;
    --bg-light: #f5f7fa;
    --border: #e1e4e8;
    --accent: #0052a3;
    --code-bg: #f6f8fa;
}

/* ===== Base Setup ===== */
* {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Droid Arabic Naskh', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    direction: rtl;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 1.75em 0 0.75em;
    color: var(--text);
    scroll-margin-top: 80px;
}

h1 {
    font-size: 2.25rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

h2 {
    font-size: 1.75rem;
    color: var(--primary);
    border-right: 4px solid var(--primary);
    padding-right: 0.75rem;
    margin-top: 2em;
}

h3 {
    font-size: 1.375rem;
    color: var(--text);
    margin-top: 1.5em;
}

h4 {
    font-size: 1.125rem;
    color: var(--text-light);
}

p {
    margin: 0 0 1.5em;
    line-height: 1.9;
    text-align: justify;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

/* ===== Text Emphasis ===== */
strong {
    font-weight: 700;
    color: var(--primary);
}

em {
    font-style: italic;
    color: var(--accent);
}

mark {
    background-color: rgba(0, 102, 204, 0.15);
    padding: 0.1em 0.3em;
    border-radius: 2px;
    font-weight: 500;
}

/* ===== Post Content ===== */
.post-content,
.page-content {
    font-size: 1rem;
}

.post-content>*:first-child,
.page-content>*:first-child {
    margin-top: 0;
}

/* ===== Code Blocks ===== */
code {
    direction: ltr;
    text-align: left;
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #d63384;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

pre {
    direction: ltr;
    text-align: left;
    background-color: #282c34;
    color: #abb2bf;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.75em 0;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
}

pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.9em;
}

/* ===== Lists ===== */
ul,
ol {
    padding-right: 1.75rem;
    margin: 1.5em 0;
}

li {
    margin-bottom: 0.75em;
    line-height: 1.8;
}

/* ===== Blockquotes ===== */
blockquote {
    border-right: 5px solid var(--primary);
    background: linear-gradient(90deg, rgba(0, 102, 204, 0.03) 0%, transparent 100%);
    padding: 1.25rem 1.5rem;
    margin: 2em 0;
    color: var(--text-light);
    border-radius: 4px;
    font-size: 1.05em;
    font-style: italic;
    line-height: 1.8;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

th,
td {
    padding: 1rem 0.75rem;
    border: 1px solid var(--border);
    text-align: right;
}

th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-weight: 600;
}

td {
    background-color: var(--bg);
}

tr:hover {
    background-color: var(--bg-light);
}

tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

/* ===== Header ===== */
/* Header styles have been moved to assets/css/header.css */

/* ===== Main Content ===== */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
    min-height: 60vh;
}

/* ===== Cards & Containers ===== */
/* Post styles have been moved to assets/css/post.css */

/* ===== Tags & Categories ===== */
.tag,
.category {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0.35rem 0.35rem 0.35rem 0;
    border: 1.5px solid var(--primary);
    transition: all 0.2s;
    font-weight: 500;
}

.tag:hover,
.category:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ===== Horizontal Rules & Dividers ===== */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 2.5em 0;
    border-radius: 1px;
}

/* ===== Categories & Tags Pages ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.category-card {
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.category-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: var(--primary);
}

.category-count,
.tag-count {
    color: var(--text-light);
    font-size: 0.875rem;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.tag-card {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.tag-card:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}

.tag-card a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Footer ===== */
/* Footer styles have been moved to assets/css/footer.css */

/* ===== Home Page ===== */
.home-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 2.5rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 2.5rem;
}

.home-hero h1 {
    color: white;
    margin: 0 0 0.75rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

.cta-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.cta-button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid var(--primary);
}

.cta-button.primary {
    background-color: var(--primary);
    color: white;
}

.cta-button.primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}

.cta-button.secondary {
    background-color: transparent;
    color: var(--primary);
}

.cta-button.secondary:hover {
    background-color: var(--primary);
    color: white;
}

/* ===== Home Page Post Previews ===== */
.post-preview {
    background-color: var(--bg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.post-preview:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.08);
}

.post-header-preview {
    margin-bottom: 1rem;
}

.post-header-preview h3 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-link {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

.post-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.post-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.7;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.post-tags-preview {
    margin: 1rem 0;
}

.post-tags-preview .tag {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--primary);
    padding: 0.25rem 0.7rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin: 0.2rem 0.2rem 0.2rem 0;
    border: 1px solid var(--primary);
    transition: all 0.2s;
}

.post-tags-preview .tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.post-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 1.5rem 0;
}

.explore-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.explore-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid var(--primary);
    display: inline-block;
}

.explore-btn.primary {
    background-color: var(--primary);
    color: white;
}

.explore-btn.primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.explore-btn.secondary {
    background-color: transparent;
    color: var(--primary);
}

.explore-btn.secondary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ===== Related Posts ===== */
.related-posts {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 2.5rem;
}

.related-posts h3 {
    margin: 0 0 1rem;
    color: var(--primary);
}

.related-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.related-posts li:last-child {
    border-bottom: none;
}

.related-post-link {
    color: var(--primary);
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .page-article,
    .post,
    .post-list-item {
        padding: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Responsive post meta */
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Responsive fixes for post lists */
    .post-list-item {
        padding: 1.5rem;
    }
    
    .post-list-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .post-list-header h3 {
        font-size: 1.25rem;
    }
    
    .post-views {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }
    
    /* Responsive fixes for home page */
    .post-preview {
        padding: 1.25rem;
    }
    
    .post-header-preview h3 {
        font-size: 1.125rem;
    }
    
    .explore-links {
        flex-direction: column;
        align-items: center;
    }
    
    .explore-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-header-wrapper {
        padding: 0 1rem;
    }

    .nav-list {
        gap: 0;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    .home-hero {
        padding: 1.5rem 1rem;
    }

    .cta-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    /* Responsive fixes for post lists */
    .post-list-item {
        padding: 1rem;
    }
    
    .post-list-meta {
        font-size: 0.8rem;
    }
    
    .post-views-list {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }
    
    .post-views {
        font-size: 0.8rem;
        padding: 0.15rem 0.5rem;
    }
    
    /* Responsive fixes for home page */
    .post-preview {
        padding: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
    direction: ltr;
}

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

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

.mt-3 {
    margin-top: 1.5rem;
}

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

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

.mb-3 {
    margin-bottom: 1.5rem;
}