/* ============================================================
   חמוטל בר כהן — אתר תיק עבודות
   טוקני העיצוב לקוחים מקובץ ה-handoff של Claude Design.
   ============================================================ */

:root {
  --ink:        #111111;
  --ink-2:      #222222;
  --muted:      #555555;
  --muted-2:    #6b6b6b;
  --muted-3:    #8a8a8a;
  --line:       #e2e2e2;
  --line-2:     #dcdcdc;
  --surface:    #f3f3f3;
  --bg:         #ffffff;

  /* פונט אחד לכל האתר — Heebo, כמו השם ושורת הניווט בעמוד הבית */
  --sans:  'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--muted); }

::selection { background: var(--ink); color: var(--bg); }

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -60px; left: 14px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; font-size: 13px;
  transition: top .15s;
}
.skip-link:focus { top: 14px; color: var(--bg); }

/* ---------- מתג שפה ---------- */

.langbar {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  display: flex; gap: 1px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(6px);
}

.langbar button {
  cursor: pointer;
  padding: 6px 11px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .5px;
  background: transparent;
  color: var(--muted);
  border: 0;
  transition: background .15s, color .15s;
}
.langbar button:hover { color: var(--ink); }
.langbar button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- כותרת עליונה (בכל הדפים חוץ מהבית) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 16px 32px 16px 104px;
}

/* בעמוד הבית הכותרת מוסתרת — בלי זה display:flex גובר על [hidden]
   והיא ממשיכה לתפוס 33px בראש העמוד */
.site-header[hidden] { display: none; }

.site-header .brand {
  font-family: var(--sans);
  font-size: 19px; font-weight: 500;
  letter-spacing: .3px;
  white-space: nowrap;
}

.site-nav { display: flex; gap: 24px; font-size: 13px; font-weight: 400; }

.site-nav a {
  padding-bottom: 4px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 620px) {
  .site-header {
    flex-direction: column; align-items: flex-start; gap: 14px;
    /* השוליים משמאל שומרים מקום למתג השפה, שרוחבו 94px ויושב בפינה
       השמאלית. באנגלית השם מתחיל שם, ובלי המקום הזה הוא נדחף מתחתיו */
    padding: 14px 20px 12px 104px;
  }
  .site-nav { gap: 18px; flex-wrap: wrap; }
}

/* ---------- עמוד הבית (סגנון Overlay) ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.hero-layer {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1800ms ease;
}
.hero-layer.is-active { opacity: 1; }
/* ה-picture עוטף את התמונה כשהוגדרה לה חלופה למסך אנכי, ובלי גובה
   מפורש הוא היה מתכווץ והתמונה שבתוכו לא הייתה ממלאת את המסך */
.hero-layer picture { display: block; width: 100%; height: 100%; }
.hero-layer img { width: 100%; height: 100%; object-fit: cover; }

.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, .94) 0%,
    rgba(255, 255, 255, .40) 26%,
    rgba(255, 255, 255, 0) 46%);
}

.hero-content {
  position: relative; z-index: 2;
  padding: clamp(18px, 2.6vw, 34px) clamp(40px, 8vw, 120px)
           clamp(32px, 6vw, 72px) clamp(72px, 13vw, 200px);
  display: flex; flex-wrap: wrap;
  align-items: baseline; justify-content: space-between;
  gap: clamp(16px, 3vw, 40px);
}

/* השם בעמוד הבית — פונט הניווט (Heebo). בעיצוב המקורי 41px, הוקטן לבקשת האמנית */
.hero-content h1 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(25px, 5.4vw, 34px);
  line-height: .92;
  letter-spacing: -1px;
  margin: 0;
}

/* באנגלית השם ארוך יותר: מוזז שמאלה (שוליים כמו בצד השני) וקטן במקצת */
[dir="ltr"] .hero-content { padding-left: clamp(48px, 9.5vw, 140px); }
[dir="ltr"] .hero-content h1 { font-size: clamp(22px, 4.6vw, 29px); }

.hero-nav {
  display: flex; flex-wrap: wrap;
  gap: clamp(20px, 3vw, 40px);
  font-size: clamp(13px, 1.2vw, 16px);
}
.hero-nav a {
  padding-bottom: 4px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s;
  white-space: nowrap;
}
.hero-nav a:hover { color: var(--ink); }

.hero-caption {
  position: absolute; z-index: 2;
  bottom: 20px; right: 28px;
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .4px;
  color: #444;
  background: rgba(255, 255, 255, .72);
  padding: 6px 11px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-layer { transition: none; }
}

/* ---------- מבנה עמודי תוכן ---------- */

.page { max-width: 1240px; margin: 0 auto; padding: clamp(40px, 5vw, 72px) clamp(24px, 5vw, 48px) 96px; }
.page--narrow  { max-width: 1100px; }
/* עמודי עבודה ותערוכה מתחילים גבוה יותר — כל הגוש (קישור החזרה, הכותרת,
   הפרטים והתמונות) עולה יחד, והמרווחים בתוכו לא משתנים */
.page--article { max-width: 900px; padding-top: clamp(18px, 2.2vw, 30px); }
/* עמוד תערוכה מתחיל מעט נמוך יותר מעמוד עבודה */
.page--wide    { max-width: 1040px; padding-top: clamp(34px, 3.8vw, 54px); }

.page-title {
  font-family: var(--sans);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  margin: 0 0 8px;
}

.page-sub {
  font-family: var(--sans);
  font-size: 11px; letter-spacing: .4px;
  color: var(--muted-2);
  margin-bottom: 44px;
}

/* ---------- רשת עבודות ---------- */

/* שלוש עמודות, אבל הרשת צרה מרוחב העמוד וממורכזת — כך הריבועים
   קטנים במקצת ויש להם יותר אוויר מסביב */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px) clamp(20px, 2vw, 32px);
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 780px) { .works-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .works-grid { grid-template-columns: 1fr; } }

.work-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
  display: block;
}
.work-card img { width: 100%; height: 100%; object-fit: cover; }

.work-cap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.work-card:hover .work-cap,
.work-card:focus-visible .work-cap { opacity: 1; }

.work-cap .t {
  font-family: var(--sans);
  font-size: 18px; font-weight: 500; line-height: 1.2;
  color: #ffffff;
}
.work-cap .m { font-size: 11px; color: #e6e6e6; margin-top: 4px; }

/* עבודה שאין לה עדיין תמונות — ריבוע ריק שבו רק השם */
.work-card--empty { border: 1px solid var(--line); background: var(--bg); }
.work-card--empty .work-cap {
  opacity: 1;
  background: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.work-card--empty .work-cap .t { color: var(--ink); }
.work-card--empty .work-cap .m { color: var(--muted-2); }
.work-card--empty:hover { background: var(--surface); }

/* מסכי מגע ומסכים צרים — אין hover, לכן הכיתוב תמיד גלוי */
@media (hover: none), (max-width: 780px) {
  .work-cap { opacity: 1; }
}

/* ---------- רשת תערוכות ---------- */

.exh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  /* הרווח בין השורות גדול מהרווח בין העמודות — הכותרת שבתחתית הכרטיס
     צריכה אוויר לפני התמונה של השורה הבאה */
  gap: clamp(48px, 5vw, 76px) clamp(22px, 2vw, 34px);
}

.exh-card { display: block; transition: opacity .2s; }
.exh-card:hover { opacity: .82; }

/* display: block — כ-inline התיבה לא נספרה בגובה הכרטיס, והכותרת
   שמתחתיה "גלשה" החוצה ואכלה את הרווח שבין השורות */
.exh-card .thumb {
  display: block;
  position: relative; aspect-ratio: 4 / 3;
  overflow: hidden; background: var(--surface);
}
.exh-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* display: block — בלעדיו ה-span נשאר inline והריווח העליון לא נכנס לפריסה */
.exh-card .body { display: block; padding-top: 13px; }
.exh-card .t { font-family: var(--sans); font-size: 15px; font-weight: 400; line-height: 1.2; color: var(--ink); }

/* ---------- עליי ---------- */

.about-layout {
  display: grid;
  grid-template-columns: minmax(170px, 225px) 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.about-layout.no-portrait { grid-template-columns: 1fr; }

.about-portrait { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface); }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 700px) { .about-layout { grid-template-columns: 1fr; } }

.prose p {
  font-family: var(--sans);
  font-size: 14px; line-height: 1.95;
  color: var(--ink-2);
  margin: 0 0 20px;
  max-width: 620px;
  text-align: justify;   /* יישור לשני הצדדים */
  text-wrap: pretty;
}

/* ---------- צור קשר ---------- */

.contact-list {
  display: flex; flex-direction: column; gap: 22px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.contact-row { display: flex; gap: 20px; align-items: baseline; }
.contact-row .k {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .5px;
  color: var(--muted-3);
  min-width: 96px;
}
.contact-row .v { font-size: 15px; color: var(--ink); }

/* ---------- עמוד עבודה / תערוכה ---------- */

.detail-title {
  font-family: var(--sans);
  font-weight: 500; line-height: 1.05;
  margin: 0;
  font-size: clamp(16px, 1.9vw, 20px);
}
/* בעמוד תערוכה הכותרת נשארת גדולה יותר */
.detail-title--exh { font-size: clamp(20px, 2.6vw, 29px); }

.detail-meta {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: .3px;
  color: var(--muted-2);
  margin-top: clamp(10px, 1.2vw, 14px);
  display: flex; flex-wrap: wrap; gap: 8px 18px;
}
.detail-meta .sep { color: #cfcfcf; }

/* בעמוד תערוכה — כל פרט בשורה נפרדת */
.detail-meta--stack { flex-direction: column; gap: 5px; line-height: 1.5; }

/* עמוד תערוכה — הכותרת והפרטים ממורכזים.
   פסקאות הטקסט עצמן נשארות מיושרות לשוליים (קריאוּת),
   אבל גוש הטקסט ממורכז בתוך העמוד. */
.page--wide .detail-title,
.page--wide .detail-meta--stack,
.page--wide .section-label,
.page--wide .credit-note { text-align: center; }
.page--wide .detail-meta--stack { align-items: center; }
/* בעמוד תערוכה — מרווח גדול יותר בין שם התערוכה לשורות הפרטים */
.page--wide .detail-meta { margin-top: clamp(18px, 2.2vw, 28px); }
/* הקרדיט יושב מיד מתחת לתמונות, קרוב אליהן */
.page--wide .credit-note { margin-top: clamp(16px, 2vw, 24px); }
/* ולפני הקו המפריד שלפני "לעמודי העבודות" — הרבה אוויר */
.page--wide .prose + .section-block,
.page--wide .credit-note + .section-block { margin-top: clamp(56px, 6vw, 82px); }
/* ה-max-width יושב על הפסקה עצמה, ולכן היא זו שצריכה שוליים אוטומטיים */
.page--wide .prose p { margin-inline: auto; }

/* עמוד עבודה — הכותרת ושורת הפרטים נשארות מיושרות לימין, אבל לא לשולי
   העמוד: הן מוסטות פנימה עד לקצה הימני של התמונה העליונה. רוחב התמונה
   תלוי בגובה החלון, ולכן ההסטה עצמה נמדדת ב-JS (alignHeadToTopImage). */

/* תמונות בעמוד עבודה — כל תמונה נכנסת בגובה המסך, בלי צורך לגלול.
   התוצאה: תמונת רוחב תופסת שורה שלמה, ושתי תמונות לאורך
   מסתדרות מאליהן זו לצד זו. */
.figures {
  display: flex; flex-wrap: wrap;
  /* התמונות ממורכזות בעמוד — והכותרת ופרטי העבודה ממורכזים איתן */
  justify-content: center; align-items: flex-start;
  /* הרווח בין השורות גדול בכוונה: שורה + הרווח שאחריה שווים בערך
     גובה מסך, כך שרואים שורה אחת בכל פעם ולא את ראש הבאה אחריה */
  gap: 19vh clamp(20px, 3vw, 32px);
  margin-top: clamp(20px, 2.4vw, 32px);
}
.figures > .figure { max-width: 100%; }
.figures .frame { width: auto; }

/* לכל שורה אותו גובה גם כשהתמונה רחבה ונמוכה (מוגבלת ברוחב ולא בגובה),
   כדי שקצב הגלילה יישאר שורה אחת לכל מסך */
@media (min-width: 781px) {
  .figures > .figure {
    min-height: 78vh;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
  }
  /* התמונה הראשונה לא מרחפת באמצע גובה המסך — הקצה העליון שלה
     מתחיל מיד מתחת לכותרת ולפרטי העבודה */
  .figures > .figure:first-child { min-height: 0; }
}
@media (max-width: 780px) {
  .figures { gap: 6vh clamp(20px, 3vw, 32px); }
}
.figures .frame img {
  max-height: 78vh;
  width: auto; max-width: 100%;
}
.figures figcaption { justify-content: center; }

/* סרטון תמיד ברוחב מלא, בשורה משלו. גם הנגן עצמו חייב רוחב מפורש:
   ה-iframe שבתוכו ממוקם אבסולוטית, ובלי זה הוא מתכווץ לרוחב אפס
   ויחס הגובה-רוחב הופך אותו לגובה אפס — כלומר סרטון בלתי נראה */
.figures > .figure--video { width: 100%; }
.figures .figure--video .video-embed { width: 100%; }
/* שני סרטונים בשורה אחת (דיפטיך) — כל אחד במחצית הרוחב, ביחס 16:9 */
.figures .figure-row .video-embed { aspect-ratio: 16 / 9; max-width: none; }

/* שורת סרטונים רחבה מהעמודה: הנגנים גדולים יותר, והשורה חורגת החוצה
   בשווה לשני הצדדים (המרכוז של .figures דואג לזה) */
@media (min-width: 781px) {
  /* flex-shrink: 0 — בלעדיו ה-flex מכווץ את השורה בחזרה לרוחב העמודה */
  .figures .figure-row.figure-row--wide { width: min(990px, 88vw); flex-shrink: 0; }
  /* שורת סרטונים בראש העמוד: קצת אוויר מתחת לכותרת, והשורה תופסת גובה
     מסך שלם כמו כל שורה אחרת — כך התמונה הבאה לא מציצה מלמטה */
  /* 45vh ולא 78: מספיק כדי שהתמונה הבאה תישאר מתחת לקו הקיפול,
     בלי לחייב גלילה ארוכה כדי להגיע אליה */
  .figures > .figure-row.figure-row--wide:first-child {
    margin-top: 40px;
    min-height: 45vh;
    align-content: flex-start;
  }
}

/* קבוצת תמונות שמוצגות תמיד זו לצד זו, בלי קשר לפרופורציות שלהן */
.figures .figure-row {
  width: 100%;
  /* flex-start ולא center: כשלתמונה אחת בשורה יש כיתוב משלה, התיבה שלה
     גבוהה יותר, ומרכוז היה מזיז אותה כלפי מעלה ביחס לשכנתה */
  display: flex; justify-content: center; align-items: flex-start;
  gap: clamp(16px, 2vw, 28px);
}
/* רוחב כל תמונה בשורה יחסי ליחס הגובה-רוחב שלה (--r נקבע ב-JS), ולכן
   כל התמונות בשורה יוצאות בדיוק באותו גובה וממלאות יחד את רוחב השורה.
   ה-max-width שומר שגם במסך נמוך הגובה לא יעבור 78vh, בלי לעוות יחס */
.figures .figure-row > .figure {
  flex: var(--r, 1) 1 0;
  max-width: calc(var(--r, 1) * 78vh);
}
.figures .figure-row .frame img { max-height: 78vh; }

@media (min-width: 781px) {
  .figures .figure-row { min-height: 78vh; }
  /* שורה ראשונה — לא מרחפת באמצע המסך, כמו תמונה ראשונה בודדת */
  .figures > .figure-row:first-child { min-height: 0; }
}
@media (max-width: 620px) {
  /* במסך צר התמונות נערמות זו מתחת לזו, כל אחת ברוחב מלא */
  .figures .figure-row > .figure { flex: 0 1 auto; max-width: 100%; }
}

.figure { margin: 0; }
.figure .frame {
  position: relative;
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
  display: block;
  width: 100%;
  border: 0; padding: 0;
}
.figure .frame img { width: 100%; height: auto; }

.figure figcaption,
.row-caption {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .4px;
  color: var(--muted-3);
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}

/* כיתוב אחד לשתי תמונות שבאותה שורה: שורה משלו מתחתיהן, ממורכז,
   והקרדיט יורד לשורה נפרדת */
/* אין רווח-שורה בין התמונות לכיתוב — המרחק נקבע רק ב-margin שלו,
   כמו בכיתוב של תמונה בודדת */
/* align-content: השורה גבוהה מהתמונות (min-height), ובלי זה העודף מתחלק
   בין השורות והכיתוב נופל רחוק מהן */
.figures .figure-row { flex-wrap: wrap; row-gap: 0; align-content: center; }
.figures .figure-row > .row-caption {
  width: 100%;
  flex-direction: column; align-items: center;
  gap: 3px;
  margin-top: 12px;
  text-align: center;
}

/* flex ולא grid — כדי ששורה אחרונה חלקית (שתי תמונות מתוך שלוש)
   תישאר ממורכזת ולא תידחק לצד אחד */
.exh-figures {
  --row-h: 195px;
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: flex-start;
  gap: clamp(24px, 3vw, 34px) clamp(18px, 2vw, 26px);
  margin-top: clamp(32px, 4vw, 48px);
}
/* רוחב הבסיס לפי הפרופורציה של התמונה (--r נקבע ב-app.js לפי מידותיה).
   אחרי שהשורות נסגרות, justifyExhFigures מותח כל שורה שיש בה יותר
   מתמונה אחת עד קצות העמודה — ותמונה שנשארה לבדה נשארת בגודל הבסיס */
.exh-figures > * {
  flex: 0 0 calc(var(--r, 1.5) * var(--row-h));
  max-width: 100%;
}
/* מפריד שורה: תופס שורה שלמה ברוחב ובגובה אפס, וכך סוגר את השורה */
.exh-figures .row-break { flex: 0 0 100%; height: 0; }

.exh-figures .frame {
  display: block;
  aspect-ratio: var(--r, 1.5);
  overflow: hidden;
}
.exh-figures .frame img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) { .exh-figures { --row-h: 150px; } }

/* מסך צר — תמונה אחת בשורה, ברוחב מלא ובגובה טבעי */
@media (max-width: 620px) {
  .exh-figures > * { flex: 1 1 100%; max-width: 100%; }
}

/* קרדיט צילום אחד לכל העמוד, כשכל התמונות צולמו בידי אותו צלם */
.credit-note {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .4px;   /* בדיוק כמו הקרדיט שהיה מתחת לתמונות */
  color: var(--muted-3);
  margin: clamp(28px, 3.5vw, 40px) 0 0;
}

/* הבלוקים שבתחתית העמוד — יורדים נמוך יותר, וקו מפריד עדין יותר */
.section-block {
  margin-top: clamp(56px, 6vw, 78px);
  border-top: 1px solid #ececec;
  padding-top: 24px;
}
/* בין שני בלוקים סמוכים אין צורך במרווח גדול */
.section-block + .section-block { margin-top: clamp(30px, 3.4vw, 44px); }

/* בעמוד עבודה הבלוקים שבתחתית צפופים יותר — הקווים מתקרבים לתוכן
   שביניהם, כדי שלא יישאר שם חלל ריק */
.page--article .section-block { margin-top: clamp(38px, 4vw, 52px); padding-top: 18px; }
.page--article .section-block + .section-block { margin-top: clamp(20px, 2.2vw, 28px); }

/* השורה שבה העיגול הועלה — מקומו הישן נשאר תפוס ויצר חלל מתחתיו.
   הערך זהה להעלאה עצמה (inset-block-start), וסוגר אותו בדיוק */
.chip-row:has(.exh-chip + .story-ring) { margin-bottom: -26px; }

.section-label {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: .5px;
  color: var(--muted-3);
  margin-bottom: 14px;
}

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* בעמוד תערוכה כל השורות ממורכזות */
.page--wide .chip-row { justify-content: center; }

.exh-chip {
  border: 1px solid var(--line-2);
  padding: 9px 14px;
  display: flex; gap: 10px; align-items: baseline;
  transition: border-color .15s;
}
.exh-chip:hover { border-color: var(--ink); }
.exh-chip .t { font-family: var(--sans); font-size: 14px; color: var(--ink); }
.exh-chip .m { font-size: 10px; color: #9a9a9a; }

.ctx-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.ctx-chip {
  border: 1px solid #d4d4d4;
  background: transparent;
  color: #333333;
  padding: 6px 13px;
  font-size: 11px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .15s;
}
.ctx-chip:hover { border-color: var(--ink); }
.ctx-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* מעבר בין עבודות — קישורי טקסט עדינים, צמודים זה לזה ומופרדים בקו דק */
.pager { display: flex; align-items: center; justify-content: flex-start; }
.pager a {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: .3px;
  color: var(--muted-2);
  transition: color .15s;
}
.pager a + a {
  border-inline-start: 1px solid var(--line-2);
  margin-inline-start: 14px;
  padding-inline-start: 14px;
}
.pager a:hover { color: var(--ink); }

/* שם העבודה / "מראה הצבה" — מופיע על התמונה במעבר עכבר בלבד */
.fig-cap {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .70), rgba(0, 0, 0, 0) 62%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.fig-cap span {
  font-size: 12px; font-weight: 500; line-height: 1.3;
  color: #ffffff;
  text-align: center;
}
.frame:hover .fig-cap,
.frame:focus-visible .fig-cap { opacity: 1; }

/* במסכי מגע אין hover — הכיתוב פשוט לא מוצג, והתמונה נשארת נקייה */

/* קישורים קטנים לעמודי העבודות, בתחתית עמוד התערוכה */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: clamp(14px, 1.5vw, 20px);
}
.mini-card { display: block; transition: opacity .2s; }
.mini-card:hover { opacity: .82; }
.mini-card .thumb { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface); }
.mini-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-card .body { display: block; padding-top: 8px; }
.mini-card .t { font-family: var(--sans); font-size: 11px; font-weight: 500; line-height: 1.25; color: var(--ink); }

/* ---------- סטורי ---------- */

/* העיגול שבשורת התערוכות — טבעת דקה, ובתוכה התמונה הראשונה של הרצף */
.story-ring {
  background: none; border: 0; padding: 0;
  font-family: var(--sans);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  width: 92px;
  /* מרווח קטן מהכרטיסים שלצדו — העיגול גבוה מהם */
  margin-inline-start: 4px;
}
/* כשיש בשורה גם כרטיסי תערוכות — העיגול נצמד לצד השני של השורה
   (בעברית לשמאל, באנגלית לימין). כשהוא לבדו בשורה הוא נשאר בהתחלה */
.chip-row .exh-chip + .story-ring {
  margin-inline-start: auto;
  /* העיגול והכיתוב עולים יחד עד שהם מקבילים לגוש כולו — הכותרת
     "הוצגה בתערוכות" והכרטיס שמתחתיה. העיגול עומד לצד הכותרת, בקצה
     השני של השורה. הזזה חזותית בלבד — היא לא מזיזה דבר ממה שסביבה */
  position: relative;
  inset-block-start: -26px;
}

.story-ring .ring {
  display: block;
  width: 68px; height: 68px;
  border-radius: 50%;
  padding: 3px;                       /* הרווח הלבן שבין הטבעת לתמונה */
  border: 1.5px solid var(--ink);
  background: var(--bg);
  transition: transform .2s ease, border-color .2s ease;
}
.story-ring .ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
.story-ring:hover .ring { transform: scale(1.05); }
/* רצף שכבר נצפה — הטבעת מתעמעמת, כמו באינסטגרם */
.story-ring.is-seen .ring { border-color: var(--line-2); }

.story-ring .story-label {
  font-size: 10px; letter-spacing: .4px; line-height: 1.35;
  color: var(--muted-2);
  text-align: center;
}
.story-ring:hover .story-label { color: var(--ink); }

/* הנגן — מסך מלא, באותו לובן של חלון ההגדלה */
.story {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(255, 255, 255, .98);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 3vw, 32px);
}
.story[hidden] { display: none; }

/* רוחב הרצף נגזר מגובה החלון, כך שהמסגרת נשארת אנכית כמו סטורי
   והפסים שמעליה יוצאים בדיוק ברוחב התמונה */
.story-shell {
  display: flex; flex-direction: column;
  gap: 10px;
  width: min(430px, calc((100vh - 140px) * 9 / 16), 100%);
  width: min(430px, calc((100dvh - 140px) * 9 / 16), 100%);
}

/* פס לכל תמונה ברצף, והפס הפעיל נמתח בקצב שבו היא מתחלפת */
.story-bars { display: flex; gap: 4px; }
.story-bar {
  flex: 1;
  height: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.story-bar i { display: block; width: 0; height: 100%; background: var(--ink); }

.story-frame {
  position: relative;
  background: var(--surface);
  overflow: hidden;
  /* ברירת מחדל של סטורי — מסגרת אנכית. תמונה ביחס אחר נכנסת בשלמותה */
  aspect-ratio: 9 / 16;
}
.story-frame img,
.story-frame video { width: 100%; height: 100%; object-fit: contain; }
/* img גלובלי הוא display:block, ולכן צריך לבטל אותו במפורש */
.story-frame [hidden] { display: none; }

/* אזורי ההקשה — שקופים, פרוסים על התמונה. בעברית הצד הימני מחזיר אחורה */
.story-tap {
  position: absolute; top: 0; bottom: 0;
  background: none; border: 0; padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.story-tap--prev { inset-inline-start: 0; width: 32%; }
.story-tap--next { inset-inline-end: 0; width: 68%; }

.story-cap {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: .3px; line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
  margin: 0;
}
.story-cap[hidden] { display: none; }

.story-close {
  position: absolute; top: 18px; right: 22px;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--ink); font-family: var(--sans); font-size: 12px;
  padding: 8px 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.story-close:hover { background: var(--ink); color: var(--bg); }

/* ---------- וידאו ---------- */

/* המסגרת מקבלת ב-JS את יחס הגובה-רוחב של תמונות אותו עמוד, כדי שהשורה
   של הסרטון תתפוס בדיוק אותו שטח כמו שורה של תמונה. הנגן עצמו נשאר 16:9
   וממורכז בתוכה — בלי מתיחה ובלי רצועות שחורות */
.video-embed {
  position: relative;
  /* --r הוא יחס הגובה-רוחב של תמונות אותו עמוד, נקבע ב-JS */
  aspect-ratio: var(--r, 16 / 9);
  width: 100%;
  /* אותה תקרה שיש לתמונה: הגובה לא עובר 78vh, ולכן במסך נמוך
     גם הרוחב מצטמצם — והסרטון יוצא בדיוק בגודל התמונות */
  max-width: calc(var(--r, 1.778) * 78vh);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: center;
}
.video-embed iframe {
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  border: 0; background: var(--surface);
}

/* ---------- הגדלת תמונה ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255, 255, 255, .97);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 5vw, 64px);
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 100%; max-height: 100%;
}
.lightbox img { max-width: 100%; min-height: 0; width: auto; height: auto; object-fit: contain; }

.lightbox-figure figcaption {
  font-size: 12px; letter-spacing: .3px;
  color: var(--muted-2);
  text-align: center;
}
.lightbox-figure figcaption[hidden] { display: none; }

/* מעבר בין התמונות בתוך חלון ההגדלה */
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 46px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--sans); font-size: 26px; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  /* התווים ‹ › עוברים היפוך אוטומטי בהקשר ימין-לשמאל.
     direction: ltr מבטל את ההיפוך, כדי שהחץ יצביע לכיוון שנקבע לו */
  direction: ltr;
}
.lightbox-nav:hover { background: var(--ink); color: var(--bg); }
.lightbox-nav[hidden] { display: none; }
/* מיקום פיזי ולא לוגי: ה-direction של הכפתור עצמו הוא ltr (בגלל החץ),
   ולכן "התחלה" ו"סוף" לא היו מתהפכים יחד עם שפת האתר */
.lightbox-nav--prev { left: 14px; }
.lightbox-nav--next { right: 14px; }
:root[dir="rtl"] .lightbox-nav--prev { left: auto; right: 14px; }
:root[dir="rtl"] .lightbox-nav--next { right: auto; left: 14px; }

.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--ink); font-family: var(--sans); font-size: 12px;
  padding: 8px 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.lightbox-close:hover { background: var(--ink); color: var(--bg); }

/* ---------- 404 ---------- */

.notfound { text-align: center; padding: clamp(80px, 14vw, 180px) 24px; }
.notfound h2 { font-family: var(--sans); font-size: clamp(24px, 4vw, 38px); font-weight: 500; margin: 0 0 18px; }
.notfound a { border-bottom: 1px solid var(--ink); font-size: 14px; }
