/* system/css/model-overlay.css (הנתיב בכותרת תוקן 19/8/2026)
   overlay תלת-ממד אינטראקטיבי לשער 3, נפתח inline (לא זורק). model-viewer
   במרכז, סמן כתום מאתר על הרכיב, זום פלוס ומינוס בשמאל. */

.model-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(18, 48, 72, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.model-overlay[hidden] { display: none; }

/* עמודה, אזור המודל גדל וממלא, והרגליים (נקודות + מעבר להקשר) בזרימה מתחתיו.
   כך שתי שורות הכפתורים לא מכסות את המודל ולא נדרסות זו על זו. */
.model-box {
  position: relative;
  display: flex; flex-direction: column;
  width: min(92vw, 840px); height: min(82vh, 620px);
  background: #fdf8f2; border-radius: 18px; overflow: hidden;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
}
.model-view { position: relative; flex: 1 1 auto; min-height: 0; }
.model-box model-viewer {
  width: 100%; height: 100%; background: #fdf8f2;
  --poster-color: #fdf8f2;
  /* הסמן של רכיב פנימי (ספק כוח, מעבד) יושב בתוך המארז. בלי זה model-viewer
     מעמעם hotspot מוסתר ל-opacity 0.25 וכמעט לא רואים אותו. 1 = נראה תמיד. */
  --min-hotspot-opacity: 1;
  /* direction ltr חובה. הדף כולו RTL, ו-model-viewer ממקם hotspot לפי הכיוון
     היורש, אז ב-RTL הסמן הכתום נזרק מחוץ למסגרת ולא נראה בכלל (נמדד 28/7/2026,
     x=715 במקום 249 על מציג ברוחב 488). אין בסמן טקסט, אז ltr לא משנה כלום חוץ מזה. */
  direction: ltr;
  transition: opacity 0.28s ease;
}

.model-foot {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 14px 14px; background: #fdf8f2; border-top: 1px solid #efe4d5;
}
.model-foot[hidden] { display: none; }

/* שלוש הנקודות, משפט השוואה מהעולם המוכר. לחיצה מסובבת את המודל אל מה
   שהמשפט מדבר עליו (28/7/2026, סינתזה של GPT ו-Gemini). המשפט עצמו הוא הכפתור,
   בלי מספור ובלי בועה נפרדת, כדי לא להעמיס על המודל. */
.model-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.model-points[hidden] { display: none; }
.mp-btn {
  min-height: 44px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid #e3d6c4; background: #fff; color: #1a4a6b;
  font-family: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.3;
  max-width: 100%; text-align: center;
}
.mp-btn:hover { border-color: #e8854a; }
.mp-btn:active { transform: scale(0.97); }
.mp-btn.active { background: #e8854a; border-color: #e8854a; color: #fff; }

/* תת כותרת לנקודה, שורה קטנה עם כוכבית מתחת לכפתורים ולא בתוכם. עומר, 15/9/2026 */
.mp-note { margin: 0; max-width: 36em; color: #5a6b78; font-size: 0.92rem; line-height: 1.45; text-align: center; white-space: pre-line; }
.mp-note[hidden] { display: none; }

/* כפתור לסרטון מתוך נקודה, השדה video. משני לכפתור הכהה, מסגרת בלי מילוי. עומר, 16/9/2026 */
.mp-video {
  min-height: 44px; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  border: 2px solid #1a4a6b; background: #fff; color: #1a4a6b;
  font-family: inherit; font-size: 0.95rem; font-weight: 700; line-height: 1.3; max-width: 90%;
}
.mp-video::before { content: "▶"; margin-inline-end: 8px; color: #e8854a; }
.mp-video[hidden] { display: none; }
.mp-video:active { transform: scale(0.97); }

/* כפתור החלפת מודל (כהה, לא כתום), קונצנזוס עומר + Gemini + GPT */
.model-context {
  min-height: 48px; padding: 12px 22px; border: none; border-radius: 999px;
  background: #1a4a6b; color: #fff; font-family: inherit; font-size: 1rem; font-weight: 700;
  /* בלי nowrap, בגופן מערכת מוגדל הטקסט נשבר לשתי שורות במקום לגלוש (19/8/2026) */
  cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,0.25); max-width: 90%; line-height: 1.35;
}
.model-context[hidden] { display: none; }
.model-context:active { transform: scale(0.97); }

/* תווית מבהירה, זה אותו רכיב בתצוגה אחרת.
   בפינה הימנית העליונה ולא במרכז (13/9/2026). במרכז היא כיסתה את ראש מודל-האב,
   ובספק הכוח ישבה על הסמן עצמו. right פיזי, כי הסגירה והזום יושבים בשמאל. */
.model-label {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  max-width: 42%; text-align: right; background: rgba(255,255,255,0.92); color: #1a4a6b;
  font-weight: 700; font-size: 0.92rem; padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.model-label[hidden] { display: none; }

.model-close {
  position: absolute; top: 12px; inset-inline-end: 12px; z-index: 6;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: #1a4a6b;
  font-size: 1.7rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.model-close:hover { background: #fff; }

/* אשכול זום בצד שמאל, רק זכוכית מגדלת פלוס ומינוס (בקשת עומר).
   left פיזי ולא inset-inline-start, הדף RTL ולכן ההתחלה הלוגית היא ימין,
   בדיוק הצד שעומר לא ביקש (תוקן 19/8/2026). */
.model-zoom {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  z-index: 6; display: flex; flex-direction: column; gap: 12px;
}
.model-zoom button {
  width: 50px; height: 50px; border-radius: 13px; border: none; cursor: pointer;
  background: #1a4a6b; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}
.model-zoom button:active { transform: scale(0.94); }

/* הסמן הכתום, מאתר בלבד, נקודה פועמת בלי טקסט.
   אלמנט רגיל מעל המציג, לא hotspot של model-viewer, והמיקום מגיע מ-JS. */
.model-marker {
  position: absolute; z-index: 5; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%; padding: 0; cursor: pointer;
  background: #e8854a; border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(232, 133, 74, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: none;
}
.model-marker[hidden] { display: none; }
/* אזור לחיצה שקוף של 44px לאצבע, בלי לשנות את המראה. נמדד בבדיקת מכשירים, 2/10/2026.
   inset נמדד מתוך המסגרת, 16px פנימה ועוד 14 מכל צד. */
.model-marker::before {
  content: ''; position: absolute; inset: -14px; border-radius: 50%;
}
.model-marker:hover { transform: translate(-50%, -50%) scale(1.18); }
.model-marker::after {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid rgba(232, 133, 74, 0.55); animation: mk-pulse 1.8s ease-out infinite;
}
@keyframes mk-pulse {
  0%   { transform: scale(0.75); opacity: 0.85; }
  100% { transform: scale(1.7);  opacity: 0; }
}

/* חיווי טעינה וכשל (19/8/2026, החליף את slot ה-poster שהוסר מה-HTML).
   אח של model-viewer בתוך .model-view, לכן ה-opacity של המציג לא מסתיר אותו. */
.model-loading {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: #fdf8f2; color: #1a4a6b; text-align: center;
}
.model-loading[hidden] { display: none; }
.model-loading span { font-size: 0.9rem; color: #8a7a66; }

@media (max-width: 600px) {
  .model-box { width: 94vw; height: 84vh; }
  /* בטלפון הזום יורד לפינה השמאלית התחתונה של אזור המודל, אחד ליד השני.
     באמצע הצד הוא כיסה מודלים רחבים, כרטיס המסך והמסך. הכרעת עומר 13/9/2026. */
  .model-zoom { top: auto; bottom: 12px; transform: none; flex-direction: row; }
  .model-zoom button { width: 46px; height: 46px; }
}

/* תיקוני נייד צר, audit רספונסיביות 9/6/2026.
   הרגליים לוקחות גובה אמיתי, ולכן החלון גבוה יותר מבעבר. */
@media (max-width: 430px) {
  .model-box { width: 95vw; height: min(86vh, 620px); }
  /* left פיזי גם כאן, מאותה סיבה כמו בכלל הראשי (19/8/2026) */
  .model-zoom { left: 8px; gap: 10px; }
  .model-zoom button { width: 44px; height: 44px; }
  .model-foot { padding: 10px 10px 12px; gap: 8px; }
  .model-points { gap: 6px; }
  .mp-btn { padding: 9px 13px; font-size: 0.88rem; }
  .model-context { font-size: 0.94rem; padding: 12px 18px; }
}
