/**
 * Elbadil Main Stylesheet
 * التصميم الأساسي للقالب
 * 
 * @package Un-Elbadil
 * @since 2.0.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --site-color: #e0383d;
    --site-color-hover: #c82e33;
    --text-color: #333333;
    --text-muted: #666666;
    --heading-color: #111111;
    --border-color: #eeeeee;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --body-bg-color: #f5f5f5;
    --glob-border-radius: 8px;
    --glob-gap: 20px;
    --font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rainbow-line: linear-gradient(to right, #f76570 0%, #f76570 8%, #f3a46b 8%, #f3a46b 16%, #ffd205 16%, #ffd205 24%, #1bbc9b 24%, #1bbc9b 32%, #14b9d5 32%, #14b9d5 40%, #c377e4 40%, #c377e4 48%, #f76570 48%, #f76570 56%, #f3a46b 56%, #f3a46b 64%, #ffd205 64%, #ffd205 72%, #1bbc9b 72%, #1bbc9b 80%, #14b9d5 80%, #14b9d5 89%, #c377e4 89%, #c377e4 100%);
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--body-bg-color);
    direction: rtl;
}

a {
    color: var(--site-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--site-color-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Layout
   ============================================ */
#site {
    max-width: 1130px;
    margin: 0 auto;
}

#site-main {
    background-color: var(--bg-white);
    padding: 20px 0;
}

.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================================
   Header
   ============================================ */
#site-header {
    padding-top: 3px;
    border-top: none;
    position: relative;
    background: var(--bg-white);
}

#site-header::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background-image: var(--rainbow-line);
}

.header-top-bar {
    background-color: var(--bg-light);
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-date {
    font-size: 14px;
    color: var(--text-muted);
}

.header-date i {
    margin-left: 5px;
}

.header-main {
    padding: 20px 0;
}

.header-main-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.site-branding {
    flex: 1;
}

.site-branding img {
    max-height: 80px;
    width: auto;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--heading-color);
}

/* Navigation */
.header-nav {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    border-bottom: 2px solid var(--site-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 12px 18px;
    color: var(--heading-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-menu > li:hover > a,
.nav-menu > li.current-menu-item > a {
    background-color: var(--site-color);
    color: #fff;
}

/* Dropdown */
.nav-menu li ul {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-white);
    border-top: 2px solid var(--site-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu li ul li a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-menu li ul li:last-child a {
    border-bottom: none;
}

.nav-menu li ul li a:hover {
    background-color: var(--bg-light);
    color: var(--site-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--heading-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* ============================================
   Breaking News
   ============================================ */
.breaking-news-outer {
    background-color: var(--bg-light);
}

.breaking-news-inner {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.breaking-news-label {
    padding: 8px 15px;
    background-color: var(--site-color);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.breaking-news-label i {
    margin-left: 5px;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    margin-right: 15px;
}

.ticker {
    position: relative;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    animation: ticker 20s linear infinite;
}

.ticker-content a {
    white-space: nowrap;
    padding: 0 30px;
    color: var(--text-color);
}

.ticker-content a:hover {
    color: var(--site-color);
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ============================================
   Social Icons
   ============================================ */
.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--text-muted);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
    color: #fff;
}

.social-facebook:hover { background-color: #1877f2; }
.social-twitter:hover { background-color: #000; }
.social-instagram:hover { background-color: #e4405f; }
.social-youtube:hover { background-color: #ff0000; }
.social-telegram:hover { background-color: #0088cc; }

/* ============================================
   Posts
   ============================================ */
.posts-loop {
    display: grid;
    gap: var(--glob-gap);
}

.post-card {
    background: var(--bg-white);
    border-radius: var(--glob-border-radius);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.post-card .post-content {
    display: flex;
    gap: 20px;
}

.post-card .post-thumb {
    flex: 0 0 200px;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--glob-border-radius);
}

.post-details {
    flex: 1;
    padding: 15px 15px 15px 0;
}

.post-category a {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--site-color);
    color: #fff;
    font-size: 12px;
    border-radius: 3px;
    margin-bottom: 10px;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}

.post-title a {
    color: var(--heading-color);
}

.post-title a:hover {
    color: var(--site-color);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.post-meta i {
    margin-left: 5px;
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   Single Post
   ============================================ */
.single-content .post-header {
    text-align: center;
    margin-bottom: 25px;
}

.single-content .post-title {
    font-size: 28px;
    margin-bottom: 15px;
}

.single-content .post-meta {
    justify-content: center;
}

.post-featured-image {
    margin-bottom: 25px;
    border-radius: var(--glob-border-radius);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
}

.post-body {
    font-size: 17px;
    line-height: 1.8;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body h2, .post-body h3, .post-body h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--heading-color);
}

.post-tags {
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 25px;
}

.post-tags a {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--bg-light);
    color: var(--text-color);
    border-radius: 3px;
    margin: 3px;
    font-size: 13px;
}

.post-tags a:hover {
    background-color: var(--site-color);
    color: #fff;
}

/* Share Links */
.share-links {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: var(--glob-border-radius);
}

.share-label {
    margin-left: 15px;
    font-weight: 600;
}

.share-links-inner {
    display: flex;
    gap: 10px;
}

.share-links-inner a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-white);
    transition: 0.3s;
}

.share-links-inner a:hover {
    color: #fff;
    background-color: var(--color);
}

.share-links-inner a .icon {
    margin-left: 8px;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: var(--glob-border-radius);
    margin-top: 30px;
}

.author-avatar img {
    border-radius: 50%;
}

.author-name {
    margin: 0 0 10px;
    font-size: 18px;
}

.author-bio {
    color: var(--text-muted);
    margin: 0;
}

/* Related Posts */
.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--site-color);
    display: inline-block;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.related-post a {
    display: block;
}

.related-post img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--glob-border-radius);
    margin-bottom: 10px;
}

.related-post h4 {
    font-size: 14px;
    margin: 0;
    color: var(--heading-color);
}

.related-post h4:hover {
    color: var(--site-color);
}

/* ============================================
   Sidebar & Widgets
   ============================================ */
.sidebar {
    padding: 0 15px;
}

.widget {
    margin-bottom: 25px;
    background: var(--bg-white);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--glob-border-radius);
}

.widget-title {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--site-color);
    font-size: 16px;
    color: var(--site-color);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget ul li:last-child {
    border-bottom: none;
}

/* ============================================
   Footer
   ============================================ */
#site-footer {
    background-color: #1a1a1a;
    color: #ccc;
    margin-top: 0;
    border-top: 5px solid var(--site-color);
}

.footer-widgets {
    padding: 40px 0;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-widget-area .widget {
    background: transparent;
    border: none;
    color: #ccc;
}

.footer-widget-area .widget-title {
    color: #fff;
    border-color: var(--site-color);
}

.footer-widget-area a {
    color: #ccc;
}

.footer-widget-area a:hover {
    color: var(--site-color);
}

.site-copyrights {
    text-align: center;
    padding: 20px;
    background-color: #111;
    color: #888;
    font-size: 14px;
}

/* ============================================
   Utilities
   ============================================ */
.breadcrumbs {
    padding: 15px 0;
    color: var(--text-muted);
    text-align: center;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--site-color);
}

.breadcrumbs .separator {
    margin: 0 8px;
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: var(--site-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--site-color-hover);
    transform: translateY(-3px);
}

/* Pagination */
.elbadil-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.elbadil-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: var(--bg-light);
    color: var(--text-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.elbadil-pagination .page-numbers:hover,
.elbadil-pagination .page-numbers.current {
    background-color: var(--site-color);
    color: #fff;
}

/* ============================================
   Overlays and Menus
   ============================================ */
.site-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 998;
}

.site-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--bg-white);
    z-index: 1000;
    transition: 0.3s;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.side-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.side-menu-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu-nav li a {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.side-menu-nav li a:hover {
    background-color: var(--bg-light);
    color: var(--site-color);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1001;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-close {
    position: absolute;
    top: 30px;
    left: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

.search-overlay-content form {
    display: flex;
    max-width: 600px;
    width: 100%;
}

.search-overlay-content input {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    border: none;
    border-radius: 5px 0 0 5px;
}

.search-overlay-content button {
    padding: 15px 25px;
    background: var(--site-color);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-card .post-content {
        flex-direction: column;
    }
    
    .post-card .post-thumb {
        flex: none;
    }
    
    .post-details {
        padding: 15px;
    }
}

@media (max-width: 767px) {
    .header-main-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-widgets-grid {
        grid-template-columns: 1fr;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .single-content .post-title {
        font-size: 22px;
    }
    
    .share-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-links-inner {
        flex-wrap: wrap;
        justify-content: center;
    }
}
