/*
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.6.37
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;
    max-width: 1200px;
    margin: 0 auto;
}

.site-title {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.site-description {
    color: var(--text-secondary);
    text-align: center;
}

.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);
}

/* Banner Section */
.banner-section {
    background-color: var(--card-background);
    padding: 20px 0;
    border-top: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    max-width: 1200px;
    margin: 0 auto;}

.banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.banner-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background-color: var(--background-dark);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.banner-item:last-child {
    margin-bottom: 0;
}

.banner-image {
    flex-shrink: 0;
}

.banner-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.banner-content {
    flex: 1;
}

.banner-content h2 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.5em;
    display: none;
}

.banner-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.banner-text p {
    margin-bottom: 1em;
}

.banner-text img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* Responsive Banner */
@media (max-width: 768px) {
    .banner-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .banner-image img {
        width: 100px;
        height: 100px;
    }

    .banner-content h2 {
        font-size: 1.25em;
    }
}

@media (max-width: 480px) {
    .banner-container {
        padding: 0 10px;
    }

    .banner-item {
        padding: 15px;
    }

    .banner-image img {
        width: 80px;
        height: 80px;
    }

    .banner-content h2 {
        font-size: 1.1em;
    }
}

/* 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;
}

.related-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

.post-content {
    padding: 15px;
}

.post-title {
    margin-bottom: 10px;
    font-weight: 600;
}

.posts-grid .post-title {
    font-size: 1.2em;
}

.related-posts .post-title {
    font-size: 1.2em !important;
}

.single-post .post-title {
    font-size: 2em;
    margin-bottom: 20px;
}

.post-title a {
    color: var(--text-primary) !important;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9em;
    display: none;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
    font-weight: 500;
    display: none;
}

/* Post Content Typography */
.single-post .post-content {
    padding: 20px;
    line-height: 1.8;
}

.single-post .post-content p {
    margin-bottom: 1.5em;
    font-size: 1em;
}

.single-post .post-content h1,
.single-post .post-content h2,
.single-post .post-content h3,
.single-post .post-content h4,
.single-post .post-content h5,
.single-post .post-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

.single-post .post-content h1 {
    font-size: 2em;
}

.single-post .post-content h2 {
    font-size: 1.75em;
}

.single-post .post-content h3 {
    font-size: 1.5em;
}

.single-post .post-content h4 {
    font-size: 1.25em;
}

.single-post .post-content h5 {
    font-size: 1.1em;
}

.single-post .post-content h6 {
    font-size: 1em;
}

.single-post .post-content ul,
.single-post .post-content ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
}

.single-post .post-content li {
    margin-bottom: 0.5em;
}

.single-post .post-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--primary-color);
    background-color: rgba(40, 160, 255, 0.1);
    font-style: italic;
}

.single-post .post-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.single-post .post-content a:hover {
    color: var(--secondary-color);
}

.single-post .post-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
}

.single-post .post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.single-post .post-content th,
.single-post .post-content td {
    padding: 0.5em;
    border: 1px solid var(--text-secondary);
    text-align: left;
}

.single-post .post-content th {
    background-color: var(--card-background);
    font-weight: 600;
}

/* Ensure inline styles from Classic Editor work */
.single-post .post-content [style*="font-size"] {
    font-size: inherit !important;
}

.single-post .post-content span[style*="font-size"] {
    font-size: inherit !important;
}

.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;
    text-align: center;
}

.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);
}

/* Post Meta Section */
.post-meta-section {
    margin-top: 20px;
    border: 2px solid var(--card-background);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
}

/* Page Title Styling */
.page h1 {
    text-align: center;
    color: var(--text-primary);
    font-size: 2em;
    margin-bottom: 20px;
}
/* Related Posts */
.related-posts {
    margin-top: 40px;
    border: 2px solid var(--card-background);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
}

.related-posts-title {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.5em;
    margin-bottom: 20px;
}

.related-posts .posts-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.related-posts .post-card {
    flex: 0 1 300px;
}

/* Pagination */
.pagination {
    text-align: center;
    margin: 40px 0;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background-color: var(--card-background);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination .page-numbers:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 160, 255, 0.3);
}

.pagination .page-numbers.current {
    background-color: var(--secondary-color);
    color: var(--background-dark);
    border-color: var(--secondary-color);
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    font-weight: 600;
}

/* Contact Form 7 Styling */
.wpcf7-form {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wpcf7-form p {
    margin-bottom: 20px;
}

.wpcf7-form label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--background-dark);
    border: 2px solid var(--card-background);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: 'Rubik', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="url"]:focus,
.wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 160, 255, 0.1);
}

.wpcf7-form textarea {
    min-height: 120px;
    resize: vertical;
}

.wpcf7-form .wpcf7-submit {
    background-color: var(--primary-color);
    color: var(--background-dark);
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpcf7-form .wpcf7-submit:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.wpcf7-form .wpcf7-submit:active {
    transform: translateY(0);
}

.wpcf7-response-output {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.wpcf7-response-output.wpcf7-mail-sent-ok {
    background-color: rgba(0, 217, 163, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-response-output.wpcf7-mail-sent-ng {
    background-color: rgba(255, 92, 92, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-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;
    }

    .single-post .post-title {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
}

@media (min-width: 768px) {
    .single-post .post-thumbnail {
        width: 60%;
        margin: 0 auto;
        display: block;
    }
}

/* RTL Support */
.rtl .posts-grid {
    direction: rtl;
}

.rtl .post-title,
.rtl .read-more {
    text-align: right;
    direction: rtl;
}

.rtl .main-navigation {
    text-align: center;
}

.rtl .main-navigation ul {
    direction: rtl;
}

.rtl .post-content {
    text-align: right;
    direction: rtl;
}

.rtl .post-meta-section,
.rtl .related-posts {
    direction: rtl;
}

.rtl .page h1,
.rtl .related-posts-title {
    text-align: right;
}

.rtl .pagination {
    text-align: center; /* or right, but center might be better */
}

.rtl .wpcf7-form {
    text-align: right;
    direction: rtl;
}

.rtl .wpcf7-form input[type="text"],
.rtl .wpcf7-form input[type="email"],
.rtl .wpcf7-form input[type="tel"],
.rtl .wpcf7-form input[type="url"],
.rtl .wpcf7-form textarea {
    text-align: right;
}