/*
Theme Name: Grid WordPress Theme
Description: A responsive grid-style WordPress theme with featured images, custom color palette, Rubik font, RTL support, and OpenGraph integration.
Version: 1.5.6
Author: GitHub Copilot
Text Domain: grid-theme
*/

/* Import Rubik Font */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

/* CSS Variables for Color Palette */
:root {
    --primary-color: #28A0FF;
    --secondary-color: #6C5CE7;
    --background-dark: #0A0A19;
    --card-background: #1A1A2E;
    --text-primary: #FFFFFF;
    --text-secondary: #B4B4C8;
    --success-color: #00D9A3;
    --error-color: #FF5C5C;
    --border-radius: 12px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
    direction: ltr;
}

.rtl body {
    direction: rtl;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--secondary-color);
}

/* Header Styles */
.site-header {
    background-color: var(--card-background);
    padding: 20px;
    text-align: center;
}

.site-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.site-description {
    color: var(--text-secondary);
}

.main-navigation {
    text-align: center;
    margin-top: 10px;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.main-navigation li {
    margin: 0 15px;
}

.main-navigation a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.main-navigation a:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Grid Layout for Posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.post-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

.post-content {
    padding: 15px;
}

.post-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--text-primary);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
    font-weight: 500;
}

/* Single Post Styles */
.single-post .post-content {
    padding: 20px;
}

.single-post .post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 20px;
}

.single-post .post-meta,
.single-post .post-categories,
.single-post .post-tags {
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.single-post .post-meta {
    display: none;
}

.single-post .post-categories a,
.single-post .post-tags a {
    color: var(--primary-color);
}

.single-post .post-categories a:hover,
.single-post .post-tags a:hover {
    color: var(--secondary-color);
}

/* Footer */
.site-footer {
    background-color: var(--card-background);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .site-title {
        font-size: 2em;
    }

}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 10px;
    }
    
    .post-content {
        padding: 10px;
    }
}

/* RTL Support */
.rtl .posts-grid {
    direction: rtl;
}

.rtl .site-description,
.rtl .post-title,
.rtl .post-excerpt,
.rtl .post-categories,
.rtl .post-tags,
.rtl .read-more {
    text-align: right;
}

.rtl .main-navigation {
    text-align: center;
}

.rtl .main-navigation ul {
    direction: rtl;
}

.rtl .post-content {
    text-align: right;
}

.rtl .pagination {
    text-align: center; /* or right, but center might be better */
}