:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --text-main: #1F2937;
    --text-light: #6B7280;
    --bg-body: #F9FAFB;
    --bg-card: #FFFFFF;
    --border: #E5E7EB;
    --font-heading: 'Tajawal', sans-serif;
    --font-body: 'Tajawal', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    width: 250px;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: white;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.hero p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Recipe Grid */
.section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.recipe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.recipe-content {
    padding: 1.5rem;
}

.recipe-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.recipe-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-read {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-read:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Single Recipe */
.recipe-single {
    max-width: 800px;
    margin: 3rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.recipe-header {
    margin-bottom: 2rem;
    text-align: center;
}

.recipe-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.recipe-meta {
    color: var(--text-light);
    font-size: 0.9rem;
}

.recipe-body h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.recipe-body ul,
.recipe-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.recipe-body li {
    margin-bottom: 0.5rem;
}

/* Ad Placeholder */
.ad-block {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    color: #999;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    font-weight: bold;
    border-radius: 0.5rem;
}

/* Comments */
.comments-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comment-list {
    margin-bottom: 2rem;
}

.comment {
    background: var(--bg-body);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-light);
}

/* Responsive */
/* Responsive Fix for RTL */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .search-input {
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }
}