/*
Theme Name: زخارف
Theme URI: https://decoration.wordsfn.com
Author: Hussain Al-Malki
Author URI: https://decoration.wordsfn.com
Description: ثيم خفيف ومتجاوب مناسب للسيو وصفحات الزخارف — بدون قوائم جانبية
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zaakhraf
Tags: rtl-language, full-width-template, custom-header, custom-logo, threaded-comments, translation-ready
*/

/* ===========================
   متغيرات — كلها بادئة zk-
   عشان ما تتعارض مع أي إضافة
=========================== */
:root {
    --zk-primary:   #2563eb;
    --zk-primary-h: #1d4ed8;
    --zk-bg:        #ffffff;
    --zk-surface:   #f8fafc;
    --zk-border:    #e2e8f0;
    --zk-text:      #1e293b;
    --zk-muted:     #64748b;
    --zk-font:      'Tajawal', 'Segoe UI', sans-serif;
    --zk-max:       900px;
}

/* ===========================
   قواعد عامة للصفحة فقط
=========================== */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--zk-font);
    background: var(--zk-bg);
    color: var(--zk-text);
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
}

*, *::before, *::after { box-sizing: border-box; }

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

/* ===========================
   هيكل الصفحة — كلاسات zk-
=========================== */
.zk-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.zk-main {
    flex: 1;
    width: 100%;
    max-width: var(--zk-max);
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.zk-main.zk-full {
    max-width: 100%;
    padding: 0;
}

/* ===========================
   الهيدر
=========================== */
.zk-header {
    background: var(--zk-bg);
    border-bottom: 1px solid var(--zk-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: static !important;
    top: auto !important;
}

.zk-logo-row {
    max-width: var(--zk-max);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zk-nav-row {
    border-top: 1px solid var(--zk-border);
    background: var(--zk-surface);
    overflow: visible;
}

.zk-nav-inner {
    max-width: var(--zk-max);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
}

.zk-logo img   { height: 90px; width: auto; display: block; }
.zk-logo-text  { font-size: 1.5rem; font-weight: 700; color: var(--zk-text); text-decoration: none; }
.zk-logo:hover { text-decoration: none; }

.zk-nav ul { list-style: none; display: flex; flex-wrap: nowrap; align-items: center; margin: 0; padding: 0; overflow: visible; }
.zk-nav a { white-space: nowrap; font-size: .85rem; padding: 10px 10px; }
.zk-nav li { position: relative; margin: 0; padding: 0; }

.zk-nav a {
    color: var(--zk-text);
    font-size: .9rem;
    font-weight: 500;
    padding: 10px 14px;
    display: block;
    text-decoration: none;
    transition: color .15s, background .15s;
    white-space: nowrap;
}

.zk-nav a:hover,
.zk-nav .current-menu-item > a,
.zk-nav .current-page-ancestor > a {
    color: var(--zk-primary);
    background: #eff6ff;
    text-decoration: none;
}

/* ===========================
   القائمة المنسدلة — المستوى الأول
=========================== */
.zk-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    background: var(--zk-bg);
    border: 1px solid var(--zk-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 999;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    flex-direction: column;
}

.zk-nav .sub-menu li { width: 100%; position: relative; }

.zk-nav .sub-menu a {
    padding: 10px 16px;
    font-size: .88rem;
    white-space: nowrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* المستوى الثاني (فرعي داخل فرعي) */
.zk-nav .sub-menu .sub-menu {
    top: 0;
    right: 100%;
    left: auto;
    border-radius: 6px;
    box-shadow: -4px 4px 12px rgba(0,0,0,.1);
}

/* ديسكتوب: hover */
@media (min-width: 769px) {
    .zk-nav li:hover > .sub-menu { display: flex; }

    /* سهم للمستوى الأول */
    .zk-nav > ul > .menu-item-has-children > a::after {
        content: ' ▾';
        font-size: .7rem;
        opacity: .6;
    }

    /* سهم للمستوى الثاني (يشير لليسار لأن RTL) */
    .zk-nav .sub-menu .menu-item-has-children > a::after {
        content: '◂';
        font-size: .7rem;
        opacity: .6;
        margin-right: auto;
        margin-left: 0;
        padding-right: 8px;
    }
}

/* موبايل */
@media (max-width: 768px) {
    .zk-nav .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-right: 3px solid var(--zk-border);
        border-radius: 0;
        margin-right: 16px;
        padding: 0;
    }

    /* تداخل إضافي للمستوى الثاني */
    .zk-nav .sub-menu .sub-menu {
        border-right: 3px solid var(--zk-primary);
        margin-right: 16px;
    }

    .zk-nav .menu-item-has-children > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .zk-nav .menu-item-has-children > a::after {
        content: '▾';
        font-size: .8rem;
        transition: transform .2s;
        margin-left: 8px;
    }
    .zk-nav .menu-item-has-children.open > a::after { transform: rotate(180deg); }
    .zk-nav .menu-item-has-children.open > .sub-menu { display: flex; }
}

/* ===========================
   محتوى — محدود داخل .zk-content
=========================== */
.zk-entry-header  { margin-bottom: 28px; }

.zk-entry-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--zk-text);
    margin-bottom: 8px;
}

.zk-entry-meta { font-size: .85rem; color: var(--zk-muted); }

/* ===========================
   فوتر
=========================== */
.zk-footer {
    background: var(--zk-text);
    color: #94a3b8;
    padding: 32px 16px 20px;
    margin-top: 48px;
}

.zk-footer-inner {
    max-width: var(--zk-max);
    margin: 0 auto;
    text-align: center;
}

.zk-footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0 0 20px;
    padding: 0;
}

.zk-footer-links li {
    position: relative;
}

.zk-footer-links li:not(:last-child)::after {
    content: '|';
    margin-right: 8px;
    opacity: .3;
}

.zk-footer-links a {
    color: #cbd5e1;
    font-size: .88rem;
    text-decoration: none;
    transition: color .15s;
    padding: 4px 0;
}

.zk-footer-links a:hover { color: #fff; text-decoration: none; }

.zk-footer-copy {
    font-size: .82rem;
    color: #64748b;
    margin: 0;
}

.zk-footer-copy a {
    color: #94a3b8;
    text-decoration: none;
}

.zk-footer-copy a:hover { color: #fff; }

/* ===========================
   Breadcrumb
=========================== */
.zk-breadcrumb-bar {
    background: var(--zk-surface);
    border-bottom: 1px solid var(--zk-border);
    padding: 6px 16px;
    font-size: .82rem;
    color: var(--zk-muted);
}

.zk-breadcrumb-bar a { color: var(--zk-muted); text-decoration: none; }
.zk-breadcrumb-bar a:hover { color: var(--zk-primary); }

/* ===========================
   همبرجر
=========================== */
.zk-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.zk-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    left: 16px;
}

.zk-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--zk-text);
    border-radius: 2px;
    transition: all .25s;
}

/* X عند الفتح */
.zk-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.zk-hamburger.open span:nth-child(2) { opacity: 0; }
.zk-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   ريسبونسيف
=========================== */
@media (max-width: 768px) {
    .zk-hamburger { display: flex; left: auto; right: auto; position: static; }
    .zk-logo-row {
        justify-content: space-between;
        flex-direction: row-reverse;
        padding: 8px 16px;
    }
    .zk-logo img { height: 60px; }
    .zk-main { padding: 20px 12px 48px; }

    .zk-nav-row {
        display: none;
        border-top: 1px solid var(--zk-border);
        background: var(--zk-bg);
    }

    .zk-nav-row.open { display: block; }

    .zk-nav-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
    }

    .zk-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .zk-nav a {
        padding: 12px 16px;
        width: 100%;
        border-bottom: 1px solid var(--zk-border);
        font-size: .95rem;
    }
}

/* ===========================
   همبرجر JS
=========================== */

/* ===========================
   التعليقات
=========================== */
.zk-comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--zk-border);
}

.zk-comments-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--zk-text);
}

.zk-comment-list { list-style: none; margin: 0 0 32px; padding: 0; }

.zk-comment { padding: 20px 0; border-bottom: 1px solid var(--zk-border); }

.zk-comment-body {
    background: var(--zk-surface);
    border-radius: 10px;
    padding: 16px 20px;
    border-right: 3px solid var(--zk-primary);
}

.zk-comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.zk-comment-author { font-weight: 700; color: var(--zk-text); font-size: .95rem; }
.zk-comment-author a { color: var(--zk-primary); text-decoration: none; }
.zk-comment-date { font-size: .8rem; color: var(--zk-muted); }
.zk-comment-content { font-size: .95rem; line-height: 1.75; color: var(--zk-text); margin-bottom: 10px; }
.zk-comment-content p { margin: 0; }
.zk-comment-reply a { font-size: .82rem; color: var(--zk-primary); text-decoration: none; }

/* نموذج التعليق */
.zk-comment-form-wrap {
    background: var(--zk-surface);
    border-radius: 12px;
    padding: 28px;
    border: 1px solid var(--zk-border);
}

.zk-comment-form-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; color: var(--zk-text); }

.zk-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.zk-form-group { margin-bottom: 16px; }

.zk-form-group label {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--zk-text);
}

.zk-required { color: #e53e3e; }

.zk-form-group input,
.zk-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--zk-border);
    border-radius: 8px;
    font-family: var(--zk-font);
    font-size: .95rem;
    background: var(--zk-bg);
    color: var(--zk-text);
    direction: rtl;
    transition: border-color .15s, box-shadow .15s;
}

.zk-form-group input:focus,
.zk-form-group textarea:focus,
#zk_captcha:focus {
    outline: none;
    border-color: var(--zk-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.zk-form-group textarea { resize: vertical; min-height: 120px; }

.zk-captcha-wrap {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.zk-captcha-wrap label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--zk-text);
}

#zk_captcha {
    width: 120px;
    padding: 8px 14px;
    border: 1px solid var(--zk-border);
    border-radius: 8px;
    font-size: .95rem;
    font-family: var(--zk-font);
    direction: ltr;
    text-align: center;
}

.zk-submit-btn {
    background: var(--zk-primary);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-family: var(--zk-font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.zk-submit-btn:hover { background: var(--zk-primary-h); transform: translateY(-1px); }

@media (max-width: 640px) {
    .zk-form-row { grid-template-columns: 1fr; }
    .zk-comment-form-wrap { padding: 16px; }
}

/* ===========================
   أيقونات المشاركة
=========================== */
.zk-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--zk-border);
    flex-wrap: wrap;
}

.zk-share-label {
    font-size: .88rem;
    font-weight: 600;
    color: var(--zk-muted);
    white-space: nowrap;
}

.zk-share-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.zk-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--share-color, #64748b);
    color: #fff;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.zk-share-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.zk-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
    text-decoration: none;
    color: #fff;
}

.zk-share-btn.zk-share-copy svg { fill: none; stroke: #fff; }

/* تأثير النسخ */
.zk-share-btn.copied { background: #10b981 !important; }

/* ===========================
   صفحات ذات صلة
=========================== */
.zk-related {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--zk-border);
}

.zk-related-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--zk-text);
    margin-bottom: 16px;
}

.zk-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.zk-related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--zk-surface);
    border: 1px solid var(--zk-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--zk-text);
    font-size: .9rem;
    font-weight: 500;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    line-height: 1.4;
}

.zk-related-item:hover {
    border-color: var(--zk-primary);
    box-shadow: 0 2px 8px rgba(37,99,235,.12);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--zk-primary);
}

.zk-related-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.zk-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zk-related-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    font-size: 1.4rem;
}

@media (max-width: 640px) {
    .zk-related-list { grid-template-columns: 1fr; }
}
