/*
Theme Name: برق - Barq
Theme URI: https://example.com/barq
Author: Dalia
Description: قالب ووردبريس متعدد الاستخدامات، سريع كالبرق، متوافق مع محركات البحث (SEO)، ومتجاوب بالكامل مع جميع الشاشات.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: barq
*/

/* 1. إعادة تعيين التنسيقات الأساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: #0073aa;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 2. هيكل وتخطيط الموقع */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header.site-header {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 3px solid #0073aa;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-title a {
    font-size: 28px;
    font-weight: bold;
    color: #111;
}

nav.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav.main-navigation a {
    font-weight: 600;
    color: #555;
    transition: color 0.3s ease;
}

nav.main-navigation a:hover {
    color: #0073aa;
}

.main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
}

.posts-loop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

article.post-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

article.post-card:hover {
    transform: translateY(-5px);
}

.post-title a {
    color: #222;
    font-size: 20px;
}

.post-meta {
    font-size: 13px;
    color: #777;
    margin: 10px 0;
}

aside.site-sidebar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

footer.site-footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* 3. التجاوب الكامل */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 4. تنسيقات المقال المنفرد والصفحات */
.single-post-content, .page-content-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #eee;
    margin-bottom: 30px;
}

.post-title-single {
    font-size: 32px;
    color: #111;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-meta-single {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 15px;
}

.post-thumbnail-single {
    margin-bottom: 25px;
    border-radius: 6px;
    overflow: hidden;
}

.entry-content p, .entry-content-page p {
    font-size: 18px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-tags {
    margin-top: 30px;
    font-size: 14px;
    color: #555;
}

.section-divider {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 40px 0;
}

@media (max-width: 768px) {
    .single-post-content {
        padding: 20px;
    }
    .post-title-single {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .header-wrap {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    nav.main-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* 5. التنسيقات الإضافية والبحث */
.page-title-archive {
    font-size: 22px;
    color: #222;
    grid-column: 1 / -1;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.page-title-archive span {
    color: #0073aa;
}

.no-results {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
    grid-column: 1 / -1;
    text-align: center;
}

.back-home-btn {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.back-home-btn:hover {
    background-color: #005177;
    color: #fff;
}

/* ==========================================================================
   تنسيقات قالب برق الجديدة (الأزرار، القوائم المنسدلة، والفقاعات)
   ========================================================================== */

/* القائمة الرئيسية المنسدلة */
.barq-nav {
    background-color: #071635; /* الكحلي الداكن المتناسق مع اللوجو */
    direction: rtl;
    padding: 10px 20px;
}
.main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.main-menu > li {
    position: relative;
}
.main-menu a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    font-family: sans-serif;
    transition: background 0.3s;
}
.main-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: 4px;
    z-index: 999;
}
.dropdown-menu a {
    color: #333;
    padding: 10px 20px;
}
.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: #0046da;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.arrow {
    font-size: 10px;
    margin-right: 5px;
}

/* الأزرار الجديدة المتوافقة مع الهوية */
.button-group {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    direction: rtl;
}
.btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}
.btn-primary {
    background-color: #0046da; /* الأزرق الحيوي من اللوجو */
    color: #fff;
}
.btn-primary:hover {
    background-color: #0032a3;
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* تأثير الفقاعات العائمة في الخلفية */
.bubble-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
    background: linear-gradient(135deg, #071635, #002266);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}
.bubble {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    animation: floatUp 8s infinite linear;
}
.b1 { width: 40px; height: 40px; left: 10%; animation-duration: 6s; }
.b2 { width: 20px; height: 20px; left: 30%; animation-duration: 9s; animation-delay: 2s; }
.b3 { width: 50px; height: 50px; left: 70%; animation-duration: 7s; animation-delay: 1s; }
.b4 { width: 30px; height: 30px; left: 85%; animation-duration: 5s; animation-delay: 3s; }

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-500px) scale(1.3); opacity: 0; }
}

/* تنسيق الشعار المطور لقالب برق */
.custom-logo-link img, .site-branding img {
    max-height: 55px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}
.custom-logo-link img:hover {
    transform: scale(1.03); /* تأثير حركة خفيف عند تمرير الماوس */
}
function barq_custom_logo_setup() {
    add_theme_support('custom-logo', array(
        'height'      => 100,
        'width'       => 300,
        'flex-height' => true,
        'flex-width'  => true,
    ));
}
add_action('after_setup_theme', 'barq_custom_logo_setup');
