/* גלריית לפני/אחרי — רצועה רצה מקצה לקצה (28.10.2026). הצילומים, הצימודים וחלון ההגדלה מחבילת השילוב (Noise-Fitness-Results-Handoff).
   כל פיקסל בצילומים נשאר כמו שהוא: object-fit: contain, בלי חיתוך, ובלי הגדלה מעבר לגודל המקורי (--photo-width/--photo-height). */
.results-section {
  /* גובה תמונה במחשב נגזר מגובה המסך — כשנוחתים מהטאב "תוצאות" הצמדים נכנסים שלמים, עד הנעליים */
  --photo-h: clamp(300px, calc(100vh - 360px), 660px);
  --pair-gap: 7px;
  --pair-w: min(calc(var(--photo-h) * 1.5 + var(--pair-gap)), 86vw);   /* שתי תמונות 3:4 זו לצד זו */
  --strip-gap: clamp(40px, 7vw, 120px);   /* רווח גדול בין צמדים — שלא יהיה ספק מה שייך למה */
  padding-block: 86px 92px;
  font-family: Rubik, Assistant, Arial, sans-serif;
  background: radial-gradient(70% 46% at 50% 66%, rgb(238 31 113 / 13%), transparent 72%);
}
@supports (height: 100svh) { .results-section { --photo-h: clamp(300px, calc(100svh - 360px), 660px); } }
.results-section .comparison-heading { max-width: 1040px; }
.results-section .comparison-heading h2 { font-size: clamp(34px, 3.5vw, 56px); line-height: 1.3; font-weight: 500; letter-spacing: -.035em; }
.results-section .comparison-heading h2 span { display: block; }

/* הרצועה יוצאת מהשוליים עד קצות המסך; הקצוות נמוגים לשחור */
.results-marquee {
  margin: 48px calc(var(--gutter) * -1) 0;
  overflow-x: auto;   /* בלי JavaScript: רצועה רגילה שגוללים */
  padding-block: 10px;   /* מקום למסגרת המיקוד של הקישורים */
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #5b3443 #171717;
}
.results-marquee:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; }
/* עם JS הסימון עובר לצמד שבמרכז (הרצועה עצמה נמוגה בקצוות ולכן מסגרת סביבה נחתכת) */
.results-js .results-marquee:focus-visible { outline: none; }
.results-js .results-marquee:focus-visible .result-card[data-focus] .result-pair { outline: 2px solid var(--pink); outline-offset: 10px; }
.results-track { display: flex; gap: var(--strip-gap); width: max-content; margin: 0; padding: 0 var(--gutter) 18px; list-style: none; }
.result-card { flex: none; width: var(--pair-w); }
.result-open { display: block; color: inherit; text-decoration: none; cursor: zoom-in; }
.results-js .results-marquee {
  overflow: hidden;
  touch-action: pan-y;   /* גלילת העמוד למטה נשארת של הדפדפן; גרירה לצדדים מזיזה את הרצועה */
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.results-js .results-track { padding: 0; will-change: transform; }
.results-js .results-marquee { padding-block: 14px; margin-top: 34px; }   /* מקום למסגרת המקלדת סביב הצמד; המיקום על המסך לא זז */
@media (max-width: 700px) { .results-js .results-marquee { margin-top: 14px; } }
.results-js .results-marquee.is-dragging, .results-js .results-marquee.is-dragging .result-open { cursor: grabbing; }
.results-js .result-open img { -webkit-user-drag: none; }
.results-js .results-swipe-note { display: none; }
.results-swipe-note { margin-top: 20px; color: #929292; font-size: 14px; text-align: center; }

/* צמד: התוויות מעל הצילומים, מחוץ להם */
.result-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--pair-gap); }
/* קו שמחבר את "לפני" ל"אחרי" ומתחמם מאפור לוורוד — קושר את הצמד ומראה את הדרך */
.result-pair::before { content: ''; position: absolute; top: 13px; height: 1px; inset-inline: calc(25% + 34px) calc(25% + 48px); background: linear-gradient(to left, rgb(255 255 255 / 24%), var(--pink)); pointer-events: none; }
.result-photo { margin: 0; min-width: 0; }
.result-photo-label { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 0 0 14px; color: #a3a3a3; font-size: 17px; line-height: 1.5; font-weight: 400; letter-spacing: .02em; }
.result-photo[data-phase="after"] .result-photo-label { color: #fff; font-weight: 500; }
.result-photo[data-phase="after"] .result-photo-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 10px rgb(238 31 113 / 85%); }
.result-photo-frame { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; overflow: hidden; }   /* בלי רקע: צילום קטן מהמסגרת (הקולאז') מרחף על השחור ולא יושב בקופסה */
.result-photo-frame img { width: 100%; height: 100%; object-fit: contain; object-position: center; max-width: min(100%, var(--photo-width)); max-height: min(100%, var(--photo-height)); }

/* במחשב: העכבר על הרצועה עוצר אותה, והצמד שמתחתיו נשאר מואר */
@media (hover: hover) and (pointer: fine) {
  /* מעמעמים רק את הצילומים (התוויות שומרות על ניגודיות מלאה), ורק כשהעכבר באמת על צמד — לא ברווח שביניהם */
  .results-js .result-photo-frame { transition: opacity .35s ease; }
  .results-js .results-marquee.is-hovering:not(.is-dragging):has(.result-card:hover) .result-card:not(:hover) .result-photo-frame { opacity: .4; }
}

/* כפתור עצירה — אותו עיגול כמו בסרטון הפתיחה */
.results-autoplay { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 28px auto 0; padding: 0; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; background: rgb(8 8 8 / 74%); color: #fff; }
.results-autoplay svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.results-autoplay:hover { border-color: var(--pink); }
.results-autoplay:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* ---- חלון הגדלה (מחבילת השילוב) ---- */
.results-arrow { display: inline-flex; width: 48px; height: 48px; padding: 0; align-items: center; justify-content: center; color: #ececec; background: transparent; border: 1px solid #444; border-radius: 50%; }
.results-arrow svg { width: 20px; height: 20px; }
.results-arrow:hover { color: #080808; border-color: var(--pink); background: var(--pink); }
.results-dialog { width: min(calc(100vw - 48px), 1120px); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 26px 30px 20px; border: 1px solid #393939; background: #080808; color: #fff; overflow: auto; overscroll-behavior: contain; font-family: Rubik, Assistant, Arial, sans-serif; }
.results-dialog::backdrop { background: rgb(0 0 0 / 88%); }
.results-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.results-dialog-header h2 { font-size: 22px; font-weight: 400; line-height: 1.4; }
.results-dialog-close { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: #c6c6c6; font-size: 15px; }
.results-dialog-close svg { width: 20px; height: 20px; }
.results-dialog-close:hover { color: var(--pink); }
.results-dialog-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.results-dialog-pair .result-photo-frame { height: min(64dvh, 680px); aspect-ratio: auto; }
.results-dialog-pair .result-photo-label { padding-bottom: 10px; }
.results-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }

@media (max-width: 700px) {
  .results-section { --pair-w: min(86vw, 420px); --pair-gap: 5px; --strip-gap: 26px; padding-block: 52px 56px; }
  .result-pair::before { top: 11px; inset-inline: calc(25% + 30px) calc(25% + 42px); }
  .results-section .comparison-heading h2 { font-size: clamp(28px, 7.5vw, 38px); line-height: 1.35; }
  .results-marquee { margin-top: 28px; }
  .result-photo-label { padding-bottom: 10px; font-size: 15px; }
  .results-autoplay { width: 44px; height: 44px; margin-top: 22px; }
  .results-arrow { width: 44px; height: 44px; }
  .results-arrow svg { width: 18px; height: 18px; }
  .results-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 12px 12px 18px; }
  .results-dialog-header { position: sticky; top: -12px; z-index: 1; margin-bottom: 14px; padding-block: 6px; background: #080808; }
  .results-dialog-header h2 { font-size: 19px; }
  .results-dialog-close { font-size: 14px; }
  .results-dialog-pair { grid-template-columns: 1fr; gap: 24px; }
  .results-dialog-pair .result-photo-frame { height: min(65dvh, 640px); aspect-ratio: auto; }
  .results-dialog-pair .result-photo-label { font-size: 17px; }
  .results-dialog-footer { margin-top: 20px; }
}

/* ---- הטאב "תוצאות": הטאבים למעלה נעוצים ו-html כבר נותן scroll-padding-top לפי רוחב —
   הכותרת נוחתת כ-40px מתחת לטאבים, כך שהצמדים נכנסים במסך ולא מציץ מעליהם זנב מסע התזונה ---- */
.results-section { scroll-margin-top: -90px; }
@media (min-width: 1800px) { .results-section { scroll-margin-top: -106px; } }
@media (max-width: 950px) { .results-section { scroll-margin-top: -74px; } }
@media (max-width: 700px) { .results-section { scroll-margin-top: -32px; } }

/* צילום קטן מהמסגרת (הקולאז' בצמד 8, או צילום שמוגבל לגודל המקורי) נצמד למעלה ולבן-הזוג שלו — הצמד נקרא כצמד ולא מרחף */
.results-track .result-photo-frame { align-items: flex-start; }
.results-track .result-photo[data-phase="before"] .result-photo-frame { justify-content: flex-end; }
.results-track .result-photo[data-phase="after"] .result-photo-frame { justify-content: flex-start; }
.results-track .result-photo[data-phase="before"] img { object-position: left top; }
.results-track .result-photo[data-phase="after"] img { object-position: right top; }
.results-dialog:focus { outline: none; }
/* במחשב כפתור העצירה יושב בפינה השמאלית של הרצועה (באזור שנמוג) — תמיד גלוי כשהרצועה במסך, בלי להקטין את הצילומים */
@media (min-width: 701px) {
  .results-section { position: relative; }
  .results-js .results-autoplay { position: absolute; z-index: 2; bottom: calc(92px + 14px + 18px); inset-inline-end: calc(var(--gutter) + 4px); margin: 0; }
}
/* טלפון לרוחב / מסך נמוך: הצמד נכנס שלם מתחת לסרגל */
@media (min-width: 701px) and (max-height: 500px) { .results-section { --photo-h: clamp(200px, calc(100vh - 140px), 660px); } }
@supports (height: 100svh) { @media (min-width: 701px) and (max-height: 500px) { .results-section { --photo-h: clamp(200px, calc(100svh - 140px), 660px); } } }
@media (max-width: 700px) {
  /* המסגרת בגודל הצילום עצמו (contain, עד 65dvh/640px ועד הגודל המקורי) — כל תווית צמודה לצילום שלה */
  .results-dialog-pair .result-photo-frame { display: block; height: auto; aspect-ratio: auto; }
  .results-dialog-pair .result-photo-frame img { width: auto; height: auto; max-width: min(100%, var(--photo-width)); max-height: min(65dvh, 640px, var(--photo-height)); margin-inline: auto; }
}
