@charset "UTF-8";

:root {
    --primary: #1e3a8a;
    --primary-dark: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

/* איפוס ללא דריסת פונטים גלובלית */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    font-family: 'Assistant', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--primary);
    color: white;
    padding: 1.4rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.site-nav-links {
    margin-top: 0.5rem;
    font-size: 0.95rem;
}
.site-nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    margin: 0 0.6rem;
    font-weight: 500;
    transition: color 0.15s;
}
.site-nav-links a:hover {
    color: #ffffff;
}

.site-container {
    max-width: 980px;
    width: 100%;
    margin: 1.6rem auto;
    padding: 0 1rem;
    flex: 1;
}
.site-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.4rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* התראות */
.alert-msg {
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* טאבים לניהול */
.admin-nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.admin-tab {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    transition: all 0.2s;
}
.admin-tab:hover { background: #e2e8f0; color: var(--text-main); }
.admin-tab.active { background: var(--accent); color: white; }

/* פאנל סינון וטפסים רגילים */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.3rem;
    margin-bottom: 1.5rem;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.8rem;
}
.filter-row-search {
    margin-bottom: 0.8rem;
    display: flex;
    gap: 0.5rem;
}
.filter-row-search input {
    flex: 1;
}

/* שדות טופס - מוגדרים בצורה שלא דורסת תפריטים צפים */
.form-input, 
.form-select, 
.form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
    outline: none;
}
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: #334155;
}

.compact-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.2rem;
}

/* לחצנים */
button, .btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.65rem 1.3rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--accent-hover); }
.btn-reset { background: #64748b; }
.btn-reset:hover { background: #475569; }
.btn-edit { background: #0284c7; font-size: 0.85rem; padding: 0.35rem 0.7rem; border-radius: 6px; }
.btn-delete { background: #dc2626; font-size: 0.85rem; padding: 0.35rem 0.7rem; border-radius: 6px; }
.btn-secondary { background: #e2e8f0; color: #1e293b; }

/* פלטת 10 צבעים */
.palette-container {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #94a3b8;
    cursor: pointer;
    transition: transform 0.15s;
}
.color-swatch:hover, .color-swatch.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--accent);
}

/* התאמות ל-Summernote (עורך התוכן העשיר) */
.note-editor.note-frame {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    background: white;
}
.note-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 8px 8px 0 0 !important;
    direction: rtl;
    text-align: right;
    padding: 6px !important;
}
.note-editor .note-editable {
    direction: rtl;
    text-align: right;
    min-height: 420px;
    padding: 1.2rem;
    font-size: 1.1rem;
    line-height: 1.85;
}
/* תיקון קריטי: רשימות נפתחות בעורך יהיו צפות ולא יתפסו 100% רוחב */
.note-dropdown-menu {
    width: auto !important;
    min-width: 170px !important;
    max-width: 260px !important;
    max-height: 280px;
    overflow-y: auto;
    direction: rtl;
    text-align: right;
}
.note-btn {
    width: auto !important;
    font-size: 0.85rem !important;
}

/* אקורדיון פריטים */
.accordion-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.accordion-header {
    padding: 1.1rem 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.15s;
}
.accordion-header:hover { background: #f8fafc; }
.accordion-item.is-open .accordion-header { background: #f8fafc; border-bottom: 1px solid var(--border-light); }
.post-title { margin: 0 0 0.35rem 0; color: var(--primary); font-size: 1.18rem; font-weight: 700; }
.post-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.accordion-body-wrapper { display: none; }
.accordion-item.is-open .accordion-body-wrapper { display: block !important; }
.accordion-content { padding: 1.4rem 1.5rem; line-height: 1.9; font-size: 1.08rem; color: #1e293b; }
.tag-clickable { background: #f1f5f9; color: #334155; padding: 0.2rem 0.55rem; border-radius: 6px; font-size: 0.82rem; text-decoration: none; display: inline-block; }

/* כרטיסי קטגוריות */
.category-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.category-card-header {
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}
.category-card-body { padding: 1.2rem; }
.subgroup-chip-selectable {
    background: #f8fafc;
    font-size: 0.88rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.4rem;
}

/* Footer & Modals */
footer.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 1.8rem;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
}
.footer-links a { color: #cbd5e1; text-decoration: none; margin: 0 0.8rem; }
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal-box {
    background: white;
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    padding: 1.6rem;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
}