/* ==========================================================================
   יניב אפרים — מאגר ידע אישי
   גיליון עיצוב משותף (RTL) לכל הדפים
   ========================================================================== */

/* מצב כהה הוא ברירת המחדל; מצב בהיר הוא אופציה שנבחרת דרך הכפתור בסרגל הצד. */
:root {
  --color-bg: #1c1815;
  --color-bg-alt: #262019;
  --color-surface: #221d18;
  --color-text: #f1e9dd;
  --color-text-muted: #a89a8a;
  --color-border: #3c352c;
  --color-accent: #e08a5f;
  --color-accent-dark: #f0a878;
  --color-accent-soft: #3a2a20;

  --font-serif: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --font-sans: 'Assistant', 'Segoe UI', Tahoma, sans-serif;

  --sidebar-width: 272px;
  --max-width: 900px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
  --color-bg: #faf7f2;
  --color-bg-alt: #f1ebe0;
  --color-surface: #ffffff;
  --color-text: #2b2620;
  --color-text-muted: #6b6255;
  --color-border: #e3dac9;
  --color-accent: #a45c40;
  --color-accent-dark: #7c4530;
  --color-accent-soft: #f0e0d3;
  --shadow: 0 1px 3px rgba(43, 38, 32, 0.06), 0 6px 20px rgba(43, 38, 32, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

img { max-width: 100%; }

a {
  color: var(--color-accent-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-accent-dark);
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------- */
/* App shell: sidebar + main content                                      */
/* ---------------------------------------------------------------------- */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
}

/* Mobile top bar (menu toggle only — no link list) */
.mobile-topbar {
  display: none;
  position: sticky;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  top: 0;
  z-index: 150;
}
.mobile-topbar .mobile-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
}
.menu-toggle {
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 40px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.35);
  z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* ---------------------------------------------------------------------- */
/* Sidebar navigation                                                     */
/* ---------------------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-inline-end: 1px solid var(--color-border);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 18px;
}
.sidebar-bottom-links {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--color-border);
}
.sidebar-bottom-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.sidebar-bottom-links a:hover {
  background: var(--color-bg-alt);
  color: var(--color-accent-dark);
  text-decoration: none;
}
.sidebar-bottom-links a.active {
  color: var(--color-accent-dark);
  font-weight: 700;
}

.sidebar-brand {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}
.sidebar-brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-accent-dark);
  margin-top: 3px;
}
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 18px 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--color-accent-soft); }

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav .nav-item { margin-bottom: 3px; }

.sidebar-nav .nav-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-nav .nav-link {
  flex: 1;
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}
.sidebar-nav .nav-link:hover {
  background: var(--color-bg-alt);
  text-decoration: none;
}
.sidebar-nav .nav-item.active > .nav-row > .nav-link {
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
}

.caret-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 6px;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}
.caret-btn:hover { background: var(--color-bg-alt); }
.nav-item.open > .nav-row .caret-btn { transform: rotate(180deg); }

.sidebar-nav .nav-children {
  list-style: none;
  margin: 3px 0 10px;
  padding-inline-start: 16px;
  border-inline-start: 2px solid var(--color-accent-soft);
  display: none;
}
.nav-item.open > .nav-children { display: block; }
.nav-children li a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--color-text);
}
.nav-children li a:hover {
  background: var(--color-accent-soft);
  text-decoration: none;
}
.nav-children li a.active {
  color: var(--color-accent-dark);
  font-weight: 700;
}

/* Breadcrumb */
.breadcrumb {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.breadcrumb .wrap { padding-top: 10px; padding-bottom: 10px; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent-dark); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.6; }
.breadcrumb .current { color: var(--color-text); font-weight: 700; }

/* Mobile: sidebar becomes an off-canvas drawer */
@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    max-width: 82vw;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 200;
    box-shadow: var(--shadow);
  }
  .sidebar.mobile-open { transform: translateX(0); }
}

/* ---------------------------------------------------------------------- */
/* Hero (home page)                                                       */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 60px 0 44px;
  border-bottom: 1px solid var(--color-border);
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 18px;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 62ch;
  margin: 0 0 22px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }

/* ---------------------------------------------------------------------- */
/* Card grid (home + hub pages)                                          */
/* ---------------------------------------------------------------------- */

.section { padding: 44px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 { margin: 0; font-size: 1.5rem; }
.section-head .muted { color: var(--color-text-muted); font-size: 0.9rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  display: block;
  color: var(--color-text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}
.card .card-icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-family: var(--font-sans);
  font-weight: 700;
}
.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}
.card .card-tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent-dark);
}

.list-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-links li a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 700;
}
.list-links li a:hover { color: var(--color-accent-dark); text-decoration: none; }
.list-links li .meta {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Article page                                                           */
/* ---------------------------------------------------------------------- */

.article-header { padding: 40px 0 28px; border-bottom: 1px solid var(--color-border); }
.article-header h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 6px 0 14px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.article-body {
  padding: 36px 28px 20px;
  max-width: 68ch;
  margin: 0 auto;
}
.article-body h2 { font-size: 1.4rem; margin: 34px 0 14px; }
.article-body h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-inline-start: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 20px 0;
  padding: 4px 20px;
  border-inline-start: 3px solid var(--color-accent);
  color: var(--color-text-muted);
  font-style: italic;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: start;
}
.article-body th {
  background: var(--color-bg-alt);
  font-family: var(--font-serif);
  font-weight: 600;
}
.callout {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.94rem;
}
.callout strong { color: var(--color-accent-dark); }

.article-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0 48px;
}
.related-title { font-size: 1rem; margin-bottom: 14px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------------- */
/* Footer                                                                 */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 26px 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer-legal {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.site-footer-legal ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.site-footer-legal a {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}
.site-footer-legal a:hover {
  color: var(--color-accent-dark);
}

/* מפת אתר (about-kb) */
.sitemap-section { margin-bottom: 24px; }
.sitemap-section:last-child { margin-bottom: 0; }
.sitemap-section h3 {
  font-size: 1.02rem;
  margin: 0 0 10px;
}
.sitemap-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sitemap-list > li {
  margin-bottom: 8px;
  font-weight: 600;
}
.sitemap-list ul {
  list-style: none;
  margin: 6px 0 0;
  padding-inline-start: 18px;
}
.sitemap-list ul li {
  margin-bottom: 4px;
  font-weight: 400;
}
.sitemap-list ul a {
  color: var(--color-text-muted);
}

.footer-utility {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.footer-utility a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.footer-utility a:hover {
  color: var(--color-accent-dark);
}

/* Utility */
.muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }

/* ==========================================================================
   הערות סקירה פנימיות
   הערות שנשמרות דרך מצב הסקירה (assets/js/review.js) נשארות בתוך קובץ ה-HTML,
   אבל הן חומר עבודה פנימי ואסור שיוצגו למבקרים באתר החי. לכן הן מוסתרות כאן
   כברירת מחדל; review.js — שנטען רק ב-localhost — מחזיר אותן לתצוגה.
   ========================================================================== */
.kb-note { display: none; }
