/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@700&family=Noto+Sans+Arabic:wght@400;700&display=swap');

/*
  Theme: VintagePress
  Language: Arabic (RTL)
  Fonts: Roboto Slab (Headings/Logo), Noto Sans Arabic (Body)
*/

:root {
    --background-color: #fdf6e3; /* A warm, creamy off-white */
    --text-color: #5c4033; /* Dark, earthy brown */
    --primary-color: #a52a2a; /* A muted, dusty red for accents */
    --container-bg-color: #faf3e0; /* Slightly lighter than main bg for contrast */
    --border-color: #e3d9c6;
    --header-footer-bg: #e3d9c6;
    --font-main: 'Noto Sans Arabic', sans-serif;
    --font-heading: 'Roboto Slab', serif;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    direction: rtl; /* Set Right-to-Left direction globally */
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    text-align: right; /* Default text alignment for RTL */
}

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

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--header-footer-bg);
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.site-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

/* --- Main Content Layout --- */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (min-width: 992px) {
    .main-layout {
        grid-template-columns: 3fr 1fr;
    }
}

main {
    background-color: var(--container-bg-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

h1, h2, h3 {
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
}

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

a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

ul, ol {
    margin-right: 1.5rem; /* Indentation for RTL */
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* --- Article Grid --- */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.article-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.article-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-card p {
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 700;
    align-self: flex-start;
}

/* --- Sidebar --- */
.sidebar {
    position: sticky;
    top: 100px;
}

.widget {
    background-color: var(--container-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.widget h3 {
    font-size: 1.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.widget ul {
    list-style: none;
    margin-right: 0;
}

.widget li {
    margin-bottom: 0.75rem;
}

.widget a {
    display: block;
}

/* --- Article Page Specifics --- */
.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: -0.5rem;
}

.cta-section {
    background-color: var(--background-color);
    border: 1px dashed var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    text-align: center;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--header-footer-bg);
    color: var(--text-color);
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
    border-top: 2px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0;
}

/* --- Responsive Menu --- */
@media (max-width: 991px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-footer-bg);
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    .menu-toggle {
        display: block;
    }
}
