/*
Theme Name: kora theme
Description: قالب ووردبريس رياضي احترافي مطابق للتصميم الأصلي
Version: 1.0
Author: OTHMANI YASSINE
Text Domain: KORA.MA
*/

/* * إعدادات أساسية باستخدام متغيرات CSS
 * هذه القيم هي مجرد قيم افتراضية، سيتم الكتابة فوقها بالقيم من لوحة التحكم
 */
:root {
    --primary-color: var(--theme-primary, #4a1816);
    --primary-dark: var(--theme-primary, #4a1816);
    --primary-light: var(--theme-accent, #99514f);
    --accent-color: var(--theme-accent, #99514f);
    --text-dark: var(--theme-text-dark, #333333);
    --text-light: var(--theme-text-light, #666666);
    --site-width: 970px;
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-dark: 0 6px 12px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Cairo", sans-serif;
    background-color: var(--theme-background, #f0f0f0);
    direction: rtl;
    color: var(--theme-text-dark, #333);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.container {
    width: 100%;
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* الشريط العلوي */
.top-bar {
    background-color: var(--primary-dark);
    padding: 8px 0;
    color: #fff;
    font-size: 14px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-right, .top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-left {
    gap: 15px;
}

.top-links a {
    margin-left: 15px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.top-links a:hover {
    opacity: 1;
}

.date, .weather {
    display: flex;
    align-items: center;
    gap: 5px;
}

.social-links {
    display: flex;
}

.social-links a {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
}

.social-links a:hover {
    color: #fff;
}

/* الرأس الرئيسي */
.main-header {
    background-color: var(--primary-color);
    padding: 15px 0;
    color: #fff;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
}

.match-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.match-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
    color: rgba(255, 255, 255, 0.8);
}

.match-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* القائمة الرئيسية */
.main-nav {
    background-color: var(--theme-content-bg, #fff);
    box-shadow: var(--shadow-light);
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-menu {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.main-menu > li > a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--primary-dark);
    font-weight: 600;
    transition: all 0.2s;
}

.main-menu > li:hover > a {
    color: var(--accent-color);
    background-color: var(--theme-background, #f9f9f9);
}

/* أقسام الدوريات */
.section-title {
    position: relative;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    padding-right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.section-title:before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--accent-color);
}

.leagues-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.league-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--theme-content-bg, #fff);
    padding: 15px;
    border-radius: var(--border-radius-md);
    text-align: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-light);
}

.league-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

.league-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    border-radius: 0%;
    overflow: hidden;
}

.league-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* عرض الدوريات */
.league-showcase {
    background-color: var(--theme-content-bg, #fff);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    overflow: hidden;
}

.league-showcase-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.league-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.league-tab {
    padding: 12px 20px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: none;
    font-family: inherit;
}

.league-tab:hover,
.league-tab.active {
    color: var(--primary-color);
}

.league-tab.active:after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.league-contents {
    padding: 15px;
}

.league-content {
    display: none;
}

.league-content.active {
    display: block;
}

.league-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* أخبار الدوريات */
.league-news {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.league-news-item {
    background-color: var(--theme-background, #f9f9f9);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.league-news-item:hover {
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
}

.league-news-img {
    height: 130px;
    overflow: hidden;
}

.league-news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s;
}

.league-news-item:hover .league-news-img img {
    transform: scale(1.05);
}

.league-news-content {
    padding: 12px;
}

.league-news-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.league-news-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* جدول الترتيب */
.league-table {
    background-color: var(--theme-background, #f9f9f9);
    border-radius: var(--border-radius-sm);
    padding: 15px;
}

.league-table-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.standings-table th,
.standings-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.standings-table th {
    font-weight: 700;
    color: var(--primary-dark);
    background-color: var(--theme-background, #f5f5f5);
}

.standings-table .team-col {
    text-align: right;
}

.team-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-name img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* الشريط الجانبي */
.sidebar-widget {
    background-color: var(--theme-content-bg, #fff);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    overflow: hidden;
}

.sidebar-widget-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-widget-content {
    padding: 15px;
}

.widget-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* عرض الأخبار الدوار */
.news-carousel-content {
    height: 330px;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.news-carousel-item {
    padding: 12px 15px;
    border-bottom: 1px dashed #eee;
    transition: all 0.2s;
}

.news-carousel-item:hover {
    background-color: var(--theme-background, #f9f9f9);
}

.news-carousel-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    position: relative;
    padding-right: 18px;
}

.news-carousel-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.news-carousel-meta {
    font-size: 12px;
    color: var(--text-light);
}

.news-carousel-controls {
    padding: 10px 15px;
    display: flex;
    justify-content: center;
    background-color: var(--theme-background, #f9f9f9);
    border-top: 1px solid #eee;
}

.news-carousel-dots {
    display: flex;
    gap: 8px;
}

.news-carousel-dot {
    width: 8px;
    height: 8px;
    background-color: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.news-carousel-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* استطلاع الرأي */
.poll-question {
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
}

.poll-submit {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 15px;
    font-family: "Cairo", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.poll-submit:hover {
    background-color: var(--primary-dark);
}

/* التذييل */
.site-footer {
    background-color: var(--theme-primary, #4a1816);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget ul li a {
    color: #ccc;
    transition: color 0.2s;
}

.footer-widget ul li a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
    color: #ccc;
}

.entry table td, .entry table th {
  text-align: right;
  border: 1px dotted rgba(0, 0, 0, 0.1);
}

/* START: Responsive Header & Mobile Menu Styles */
.main-header .container { display: flex; justify-content: space-between; align-items: center; }
.main-nav .container { display: flex; justify-content: center; }
.mobile-menu-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.5); color: #fff; font-size: 22px; padding: 5px 10px; border-radius: 4px; cursor: pointer; }
@media (max-width: 768px) {
    .main-header .match-nav, .top-bar, .main-nav .live-elkora-top { display: none; }
    .main-nav { background-color: transparent; position: static; box-shadow: none; border-bottom: none; }
    .main-menu { display: none; flex-direction: column; width: 100%; background-color: var(--theme-text-dark, #333); position: absolute; top: 100%; left: 0; box-shadow: 0 4px 8px rgba(0,0,0,0.1); z-index: 1000; }
    .main-menu.mobile-open { display: flex; }
    .main-menu > li { width: 100%; border-bottom: 1px solid #444; }
    .main-menu > li > a { padding: 15px; color: #fff; font-weight: normal; }
    .main-menu > li:hover > a { background-color: var(--primary-color); }
    .mobile-menu-toggle { display: block; }
    .main-header { position: relative; }
}
/* END: Responsive Header & Mobile Menu Styles */

/* --- Global Styles --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.section-title { font-size: 24px; font-weight: 800; color: var(--theme-text-dark, #333); margin-bottom: 20px; border-right: 4px solid var(--primary-color); padding-right: 15px; }
.entry-content p { line-height: 1.8; margin-bottom: 1.5em; }
.entry-content h2, .entry-content h3 { margin-top: 2em; margin-bottom: 1em; }

/* --- Header --- */
.top-bar { background: var(--theme-background, #f5f5f5); padding: 8px 0; font-size: 13px; color: var(--theme-text-light, #666); }
.top-bar .container, .main-header .container { display: flex; justify-content: space-between; align-items: center; }
.main-header { padding: 15px 0; border-bottom: 1px solid #eee; }
.logo img { max-height: 50px; }
.main-nav .main-menu { list-style: none; display: flex; margin: 0; padding: 0; }
.main-nav .main-menu > li > a { padding: 15px; font-weight: 700; color: var(--theme-text-dark, #333); text-decoration: none; transition: color .2s; }
.main-nav .main-menu > li > a:hover { color: var(--primary-color); }
.mobile-menu-toggle { display: none; background: none; border: 1px solid #ddd; color: var(--theme-text-dark, #333); font-size: 20px; padding: 8px 12px; border-radius: 4px; cursor: pointer; }

/* --- Homepage Blocks --- */
.home-widget { padding: 30px 0; }
.posts-block-wrap { display: grid; gap: 20px; }
.posts-block-wrap.layout-default { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.posts-block-wrap.layout-video { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.posts-block-wrap.layout-grid-3-cols { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.post-item-thumbnail { position: relative; overflow: hidden; border-radius: 8px; margin-bottom: 15px; }
.post-item-thumbnail img { width: 100%; height: auto; display: block; transition: transform .3s; }
.post-item-default:hover img, .post-item-grid-3:hover img, .post-item-video:hover img { transform: scale(1.05); }
.post-item-title { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.4; }
.post-item-title a { color: var(--theme-text-dark, #333); text-decoration: none; }
.post-item-title a:hover { color: var(--primary-color); }
.post-item-meta { font-size: 13px; color: #777; margin-top: 8px; }
.post-item-video .play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 50px; height: 50px; background: var(--theme-accent, rgba(255,87,34,0.8)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: background .2s; }
.post-item-video:hover .play-icon { background: var(--primary-color); }
.league-showcase-section { background: var(--theme-content-bg, #fff); padding: 20px; border-radius: 8px; margin-bottom: 30px; }
.league-tabs { display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.league-tab { background: none; border: none; padding: 10px 20px; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 8px; }
.league-tab.active { border-bottom-color: var(--primary-color); color: var(--primary-color); }
.league-tab img { width: 24px; height: 24px; }
.league-content { display: none; }
.league-content.active { display: block; }
.league-content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }

/* --- Single Post & Page --- */
.single-post-article, .page-article { background: var(--theme-content-bg, #fff); padding: 40px; border-radius: 8px; margin: 30px 0; }
.single-post-header, .page-header { text-align: center; margin-bottom: 30px; }
.post-categories a { background: var(--primary-color); color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 14px; text-decoration: none; }
.post-title, .page-title { font-size: 42px; font-weight: 800; margin: 20px 0; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px; color: var(--theme-text-light, #666); font-size: 14px; }
.meta-item a { color: var(--theme-text-dark, #333); font-weight: 700; text-decoration: none; }
.meta-item img { border-radius: 50%; margin-left: 8px; }
.post-featured-image, .page-featured-image { margin-bottom: 30px; border-radius: 8px; overflow: hidden; }
.post-tags { margin: 30px 0; }
.post-tags a { background: var(--theme-background, #f5f5f5); padding: 5px 10px; border-radius: 4px; font-size: 13px; text-decoration: none; color: var(--theme-text-light, #666); }
.post-share { display: flex; align-items: center; gap: 10px; border-top: 1px solid #eee; padding-top: 20px; margin-top: 20px; }
.share-title { font-size: 16px; margin: 0; }
.share-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: #fff; border-radius: 50%; text-decoration: none; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.whatsapp { background: #25D366; }
.author-box { display: flex; gap: 20px; background: var(--theme-background, #f9f9f9); padding: 20px; border-radius: 8px; margin-top: 30px; }
.author-avatar img { border-radius: 50%; }
.author-name { margin: 0 0 10px; }
.related-posts { margin-top: 40px; }
.comments-area { background: var(--theme-content-bg, #fff); padding: 40px; border-radius: 8px; margin: 30px 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-header .container { position: relative; }
    .main-nav { order: 3; width: 100%; }
    .main-menu { display: none; flex-direction: column; background: var(--theme-content-bg, #fff); position: absolute; top: 100%; left: 0; width: 100%; box-shadow: 0 5px 10px rgba(0,0,0,0.1); }
    .main-menu.mobile-open { display: flex; }
    .mobile-menu-toggle { display: block; }
    .post-title, .page-title { font-size: 28px; }
    .single-post-article, .page-article, .comments-area { padding: 20px; }
}


/* الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .leagues-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .league-content-grid {
        grid-template-columns: 1fr;
    }
    
    .league-news {
        grid-template-columns: 1fr;
    }
    
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .leagues-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
    }
}