/* הצבעים, הגופן והגדלים מגיעים מממשק הניהול (theme-vars). כאן ערכי ברירת מחדל ונגזרות. */
:root {
  --accent: #5b5bf0; --accent-2: #0ea5c6;
  --bg: #f6f7fb; --surface: #fff; --text: #141a2e; --muted: #5d6680; --border: #e3e6f0;
  --radius: 16px; --icon: 48px; --fs: 17px; --maxw: 1180px;
  --font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
:root {
  --bg-2: color-mix(in srgb, var(--bg) 90%, var(--text) 4%);
  --surface-2: color-mix(in srgb, var(--surface) 92%, var(--text) 5%);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --radius-sm: calc(var(--radius) * .65);
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / .07), 0 16px 40px rgb(0 0 0 / .13);
  --code-bg: #0f1424; --code-text: #dfe6ff;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 840px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ic { flex: none; width: 1.25em; height: 1.25em; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
kbd { font-family: var(--mono); font-size: .72em; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.only-dark, .only-light { display: none; }
html:not([data-theme="dark"]) .only-light { display: inline-flex; }
html[data-theme="dark"] .only-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .only-dark { display: inline-flex; }
  html:not([data-theme]) .only-light { display: none; }
}

/* ===== Tile: מסגרת אחידה לכל אייקון באתר ===== */
.tile {
  --t: var(--icon);
  width: var(--t); height: var(--t); flex: none; display: grid; place-items: center;
  border-radius: calc(var(--t) * .28); background: var(--surface); border: 1px solid var(--border);
  color: var(--accent); overflow: hidden;
}
.tile img { width: 72%; height: 72%; object-fit: contain; }
.tile .ic { width: 52%; height: 52%; }
.tile-lg { --t: calc(var(--icon) * 1.15); }
.tile-sm { --t: calc(var(--icon) * .75); }
.tile-accent { background: var(--accent-soft); border-color: transparent; }

/* ===== Header ===== */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 1.25rem; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 700; }
.brand-text small { font-size: .75rem; color: var(--muted); }
.nav { display: flex; gap: 2px; margin-inline-start: auto; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--muted); font-size: .92rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-ic { width: 18px; height: 18px; display: grid; place-items: center; }
.nav-ic img, .nav-ic .ic { width: 18px; height: 18px; object-fit: contain; }
.tools { display: flex; gap: 4px; flex: none; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); text-decoration: none; }
.menu-btn { display: none; }
/* The header row is a bit wider than the content, so the full menu fits on common desktop screens */
.topbar-in { max-width: max(var(--maxw), 1440px); }
/* Set by the script in base.html according to the space actually available (screen width and browser zoom):
   nav-wrap    – the menu doesn't fit next to the logo, so it moves to its own row below (up to two lines)
   nav-compact – it doesn't fit even there, so it folds into the ☰ button */
.nav-wrap .topbar-in { flex-wrap: wrap; row-gap: 0; }
.nav-wrap .tools { margin-inline-start: auto; }
.nav-wrap .nav { order: 3; flex-basis: 100%; flex-wrap: wrap; justify-content: center; margin-inline: 0; padding: 6px 0 8px; border-top: 1px solid var(--border); }
.nav-compact .menu-btn { display: inline-grid; }
.nav-compact .tools { margin-inline-start: auto; }
.nav-compact .nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 4px; padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); max-height: calc(100dvh - 64px); overflow-y: auto; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; margin: 0; }
.nav-compact .nav.open { opacity: 1; transform: none; pointer-events: auto; }
.nav-compact .nav a { font-size: 1.02rem; padding: 11px 14px; border-radius: 12px; gap: 12px; }
.nav-compact .nav-ic, .nav-compact .nav-ic img, .nav-compact .nav-ic .ic { width: 22px; height: 22px; }
@media (min-width: 700px) {
  .nav-compact .nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 520px) { .brand-text small { display: none; } }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1; background: radial-gradient(40% 60% at 70% 30%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), radial-gradient(35% 55% at 25% 20%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%); filter: blur(10px); }
.hero.has-img::after, .page-hero.has-img::after { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--hero-img) center / cover no-repeat; opacity: .22; }
.hero-in { max-width: 860px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgb(34 197 94 / .18); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.1; margin: 0 0 18px; font-weight: 800; letter-spacing: -.02em; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); margin: 0 0 28px; max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-size: 1rem; }
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2))); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.pill { background: rgb(255 255 255 / .22); padding: 0 8px; border-radius: 999px; font-size: .85rem; }

.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: 40px 0 28px; border-bottom: 1px solid var(--border); background: var(--hero-bg, linear-gradient(180deg, var(--bg-2), var(--bg))); }
.page-hero h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1.2; margin: 8px 0 0; font-weight: 800; overflow-wrap: anywhere; }
.page-blurb { margin: 10px 0 0; color: var(--muted); }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin: 12px 0 0; font-size: .95rem; }

/* ===== Sections ===== */
.section { padding-block: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title { font-size: 1.5rem; margin: 0 0 18px; font-weight: 800; }
.more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.content { padding-block: 28px 56px; }
.home-blocks { padding-top: 8px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 88px; }
.cat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.cat strong { display: block; font-size: 1.05rem; }
.cat small { color: var(--muted); font-size: .85rem; line-height: 1.4; display: block; }

/* ===== Post cards — תמונה ממוזערת באותו יחס לכולן ===== */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.post-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-thumb { aspect-ratio: 16 / 9; background: var(--surface-2); display: block; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.post-thumb-ph .ic, .post-thumb-ph img { width: 56px; height: 56px; }
.post-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.post-date { font-size: .8rem; color: var(--muted); }
.post-title { font-weight: 700; font-size: 1.06rem; line-height: 1.35; }
.post-excerpt { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Links — כל קישור: אייקון באותו גודל + כותרת + דומיין ===== */
.links { list-style: none; margin: 14px 0 28px; padding: 0; display: grid; gap: 10px; }
.links-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.links-list { grid-template-columns: 1fr; max-width: 820px; }
.links-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.links-title { margin: 24px 0 4px; font-size: 1.15rem; }
.link { height: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.link .tile { background: var(--surface-2); border-color: transparent; }
.link-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.link-title { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-desc { font-size: .85rem; color: var(--muted); }
.link-host { font-size: .78rem; color: var(--muted); direction: ltr; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.link-go { color: var(--muted); opacity: .6; flex: none; }
.link:hover .link-go { color: var(--accent); opacity: 1; }
.links-tiles .link { flex-direction: column; text-align: center; padding: 18px 12px 14px; gap: 10px; }
.links-tiles .tile { --t: calc(var(--icon) * 1.25); }
.links-tiles .link-body { align-items: center; }
.links-tiles .link-title, .links-tiles .link-host { text-align: center; }
.links-tiles .link-go { display: none; }

/* ===== Blocks ===== */
.blk { color: var(--blk-color, inherit); font-size: calc(1em * var(--blk-scale, 1)); }
.blk.has-bg { background: var(--blk-bg); padding: 18px 22px; border-radius: var(--radius); margin-block: 14px; }
.blk.has-color .block-h, .blk.has-color .prose { color: var(--blk-color); }
.al-center { text-align: center; } .al-center .prose p, .al-center .block-h { text-align: center; }
.al-left { text-align: left; } .al-left .prose p, .al-left .block-h { text-align: left; }
.al-center .btn { margin-inline: auto; } .blk-button { display: flex; } .blk-button.al-center { justify-content: center; } .blk-button.al-left { justify-content: flex-end; }
.w-narrow { max-width: 640px; margin-inline: auto; } .w-normal { max-width: 860px; margin-inline: auto; } .w-wide { max-width: 100%; }
.w-full { width: 100vw; position: relative; inset-inline-start: 50%; margin-inline-start: -50vw; padding-inline: max(16px, calc((100vw - var(--maxw)) / 2 + 16px)); border-radius: 0 !important; }

.block-h { margin: 34px 0 10px; line-height: 1.3; font-weight: 800; unicode-bidi: plaintext; text-align: start; }
h2.block-h { font-size: 1.55em; } h3.block-h { font-size: 1.25em; }
.content > .blk:first-child .block-h { margin-top: 0; }
.prose { margin: 10px 0 18px; overflow-wrap: anywhere; }
.prose p { margin: 0 0 14px; unicode-bidi: plaintext; text-align: start; }
.prose h2, .prose h3, .prose h4 { line-height: 1.3; margin: 28px 0 10px; unicode-bidi: plaintext; text-align: start; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 14px; }
.prose li { margin-block: 4px; unicode-bidi: plaintext; }
.prose img { border-radius: var(--radius-sm); margin: 12px auto; max-height: 420px; width: auto; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.prose pre { position: relative; background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: 12px; overflow-x: auto; direction: ltr; text-align: left; font-family: var(--mono); font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose blockquote { margin: 14px 0; padding: 10px 16px; border-inline-start: 4px solid var(--accent); background: var(--accent-soft); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--border); padding: 8px 10px; }
.copy { position: absolute; top: 8px; left: 8px; font-size: .75rem; padding: 4px 10px; border-radius: 8px; border: 1px solid #2a3458; background: #141b33; color: #c8d1f5; cursor: pointer; }

/* תמונות: ארבעה גדלים קבועים — הכול מסודר ואחיד */
.figure { margin: 18px auto; }
.figure img { border-radius: var(--radius-sm); margin-inline: auto; box-shadow: var(--shadow); width: 100%; height: 100%; object-fit: cover; }
.fig-s { max-width: 320px; } .fig-s img { aspect-ratio: 4 / 3; }
.fig-m { max-width: 560px; } .fig-m img { aspect-ratio: 16 / 10; }
.fig-l { max-width: 860px; } .fig-l img { aspect-ratio: 16 / 9; }
.fig-full { max-width: 100%; } .fig-full img { object-fit: contain; height: auto; max-height: 80vh; }
.figure img[src$=".gif"] { object-fit: contain; background: var(--surface-2); }
.figure figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 8px; }
.zoom { border: 0; padding: 0; background: none; cursor: zoom-in; display: block; width: 100%; }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin: 18px auto 24px; box-shadow: var(--shadow); display: block; max-width: 860px; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .88; transition: opacity .2s; }
.video:hover img { opacity: 1; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(255 255 255 / .92); color: #e11d48; cursor: pointer; box-shadow: 0 10px 30px rgb(0 0 0 / .35); transition: transform .15s; }
.video .play .ic { width: 28px; height: 28px; margin-inline-start: 4px; fill: currentColor; }
.video:hover .play { transform: scale(1.08); }
.video-note { position: absolute; bottom: 12px; inset-inline-start: 12px; background: rgb(0 0 0 / .7); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: .85rem; }

.audio { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px 16px; margin: 12px 0; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.audio .tile { grid-row: span 2; }
.audio-meta { display: flex; flex-direction: column; line-height: 1.35; }
.audio-meta small { color: var(--muted); }
.audio audio { width: 100%; height: 40px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 18px 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
/* תמונות זו לצד זו — שלמות (בלי חיתוך), באותו גובה */
.gallery-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.gallery-row .zoom { width: auto; flex: 0 1 auto; margin: 0; }
.gallery-row img { width: auto; height: var(--row-h, 240px); max-width: 100%; aspect-ratio: auto; object-fit: contain; box-shadow: var(--shadow); }
.al-right .gallery-row { justify-content: flex-start; } .al-left .gallery-row { justify-content: flex-end; }
@media (max-width: 600px) { .gallery-row img { height: auto; max-height: var(--row-h, 240px); } .gallery-row .zoom { flex-basis: calc(50% - 7px); } .gallery-row img { width: 100%; } }
.map { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin: 18px 0; }
.map iframe { width: 100%; height: 100%; border: 0; }
.accordion { display: grid; gap: 10px; margin: 18px 0; }
.accordion details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.accordion summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.accordion summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.accordion details[open] summary::after { content: "−"; }
.acc-body { padding: 12px 18px; border-top: 1px solid var(--border); }
.divider { border: 0; height: 1px; background: var(--border); margin: 32px 0; }

/* ===== Pager / filter / search ===== */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 56px; }
.pager-link { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pager-link:hover { text-decoration: none; border-color: var(--accent); }
.pager-link small { color: var(--muted); }
.pager-link span { font-weight: 600; }
.pager-old { text-align: left; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager-old { text-align: start; } }
.filter { display: flex; align-items: center; gap: 10px; margin-top: 20px; max-width: 460px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.filter input { flex: 1; border: 0; background: none; padding: 12px 0; font: inherit; color: var(--text); outline: none; min-width: 0; }
.empty { text-align: center; padding: 40px 0; }
dialog { color: var(--text); }
dialog::backdrop { background: rgb(5 8 20 / .55); backdrop-filter: blur(4px); }
.search { width: min(640px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-hover); margin-top: 10vh; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-box input { flex: 1; border: 0; background: none; font: inherit; font-size: 1.1rem; color: var(--text); outline: none; min-width: 0; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); text-decoration: none; }
.search-results strong { display: block; unicode-bidi: plaintext; text-align: start; }
.search-results small { color: var(--muted); }
.search-results .none { padding: 16px; color: var(--muted); text-align: center; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 12px; }
.lb-close { position: absolute; top: -48px; left: 0; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 32px 0; margin-top: 24px; }
.footer-in { display: grid; gap: 16px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--muted); font-size: .92rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.footer-bottom p { margin: 0; }
.admin-link { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; }
.admin-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.edit-fab { position: fixed; bottom: 20px; left: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-hover); }
.edit-fab:hover { text-decoration: none; filter: brightness(1.15); }

.hero-404 { text-align: center; }
.hero-404 .hero-in { margin-inline: auto; }
.hero-404 .hero-actions { justify-content: center; }
.code-404 { font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; line-height: 1; margin: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (max-width: 600px) {
  body { font-size: calc(var(--fs) - 1px); }
  .hero { padding: 48px 0 36px; }
  .links-grid { grid-template-columns: 1fr; }
  .links-tiles { grid-template-columns: repeat(2, 1fr); }
  .hero-actions kbd { display: none; }
  .fig-s, .fig-m { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* =====================================================================
   גופן כותרות (לפי התבנית)
   ===================================================================== */
:root { --font-h: var(--font); }
h1, h2, h3, .block-h, .section-title, .post-title, .ib-title, .cat strong, .links-title, .brand-text strong { font-family: var(--font-h); }

/* =====================================================================
   עיצוב לכל רכיב (כמו Elementor): ריפוד, שוליים, רקע, מסגרת, צל, אנימציה
   ===================================================================== */
.has-bg { background: var(--blk-bg, transparent); }
.has-img { position: relative; isolation: isolate; background: var(--blk-img) center / cover no-repeat, var(--blk-bg, transparent); padding: 28px 26px; border-radius: var(--radius); overflow: hidden; }
.has-img::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #000; opacity: var(--blk-ov, 0); }
.has-pady { padding-block: var(--pad-y) !important; }
.has-padx { padding-inline: var(--pad-x) !important; }
.has-mt { margin-top: var(--mt) !important; }
.has-mb { margin-bottom: var(--mb) !important; }
.has-radius { border-radius: var(--blk-r) !important; overflow: hidden; }
.has-radius .figure img, .has-radius .gallery img { border-radius: calc(var(--blk-r) * .7); }
.has-maxw { max-width: var(--blk-maxw); margin-inline: auto; }
.has-border { border: var(--bw) solid var(--bc); border-radius: var(--blk-r, var(--radius)); }
.has-border:not(.has-pady):not(.has-bg) { padding: 16px 20px; }
.has-fw, .has-fw .block-h, .has-fw .prose { font-weight: var(--fw); }
.sh-sm { box-shadow: var(--shadow); }
.sh-md { box-shadow: 0 4px 10px rgb(0 0 0 / .07), 0 18px 40px rgb(0 0 0 / .12); }
.sh-lg { box-shadow: 0 10px 25px rgb(0 0 0 / .1), 0 30px 70px rgb(0 0 0 / .2); }
[class*="sh-"]:not(.has-bg):not(.has-border) { background: var(--surface); border-radius: var(--blk-r, var(--radius)); padding: 18px 22px; }
.va-center { align-self: center; } .va-bottom { align-self: end; } .va-top { align-self: start; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (min-width: 769px) { .hide-desktop { display: none !important; } }

/* אנימציות כניסה (מופעלות כשהרכיב נכנס למסך) */
html.js .anim { opacity: 0; transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
html.js .anim-up { transform: translateY(36px); }
html.js .anim-down { transform: translateY(-36px); }
html.js .anim-right { transform: translateX(48px); }
html.js .anim-left { transform: translateX(-48px); }
html.js .anim-zoom { transform: scale(.88); }
html.js .anim.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .anim { opacity: 1; transform: none; } }

/* =====================================================================
   שורות ועמודות — תמונות / טקסט / כל רכיב זה לצד זה
   ===================================================================== */
.row-grid { display: grid; grid-template-columns: var(--cols, 1fr 1fr); gap: var(--gap, 24px); align-items: start; margin-block: 18px; }
.row-grid.va-center { align-items: center; } .row-grid.va-bottom { align-items: end; } .row-grid.va-stretch { align-items: stretch; }
.row-grid > .col { min-width: 0; }
.col > .blk:first-child > .block-h, .col > .blk:first-child .prose > :first-child { margin-top: 0; }
.col .figure { margin-block: 0 12px; }
.col .fig-s, .col .fig-m, .col .fig-l { max-width: 100%; }
.col .video { margin-block: 0 12px; }
.col .links-grid { grid-template-columns: 1fr; }
.col .gallery-row { justify-content: flex-start; }
.row-grid.va-stretch > .col > .blk:only-child, .row-grid.va-stretch > .col > .blk:only-child > .iconbox { height: 100%; }
@media (max-width: 768px) {
  .row-stack { grid-template-columns: 1fr; }
  .row-stack.row-rev > .col { order: calc(var(--n) - var(--i)); }
}

/* קופסת אייקון */
.iconbox { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); height: 100%; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.iconbox:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ib-side { flex-direction: row; text-align: start; align-items: flex-start; }
.ib-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ib-title { font-size: 1.15em; line-height: 1.3; }
.ib-text { margin: 0; color: var(--muted); font-size: .95em; }
.ib-text p:last-child { margin-bottom: 0; }
.has-color .iconbox, .has-color .ib-text { color: var(--blk-color); }

/* =====================================================================
   תבניות: כותרת עליונה
   ===================================================================== */
[data-header="solid"] .topbar { background: var(--accent); border-bottom: 0; backdrop-filter: none; }
[data-header="solid"] .brand, [data-header="solid"] .brand-text small { color: #fff; }
[data-header="solid"] .brand-text small { opacity: .8; }
[data-header="solid"] .brand-mark { background: rgb(255 255 255 / .18); box-shadow: none; }
[data-header="solid"] .icon-btn { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .2); color: #fff; }
html:not(.nav-compact)[data-header="solid"] .nav a { color: rgb(255 255 255 / .85); }
html:not(.nav-compact)[data-header="solid"] .nav a:hover, html:not(.nav-compact)[data-header="solid"] .nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .16); }
[data-header="centered"] .topbar { background: var(--bg); backdrop-filter: none; border-bottom: 3px double var(--border); }
[data-header="centered"] .topbar-in { position: relative; flex-wrap: wrap; justify-content: center; padding-block: 12px; }
[data-header="centered"] .brand { flex-basis: 100%; justify-content: center; }
[data-header="centered"] .brand-text { align-items: center; }
[data-header="centered"] .brand-text strong { font-size: 1.6rem; }
[data-header="centered"] .tools { position: absolute; left: 16px; top: 16px; }
html:not(.nav-compact)[data-header="centered"] .nav { margin-inline: auto; justify-content: center; border-top: 1px solid var(--border); padding-top: 8px; flex-basis: 100%; }
.nav-compact[data-header="centered"] .nav { inset-block-start: 100%; position: absolute; }
[data-header="minimal"] .topbar { background: var(--bg); backdrop-filter: none; border-bottom-color: transparent; }
[data-header="minimal"] .brand-mark { background: var(--text); color: var(--bg); box-shadow: none; }
[data-header="minimal"] .nav-ic { display: none; }
[data-header="minimal"] .icon-btn { border-color: transparent; background: transparent; }
[data-header="floating"] .topbar { top: 12px; margin: 12px auto 0; width: calc(100% - 24px); max-width: calc(var(--maxw) + 24px); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); }
.nav-compact[data-header="floating"] .nav { border-radius: 22px; inset: 72px 12px auto; }

/* =====================================================================
   תבניות: אזור הפתיחה (Hero)
   ===================================================================== */
[data-hero="center"] .hero-in { margin-inline: auto; text-align: center; }
[data-hero="center"] .lead { margin-inline: auto; }
[data-hero="center"] .hero-actions { justify-content: center; }
[data-hero="split"] .hero-wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-art { display: none; }
[data-hero="split"] .hero-art { display: block; }
[data-hero="split"] .hero-art img { border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow-hover); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; justify-items: center; padding: 20px; }
.hero-tiles .tile { --t: calc(var(--icon) * 1.9); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transform: rotate(-4deg); }
.hero-tiles .tile:nth-child(even) { transform: rotate(5deg) translateY(16px); }
@media (max-width: 860px) { [data-hero="split"] .hero-wrap { grid-template-columns: 1fr; } [data-hero="split"] .hero-art { display: none; } }
[data-hero="compact"] .hero { padding: 44px 0 30px; border-bottom: 1px solid var(--border); }
[data-hero="compact"] .hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
[data-hero="compact"] .lead { margin-bottom: 20px; }
[data-hero="bold"] .hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; padding: 84px 0 72px; }
[data-hero="bold"] .hero .grad { background: none; -webkit-text-fill-color: #fff; color: #fff; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 10px; text-decoration-color: rgb(255 255 255 / .5); }
[data-hero="bold"] .hero .lead { color: rgb(255 255 255 / .88); }
[data-hero="bold"] .hero .eyebrow { background: rgb(255 255 255 / .14); border-color: rgb(255 255 255 / .25); color: #fff; }
[data-hero="bold"] .hero .btn-primary { background: #fff; color: var(--accent); box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
[data-hero="bold"] .hero .btn-ghost { background: transparent; border-color: rgb(255 255 255 / .55); color: #fff; }
[data-hero="bold"] .hero kbd { background: rgb(255 255 255 / .15); color: #fff; border-color: transparent; }
[data-hero="terminal"] .hero { background: var(--surface); border-bottom: 1px solid var(--border); }
[data-hero="terminal"] .hero-in { border: 1px solid var(--border); border-radius: var(--radius); padding: 44px 32px 32px; background: var(--bg); position: relative; max-width: 900px; }
[data-hero="terminal"] .hero-in::before { content: "● ● ●"; position: absolute; top: 10px; inset-inline-end: 14px; letter-spacing: 4px; font-size: .7rem; color: var(--muted); }
[data-hero="terminal"] .hero h1 { font-family: var(--mono); font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -.02em; }
[data-hero="terminal"] .hero .grad { background: none; -webkit-text-fill-color: var(--accent); color: var(--accent); }
.prompt { color: var(--accent); direction: ltr; unicode-bidi: isolate; }
.cursor { display: inline-block; width: .55em; height: 1em; background: var(--accent); margin-inline-start: 6px; vertical-align: -.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =====================================================================
   תבניות: סגנון כרטיסים
   ===================================================================== */
[data-card="flat"] :is(.cat, .post-card, .link, .iconbox, .audio, .pager-link) { box-shadow: none; }
[data-card="flat"] :is(.cat, .post-card, .link, .iconbox):hover { transform: none; box-shadow: none; border-color: var(--accent); }
[data-card="outline"] :is(.cat, .post-card, .link, .iconbox, .audio) { background: transparent; box-shadow: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
[data-card="outline"] :is(.cat, .post-card, .link, .iconbox):hover { background: var(--accent-soft); box-shadow: none; }
[data-card="outline"] .link .tile, [data-card="outline"] .cat .tile { background: transparent; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
[data-card="elevated"] :is(.cat, .post-card, .link, .iconbox, .audio) { border-color: transparent; box-shadow: 0 2px 6px rgb(0 0 0 / .05), 0 14px 34px rgb(0 0 0 / .09); }
[data-card="elevated"] :is(.cat, .post-card, .link, .iconbox):hover { box-shadow: 0 4px 10px rgb(0 0 0 / .07), 0 24px 50px rgb(0 0 0 / .16); }

/* כפתורים */
[data-button="pill"] .btn { border-radius: 999px; padding-inline: 24px; }
[data-button="square"] .btn { border-radius: 4px; }

/* =====================================================================
   תבניות: נושאים בדף הבית
   ===================================================================== */
[data-topics="tiles"] .cats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
[data-topics="tiles"] .cat { flex-direction: column; text-align: center; padding: 22px 14px; gap: 12px; }
[data-topics="tiles"] .cat .tile { --t: calc(var(--icon) * 1.35); }
[data-topics="list"] .cats { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 28px; }
[data-topics="list"] .cat { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: transparent; padding: 12px 4px; min-height: 0; }
[data-topics="list"] .cat:hover { transform: none; box-shadow: none; background: var(--accent-soft); }
[data-topics="list"] .cat .tile { --t: calc(var(--icon) * .8); }
[data-topics="chips"] .cats { display: flex; flex-wrap: wrap; gap: 10px; }
[data-topics="chips"] .cat { border-radius: 999px; padding: 6px 18px 6px 8px; min-height: 0; gap: 10px; }
[data-topics="chips"] .cat .tile { --t: 34px; border-radius: 50%; }
[data-topics="chips"] .cat small { display: none; }

/* =====================================================================
   תבניות: מדריכים
   ===================================================================== */
[data-posts="list"] .posts { grid-template-columns: 1fr; gap: 14px; max-width: 920px; }
[data-posts="list"] .post-card { flex-direction: row; }
[data-posts="list"] .post-thumb { width: 240px; flex: none; aspect-ratio: 16 / 10; }
[data-posts="list"] .post-body { justify-content: center; }
@media (max-width: 600px) { [data-posts="list"] .post-card { flex-direction: column; } [data-posts="list"] .post-thumb { width: 100%; } }
[data-posts="featured"] .posts-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-posts="featured"] .posts-home .featured { grid-column: span 2; grid-row: span 2; }
[data-posts="featured"] .posts-home .featured .post-thumb { aspect-ratio: 16 / 10; }
[data-posts="featured"] .posts-home .featured .post-title { font-size: 1.6rem; }
[data-posts="featured"] .posts-home .featured .post-excerpt { -webkit-line-clamp: 4; font-size: 1rem; }
@media (max-width: 900px) { [data-posts="featured"] .posts-home { grid-template-columns: 1fr; } [data-posts="featured"] .posts-home .featured { grid-column: auto; grid-row: auto; } }

/* =====================================================================
   תבניות: רקע
   ===================================================================== */
:root:not([data-pattern="glow"]) .hero::before { display: none; }
[data-pattern="grid"] body { background-image: linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px); background-size: 34px 34px; }
[data-pattern="dots"] body { background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1.4px, transparent 1.6px); background-size: 24px 24px; }
[data-pattern="waves"] body { background-image: radial-gradient(60% 40% at 100% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%), radial-gradient(50% 35% at 0% 30%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); background-attachment: fixed; }
[data-pattern="grid"] .page-hero, [data-pattern="dots"] .page-hero, [data-pattern="waves"] .page-hero { background: color-mix(in srgb, var(--bg) 70%, transparent); }
