/* ──────────────────────────────────────────────────────────────────────────
   מעטפת האתר: גופן המותג, הכותרת העליונה ותפריט "שאלו AI".
   עיצוב Scalar עצמו נמצא ב-scalar-theme.css (מוזרק כ-customCss).
   ────────────────────────────────────────────────────────────────────────── */

/* Ploni - גופן המותג של banta, מאותו Storage שהאפליקציה משתמשת בו. */
@font-face {
  font-family: 'Ploni';
  src: url('https://db.banta.co.il/storage/v1/object/public/custom-fonts/fontbanta/ploni-regular-aaa.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Ploni';
  src: url('https://db.banta.co.il/storage/v1/object/public/custom-fonts/fontbanta/ploni-medium-aaa.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Ploni';
  src: url('https://db.banta.co.il/storage/v1/object/public/custom-fonts/fontbanta/ploni-demibold-aaa.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Ploni';
  src: url('https://db.banta.co.il/storage/v1/object/public/custom-fonts/fontbanta/ploni-bold-aaa.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --site-header-height: 56px;
  --site-font: 'Ploni', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --site-bg: #ffffff;
  --site-fg: #1f2924;
  --site-muted: #5d6b63;
  --site-border: #e3e8e5;
  --site-accent: #527e66;
  --site-accent-fg: #ffffff;
  --site-hover: #f1f5f2;
  --site-shadow: 0 10px 30px rgb(15 30 22 / 0.12);
  /* Scalar מזיז את הסרגל והתוכן מתחת לכותרת מותאמת לפי המשתנה הזה. */
  --scalar-custom-header-height: var(--site-header-height);
  color-scheme: light;
}

/* Scalar מסמן מצב כהה ב-class על body; ברירת המחדל עוקבת אחרי המערכת. */
@media (prefers-color-scheme: dark) {
  :root:not(:has(body.light-mode)) {
    --site-bg: #0f1412;
    --site-fg: #e7ece9;
    --site-muted: #9aa8a0;
    --site-border: #26302b;
    --site-accent: #6fc49a;
    --site-accent-fg: #0f1412;
    --site-hover: #18201c;
    --site-shadow: 0 10px 30px rgb(0 0 0 / 0.45);
    color-scheme: dark;
  }
}
:root:has(body.dark-mode) {
  --site-bg: #0f1412;
  --site-fg: #e7ece9;
  --site-muted: #9aa8a0;
  --site-border: #26302b;
  --site-accent: #6fc49a;
  --site-accent-fg: #0f1412;
  --site-hover: #18201c;
  --site-shadow: 0 10px 30px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}

html,
body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--site-font);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--site-header-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--site-bg);
  border-bottom: 1px solid var(--site-border);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.site-brand img {
  display: block;
  height: 26px;
  width: auto;
}
:root:has(body.dark-mode) .site-brand img {
  filter: brightness(0) invert(1);
}
@media (prefers-color-scheme: dark) {
  :root:not(:has(body.light-mode)) .site-brand img {
    filter: brightness(0) invert(1);
  }
}
.site-brand-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--site-accent);
  border: 1px solid currentColor;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.site-link,
.site-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.site-link {
  color: var(--site-fg);
}
.site-link:hover {
  background: var(--site-hover);
}
.site-cta {
  color: var(--site-accent-fg);
  background: var(--site-accent);
}
.site-cta:hover {
  filter: brightness(1.08);
}
.site-link:focus-visible,
.site-cta:focus-visible,
.ai-menu-item:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 2px;
}

/* ── תפריט "שאלו AI" (<details> - עובד גם בלי JavaScript) ─────────────── */
.ai-menu {
  position: relative;
}
.ai-menu > summary {
  list-style: none;
}
.ai-menu > summary::-webkit-details-marker {
  display: none;
}
.ai-menu[open] > summary {
  background: var(--site-hover);
}
.ai-menu-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: 290px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 8px;
  background: var(--site-bg);
  border: 1px solid var(--site-border);
  border-radius: 12px;
  box-shadow: var(--site-shadow);
}
.ai-menu-panel hr {
  border: 0;
  border-top: 1px solid var(--site-border);
  margin: 6px 0;
}
.ai-menu-label {
  margin: 6px 10px 4px;
  font-size: 12px;
  color: var(--site-muted);
}
.ai-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--site-fg);
  font: inherit;
  font-size: 14px;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.ai-menu-item:hover {
  background: var(--site-hover);
}
.ai-menu-hint {
  font-size: 12px;
  color: var(--site-muted);
}

/* ── מובייל ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header {
    padding: 0 12px;
    gap: 8px;
  }
  .site-link-optional {
    display: none;
  }
  .site-link,
  .site-cta {
    padding: 0 10px;
    font-size: 14px;
  }
  .site-brand-tag {
    display: none;
  }
}

/* ── לפני ש-Scalar נטען / בלי JavaScript ──────────────────────────────── */
#app {
  min-height: 100vh;
  padding-top: var(--site-header-height);
  box-sizing: border-box;
}
#app:has(.scalar-app) {
  padding-top: 0;
}
.noscript {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--site-header-height) + 48px) 20px 48px;
  line-height: 1.7;
}
.noscript a {
  color: var(--site-accent);
}
